Replies: 1 comment 1 reply
Done in 153fd6f
If you want to have a StaticCompoundShapeSettings settings;
settings.AddShape(...);
ShapeSettings::ShapeResult result;
TempAllocatorMalloc allocator;
Ref<StaticCompoundShape> shape = new StaticCompoundShape(settings, allocator, result);
if (!result.IsValid()) ... |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When
StaticCompoundShapeSettings::Createis called with a single sub-shape and identity transform, it returns the sub-shape directly. This is a nice optimization, but I've had a few head-scratching moments because of it when setting/getting the userdata of what I thought was the compound silently swapped as the sub-shape (which is the kind of thing the pattern inArchitecture.mdrelies on).I would like to start a conversation about this, maybe addressing it somehow?
Some options off the top of my head:
JPH_TRACE(or similar) in debug when the optimization triggers.Create()itself, perhaps in some (doxygen) warning banner or something very visible.Also, maybe an opt-in flag on
StaticCompoundShapeSettingsin a future major version, so callers explicitly acknowledge thatCreate()may return a sub-shape?All reactions