Replies: 1 comment 1 reply
-
This is indeed the expected way to use Jolt and also how I use it. Making 'weld' bodies would complicate the broadphase design and would mean that everybody pays the cost for a feature that not everybody needs. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi and thanks for all the great work on this library! I've recently done an initial engine integration and experimented a bit with the API and setups, but I'm still relatively new to Jolt, so I'm hoping I could confirm my understanding about a few things.
For the specific scenario, it's relatively common to have a simple shape (or compound shape) used to model RBD and simulate, while a more complex shape is used for (e.g.) hit detection or other purposes. In Jolt, the "object layer" which determines not just broad-phase layer assignment but also collision responses is assigned to the body (and not the shape), so to accomplish this, many of my game objects have two bodies attached. The body associated with the complex shape is always assigned
EMotionType::Static
motion, and after simulation, awake bodies propagate their transform updates to the complex representation through a user-data lookup (and an additional indirection).My question is, is this the correct/expected way to model this, or is there an aspect of the API that I overlooked? I think I would have liked to be able to "weld" bodies, given that I never want the transforms to evolve independently in this simple/complex case. That said, what I've done so far also seems to work.
Beta Was this translation helpful? Give feedback.
All reactions