jrouwe / JoltPhysics

A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
MIT License
6.71k stars 447 forks source link

Some userdata variables are still uint32_t #1012

Closed SSNTails closed 7 months ago

SSNTails commented 7 months ago

Some mUserData variables, such as the one in CompoundShapeSettings, are still uint32_t, instead of uint64_t. Should these be expanded to be 64-bit variables so they are suitable for storing custom pointers?

jrouwe commented 7 months ago

This is on purpose to keep compound shapes small (we have compounds with 1000s of shapes).

SSNTails commented 7 months ago

OK, makes sense. During contact callbacks, etc., is the SubShapeID one of these such sub-shapes, or does the 'parent' compound shape body ID consist of this? (I admit I have not gotten to the point of testing this yet)

Essentially I want to be sure that if I am handling a contact, or a ray/shape cast, etc, I can find out the mUserPointer of the parent compound shape (the 64-bit mUserData).