- commit possible fix for windows 64 pointer casting issues, see http://msdn.microsoft.com/en-us/library/aa384242(v=vs.85).aspx

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8487 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 164dec188a
commit aa96a1caf8
  1. 2
      engine/src/bullet/native/com_jme3_bullet_PhysicsSpace.cpp
  2. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_BoxCollisionShape.cpp
  3. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.cpp
  4. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_CompoundCollisionShape.cpp
  5. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_ConeCollisionShape.cpp
  6. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_CylinderCollisionShape.cpp
  7. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_GImpactCollisionShape.cpp
  8. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.cpp
  9. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_HullCollisionShape.cpp
  10. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_MeshCollisionShape.cpp
  11. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_PlaneCollisionShape.cpp
  12. 8
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_SimplexCollisionShape.cpp
  13. 2
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_SphereCollisionShape.cpp
  14. 2
      engine/src/bullet/native/com_jme3_bullet_joints_ConeJoint.cpp
  15. 2
      engine/src/bullet/native/com_jme3_bullet_joints_HingeJoint.cpp
  16. 2
      engine/src/bullet/native/com_jme3_bullet_joints_Point2PointJoint.cpp
  17. 6
      engine/src/bullet/native/com_jme3_bullet_joints_SixDofJoint.cpp
  18. 2
      engine/src/bullet/native/com_jme3_bullet_joints_SixDofSpringJoint.cpp
  19. 2
      engine/src/bullet/native/com_jme3_bullet_joints_SliderJoint.cpp
  20. 4
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsCharacter.cpp
  21. 2
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsGhostObject.cpp
  22. 4
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsRigidBody.cpp
  23. 4
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsVehicle.cpp
  24. 2
      engine/src/bullet/native/com_jme3_bullet_objects_infos_RigidBodyMotionState.cpp
  25. 2
      engine/src/bullet/native/com_jme3_bullet_util_NativeMeshUtil.cpp
  26. 8
      engine/src/bullet/native/jmeBulletUtil.h

