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 <kai-boernert@visiongamestudios.de>
This commit is contained in:
parent
65164e2075
commit
22db3212e1
@ -52,7 +52,9 @@ extern "C" {
|
|||||||
btMotionState* motionState = reinterpret_cast<btMotionState*>(motionstatId);
|
btMotionState* motionState = reinterpret_cast<btMotionState*>(motionstatId);
|
||||||
btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
|
btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
|
||||||
btVector3 localInertia = btVector3();
|
btVector3 localInertia = btVector3();
|
||||||
|
if(mass > 0){
|
||||||
shape->calculateLocalInertia(mass, localInertia);
|
shape->calculateLocalInertia(mass, localInertia);
|
||||||
|
}
|
||||||
btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia);
|
btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia);
|
||||||
body->setUserPointer(NULL);
|
body->setUserPointer(NULL);
|
||||||
return reinterpret_cast<jlong>(body);
|
return reinterpret_cast<jlong>(body);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user