diff --git a/engine/src/bullet/native/com_jme3_bullet_objects_PhysicsVehicle.cpp b/engine/src/bullet/native/com_jme3_bullet_objects_PhysicsVehicle.cpp index d9a96af5e..2c52ca90f 100644 --- a/engine/src/bullet/native/com_jme3_bullet_objects_PhysicsVehicle.cpp +++ b/engine/src/bullet/native/com_jme3_bullet_objects_PhysicsVehicle.cpp @@ -36,6 +36,7 @@ #include "com_jme3_bullet_objects_PhysicsVehicle.h" #include "jmeBulletUtil.h" +#include "jmePhysicsSpace.h" #include "BulletDynamics/Vehicle/btRaycastVehicle.h" #ifdef __cplusplus @@ -66,13 +67,13 @@ extern "C" { JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createVehicleRaycaster (JNIEnv *env, jobject object, jlong bodyId, jlong spaceId) { //btRigidBody* body = (btRigidBody*) bodyId; - btDiscreteDynamicsWorld* spsace = (btDiscreteDynamicsWorld*) spaceId; - if (spsace == NULL) { + jmePhysicsSpace *space = (jmePhysicsSpace *)spaceId; + if (space == NULL) { jclass newExc = env->FindClass("java/lang/NullPointerException"); env->ThrowNew(newExc, "The native object does not exist."); return 0; } - btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(spsace); + btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(space->getDynamicsWorld()); return (long) caster; } diff --git a/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.cpp b/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.cpp index 302db41cc..31a29b7a0 100644 --- a/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.cpp +++ b/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.cpp @@ -105,7 +105,7 @@ extern "C" { // Check there is a hull shape to render if (convexShape->getUserPointer() == NULL) { // create a hull approximation - btShapeHull* hull = &btShapeHull(convexShape); + btShapeHull* hull = new btShapeHull(convexShape); float margin = convexShape->getMargin(); hull->buildHull(margin); convexShape->setUserPointer(hull); @@ -146,7 +146,7 @@ extern "C" { return; } } - + delete hull; convexShape->setUserPointer(NULL); } } diff --git a/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.h b/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.h index 45eca74cd..757696fcc 100644 --- a/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.h +++ b/engine/src/bullet/native/com_jme3_bullet_util_DebugShapeFactory.h @@ -7,7 +7,6 @@ #ifdef __cplusplus extern "C" { #endif -/* Inaccessible static: _00024assertionsDisabled */ /* * Class: com_jme3_bullet_util_DebugShapeFactory * Method: getVertices