-
|
Is it possible to make one dynamic object to treat the other as static/kinematic? I think it is called dominance group/filter? Its useful when creating for example, some constrained vanity items on dynamic player characters, e.g. a flower on a player hat, or an antennae on a vehicle, etc. We don't want them to affect the motion of the body they are attached to, but we want them to respect the constraint and collide with everything. Also in a non-constrained collision, when one dynamic body should be treated as kinematic/static by dynamic debris, but still be affected by other dynamic objects/forces around it. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
What you can do is override the contact listener like here: https://github.com/jrouwe/JoltPhysics.js/blob/main/Examples/contact_listener.html And adjust mInvMassScale1 / mInvMassScale2 of the contact settings to make the other object kinematic (inverse mass = 0). |
Beta Was this translation helpful? Give feedback.
-
|
Thank you! Yes, that could be an option for collision based contacts. That wouldn't work for two bodies connected with a constraint though, I presume. Both bodies would affect each other. You can consider it as a feature request, if those are still accepted 🙂 |
Beta Was this translation helpful? Give feedback.
-
What you can do is attach your 'flower hat' to a kinematic body that collides with nothing. Every update move the kinematic body with the main body (using BodyInterface::MoveKinematic). This results in a 1 frame delay but it means the hat won't affect the main body, while the main body will affect the hat. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, that should do it, I'd presume. Just a bit more bookkeeping, but nothing major. Thanks for the hint! |
Beta Was this translation helpful? Give feedback.
What you can do is attach your 'flower hat' to a kinematic body that collides with nothing. Every update move the kinematic body with the main body (using BodyInterface::MoveKinematic). This results in a 1 frame delay but it means the hat won't affect the main body, while the main body will affect the hat.