Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Modules/Jolt/RNJoltShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 *mesh, size_t index, bool &stop) {
AddChild(mesh, material, Vector3(), Quaternion(), scale, useTriangleMesh, wantsDoubleSided);
});
Expand Down