瀏覽代碼

Merge pull request #511 from empirephoenix/master

Finally fixing this
empirephoenix 9 年之前
父節點
當前提交
e2b6c51730
共有 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);