소스 검색

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 <[email protected]>

Kai Boernert 9 년 전
부모
커밋
22db3212e1
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp

+ 3 - 1
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp

@@ -52,7 +52,9 @@ extern "C" {
         btMotionState* motionState = reinterpret_cast<btMotionState*>(motionstatId);
         btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(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<jlong>(body);