- initialize native bullet classes on every object creation
- remove initialization from java physicsspace git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7431 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
dd67011809
commit
3c45cc6e97
@ -142,7 +142,6 @@ public class PhysicsSpace {
|
|||||||
this.worldMax.set(worldMax);
|
this.worldMax.set(worldMax);
|
||||||
this.broadphaseType = broadphaseType;
|
this.broadphaseType = broadphaseType;
|
||||||
create();
|
create();
|
||||||
initNativePhysics();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -150,7 +149,6 @@ public class PhysicsSpace {
|
|||||||
*/
|
*/
|
||||||
public void create() {
|
public void create() {
|
||||||
//TODO: boroadphase!
|
//TODO: boroadphase!
|
||||||
initNativePhysics();
|
|
||||||
physicsSpaceId = createPhysicsSpace(worldMin.x, worldMin.y, worldMin.z, worldMax.x, worldMax.y, worldMax.z, 3, false);
|
physicsSpaceId = createPhysicsSpace(worldMin.x, worldMin.y, worldMin.z, worldMax.x, worldMax.y, worldMax.z, 3, false);
|
||||||
pQueueTL.set(pQueue);
|
pQueueTL.set(pQueue);
|
||||||
physicsSpaceTL.set(this);
|
physicsSpaceTL.set(this);
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_PhysicsSpace_createPhysicsSpace
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_PhysicsSpace_createPhysicsSpace
|
||||||
(JNIEnv * env, jobject object, jfloat minX, jfloat minY, jfloat minZ, jfloat maxX, jfloat maxY, jfloat maxZ, jint broadphase, jboolean threading) {
|
(JNIEnv * env, jobject object, jfloat minX, jfloat minY, jfloat minZ, jfloat maxX, jfloat maxY, jfloat maxZ, jint broadphase, jboolean threading) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
jmePhysicsSpace* space = new jmePhysicsSpace(env, object);
|
jmePhysicsSpace* space = new jmePhysicsSpace(env, object);
|
||||||
if (space == NULL) {
|
if (space == NULL) {
|
||||||
jclass newExc = env->FindClass("java/lang/IllegalStateException");
|
jclass newExc = env->FindClass("java/lang/IllegalStateException");
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_BoxCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_BoxCollisionShape_createShape
|
||||||
(JNIEnv *env, jobject object, jobject halfExtents) {
|
(JNIEnv *env, jobject object, jobject halfExtents) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btVector3* extents = &btVector3();
|
btVector3* extents = &btVector3();
|
||||||
jmeBulletUtil::convert(env, halfExtents, extents);
|
jmeBulletUtil::convert(env, halfExtents, extents);
|
||||||
btBoxShape* shape = new btBoxShape(*extents);
|
btBoxShape* shape = new btBoxShape(*extents);
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CapsuleCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CapsuleCollisionShape_createShape
|
||||||
(JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
|
(JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btCollisionShape* shape;
|
btCollisionShape* shape;
|
||||||
switch(axis){
|
switch(axis){
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_createShape
|
||||||
(JNIEnv *env, jobject object) {
|
(JNIEnv *env, jobject object) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btCompoundShape* shape = new btCompoundShape();
|
btCompoundShape* shape = new btCompoundShape();
|
||||||
return (long) shape;
|
return (long) shape;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_ConeCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_ConeCollisionShape_createShape
|
||||||
(JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
|
(JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btCollisionShape* shape;
|
btCollisionShape* shape;
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CylinderCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CylinderCollisionShape_createShape
|
||||||
(JNIEnv * env, jobject object, jint axis, jobject halfExtents) {
|
(JNIEnv * env, jobject object, jint axis, jobject halfExtents) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btVector3* extents = &btVector3();
|
btVector3* extents = &btVector3();
|
||||||
jmeBulletUtil::convert(env, halfExtents, extents);
|
jmeBulletUtil::convert(env, halfExtents, extents);
|
||||||
btCollisionShape* shape;
|
btCollisionShape* shape;
|
||||||
|
@ -48,6 +48,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_createShape
|
||||||
(JNIEnv * env, jobject object, jlong meshId) {
|
(JNIEnv * env, jobject object, jlong meshId) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btTriangleIndexVertexArray* array = (btTriangleIndexVertexArray*) meshId;
|
btTriangleIndexVertexArray* array = (btTriangleIndexVertexArray*) meshId;
|
||||||
btGImpactMeshShape* shape = new btGImpactMeshShape(array);
|
btGImpactMeshShape* shape = new btGImpactMeshShape(array);
|
||||||
return (long) shape;
|
return (long) shape;
|
||||||
|
@ -48,6 +48,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HeightfieldCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HeightfieldCollisionShape_createShape
|
||||||
(JNIEnv * env, jobject object, jint heightStickWidth, jint heightStickLength, jobject heightfieldData, jfloat heightScale, jfloat minHeight, jfloat maxHeight, jint upAxis, jboolean flipQuadEdges) {
|
(JNIEnv * env, jobject object, jint heightStickWidth, jint heightStickLength, jobject heightfieldData, jfloat heightScale, jfloat minHeight, jfloat maxHeight, jint upAxis, jboolean flipQuadEdges) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
void* data = env->GetDirectBufferAddress(heightfieldData);
|
void* data = env->GetDirectBufferAddress(heightfieldData);
|
||||||
btHeightfieldTerrainShape* shape=new btHeightfieldTerrainShape(heightStickWidth, heightStickLength, data, heightScale, minHeight, maxHeight, upAxis, PHY_FLOAT, flipQuadEdges);
|
btHeightfieldTerrainShape* shape=new btHeightfieldTerrainShape(heightStickWidth, heightStickLength, data, heightScale, minHeight, maxHeight, upAxis, PHY_FLOAT, flipQuadEdges);
|
||||||
return (long)shape;
|
return (long)shape;
|
||||||
|
@ -48,6 +48,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HullCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HullCollisionShape_createShape
|
||||||
(JNIEnv *env, jobject object, jobject array) {
|
(JNIEnv *env, jobject object, jobject array) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
float* data = (float*) env->GetDirectBufferAddress(array);
|
float* data = (float*) env->GetDirectBufferAddress(array);
|
||||||
//TODO: capacity will not always be length!
|
//TODO: capacity will not always be length!
|
||||||
int length = env->GetDirectBufferCapacity(array)/4;
|
int length = env->GetDirectBufferCapacity(array)/4;
|
||||||
|
@ -48,6 +48,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_createShape
|
||||||
(JNIEnv * env, jobject object, jlong arrayId) {
|
(JNIEnv * env, jobject object, jlong arrayId) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btTriangleIndexVertexArray* array = (btTriangleIndexVertexArray*) arrayId;
|
btTriangleIndexVertexArray* array = (btTriangleIndexVertexArray*) arrayId;
|
||||||
btBvhTriangleMeshShape* shape = new btBvhTriangleMeshShape(array, true, true);
|
btBvhTriangleMeshShape* shape = new btBvhTriangleMeshShape(array, true, true);
|
||||||
return (long) shape;
|
return (long) shape;
|
||||||
|
@ -48,6 +48,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_PlaneCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_PlaneCollisionShape_createShape
|
||||||
(JNIEnv * env, jobject object, jobject normal, jfloat constant) {
|
(JNIEnv * env, jobject object, jobject normal, jfloat constant) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btVector3* norm = &btVector3();
|
btVector3* norm = &btVector3();
|
||||||
jmeBulletUtil::convert(env, normal, norm);
|
jmeBulletUtil::convert(env, normal, norm);
|
||||||
btStaticPlaneShape* shape = new btStaticPlaneShape(*norm, constant);
|
btStaticPlaneShape* shape = new btStaticPlaneShape(*norm, constant);
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2
|
||||||
(JNIEnv *env, jobject object, jobject vector1) {
|
(JNIEnv *env, jobject object, jobject vector1) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btVector3* vec1 = &btVector3();
|
btVector3* vec1 = &btVector3();
|
||||||
jmeBulletUtil::convert(env, vector1, vec1);
|
jmeBulletUtil::convert(env, vector1, vec1);
|
||||||
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(*vec1);
|
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(*vec1);
|
||||||
@ -60,6 +61,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
|
||||||
(JNIEnv *env, jobject object, jobject vector1, jobject vector2) {
|
(JNIEnv *env, jobject object, jobject vector1, jobject vector2) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btVector3* vec1 = &btVector3();
|
btVector3* vec1 = &btVector3();
|
||||||
jmeBulletUtil::convert(env, vector1, vec1);
|
jmeBulletUtil::convert(env, vector1, vec1);
|
||||||
btVector3* vec2 = &btVector3();
|
btVector3* vec2 = &btVector3();
|
||||||
@ -74,6 +76,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
|
||||||
(JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3) {
|
(JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btVector3* vec1 = &btVector3();
|
btVector3* vec1 = &btVector3();
|
||||||
jmeBulletUtil::convert(env, vector1, vec1);
|
jmeBulletUtil::convert(env, vector1, vec1);
|
||||||
btVector3* vec2 = &btVector3();
|
btVector3* vec2 = &btVector3();
|
||||||
@ -90,6 +93,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
|
||||||
(JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3, jobject vector4) {
|
(JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3, jobject vector4) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btVector3* vec1 = &btVector3();
|
btVector3* vec1 = &btVector3();
|
||||||
jmeBulletUtil::convert(env, vector1, vec1);
|
jmeBulletUtil::convert(env, vector1, vec1);
|
||||||
btVector3* vec2 = &btVector3();
|
btVector3* vec2 = &btVector3();
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SphereCollisionShape_createShape
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SphereCollisionShape_createShape
|
||||||
(JNIEnv *env, jobject object, jfloat radius) {
|
(JNIEnv *env, jobject object, jfloat radius) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btSphereShape* shape=new btSphereShape(radius);
|
btSphereShape* shape=new btSphereShape(radius);
|
||||||
return (long)shape;
|
return (long)shape;
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_ConeJoint_createJoint
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_ConeJoint_createJoint
|
||||||
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB) {
|
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
||||||
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
||||||
btMatrix3x3* mtx1 = &btMatrix3x3();
|
btMatrix3x3* mtx1 = &btMatrix3x3();
|
||||||
|
@ -157,6 +157,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_HingeJoint_createJoint
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_HingeJoint_createJoint
|
||||||
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject axisA, jobject pivotB, jobject axisB) {
|
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject axisA, jobject pivotB, jobject axisB) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
||||||
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
||||||
btVector3* vec1 = &btVector3();
|
btVector3* vec1 = &btVector3();
|
||||||
|
@ -113,6 +113,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_createJoint
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_createJoint
|
||||||
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject pivotB) {
|
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject pivotB) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
||||||
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
||||||
//TODO: matrix not needed?
|
//TODO: matrix not needed?
|
||||||
|
@ -121,6 +121,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_createJoint
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_createJoint
|
||||||
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
|
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
||||||
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
||||||
btMatrix3x3* mtx1 = &btMatrix3x3();
|
btMatrix3x3* mtx1 = &btMatrix3x3();
|
||||||
|
@ -663,6 +663,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SliderJoint_createJoint
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SliderJoint_createJoint
|
||||||
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
|
(JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
|
||||||
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
|
||||||
btMatrix3x3* mtx1=&btMatrix3x3();
|
btMatrix3x3* mtx1=&btMatrix3x3();
|
||||||
|
@ -50,6 +50,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createGhostObject
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createGhostObject
|
||||||
(JNIEnv * env, jobject object) {
|
(JNIEnv * env, jobject object) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
|
btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
|
||||||
return (long) ghost;
|
return (long) ghost;
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_createGhostObject
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_createGhostObject
|
||||||
(JNIEnv * env, jobject object) {
|
(JNIEnv * env, jobject object) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
|
btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
|
||||||
return (long) ghost;
|
return (long) ghost;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_createRigidBody
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_createRigidBody
|
||||||
(JNIEnv *env, jobject object, jfloat mass, jlong motionstatId, jlong shapeId) {
|
(JNIEnv *env, jobject object, jfloat mass, jlong motionstatId, jlong shapeId) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
btMotionState* motionState = (btMotionState*) motionstatId;
|
btMotionState* motionState = (btMotionState*) motionstatId;
|
||||||
btCollisionShape* shape = (btCollisionShape*) shapeId;
|
btCollisionShape* shape = (btCollisionShape*) shapeId;
|
||||||
btVector3* localInertia = &btVector3();
|
btVector3* localInertia = &btVector3();
|
||||||
|
@ -48,6 +48,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_createMotionState
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_createMotionState
|
||||||
(JNIEnv *env, jobject object) {
|
(JNIEnv *env, jobject object) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
jmeMotionState* motionState = new jmeMotionState();
|
jmeMotionState* motionState = new jmeMotionState();
|
||||||
return (long) motionState;
|
return (long) motionState;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_util_NativeMeshUtil_createTriangleIndexVertexArray
|
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_util_NativeMeshUtil_createTriangleIndexVertexArray
|
||||||
(JNIEnv * env, jclass cls, jobject triangleIndexBase, jobject vertexIndexBase, jint numTriangles, jint numVertices, jint vertexStride, jint triangleIndexStride) {
|
(JNIEnv * env, jclass cls, jobject triangleIndexBase, jobject vertexIndexBase, jint numTriangles, jint numVertices, jint vertexStride, jint triangleIndexStride) {
|
||||||
|
jmeClasses::initJavaClasses(env);
|
||||||
int* triangles = (int*) env->GetDirectBufferAddress(triangleIndexBase);
|
int* triangles = (int*) env->GetDirectBufferAddress(triangleIndexBase);
|
||||||
float* vertices = (float*) env->GetDirectBufferAddress(vertexIndexBase);
|
float* vertices = (float*) env->GetDirectBufferAddress(vertexIndexBase);
|
||||||
btTriangleIndexVertexArray* array = new btTriangleIndexVertexArray(numTriangles, triangles, triangleIndexStride, numVertices, vertices, vertexStride);
|
btTriangleIndexVertexArray* array = new btTriangleIndexVertexArray(numTriangles, triangles, triangleIndexStride, numVertices, vertices, vertexStride);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user