#Working Directly with LTW & LTP
1 messages · Page 1 of 1 (latest)
It’s a new project. I am using default DOTS Physics, and will be switching to Havok in the next minor version.
i dont remember for static physics but kinematic and non kinematic rigidbodies dont use ltw or ltp(nor any other extended transform system components)
@normal cairn Do the raycast not hit anything at all, or perhaps they see the colliders in their previous locations (as in; they happen against a cached "snapshot" of the scene or something)?
Thank you for that answer. I had a feeling that I was right about the Physics relying on TRS helpers. Looks like I just have to play close attention to Parent-Child relationships then.
The raycast filter is default and everything it hits it compares EntityManager.HasComponent<SomeData>() type deal. I have debug draws that show the raycast and draws hit locations, entity locations, and a couple other calculations when doing a proximity check on closest entity, etc.
According to that, it does NOT hit any <SomeData> entities that were moved directly with LocalToWorld.
I'm pretty sure it detects the floor as a raw hit, but my code filters that out. If you want, I can slap a Debug.Log and see if it does hit the floor if that's what you really need to quench your curiosity. I'm betting it will detect floor hit though.
the easiest thing would be just to use translation and rotation for anything physics related. I have some parent child stuff with physics(ragdoll tests)but it means that rigidbodies are still unparented in world space but get their translation and rotation set from the entity they are meant to be parented from in a separate job.
@normal cairn
This is from updating a Rigidbody's RigidTransform (presumably used for final Collider TRS calculation).
To define this RigidTransform, it seems that Translation and Rotation are used only if present. Otherwise, LocalToWorld is used.
Perhaps you need to take into account that all RigidTransform-components have finished updating as well.
I'm just guessing though. But maybe this helps provide some insight
Note that for parented Rigidbodies, only LocalToWorld is used.
Otherwise, whatever the last value was of 'worldFromBody' is assigned, apparently? 🤨
That last one is a bit suspicious, but based on your story you should not be affected by this. Perhaps worth double-checking, though.
(screenshotted code location: Unity.Physics --> BuildPhysicsWorld.Jobs.CreateRigidBodies)