- 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
This commit is contained in:
parent
164dec188a
commit
aa96a1caf8
@ -55,7 +55,7 @@ extern "C" {
|
||||
return 0;
|
||||
}
|
||||
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();
|
||||
jmeBulletUtil::convert(env, halfExtents, &extents);
|
||||
btBoxShape* shape = new btBoxShape(extents);
|
||||
return (long)shape;
|
||||
return (OBJ_PTR)shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -60,7 +60,7 @@ extern "C" {
|
||||
shape = new btCapsuleShapeZ(radius, height);
|
||||
break;
|
||||
}
|
||||
return (long) shape;
|
||||
return (OBJ_PTR) shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -49,7 +49,7 @@ extern "C" {
|
||||
(JNIEnv *env, jobject object) {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
btCompoundShape* shape = new btCompoundShape();
|
||||
return (long) shape;
|
||||
return (OBJ_PTR) shape;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -60,7 +60,7 @@ extern "C" {
|
||||
shape = new btConeShapeZ(radius, height);
|
||||
break;
|
||||
}
|
||||
return (long) shape;
|
||||
return (OBJ_PTR) shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -62,7 +62,7 @@ extern "C" {
|
||||
shape = new btCylinderShapeZ(extents);
|
||||
break;
|
||||
}
|
||||
return (long) shape;
|
||||
return (OBJ_PTR) shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -51,7 +51,7 @@ extern "C" {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
btTriangleIndexVertexArray* array = (btTriangleIndexVertexArray*) meshId;
|
||||
btGImpactMeshShape* shape = new btGImpactMeshShape(array);
|
||||
return (long) shape;
|
||||
return (OBJ_PTR) shape;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -51,7 +51,7 @@ extern "C" {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
void* data = env->GetDirectBufferAddress(heightfieldData);
|
||||
btHeightfieldTerrainShape* shape=new btHeightfieldTerrainShape(heightStickWidth, heightStickLength, data, heightScale, minHeight, maxHeight, upAxis, PHY_FLOAT, flipQuadEdges);
|
||||
return (long)shape;
|
||||
return (OBJ_PTR)shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -61,7 +61,7 @@ extern "C" {
|
||||
shape->addPoint(vect);
|
||||
}
|
||||
|
||||
return (long) shape;
|
||||
return (OBJ_PTR) shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -51,7 +51,7 @@ extern "C" {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
btTriangleIndexVertexArray* array = (btTriangleIndexVertexArray*) arrayId;
|
||||
btBvhTriangleMeshShape* shape = new btBvhTriangleMeshShape(array, true, true);
|
||||
return (long) shape;
|
||||
return (OBJ_PTR) shape;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -52,7 +52,7 @@ extern "C" {
|
||||
btVector3 norm = btVector3();
|
||||
jmeBulletUtil::convert(env, normal, &norm);
|
||||
btStaticPlaneShape* shape = new btStaticPlaneShape(norm, constant);
|
||||
return (long)shape;
|
||||
return (OBJ_PTR)shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -51,7 +51,7 @@ extern "C" {
|
||||
btVector3 vec1 = btVector3();
|
||||
jmeBulletUtil::convert(env, vector1, &vec1);
|
||||
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1);
|
||||
return (long) simplexShape;
|
||||
return (OBJ_PTR) simplexShape;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -67,7 +67,7 @@ extern "C" {
|
||||
btVector3 vec2 = btVector3();
|
||||
jmeBulletUtil::convert(env, vector2, &vec2);
|
||||
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2);
|
||||
return (long) simplexShape;
|
||||
return (OBJ_PTR) simplexShape;
|
||||
}
|
||||
/*
|
||||
* Class: com_jme3_bullet_collision_shapes_SimplexCollisionShape
|
||||
@ -84,7 +84,7 @@ extern "C" {
|
||||
btVector3 vec3 = btVector3();
|
||||
jmeBulletUtil::convert(env, vector3, &vec3);
|
||||
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3);
|
||||
return (long) simplexShape;
|
||||
return (OBJ_PTR) simplexShape;
|
||||
}
|
||||
/*
|
||||
* Class: com_jme3_bullet_collision_shapes_SimplexCollisionShape
|
||||
@ -103,7 +103,7 @@ extern "C" {
|
||||
btVector3 vec4 = btVector3();
|
||||
jmeBulletUtil::convert(env, vector4, &vec4);
|
||||
btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3, vec4);
|
||||
return (long) simplexShape;
|
||||
return (OBJ_PTR) simplexShape;
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ extern "C" {
|
||||
(JNIEnv *env, jobject object, jfloat radius) {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
btSphereShape* shape=new btSphereShape(radius);
|
||||
return (long)shape;
|
||||
return (OBJ_PTR)shape;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -92,7 +92,7 @@ extern "C" {
|
||||
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
|
||||
jmeBulletUtil::convert(env, rotB, &transB.getBasis());
|
||||
btConeTwistConstraint* joint = new btConeTwistConstraint(*bodyA, *bodyB, transA, transB);
|
||||
return (long) joint;
|
||||
return (OBJ_PTR) joint;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -219,7 +219,7 @@ extern "C" {
|
||||
jmeBulletUtil::convert(env, axisA, &vec3);
|
||||
jmeBulletUtil::convert(env, axisB, &vec4);
|
||||
btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, vec1, vec2, vec3, vec4);
|
||||
return (long) joint;
|
||||
return (OBJ_PTR) joint;
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ extern "C" {
|
||||
btTransform transB = btTransform(mtx2);
|
||||
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
|
||||
btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, transA, transB);
|
||||
return (long) joint;
|
||||
return (OBJ_PTR) joint;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -53,7 +53,7 @@ extern "C" {
|
||||
env->ThrowNew(newExc, "The native object does not exist.");
|
||||
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.");
|
||||
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, rotB, &transB.getBasis());
|
||||
btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
|
||||
return (long) joint;
|
||||
return (OBJ_PTR) joint;
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_createJoin
|
||||
jmeBulletUtil::convert(env, rotB, &transB.getBasis());
|
||||
|
||||
btGeneric6DofSpringConstraint* joint = new btGeneric6DofSpringConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
|
||||
return (long)joint;
|
||||
return (OBJ_PTR)joint;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -955,7 +955,7 @@ extern "C" {
|
||||
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 (OBJ_PTR) joint;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -52,7 +52,7 @@ extern "C" {
|
||||
(JNIEnv * env, jobject object) {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
|
||||
return (long) ghost;
|
||||
return (OBJ_PTR) ghost;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -88,7 +88,7 @@ extern "C" {
|
||||
//TODO: check convexshape!
|
||||
btConvexShape* shape = (btConvexShape*) shapeId;
|
||||
btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight);
|
||||
return (long) character;
|
||||
return (OBJ_PTR) character;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -54,7 +54,7 @@ extern "C" {
|
||||
(JNIEnv * env, jobject object) {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
|
||||
return (long) ghost;
|
||||
return (OBJ_PTR) ghost;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -55,7 +55,7 @@ extern "C" {
|
||||
shape->calculateLocalInertia(mass, localInertia);
|
||||
btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia);
|
||||
body->setUserPointer(NULL);
|
||||
return (long) body;
|
||||
return (OBJ_PTR) body;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -336,7 +336,7 @@ extern "C" {
|
||||
btVector3 localInertia = btVector3();
|
||||
shape->calculateLocalInertia(mass, localInertia);
|
||||
body->setMassProps(mass, localInertia);
|
||||
return (long) body;
|
||||
return (OBJ_PTR) body;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -75,7 +75,7 @@ extern "C" {
|
||||
return 0;
|
||||
}
|
||||
btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(space->getDynamicsWorld());
|
||||
return (long) caster;
|
||||
return (OBJ_PTR) caster;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -101,7 +101,7 @@ extern "C" {
|
||||
}
|
||||
btRaycastVehicle::btVehicleTuning tuning;
|
||||
btRaycastVehicle* vehicle = new btRaycastVehicle(tuning, body, caster);
|
||||
return (long) vehicle;
|
||||
return (OBJ_PTR) vehicle;
|
||||
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ extern "C" {
|
||||
(JNIEnv *env, jobject object) {
|
||||
jmeClasses::initJavaClasses(env);
|
||||
jmeMotionState* motionState = new jmeMotionState();
|
||||
return (long) motionState;
|
||||
return (OBJ_PTR) motionState;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -51,7 +51,7 @@ extern "C" {
|
||||
int* triangles = (int*) env->GetDirectBufferAddress(triangleIndexBase);
|
||||
float* vertices = (float*) env->GetDirectBufferAddress(vertexIndexBase);
|
||||
btTriangleIndexVertexArray* array = new btTriangleIndexVertexArray(numTriangles, triangles, triangleIndexStride, numVertices, vertices, vertexStride);
|
||||
return (long) array;
|
||||
return (OBJ_PTR) array;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -34,6 +34,14 @@
|
||||
#include "btBulletCollisionCommon.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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user