@ -55,7 +55,7 @@ extern "C" {
return 0; return 0;
} }
space->createPhysicsSpace(minX, minY, minZ, maxX, maxY, maxZ, broadphase, threading); space->createPhysicsSpace(minX, minY, minZ, maxX, maxY, maxZ, broadphase, threading);
return (long) space; return (OBJ_PTR) space;
} }
/* /*

@ -51,7 +51,7 @@ extern "C" {
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);
return (long)shape; return (OBJ_PTR)shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -60,7 +60,7 @@ extern "C" {
shape = new btCapsuleShapeZ(radius, height); shape = new btCapsuleShapeZ(radius, height);
break; break;
} }
return (long) shape; return (OBJ_PTR) shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -49,7 +49,7 @@ extern "C" {
(JNIEnv *env, jobject object) { (JNIEnv *env, jobject object) {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
btCompoundShape* shape = new btCompoundShape(); btCompoundShape* shape = new btCompoundShape();
return (long) shape; return (OBJ_PTR) shape;
} }
/* /*

@ -60,7 +60,7 @@ extern "C" {
shape = new btConeShapeZ(radius, height); shape = new btConeShapeZ(radius, height);
break; break;
} }
return (long) shape; return (OBJ_PTR) shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -62,7 +62,7 @@ extern "C" {
shape = new btCylinderShapeZ(extents); shape = new btCylinderShapeZ(extents);
break; break;
} }
return (long) shape; return (OBJ_PTR) shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -51,7 +51,7 @@ extern "C" {
jmeClasses::initJavaClasses(env); 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 (OBJ_PTR) shape;
} }
/* /*

@ -51,7 +51,7 @@ extern "C" {
jmeClasses::initJavaClasses(env); 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 (OBJ_PTR)shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -61,7 +61,7 @@ extern "C" {
shape->addPoint(vect); shape->addPoint(vect);
} }
return (long) shape; return (OBJ_PTR) shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -51,7 +51,7 @@ extern "C" {
jmeClasses::initJavaClasses(env); 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 (OBJ_PTR) shape;
} }
/* /*

@ -52,7 +52,7 @@ extern "C" {
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);
return (long)shape; return (OBJ_PTR)shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -51,7 +51,7 @@ extern "C" {
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);
return (long) simplexShape; return (OBJ_PTR) simplexShape;
} }
/* /*
@ -67,7 +67,7 @@ extern "C" {
btVector3 vec2 = btVector3(); btVector3 vec2 = btVector3();
jmeBulletUtil::convert(env, vector2, &vec2); jmeBulletUtil::convert(env, vector2, &vec2);
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2); btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2);
return (long) simplexShape; return (OBJ_PTR) simplexShape;
} }
/* /*
* Class: com_jme3_bullet_collision_shapes_SimplexCollisionShape * Class: com_jme3_bullet_collision_shapes_SimplexCollisionShape
@ -84,7 +84,7 @@ extern "C" {
btVector3 vec3 = btVector3(); btVector3 vec3 = btVector3();
jmeBulletUtil::convert(env, vector3, &vec3); jmeBulletUtil::convert(env, vector3, &vec3);
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3); btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3);
return (long) simplexShape; return (OBJ_PTR) simplexShape;
} }
/* /*
* Class: com_jme3_bullet_collision_shapes_SimplexCollisionShape * Class: com_jme3_bullet_collision_shapes_SimplexCollisionShape
@ -103,7 +103,7 @@ extern "C" {
btVector3 vec4 = btVector3(); btVector3 vec4 = btVector3();
jmeBulletUtil::convert(env, vector4, &vec4); jmeBulletUtil::convert(env, vector4, &vec4);
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3, vec4); btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3, vec4);
return (long) simplexShape; return (OBJ_PTR) simplexShape;
} }
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -49,7 +49,7 @@ extern "C" {
(JNIEnv *env, jobject object, jfloat radius) { (JNIEnv *env, jobject object, jfloat radius) {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
btSphereShape* shape=new btSphereShape(radius); btSphereShape* shape=new btSphereShape(radius);
return (long)shape; return (OBJ_PTR)shape;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -92,7 +92,7 @@ extern "C" {
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin()); jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis()); jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btConeTwistConstraint* joint = new btConeTwistConstraint(*bodyA, *bodyB, transA, transB); btConeTwistConstraint* joint = new btConeTwistConstraint(*bodyA, *bodyB, transA, transB);
return (long) joint; return (OBJ_PTR) joint;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -219,7 +219,7 @@ extern "C" {
jmeBulletUtil::convert(env, axisA, &vec3); jmeBulletUtil::convert(env, axisA, &vec3);
jmeBulletUtil::convert(env, axisB, &vec4); jmeBulletUtil::convert(env, axisB, &vec4);
btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, vec1, vec2, vec3, vec4); btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, vec1, vec2, vec3, vec4);
return (long) joint; return (OBJ_PTR) joint;
} }
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -154,7 +154,7 @@ extern "C" {
btTransform transB = btTransform(mtx2); btTransform transB = btTransform(mtx2);
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin()); jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, transA, transB); btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, transA, transB);
return (long) joint; return (OBJ_PTR) joint;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -53,7 +53,7 @@ extern "C" {
env->ThrowNew(newExc, "The native object does not exist."); env->ThrowNew(newExc, "The native object does not exist.");
return 0; return 0;
} }
return (long) joint->getRotationalLimitMotor(index); return (OBJ_PTR) joint->getRotationalLimitMotor(index);
} }
/* /*
@ -69,7 +69,7 @@ extern "C" {
env->ThrowNew(newExc, "The native object does not exist."); env->ThrowNew(newExc, "The native object does not exist.");
return 0; return 0;
} }
return (long) joint->getTranslationalLimitMotor(); return (OBJ_PTR) joint->getTranslationalLimitMotor();
} }
/* /*
@ -163,7 +163,7 @@ extern "C" {
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin()); jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis()); jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA); btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
return (long) joint; return (OBJ_PTR) joint;
} }
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -86,7 +86,7 @@ JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_createJoin
jmeBulletUtil::convert(env, rotB, &transB.getBasis()); jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btGeneric6DofSpringConstraint* joint = new btGeneric6DofSpringConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA); btGeneric6DofSpringConstraint* joint = new btGeneric6DofSpringConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
return (long)joint; return (OBJ_PTR)joint;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -955,7 +955,7 @@ extern "C" {
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin()); jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis()); jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA); btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
return (long) joint; return (OBJ_PTR) joint;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -52,7 +52,7 @@ extern "C" {
(JNIEnv * env, jobject object) { (JNIEnv * env, jobject object) {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
btPairCachingGhostObject* ghost = new btPairCachingGhostObject(); btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
return (long) ghost; return (OBJ_PTR) ghost;
} }
/* /*
@ -88,7 +88,7 @@ extern "C" {
//TODO: check convexshape! //TODO: check convexshape!
btConvexShape* shape = (btConvexShape*) shapeId; btConvexShape* shape = (btConvexShape*) shapeId;
btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight); btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight);
return (long) character; return (OBJ_PTR) character;
} }
/* /*

@ -54,7 +54,7 @@ extern "C" {
(JNIEnv * env, jobject object) { (JNIEnv * env, jobject object) {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
btPairCachingGhostObject* ghost = new btPairCachingGhostObject(); btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
return (long) ghost; return (OBJ_PTR) ghost;
} }
/* /*

@ -55,7 +55,7 @@ extern "C" {
shape->calculateLocalInertia(mass, localInertia); shape->calculateLocalInertia(mass, localInertia);
btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia); btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia);
body->setUserPointer(NULL); body->setUserPointer(NULL);
return (long) body; return (OBJ_PTR) body;
} }
/* /*
@ -336,7 +336,7 @@ extern "C" {
btVector3 localInertia = btVector3(); btVector3 localInertia = btVector3();
shape->calculateLocalInertia(mass, localInertia); shape->calculateLocalInertia(mass, localInertia);
body->setMassProps(mass, localInertia); body->setMassProps(mass, localInertia);
return (long) body; return (OBJ_PTR) body;
} }
/* /*

@ -75,7 +75,7 @@ extern "C" {
return 0; return 0;
} }
btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(space->getDynamicsWorld()); btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(space->getDynamicsWorld());
return (long) caster; return (OBJ_PTR) caster;
} }
/* /*
@ -101,7 +101,7 @@ extern "C" {
} }
btRaycastVehicle::btVehicleTuning tuning; btRaycastVehicle::btVehicleTuning tuning;
btRaycastVehicle* vehicle = new btRaycastVehicle(tuning, body, caster); btRaycastVehicle* vehicle = new btRaycastVehicle(tuning, body, caster);
return (long) vehicle; return (OBJ_PTR) vehicle;
} }

@ -50,7 +50,7 @@ extern "C" {
(JNIEnv *env, jobject object) { (JNIEnv *env, jobject object) {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
jmeMotionState* motionState = new jmeMotionState(); jmeMotionState* motionState = new jmeMotionState();
return (long) motionState; return (OBJ_PTR) motionState;
} }
/* /*

@ -51,7 +51,7 @@ extern "C" {
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);
return (long) array; return (OBJ_PTR) array;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -34,6 +34,14 @@
#include "btBulletCollisionCommon.h" #include "btBulletCollisionCommon.h"
#include "LinearMath/btVector3.h" #include "LinearMath/btVector3.h"
#ifdef _WIN32
typedef ULONG OBJ_PTR;
#elif _WIN64
typedef _int64 OBJ_PTR;
#else
typedef long OBJ_PTR;
#endif
/** /**
* Author: Normen Hansen * Author: Normen Hansen
*/ */

Loading…
Cancel
Save