From ba48757e8d3b678ab957b5df3fbc72d3a25d0c00 Mon Sep 17 00:00:00 2001 From: Xoppa Date: Thu, 6 Jun 2013 20:23:26 +0200 Subject: [PATCH] Bullet: Fix swig with correct Model path --- .../jni/swig/custom/btBvhTriangleMeshShape.i | 41 +++++++++++++--------- .../jni/swig/custom/btTriangleIndexVertexArray.i | 17 ++++++--- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/extensions/gdx-bullet/jni/swig/custom/btBvhTriangleMeshShape.i b/extensions/gdx-bullet/jni/swig/custom/btBvhTriangleMeshShape.i index bbdb707a0..fccab4b83 100644 --- a/extensions/gdx-bullet/jni/swig/custom/btBvhTriangleMeshShape.i +++ b/extensions/gdx-bullet/jni/swig/custom/btBvhTriangleMeshShape.i @@ -7,6 +7,15 @@ #include %} +%typemap(javaimports) btBvhTriangleMeshShape %{ +import com.badlogic.gdx.math.Vector3; +import com.badlogic.gdx.math.Quaternion; +import com.badlogic.gdx.math.Matrix3; +import com.badlogic.gdx.math.Matrix4; +import com.badlogic.gdx.graphics.Mesh; +import com.badlogic.gdx.graphics.g3d.Model; +%} + %typemap(javacode) btBvhTriangleMeshShape %{ protected btStridingMeshInterface meshInterface = null; @@ -38,59 +47,59 @@ this.meshInterface = meshInterface; } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.Mesh} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Mesh} instances. * The specified meshes must be indexed and triangulated and must outlive this btBvhTriangleMeshShape. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, final com.badlogic.gdx.graphics.Mesh... meshes) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, final Mesh... meshes) { this(true, new btTriangleIndexVertexArray(meshes), useQuantizedAabbCompression); } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.Mesh} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Mesh} instances. * The specified meshes must be indexed and triangulated and must outlive this btBvhTriangleMeshShape. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, boolean buildBvh, final com.badlogic.gdx.graphics.Mesh... meshes) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, boolean buildBvh, final Mesh... meshes) { this(true, new btTriangleIndexVertexArray(meshes), useQuantizedAabbCompression, buildBvh); } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.Mesh} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Mesh} instances. * The specified meshes must be indexed and triangulated and must outlive this btBvhTriangleMeshShape. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, boolean buildBvh, final com.badlogic.gdx.graphics.Mesh... meshes) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, boolean buildBvh, final Mesh... meshes) { this(true, new btTriangleIndexVertexArray(meshes), useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax, buildBvh); } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.Mesh} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Mesh} instances. * The specified meshes must be indexed and triangulated and must outlive this btBvhTriangleMeshShape. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, final com.badlogic.gdx.graphics.Mesh... meshes) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, final Mesh... meshes) { this(true, new btTriangleIndexVertexArray(meshes), useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax); } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.g3d.model.Model} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Model} instances. * Only the triangulated submeshes are added, which must be indexed. The model must outlive this btTriangleIndexVertexArray. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, final com.badlogic.gdx.graphics.g3d.model.Model... models) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, final Model... models) { this(true, new btTriangleIndexVertexArray(models), useQuantizedAabbCompression); } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.g3d.model.Model} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Model} instances. * Only the triangulated submeshes are added, which must be indexed. The model must outlive this btTriangleIndexVertexArray. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, boolean buildBvh, final com.badlogic.gdx.graphics.g3d.model.Model... models) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, boolean buildBvh, final Model... models) { this(true, new btTriangleIndexVertexArray(models), useQuantizedAabbCompression, buildBvh); } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.g3d.model.Model} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Model} instances. * Only the triangulated submeshes are added, which must be indexed. The model must outlive this btTriangleIndexVertexArray. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, boolean buildBvh, final com.badlogic.gdx.graphics.g3d.model.Model... models) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, boolean buildBvh, final Model... models) { this(true, new btTriangleIndexVertexArray(models), useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax, buildBvh); } - /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link com.badlogic.gdx.graphics.g3d.model.Model} instances. + /** Construct a new btBvhTriangleMeshShape based one or more supplied {@link Model} instances. * Only the triangulated submeshes are added, which must be indexed. The model must outlive this btTriangleIndexVertexArray. * The buffers for the vertices and indices are shared amonst both. */ - public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, final com.badlogic.gdx.graphics.g3d.model.Model... models) { + public btBvhTriangleMeshShape(boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax, final Model... models) { this(true, new btTriangleIndexVertexArray(models), useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax); } diff --git a/extensions/gdx-bullet/jni/swig/custom/btTriangleIndexVertexArray.i b/extensions/gdx-bullet/jni/swig/custom/btTriangleIndexVertexArray.i index 3f8123aa2..0c92389b1 100644 --- a/extensions/gdx-bullet/jni/swig/custom/btTriangleIndexVertexArray.i +++ b/extensions/gdx-bullet/jni/swig/custom/btTriangleIndexVertexArray.i @@ -74,6 +74,15 @@ import com.badlogic.gdx.graphics.VertexAttributes.Usage; } %} +%typemap(javaimports) btTriangleIndexVertexArray %{ +import com.badlogic.gdx.math.Vector3; +import com.badlogic.gdx.math.Quaternion; +import com.badlogic.gdx.math.Matrix3; +import com.badlogic.gdx.math.Matrix4; +import com.badlogic.gdx.graphics.Mesh; +import com.badlogic.gdx.graphics.g3d.Model; +%} + %typemap(javacode) btTriangleIndexVertexArray %{ com.badlogic.gdx.utils.Array meshes = null; @@ -85,10 +94,10 @@ import com.badlogic.gdx.graphics.VertexAttributes.Usage; addMesh(meshes); } - /** Construct a new btTriangleIndexVertexArray based on one or more {@link com.badlogic.gdx.graphics.g3d.model.Model} instances. + /** Construct a new btTriangleIndexVertexArray based on one or more {@link Model} instances. * Only the triangulated submeshes are added, which must be indexed. The model must outlive this btTriangleIndexVertexArray. * The buffers for the vertices and indices are shared amongst both. */ - public btTriangleIndexVertexArray(final com.badlogic.gdx.graphics.g3d.model.Model... models) { + public btTriangleIndexVertexArray(final Model... models) { this(); addModel(models); } @@ -101,10 +110,10 @@ import com.badlogic.gdx.graphics.VertexAttributes.Usage; addIndexedMesh(new btIndexedMesh(meshes[i]), PHY_ScalarType.PHY_SHORT, true); } - /** Add one or more {@link com.badlogic.gdx.graphics.g3d.model.Model} instances to this btTriangleIndexVertexArray. + /** Add one or more {@link Model} instances to this btTriangleIndexVertexArray. * Only the triangulated submeshes are added, which must be indexed. The model must outlive this btTriangleIndexVertexArray. * The buffers for the vertices and indices are shared amongst both. */ - public void addModel(final com.badlogic.gdx.graphics.g3d.model.Model... models) { + public void addModel(final Model... models) { for (int i = 0; i < models.length; i++) { for (int j = 0; j < models[i].meshParts.size; j++) { com.badlogic.gdx.graphics.g3d.model.MeshPart mp = models[i].meshParts.get(j); -- 2.11.0