Centre of Mass with collision

ValanValan Member, BASIC Posts: 410

When I set a figure to the Centre of Mass of an object there cannot be any collision associated with it. If there is then the Centre of Mass goes screwy.

Is this a bug?

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @Valan -- I am wondering about this also. For me, it seems that a collide behavior or a collision rule causes an actor's center of mass to revert back to 0,0.

    Are you seeing the same thing?

  • ArmellineArmelline Member, PRO Posts: 5,327

    @stevej said:
    Got it working, there will be a new attribute under the "Motion" attributes called "Center Of Mass". Your actor will rotate around this point. Note that physics behavior will also be affected by this, since the Box2D physics engine rotates objects around their COM. The default value of x=0, y=0 is the center of an actor, so no change is needed to keep the current behavior.

    Sounds like this is not the intended behaviour.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    It seems that rotate behaviors revert back to a 0,0 COM whenever there is a collide behavior (or rule) is associated with the actor.

    Perhaps its not rotate behaviors, but changes in angular velocity that is the common denominator.

    But more testing is needed.

  • stevejstevej Member, PRO, Chef Emeritus Posts: 435

    Could you send us an example project? I tested COM and collision and it seemed to work ok.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @stevej said:
    Could you send us an example project? I tested COM and collision and it seemed to work ok.

    Sent you a PM with a quick example

  • SocksSocks London, UK.Member Posts: 12,822
  • ValanValan Member, BASIC Posts: 410

  • RainbrosRainbros Member Posts: 124

    Any progress on this yet? I could use center of mass for the pinball jam about now...

  • stevejstevej Member, PRO, Chef Emeritus Posts: 435

    @Valan said:

    Other collision/CoM issues seem to do with the way acceleration is being applied, but this is a really weird one (we don't apply acceleration on rotation, just velocity). Still trying to track it down, now that custom font work is done.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @stevej said:

    @Valan said:

    Other collision/CoM issues seem to do with the way acceleration is being applied, but this is a really weird one (we don't apply acceleration on rotation, just velocity). Still trying to track it down, now that custom font work is done.

    Did you get that sample project I submitted via the chat bubble a few days ago?

  • stevejstevej Member, PRO, Chef Emeritus Posts: 435

    @Lost_Oasis_Games said:

    @stevej said:

    @Valan said:

    Other collision/CoM issues seem to do with the way acceleration is being applied, but this is a really weird one (we don't apply acceleration on rotation, just velocity). Still trying to track it down, now that custom font work is done.

    Did you get that sample project I submitted via the chat bubble a few days ago?

    Yes, that appears to be caused by a collision triggering as soon as the game starts, before all the actors have been fully set up. Why changing the CoM triggers it I'm not sure yet, but it looks like it's an accident that it's worked up 'til now. :)

    Hopefully I'll have a fix in a day or two.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @stevej said:

    @Lost_Oasis_Games said:

    @stevej said:

    @Valan said:

    Other collision/CoM issues seem to do with the way acceleration is being applied, but this is a really weird one (we don't apply acceleration on rotation, just velocity). Still trying to track it down, now that custom font work is done.

    Did you get that sample project I submitted via the chat bubble a few days ago?

    Yes, that appears to be caused by a collision triggering as soon as the game starts, before all the actors have been fully set up. Why changing the CoM triggers it I'm not sure yet, but it looks like it's an accident that it's worked up 'til now. :)

    Hopefully I'll have a fix in a day or two.

    Excellent!

  • DigiChainDigiChain Member, PRO Posts: 1,277

    Do we know if this is now fixed in the upcoming release?

    I'm using a constrain on rotation in my current project and the centre of mass reverts back to 0,0.

  • ValanValan Member, BASIC Posts: 410

    1.25 may be ready any day now.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @DigiChain said:
    Do we know if this is now fixed in the upcoming release?

    I'm using a constrain on rotation in my current project and the centre of mass reverts back to 0,0.

    In 1.25 it´s possible to pin the CoM so it will work with constrains.

    Mental Donkey Games
    Website - Facebook - Twitter

  • DigiChainDigiChain Member, PRO Posts: 1,277
    edited March 2016

    @MentalDonkeyGames said:

    @DigiChain said:
    Do we know if this is now fixed in the upcoming release?

    I'm using a constrain on rotation in my current project and the centre of mass reverts back to 0,0.

    In 1.25 it´s possible to pin the CoM so it will work with constrains.

    Great. Thanks for the info.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited March 2016

    @MentalDonkeyGames said:

    @DigiChain said:
    Do we know if this is now fixed in the upcoming release?

    I'm using a constrain on rotation in my current project and the centre of mass reverts back to 0,0.

    In 1.25 it´s possible to pin the CoM so it will work with constrains.

    Using pin there is not even a need to add constrains the pin feature functions as a constrain. Just place the actor where you want it. The position is still shown from center so position it taking into account the offset you added in the COM fields.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @Lost_Oasis_Games said:

    @MentalDonkeyGames said:

    @DigiChain said:
    Do we know if this is now fixed in the upcoming release?

    I'm using a constrain on rotation in my current project and the centre of mass reverts back to 0,0.

    In 1.25 it´s possible to pin the CoM so it will work with constrains.

    Using pin there is not even a need to add constrains the pin feature functions as a constrain. Just place the actor where you want it. The position is still shown from center so position it taking into account the offset you added in the COM fields.

    Right, but there might still be cases where you want to use constrains. In 1.24.42 the CoM does not function properly with constrains, but in 1.25 the CoM and rotation constrains work together nicely.

    Mental Donkey Games
    Website - Facebook - Twitter

Sign In or Register to comment.