From aaac317c67da406d1a9ccb64918ba958ef1d55e5 Mon Sep 17 00:00:00 2001 From: Josip Miskovic Date: Thu, 11 Apr 2024 20:28:36 +0200 Subject: [PATCH] Fix setMass allocation on user side --- src/modules/physics/physics_jolt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/physics/physics_jolt.c b/src/modules/physics/physics_jolt.c index 4b6bfdfd..5ae4121d 100644 --- a/src/modules/physics/physics_jolt.c +++ b/src/modules/physics/physics_jolt.c @@ -623,10 +623,10 @@ float lovrColliderGetMass(Collider* collider) { void lovrColliderSetMass(Collider* collider, float mass) { JPH_MotionProperties* motionProperties = JPH_Body_GetMotionProperties(collider->body); Shape* shape = collider->shape; - JPH_MassProperties* massProperties; - JPH_Shape_GetMassProperties(shape->shape, massProperties); - JPH_MassProperties_ScaleToMass(massProperties, mass); - JPH_MotionProperties_SetMassProperties(motionProperties, JPH_AllowedDOFs_All, massProperties); + JPH_MassProperties massProperties; + JPH_Shape_GetMassProperties(shape->shape, &massProperties); + JPH_MassProperties_ScaleToMass(&massProperties, mass); + JPH_MotionProperties_SetMassProperties(motionProperties, JPH_AllowedDOFs_All, &massProperties); } void lovrColliderGetMassData(Collider* collider, float centerOfMass[3], float* mass, float inertia[6]) {