From f09ae4bb4729d2ebb705d71891ddc86b0d8c4b26 Mon Sep 17 00:00:00 2001 From: Tom Lynch Date: Sun, 15 Mar 2026 02:08:05 +1100 Subject: [PATCH] Jolt: fix Compound shapes not initializing their _shape --- Modules/Jolt/RNJoltShape.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/Jolt/RNJoltShape.cpp b/Modules/Jolt/RNJoltShape.cpp index b1790c10f..a838bf090 100644 --- a/Modules/Jolt/RNJoltShape.cpp +++ b/Modules/Jolt/RNJoltShape.cpp @@ -211,6 +211,8 @@ namespace RN JoltCompoundShape::JoltCompoundShape() { + _shape = new JPH::MutableCompoundShape(); + _shape->AddRef(); } JoltCompoundShape::JoltCompoundShape(Model *model, JoltMaterial *material, Vector3 scale, bool useTriangleMesh, bool wantsDoubleSided) @@ -229,6 +231,9 @@ namespace RN JoltCompoundShape::JoltCompoundShape(const Array *meshes, JoltMaterial *material, Vector3 scale, bool useTriangleMesh, bool wantsDoubleSided) { + _shape = new JPH::MutableCompoundShape(); + _shape->AddRef(); + meshes->Enumerate([&](Mesh *mesh, size_t index, bool &stop) { AddChild(mesh, material, Vector3(), Quaternion(), scale, useTriangleMesh, wantsDoubleSided); });