From 22db3212e18ff7ae8d498c33753456de49eb2649 Mon Sep 17 00:00:00 2001 From: Kai Boernert Date: Mon, 13 Jun 2016 13:06:35 +0200 Subject: [PATCH] Finally fixing this https://hub.jmonkeyengine.org/t/jmonkey-3-1-native-bullet-bug/33595/3 http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=12158&f=9&t= Signed-off-by: Kai Boernert --- .../native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp b/jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp index 2ea5557d0..e4d0c74bf 100644 --- a/jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp +++ b/jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp @@ -52,7 +52,9 @@ extern "C" { btMotionState* motionState = reinterpret_cast(motionstatId); btCollisionShape* shape = reinterpret_cast(shapeId); btVector3 localInertia = btVector3(); - shape->calculateLocalInertia(mass, localInertia); + if(mass > 0){ + shape->calculateLocalInertia(mass, localInertia); + } btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia); body->setUserPointer(NULL); return reinterpret_cast(body);