Replies: 1 comment 5 replies
-
It is indeed impossible for a body to reside in 2 layers. If you want a high-res kinematic body following a low-res dynamic body, you'll need to create 2 Bodies. Using a fixed constraint in this case will not work as a kinematic object cannot be moved by a constraint (a kinematic object has infinite mass so cannot be moved by a dynamic object). You'll need to update the physics system and afterwards loop over your dynamic bodies and call |
Beta Was this translation helpful? Give feedback.
-
Apologies if this is explained clearly somewhere, but I couldn't find it and would like to add it to architecture.md if I can figure it out.
The manual (§ Collision Filtering) describes a situation where collision filtering is used to give an object two collision/intersection behaviors: a regular geometric collider for common rigid body collisions (in layer MOVING), and a second high detail collider (e.g. a mesh collider) used for raycasting (in layer BULLET). This is precisely the behavior I am looking for -- but I'm not sure how the API wants this done.
Naively I was going to just create a separate body for each, making the high-res body kinematic and applying a fixed constraint to join it to its low-res dynamic parent, but this feels somewhat wasteful. This is for an application that supports large world multiplayer that may contain very large numbers of bodies at once, so doubling the number of bodies and needing to keep track of them + a constraint feels like a potentially great waste of cycles and memory (both on my side and within Jolt). Is there a way this relationship between the low and high-res collision shapes can be handled at a lower level to avoid this duplication, while retaining the collision filtering/broadphase capabilities? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions