OSDN Git Service

Fix stupid bug in pooling
authorXoppa <contact@xoppa.nl>
Tue, 8 Oct 2013 17:02:45 +0000 (19:02 +0200)
committerXoppa <contact@xoppa.nl>
Tue, 8 Oct 2013 17:02:45 +0000 (19:02 +0200)
extensions/gdx-bullet/jni/swig/common/gdxDefault.i
extensions/gdx-bullet/jni/swig/common/gdxPooledObject.i
extensions/gdx-bullet/jni/swig/gdxBullet.i

index 33a83a0..720bb96 100644 (file)
                construct();
        }
        
+       @Override
+       protected void reset(long cPtr, boolean cMemoryOwn) {
+               if (!destroyed)
+                       destroy();
+               super.reset(swigCPtr = cPtr, cMemoryOwn);
+       }
+       
        public static long getCPtr($javaclassname obj) {
                return (obj == null) ? 0 : obj.swigCPtr;
        }
                construct();
        }
        
+       @Override
+       protected void reset(long cPtr, boolean cMemoryOwn) {
+               if (!destroyed)
+                       destroy();
+               super.reset($imclassname.$javaclazznameSWIGUpcast(swigCPtr = cPtr), cMemoryOwn);
+       }
+       
        public static long getCPtr($javaclassname obj) {
                return (obj == null) ? 0 : obj.swigCPtr;
        }
index 3c4a50e..1516f4e 100644 (file)
@@ -51,7 +51,7 @@
          
          static jmethodID reuseMethod = NULL;
          if (reuseMethod == NULL)
-                 reuseMethod = (jmethodID) jenv->GetMethodID(clazz, "reuse", "(JZ)V");
+                 reuseMethod = (jmethodID) jenv->GetMethodID(clazz, "reset", "(JZ)V");
          
          long ptr;
          *(const void **)&ptr = cPtr;
index 1729ed9..a928928 100644 (file)
@@ -16,6 +16,7 @@
 %ignore btManifoldPoint::getPositionWorldOnB;\r
 %ignore btManifoldPoint::getAppliedImpulse;\r
 %ignore btSolverBody::getWorldTransform;\r
+%ignore btSolverBody::setWorldTransform;\r
 %ignore btSolverBody::getDeltaLinearVelocity;\r
 %ignore btSolverBody::getDeltaAngularVelocity;\r
 %ignore btSolverBody::getPushVelocity;\r
 \r
 %include "common/gdxPooledObject.i"\r
 \r
-//%include "common/gdxManagedObject.i"\r
-\r
-/* Prefer libgdx's linear math types (Vector3, Matrix3, etc.). */\r
-%include "common/gdxMathTypes.i"\r
 \r
 /* Map "void *" to "jlong". */\r
 // %include "gdxVoidPointer.i";\r
@@ -58,7 +55,6 @@
 /* Include Java imports for all the types we'll need in all extensions/custom types. */\r
 %include "common/gdxJavaImports.i"\r
 \r
-\r
 %{\r
 #include <stdint.h>\r
 %}\r
  */\r
 %include "common/btTransform.i"\r
 \r
+%{\r
+#include <LinearMath/btVector3.h>\r
+%}\r
+%include <LinearMath/btVector3.h>\r
+\r
+%{\r
+#include <LinearMath/btQuaternion.h>\r
+%}\r
+%include <LinearMath/btQuaternion.h>\r
+\r
+\r
+\r
+//%include "common/gdxManagedObject.i"\r
+\r
+/* Prefer libgdx's linear math types (Vector3, Matrix3, etc.). */\r
+%include "common/gdxMathTypes.i"\r
+\r
 /* Configure directors for types with virtual methods that need Java implementations */\r
 %feature("director") btIDebugDraw;\r
 \r
  */\r
 \r
 %{\r
-#include <LinearMath/btVector3.h>\r
-%}\r
-%include <LinearMath/btVector3.h>\r
-\r
-%{\r
 #include <LinearMath/btQuadWord.h>\r
 %}\r
 #include <LinearMath/btQuadWord.h>\r
 \r
 %{\r
-#include <LinearMath/btQuaternion.h>\r
-%}\r
-%include <LinearMath/btQuaternion.h>\r
-\r
-%{\r
 #include <LinearMath/btMatrix3x3.h>\r
 %}\r
 #include <LinearMath/btMatrix3x3.h>\r