jmeClasses::initJavaClasses(env);
jmePhysicsSpace* space = new jmePhysicsSpace(env, object);
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space has not been created.");
return 0;
}
(JNIEnv * env, jobject object, jlong spaceId, jfloat tpf, jint maxSteps, jfloat accuracy) {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (collisionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (collisionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btRigidBody* collisionObject = (btRigidBody*) rigidBodyId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (collisionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btRigidBody* collisionObject = (btRigidBody*) rigidBodyId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (collisionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (collisionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (collisionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (actionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The action object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (actionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The action object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (actionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The vehicle object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (actionObject == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The action object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btTypedConstraint* constraint = (btTypedConstraint*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (constraint == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The constraint object does not exist.");
return;
}
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btTypedConstraint* constraint = (btTypedConstraint*) objectId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (constraint == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The constraint object does not exist.");
return;
}
(JNIEnv * env, jobject object, jlong spaceId, jobject vector) {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
if (space == NULL) {
- jclass newExc = env->FindClass("java/lang/IllegalStateException");
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_finalizeNative
(JNIEnv * env, jobject object, jlong objectId) {
btCollisionObject* collisionObject = (btCollisionObject*) objectId;
+ if (collisionObject == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
delete(collisionObject);
}
#ifdef __cplusplus
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_getMargin
(JNIEnv * env, jobject object, jlong shapeId) {
btCollisionShape* shape = (btCollisionShape*) shapeId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return shape->getMargin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setLocalScaling
(JNIEnv * env, jobject object, jlong shapeId, jobject scale) {
btCollisionShape* shape = (btCollisionShape*) shapeId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 scl = btVector3();
jmeBulletUtil::convert(env, scale, &scl);
shape->setLocalScaling(scl);
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setMargin
(JNIEnv * env, jobject object, jlong shapeId, jfloat newMargin) {
btCollisionShape* shape = (btCollisionShape*) shapeId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
shape->setMargin(newMargin);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_finalizeNative
(JNIEnv * env, jobject object, jlong shapeId) {
btCollisionShape* shape = (btCollisionShape*) shapeId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
delete(shape);
}
#ifdef __cplusplus
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_addChildShape
(JNIEnv *env, jobject object, jlong compoundId, jlong childId, jobject childLocation, jobject childRotation) {
btCompoundShape* shape = (btCompoundShape*) compoundId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
btCollisionShape* child = (btCollisionShape*) childId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
btMatrix3x3 mtx = btMatrix3x3();
btTransform trans = btTransform(mtx);
jmeBulletUtil::convert(env, childLocation, &trans.getOrigin());
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_removeChildShape
(JNIEnv * env, jobject object, jlong compoundId, jlong childId) {
btCompoundShape* shape = (btCompoundShape*) compoundId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
btCollisionShape* child = (btCollisionShape*) childId;
+ if (shape == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
shape->removeChildShape(child);
return 0;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat swingSpan1, jfloat swingSpan2, jfloat twistSpan) {
btConeTwistConstraint* joint = (btConeTwistConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
//TODO: extended setLimit!
joint->setLimit(swingSpan1, swingSpan2, twistSpan);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setAngularOnly
(JNIEnv * env, jobject object, jlong jointId, jboolean angularOnly) {
btConeTwistConstraint* joint = (btConeTwistConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setAngularOnly(angularOnly);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_enableMotor
(JNIEnv * env, jobject object, jlong jointId, jboolean enable, jfloat targetVelocity, jfloat maxMotorImpulse) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->enableAngularMotor(enable, targetVelocity, maxMotorImpulse);
}
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_HingeJoint_getEnableAngularMotor
(JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return joint->getEnableAngularMotor();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMotorTargetVelocity
(JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getMotorTargetVelosity();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMaxMotorImpulse
(JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getMaxMotorImpulse();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFF
(JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
return joint->setLimit(low, high);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFFFFF
(JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high, jfloat softness, jfloat biasFactor, jfloat relaxationFactor) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
return joint->setLimit(low, high, softness, biasFactor, relaxationFactor);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getUpperLimit
(JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getUpperLimit();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getLowerLimit
(JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getLowerLimit();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setAngularOnly
(JNIEnv * env, jobject object, jlong jointId, jboolean angular) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setAngularOnly(angular);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getHingeAngle
(JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getHingeAngle();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_getAppliedImpulse
(JNIEnv * env, jobject object, jlong jointId) {
btTypedConstraint* joint = (btTypedConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getAppliedImpulse();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setDamping
(JNIEnv * env, jobject object, jlong jointId, jfloat damping) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->m_setting.m_damping = damping;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setImpulseClamp
(JNIEnv * env, jobject object, jlong jointId, jfloat clamp) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->m_setting.m_impulseClamp = clamp;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setTau
(JNIEnv * env, jobject object, jlong jointId, jfloat tau) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->m_setting.m_tau = tau;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getDamping
(JNIEnv * env, jobject object, jlong jointId) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->m_setting.m_damping;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getImpulseClamp
(JNIEnv * env, jobject object, jlong jointId) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->m_setting.m_damping;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getTau
(JNIEnv * env, jobject object, jlong jointId) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->m_setting.m_damping;
}
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
//TODO: matrix not needed?
- btMatrix3x3 mtx1=btMatrix3x3();
- btMatrix3x3 mtx2=btMatrix3x3();
+ btMatrix3x3 mtx1 = btMatrix3x3();
+ btMatrix3x3 mtx2 = btMatrix3x3();
btTransform transA = btTransform(mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
btTransform transB = btTransform(mtx2);
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getRotationalLimitMotor
(JNIEnv * env, jobject object, jlong jointId, jint index) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
- return (long)joint->getRotationalLimitMotor(index);
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
+ return (long) joint->getRotationalLimitMotor(index);
}
/*
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getTranslationalLimitMotor
(JNIEnv * env, jobject object, jlong jointId) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
- return (long)joint->getTranslationalLimitMotor();
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
+ return (long) joint->getTranslationalLimitMotor();
}
/*
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearUpperLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec);
joint->setLinearUpperLimit(vec);
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearLowerLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec);
joint->setLinearLowerLimit(vec);
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularUpperLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec);
joint->setAngularUpperLimit(vec);
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularLowerLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec);
joint->setAngularLowerLimit(vec);
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
- return (long)joint;
+ return (long) joint;
}
#ifdef __cplusplus
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerLinLimit
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getLowerLinLimit();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerLinLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setLowerLinLimit(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperLinLimit
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getUpperLinLimit();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperLinLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setUpperLinLimit(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerAngLimit
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getLowerAngLimit();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerAngLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setLowerAngLimit(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperAngLimit
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getUpperAngLimit();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperAngLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setUpperAngLimit(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getSoftnessDirLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setSoftnessDirLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getRestitutionDirLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setRestitutionDirLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getDampingDirLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setDampingDirLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getSoftnessDirAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setSoftnessDirAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getRestitutionDirAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setRestitutionDirAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getDampingDirAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setDampingDirAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getSoftnessLimLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setSoftnessLimLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getRestitutionLimLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setRestitutionLimLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getDampingLimLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setDampingLimLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getSoftnessLimAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setSoftnessLimAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getRestitutionLimAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setRestitutionLimAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getDampingLimAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setDampingLimAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getSoftnessOrthoLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setSoftnessOrthoLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getRestitutionOrthoLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setRestitutionOrthoLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoLin
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getDampingOrthoLin();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setDampingOrthoLin(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getSoftnessOrthoAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setSoftnessOrthoAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getRestitutionOrthoAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setRestitutionOrthoAng(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoAng
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getDampingOrthoAng();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setDampingOrthoAng(value);
}
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredLinMotor
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return joint->getPoweredLinMotor();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredLinMotor
(JNIEnv * env, jobject object, jlong jointId, jboolean value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setPoweredLinMotor(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetLinMotorVelocity
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getTargetLinMotorVelocity();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetLinMotorVelocity
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setTargetLinMotorVelocity(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxLinMotorForce
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getMaxLinMotorForce();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxLinMotorForce
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setMaxLinMotorForce(value);
}
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredAngMotor
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return joint->getPoweredAngMotor();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredAngMotor
(JNIEnv * env, jobject object, jlong jointId, jboolean value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setPoweredAngMotor(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetAngMotorVelocity
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getTargetAngMotorVelocity();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetAngMotorVelocity
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setTargetAngMotorVelocity(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxAngMotorForce
(JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return joint->getMaxAngMotorForce();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxAngMotorForce
(JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId;
+ if (joint == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
joint->setMaxAngMotorForce(value);
}
jmeClasses::initJavaClasses(env);
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
- btMatrix3x3 mtx1=btMatrix3x3();
- btMatrix3x3 mtx2=btMatrix3x3();
+ btMatrix3x3 mtx1 = btMatrix3x3();
+ btMatrix3x3 mtx2 = btMatrix3x3();
btTransform transA = btTransform(mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
jmeBulletUtil::convert(env, rotA, &transA.getBasis());
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
- return (long)joint;
+ return (long) joint;
}
#ifdef __cplusplus
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLoLimit
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_loLimit;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLoLimit
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_loLimit = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getHiLimit
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_hiLimit;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setHiLimit
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_hiLimit = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getTargetVelocity
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_targetVelocity;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setTargetVelocity
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_targetVelocity = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxMotorForce
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_maxMotorForce;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxMotorForce
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_maxMotorForce = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxLimitForce
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_maxLimitForce;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxLimitForce
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_maxLimitForce = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getDamping
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_damping;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setDamping
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_damping = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLimitSoftness
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_limitSoftness;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLimitSoftness
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_limitSoftness = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getERP
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_stopERP;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setERP
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_stopERP = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getBounce
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_bounce;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setBounce
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_bounce = value;
}
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_isEnableMotor
(JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return motor->m_enableMotor;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setEnableMotor
(JNIEnv *env, jobject object, jlong motorId, jboolean value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_enableMotor = value;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLowerLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &motor->m_lowerLimit, vector);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLowerLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, vector, &motor->m_lowerLimit);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getUpperLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &motor->m_upperLimit, vector);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setUpperLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, vector, &motor->m_upperLimit);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getAccumulatedImpulse
(JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &motor->m_accumulatedImpulse, vector);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setAccumulatedImpulse
(JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, vector, &motor->m_accumulatedImpulse);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLetLimitSoftness
(JNIEnv *env, jobject object, jlong motorId) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_limitSoftness;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLimitSoftness
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_limitSoftness = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getDamping
(JNIEnv *env, jobject object, jlong motorId) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_damping;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setDamping
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_damping = value;
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getRestitution
(JNIEnv *env, jobject object, jlong motorId) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return motor->m_restitution;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setRestitution
(JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
+ if (motor == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
motor->m_restitution = value;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCharacterFlags
(JNIEnv *env, jobject object, jlong ghostId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) ghostId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
ghost->setCollisionFlags(ghost->getCollisionFlags() | btCollisionObject::CF_CHARACTER_OBJECT);
ghost->setCollisionFlags(ghost->getCollisionFlags() & ~btCollisionObject::CF_NO_CONTACT_RESPONSE);
}
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createCharacterObject
(JNIEnv *env, jobject object, jlong objectId, jlong shapeId, jfloat stepHeight) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
//TODO: check convexshape!
btConvexShape* shape = (btConvexShape*) shapeId;
btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_warp
(JNIEnv *env, jobject object, jlong objectId, jobject vector) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec);
character->warp(vec);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setWalkDirection
(JNIEnv *env, jobject object, jlong objectId, jobject vector) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec);
character->setWalkDirection(vec);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setUpAxis
(JNIEnv *env, jobject object, jlong objectId, jint value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
character->setUpAxis(value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setFallSpeed
(JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
character->setFallSpeed(value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setJumpSpeed
(JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
character->setJumpSpeed(value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setGravity
(JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
character->setGravity(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getGravity
(JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return character->getGravity();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxSlope
(JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
character->setMaxSlope(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxSlope
(JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return character->getMaxSlope();
}
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_onGround
(JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return character->onGround();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_jump
(JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
character->jump();
}
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getPhysicsLocation
(JNIEnv *env, jobject object, jlong objectId, jobject value) {
- btGhostObject* character = (btGhostObject*) objectId;
- jmeBulletUtil::convert(env, &character->getWorldTransform().getOrigin(), value);
+ btGhostObject* ghost = (btGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
+ jmeBulletUtil::convert(env, &ghost->getWorldTransform().getOrigin(), value);
}
/*
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong objectId, jfloat value) {
- btGhostObject* character = (btGhostObject*) objectId;
- character->setCcdSweptSphereRadius(value);
+ btGhostObject* ghost = (btGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
+ ghost->setCcdSweptSphereRadius(value);
}
/*
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdMotionThreshold
(JNIEnv *env, jobject object, jlong objectId, jfloat value) {
- btGhostObject* character = (btGhostObject*) objectId;
- character->setCcdMotionThreshold(value);
+ btGhostObject* ghost = (btGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
+ ghost->setCcdMotionThreshold(value);
}
/*
*/
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong objectId) {
- btGhostObject* character = (btGhostObject*) objectId;
- return character->getCcdSweptSphereRadius();
+ btGhostObject* ghost = (btGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
+ return ghost->getCcdSweptSphereRadius();
}
/*
*/
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdMotionThreshold
(JNIEnv *env, jobject object, jlong objectId) {
- btGhostObject* character = (btGhostObject*) objectId;
- return character->getCcdMotionThreshold();
+ btGhostObject* ghost = (btGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
+ return ghost->getCcdMotionThreshold();
}
/*
*/
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSquareMotionThreshold
(JNIEnv *env, jobject object, jlong objectId) {
- btGhostObject* character = (btGhostObject*) objectId;
- return character->getCcdSquareMotionThreshold();
+ btGhostObject* ghost = (btGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
+ return ghost->getCcdSquareMotionThreshold();
}
/*
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_finalizeNativeCharacter
(JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
+ if (character == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
delete(character);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setGhostFlags
(JNIEnv *env, jobject object, jlong objectId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
ghost->setCollisionFlags(ghost->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
}
* Signature: (JLcom/jme3/math/Vector3f;)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsLocation
- (JNIEnv *env, jobject object, jlong objectId, jobject value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getOrigin());
}
* Signature: (JLcom/jme3/math/Matrix3f;)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
- (JNIEnv *env, jobject object, jlong objectId, jobject value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getBasis());
}
* Signature: (JLcom/jme3/math/Quaternion;)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
- (JNIEnv *env, jobject object, jlong objectId, jobject value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convertQuat(env, value, &ghost->getWorldTransform().getBasis());
}
* Signature: (JLcom/jme3/math/Vector3f;)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsLocation
- (JNIEnv *env, jobject object, jlong objectId, jobject value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &ghost->getWorldTransform().getOrigin(), value);
}
* Signature: (JLcom/jme3/math/Quaternion;)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotation
- (JNIEnv *env, jobject object, jlong objectId, jobject value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convertQuat(env, &ghost->getWorldTransform().getBasis(), value);
}
* Signature: (JLcom/jme3/math/Matrix3f;)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotationMatrix
- (JNIEnv *env, jobject object, jlong objectId, jobject value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &ghost->getWorldTransform().getBasis(), value);
}
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingCount
- (JNIEnv *env, jobject object, jlong objectId){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return ghost->getNumOverlappingObjects();
}
* Signature: (JF)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdSweptSphereRadius
- (JNIEnv *env, jobject object, jlong objectId, jfloat value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
ghost->setCcdSweptSphereRadius(value);
}
* Signature: (JF)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdMotionThreshold
- (JNIEnv *env, jobject object, jlong objectId, jfloat value){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
ghost->setCcdMotionThreshold(value);
}
* Signature: (J)F
*/
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSweptSphereRadius
- (JNIEnv *env, jobject object, jlong objectId){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return ghost->getCcdSweptSphereRadius();
}
* Signature: (J)F
*/
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdMotionThreshold
- (JNIEnv *env, jobject object, jlong objectId){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return ghost->getCcdMotionThreshold();
}
* Signature: (J)F
*/
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSquareMotionThreshold
- (JNIEnv *env, jobject object, jlong objectId){
- btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId;
+ (JNIEnv *env, jobject object, jlong objectId) {
+ btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
+ if (ghost == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return ghost->getCcdSquareMotionThreshold();
}
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isInWorld
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return body->isInWorld();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsLocation
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
-// if (body->isStaticOrKinematicObject() || !body->isInWorld())
- ((jmeMotionState*)body->getMotionState())->setKinematicLocation(env, value);
- body->setCenterOfMassTransform(((jmeMotionState*)body->getMotionState())->worldTransform);
-// else{
-// btMatrix3x3* mtx = &btMatrix3x3();
-// btTransform* trans = &btTransform(*mtx);
-// trans->setBasis(body->getCenterOfMassTransform().getBasis());
-// jmeBulletUtil::convert(env, value, &trans->getOrigin());
-// body->setCenterOfMassTransform(*trans);
-// }
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
+ // if (body->isStaticOrKinematicObject() || !body->isInWorld())
+ ((jmeMotionState*) body->getMotionState())->setKinematicLocation(env, value);
+ body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
+ // else{
+ // btMatrix3x3* mtx = &btMatrix3x3();
+ // btTransform* trans = &btTransform(*mtx);
+ // trans->setBasis(body->getCenterOfMassTransform().getBasis());
+ // jmeBulletUtil::convert(env, value, &trans->getOrigin());
+ // body->setCenterOfMassTransform(*trans);
+ // }
}
/*
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
-// if (body->isStaticOrKinematicObject() || !body->isInWorld())
- ((jmeMotionState*)body->getMotionState())->setKinematicRotation(env, value);
- body->setCenterOfMassTransform(((jmeMotionState*)body->getMotionState())->worldTransform);
-// else{
-// btMatrix3x3* mtx = &btMatrix3x3();
-// btTransform* trans = &btTransform(*mtx);
-// trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
-// jmeBulletUtil::convert(env, value, &trans->getBasis());
-// body->setCenterOfMassTransform(*trans);
-// }
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
+ // if (body->isStaticOrKinematicObject() || !body->isInWorld())
+ ((jmeMotionState*) body->getMotionState())->setKinematicRotation(env, value);
+ body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
+ // else{
+ // btMatrix3x3* mtx = &btMatrix3x3();
+ // btTransform* trans = &btTransform(*mtx);
+ // trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
+ // jmeBulletUtil::convert(env, value, &trans->getBasis());
+ // body->setCenterOfMassTransform(*trans);
+ // }
}
/*
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
-// if (body->isStaticOrKinematicObject() || !body->isInWorld())
- ((jmeMotionState*)body->getMotionState())->setKinematicRotationQuat(env, value);
- body->setCenterOfMassTransform(((jmeMotionState*)body->getMotionState())->worldTransform);
-// else{
-// btMatrix3x3* mtx = &btMatrix3x3();
-// btTransform* trans = &btTransform(*mtx);
-// trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
-// jmeBulletUtil::convertQuat(env, value, &trans->getBasis());
-// body->setCenterOfMassTransform(*trans);
-// }
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
+ // if (body->isStaticOrKinematicObject() || !body->isInWorld())
+ ((jmeMotionState*) body->getMotionState())->setKinematicRotationQuat(env, value);
+ body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
+ // else{
+ // btMatrix3x3* mtx = &btMatrix3x3();
+ // btTransform* trans = &btTransform(*mtx);
+ // trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
+ // jmeBulletUtil::convertQuat(env, value, &trans->getBasis());
+ // body->setCenterOfMassTransform(*trans);
+ // }
}
/*
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsLocation
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &body->getWorldTransform().getOrigin(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotation
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convertQuat(env, &body->getWorldTransform().getBasis(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotationMatrix
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &body->getWorldTransform().getBasis(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setKinematic
(JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
if (value) {
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
body->setActivationState(DISABLE_DEACTIVATION);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setCcdSweptSphereRadius(value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdMotionThreshold
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setCcdMotionThreshold(value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getCcdSweptSphereRadius();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdMotionThreshold
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getCcdMotionThreshold();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSquareMotionThreshold
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getCcdSquareMotionThreshold();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setStatic
(JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
if (value) {
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_STATIC_OBJECT);
} else {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_updateMassProps
(JNIEnv *env, jobject object, jlong bodyId, jlong shapeId, jfloat mass) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
btCollisionShape* shape = (btCollisionShape*) shapeId;
btVector3 localInertia = btVector3();
shape->calculateLocalInertia(mass, localInertia);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getGravity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &body->getGravity(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setGravity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, value, &vec);
body->setGravity(vec);
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getFriction
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getFriction();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setFriction
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setFriction(value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setDamping
(JNIEnv *env, jobject object, jlong bodyId, jfloat value1, jfloat value2) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setDamping(value1, value2);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularDamping
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setDamping(body->getLinearDamping(), value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearDamping
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getLinearDamping();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularDamping
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getAngularDamping();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getRestitution
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getRestitution();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setRestitution
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setRestitution(value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &body->getAngularVelocity(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
- jmeBulletUtil::convert(env, value,&vec);
+ jmeBulletUtil::convert(env, value, &vec);
body->setAngularVelocity(vec);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &body->getLinearVelocity(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec = btVector3();
jmeBulletUtil::convert(env, value, &vec);
body->setLinearVelocity(vec);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyForce
(JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec1 = btVector3();
btVector3 vec2 = btVector3();
jmeBulletUtil::convert(env, force, &vec1);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyCentralForce
(JNIEnv *env, jobject object, jlong bodyId, jobject force) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec1 = btVector3();
jmeBulletUtil::convert(env, force, &vec1);
body->applyCentralForce(vec1);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorque
(JNIEnv *env, jobject object, jlong bodyId, jobject force) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec1 = btVector3();
jmeBulletUtil::convert(env, force, &vec1);
body->applyTorque(vec1);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyImpulse
(JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec1 = btVector3();
btVector3 vec2 = btVector3();
jmeBulletUtil::convert(env, force, &vec1);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorqueImpulse
(JNIEnv *env, jobject object, jlong bodyId, jobject force) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec1 = btVector3();
jmeBulletUtil::convert(env, force, &vec1);
body->applyTorqueImpulse(vec1);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_clearForces
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->clearForces();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCollisionShape
(JNIEnv *env, jobject object, jlong bodyId, jlong shapeId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btCollisionShape* shape = (btCollisionShape*) shapeId;
body->setCollisionShape(shape);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_activate
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->activate(false);
}
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isActive
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return body->isActive();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setSleepingThresholds
(JNIEnv *env, jobject object, jlong bodyId, jfloat linear, jfloat angular) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setSleepingThresholds(linear, angular);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setSleepingThresholds(value, body->getAngularSleepingThreshold());
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
body->setSleepingThresholds(body->getLinearSleepingThreshold(), value);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getLinearSleepingThreshold();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getAngularSleepingThreshold();
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
(JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return body->getAngularFactor().getX();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
btVector3 vec1 = btVector3();
vec1.setX(value);
vec1.setY(value);
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_updateWheelTransform
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jboolean interpolated) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
vehicle->updateWheelTransform(wheel, interpolated);
}
(JNIEnv *env, jobject object, jlong bodyId, jlong spaceId) {
//btRigidBody* body = (btRigidBody*) bodyId;
btDiscreteDynamicsWorld* spsace = (btDiscreteDynamicsWorld*) spaceId;
+ if (spsace == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(spsace);
return (long) caster;
}
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createRaycastVehicle
(JNIEnv *env, jobject object, jlong objectId, jlong casterId) {
btRigidBody* body = (btRigidBody*) objectId;
+ if (body == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
body->setActivationState(DISABLE_DEACTIVATION);
btVehicleRaycaster* caster = (btDefaultVehicleRaycaster*) casterId;
btRaycastVehicle::btVehicleTuning tuning;
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_setCoordinateSystem
(JNIEnv *env, jobject object, jlong vehicleId, jint right, jint up, jint forward) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
vehicle->setCoordinateSystem(right, up, forward);
}
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_addWheel
(JNIEnv *env, jobject object, jlong vehicleId, jobject location, jobject direction, jobject axle, jfloat restLength, jfloat radius, jobject tuning, jboolean frontWheel) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
btVector3 vec1 = btVector3();
btVector3 vec2 = btVector3();
btVector3 vec3 = btVector3();
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_resetSuspension
(JNIEnv *env, jobject object, jlong vehicleId) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
vehicle->resetSuspension();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_applyEngineForce
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat force) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
vehicle->applyEngineForce(force, wheel);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_steer
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
vehicle->setSteeringValue(value, wheel);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_brake
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
vehicle->setBrake(value, wheel);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getCurrentVehicleSpeedKmHour
(JNIEnv *env, jobject object, jlong vehicleId) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return vehicle->getCurrentSpeedKmHour();
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getForwardVector
(JNIEnv *env, jobject object, jlong vehicleId, jobject out) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &vehicle->getForwardVector(), out);
}
(JNIEnv *env, jobject object, jlong casterId, jlong vehicleId) {
btVehicleRaycaster* rayCaster = (btVehicleRaycaster*) casterId;
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
+ if (vehicle == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
delete(vehicle);
delete(rayCaster);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelLocation
(JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId;
+ if (wheel == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &wheel->m_worldTransform.getOrigin(), out);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelRotation
(JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId;
+ if (wheel == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &wheel->m_worldTransform.getBasis(), out);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionLocation
(JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId;
+ if (wheel == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &wheel->m_raycastInfo.m_contactPointWS, out);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionNormal
(JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId;
+ if (wheel == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &wheel->m_raycastInfo.m_contactNormalWS, out);
}
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getSkidInfo
(JNIEnv *env, jobject object, jlong wheelId) {
btWheelInfo* wheel = (btWheelInfo*) wheelId;
+ if (wheel == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return 0;
+ }
return wheel->m_skidInfo;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_finalizeNative
- (JNIEnv *env, jobject object, jlong wheelId){
+ (JNIEnv *env, jobject object, jlong wheelId) {
btWheelInfo* wheel = (btWheelInfo*) wheelId;
+ if (wheel == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
delete(wheel);
}
#ifdef __cplusplus
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_applyTransform
(JNIEnv *env, jobject object, jlong stateId, jobject location, jobject rotation) {
jmeMotionState* motionState = (jmeMotionState*) stateId;
+ if (motionState == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return false;
+ }
return motionState->applyTransform(env, location, rotation);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldLocation
(JNIEnv *env, jobject object, jlong stateId, jobject value) {
jmeMotionState* motionState = (jmeMotionState*) stateId;
+ if (motionState == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &motionState->worldTransform.getOrigin(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotation
(JNIEnv *env, jobject object, jlong stateId, jobject value) {
jmeMotionState* motionState = (jmeMotionState*) stateId;
+ if (motionState == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convert(env, &motionState->worldTransform.getBasis(), value);
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotationQuat
(JNIEnv *env, jobject object, jlong stateId, jobject value) {
jmeMotionState* motionState = (jmeMotionState*) stateId;
+ if (motionState == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
jmeBulletUtil::convertQuat(env, &motionState->worldTransform.getBasis(), value);
}
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_finalizeNative
- (JNIEnv *env, jobject object, jlong stateId){
+ (JNIEnv *env, jobject object, jlong stateId) {
jmeMotionState* motionState = (jmeMotionState*) stateId;
+ if (motionState == NULL) {
+ jclass newExc = env->FindClass("java/lang/NullPointerException");
+ env->ThrowNew(newExc, "The native object does not exist.");
+ return;
+ }
delete(motionState);
}