fix(physics): unanchoring initially anchored bodies causes crash

This commit is contained in:
maelstrom 2025-08-29 02:52:04 +02:00
parent 0bd6acb7fa
commit ded96d4e1f

View file

@ -146,6 +146,7 @@ void PhysWorld::syncBodyProperties(std::shared_ptr<BasePart> part) {
if (body == nullptr) {
JPH::Shape* shape = makeShape(part);
JPH::BodyCreationSettings settings(shape, convert<JPH::Vec3>(part->position()), convert<JPH::Quat>((glm::quat)part->cframe.RotMatrix()), motionType, objectLayer);
settings.mAllowDynamicOrKinematic = true;
settings.mRestitution = 0.5;
body = interface.CreateBody(settings);