Skip to content

Commit f09ae4b

Browse files
committed
Jolt: fix Compound shapes not initializing their _shape
1 parent 68921fd commit f09ae4b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Modules/Jolt/RNJoltShape.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ namespace RN
211211

212212
JoltCompoundShape::JoltCompoundShape()
213213
{
214+
_shape = new JPH::MutableCompoundShape();
215+
_shape->AddRef();
214216
}
215217

216218
JoltCompoundShape::JoltCompoundShape(Model *model, JoltMaterial *material, Vector3 scale, bool useTriangleMesh, bool wantsDoubleSided)
@@ -229,6 +231,9 @@ namespace RN
229231

230232
JoltCompoundShape::JoltCompoundShape(const Array *meshes, JoltMaterial *material, Vector3 scale, bool useTriangleMesh, bool wantsDoubleSided)
231233
{
234+
_shape = new JPH::MutableCompoundShape();
235+
_shape->AddRef();
236+
232237
meshes->Enumerate<Mesh>([&](Mesh *mesh, size_t index, bool &stop) {
233238
AddChild(mesh, material, Vector3(), Quaternion(), scale, useTriangleMesh, wantsDoubleSided);
234239
});

0 commit comments

Comments
 (0)