GameSalad

Centre of Mass with collision

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 Posts: 2,688

    @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 Posts: 4,358

    @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 Posts: 2,688

    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 Posts: 435 GameSalad Employee

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

  • @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.Posts: 12,453
  • ValanValan Posts: 366

  • They are working on it.

  • RainbrosRainbros Posts: 124

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

  • stevejstevej Posts: 435 GameSalad Employee

    @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.

  • @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 Posts: 435 GameSalad Employee

    @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.

  • @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 Posts: 1,113

    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 Posts: 366

    1.25 may be ready any day now.

  • @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.

  • DigiChainDigiChain Posts: 1,113
    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 Posts: 9,860
    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.

  • @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.

Sign In or Register to comment.