How to relate xpbd Position to Bevy Transform #142
-
What's the meaning of a xpbd Position? If I have an entity with a parent transform, when I add a Kinematic body to the entity, its Transform will be determined by its Position right? Is the Position global? In this case, if I move the entity's parent, the entity won't move as well, which won't happen if there's no Kinematic body attached. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
This is my use case. I use xpbd to simulate simple hair physics. When I move the model, the hair won't follow like it does when there's no xpbd bodies attached. I realize I need to move the hair's root joints manually (as they are kinematic bodies). However, it's impossible for me to do so if I'm unable to make sense of the bodies' Position. |
Beta Was this translation helpful? Give feedback.
-
The There are several reasons why we currently use these separate components: (from Bevy Discord)
There's also some discussion in #16.
Currently, we make entities with a However, I realize that it can also be very beneficial to have children automatically follow the parent, especially in the case of kinematic or static bodies. I will most likely adopt this behavior soon and also test how other game engines or physics engines handle body hierarchies. |
Beta Was this translation helpful? Give feedback.
-
I am new to all of this and very naive. I see the benefit of this, but it also can make things very confusing. How expensive would it be to implement this by having some convenience sugar to automatically create joints when adding children? (By default, a Fixed Joint.) That way, there's just one rule for enforcing relative movement, not two. |
Beta Was this translation helpful? Give feedback.
The
Position
andRotation
components represent the global transforms of physics bodies.GlobalTransform
should be automatically updated to match these components. On the main branch, you can also directly useTransform
instead ofPosition
for moving bodies.There are several reasons why we currently use these separate components: (from Bevy Discord)