From 4fb3e6b6aa1fbcd3dd480ba2da5b6bc3e25591cf Mon Sep 17 00:00:00 2001 From: Natan Date: Sat, 5 Aug 2023 16:14:19 -0300 Subject: [PATCH] breaking bullet code --- .../gdx-bullet-base/build.gradle.kts | 1 + .../badlogic/gdx/physics/bullet/Bullet.java | 200 +- .../gdx/physics/bullet/BulletBase.java | 161 -- .../gdx/physics/bullet/DebugDrawer.java | 181 -- .../collision/BroadphaseNativeTypes.java | 41 - .../collision/ClosestRayResultCallback.java | 244 -- .../physics/bullet/collision/Collision.java | 4 - .../bullet/collision/CollisionConstants.java | 74 - .../collision/ContactResultCallback.java | 34 - .../collision/ConvexResultCallback.java | 23 - .../bullet/collision/LocalRayResult.java | 80 - .../bullet/collision/LocalShapeInfo.java | 9 - .../bullet/collision/PHY_ScalarType.java | 16 - .../bullet/collision/RayResultCallback.java | 201 -- .../bullet/collision/btAxisSweep3.java | 44 - .../collision/btAxisSweep3InternalShort.java | 4 - .../physics/bullet/collision/btBoxShape.java | 59 - .../collision/btBroadphaseInterface.java | 12 - .../bullet/collision/btBroadphasePair.java | 14 - .../collision/btBroadphasePairArray.java | 31 - .../bullet/collision/btBroadphaseProxy.java | 14 - .../collision/btBvhTriangleMeshShape.java | 82 - .../bullet/collision/btCapsuleShape.java | 38 - .../collision/btCollisionConfiguration.java | 9 - .../collision/btCollisionDispatcher.java | 40 - .../bullet/collision/btCollisionObject.java | 120 - .../collision/btCollisionObjectArray.java | 37 - .../collision/btCollisionObjectWrapper.java | 9 - .../bullet/collision/btCollisionShape.java | 40 - .../bullet/collision/btCollisionWorld.java | 164 -- .../bullet/collision/btCompoundShape.java | 58 - .../bullet/collision/btConcaveShape.java | 11 - .../physics/bullet/collision/btConeShape.java | 38 - .../bullet/collision/btConvexHullShape.java | 105 - .../collision/btConvexInternalShape.java | 11 - .../bullet/collision/btConvexShape.java | 10 - .../bullet/collision/btCylinderShape.java | 44 - .../bullet/collision/btDbvtBroadphase.java | 38 - .../btDefaultCollisionConfiguration.java | 38 - .../bullet/collision/btDispatcher.java | 44 - .../bullet/collision/btDispatcherInfo.java | 14 - .../bullet/collision/btIndexedMesh.java | 168 -- .../bullet/collision/btManifoldPoint.java | 18 - .../collision/btOverlappingPairCache.java | 16 - .../collision/btOverlappingPairCallback.java | 9 - .../collision/btPersistentManifold.java | 52 - .../btPolyhedralConvexAabbCachingShape.java | 7 - .../collision/btPolyhedralConvexShape.java | 7 - .../physics/bullet/collision/btShapeHull.java | 40 - .../bullet/collision/btSphereShape.java | 38 - .../collision/btStridingMeshInterface.java | 9 - .../bullet/collision/btTriangleCallback.java | 14 - .../collision/btTriangleIndexVertexArray.java | 153 - .../bullet/collision/btTriangleMeshShape.java | 11 - .../collision/btTriangleRaycastCallback.java | 246 -- .../bullet/dynamics/btActionInterface.java | 13 - .../dynamics/btConeTwistConstraint.java | 60 - .../bullet/dynamics/btConstraintSetting.java | 127 - .../bullet/dynamics/btConstraintSolver.java | 13 - .../bullet/dynamics/btContactSolverInfo.java | 16 - .../dynamics/btContactSolverInfoData.java | 13 - .../dynamics/btDiscreteDynamicsWorld.java | 48 - .../bullet/dynamics/btDynamicsWorld.java | 83 - .../bullet/dynamics/btFixedConstraint.java | 45 - .../btGeneric6DofSpring2Constraint.java | 100 - .../bullet/dynamics/btHingeConstraint.java | 64 - .../dynamics/btPoint2PointConstraint.java | 89 - .../physics/bullet/dynamics/btRigidBody.java | 251 -- .../dynamics/btRotationalLimitMotor2.java | 518 ---- .../btSequentialImpulseConstraintSolver.java | 38 - .../dynamics/btTranslationalLimitMotor2.java | 618 ---- .../bullet/dynamics/btTypedConstraint.java | 55 - .../physics/bullet/linearmath/LinearMath.java | 19 - .../linearmath/LinearMathConstants.java | 17 - .../physics/bullet/linearmath/VoidPtr.java | 7 - .../linearmath/btDefaultMotionState.java | 39 - .../bullet/linearmath/btIDebugDraw.java | 217 -- .../bullet/linearmath/btMatrix3x3.java | 57 - .../bullet/linearmath/btMotionState.java | 157 -- .../physics/bullet/linearmath/btQuadWord.java | 14 - .../bullet/linearmath/btQuaternion.java | 82 - .../bullet/linearmath/btTransform.java | 172 -- .../bullet/linearmath/btTypedObject.java | 9 - .../physics/bullet/linearmath/btVector3.java | 95 - .../gdx-bullet-build/jni/bullet.idl | 2496 +++++++++-------- .../gdx-bullet/gdx-bullet-build/jni/post.js | 9 +- .../xpenatan/gdx/html5/bullet/Main.java | 62 +- .../gdx-bullet/gdx-bullet/build.gradle.kts | 1 + 88 files changed, 1346 insertions(+), 7443 deletions(-) delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/BulletBase.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/DebugDrawer.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/BroadphaseNativeTypes.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ClosestRayResultCallback.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/Collision.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/CollisionConstants.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ContactResultCallback.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ConvexResultCallback.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalRayResult.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalShapeInfo.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/PHY_ScalarType.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/RayResultCallback.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3InternalShort.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBoxShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseInterface.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePair.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePairArray.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseProxy.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBvhTriangleMeshShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCapsuleShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionConfiguration.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionDispatcher.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObject.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectArray.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectWrapper.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionWorld.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCompoundShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConcaveShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConeShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexHullShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexInternalShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCylinderShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDbvtBroadphase.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDefaultCollisionConfiguration.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcher.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcherInfo.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btIndexedMesh.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btManifoldPoint.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCache.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCallback.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPersistentManifold.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexAabbCachingShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btShapeHull.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btSphereShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btStridingMeshInterface.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleCallback.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleIndexVertexArray.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleMeshShape.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleRaycastCallback.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btActionInterface.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConeTwistConstraint.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSetting.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSolver.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfo.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfoData.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDiscreteDynamicsWorld.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDynamicsWorld.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btFixedConstraint.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btGeneric6DofSpring2Constraint.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btHingeConstraint.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btPoint2PointConstraint.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRigidBody.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRotationalLimitMotor2.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btSequentialImpulseConstraintSolver.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTranslationalLimitMotor2.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTypedConstraint.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMath.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMathConstants.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/VoidPtr.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btDefaultMotionState.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btIDebugDraw.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMatrix3x3.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMotionState.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuadWord.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuaternion.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTransform.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTypedObject.java delete mode 100644 extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btVector3.java diff --git a/extensions/gdx-bullet/gdx-bullet-base/build.gradle.kts b/extensions/gdx-bullet/gdx-bullet-base/build.gradle.kts index 801be2d6..5da81bfa 100644 --- a/extensions/gdx-bullet/gdx-bullet-base/build.gradle.kts +++ b/extensions/gdx-bullet/gdx-bullet-base/build.gradle.kts @@ -1,4 +1,5 @@ dependencies { implementation("com.badlogicgames.gdx:gdx:${LibExt.gdxVersion}") implementation("com.github.xpenatan.jParser:loader-core:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:jParser-base:${LibExt.jParserVersion}") } \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/Bullet.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/Bullet.java index 9843f386..9a19bf6d 100644 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/Bullet.java +++ b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/Bullet.java @@ -1,182 +1,42 @@ package com.badlogic.gdx.physics.bullet; -import com.badlogic.gdx.graphics.g3d.model.MeshPart; -import com.badlogic.gdx.graphics.g3d.model.Node; -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.physics.bullet.collision.btBvhTriangleMeshShape; -import com.badlogic.gdx.physics.bullet.collision.btCollisionShape; -import com.badlogic.gdx.physics.bullet.collision.btCompoundShape; -import com.badlogic.gdx.physics.bullet.linearmath.LinearMath; -import com.badlogic.gdx.physics.bullet.linearmath.LinearMathConstants; -import com.badlogic.gdx.physics.bullet.linearmath.btTransform; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.GdxRuntimeException; -import com.badlogic.gdx.utils.Pool; import com.github.xpenatan.jparser.loader.JParserLibraryLoader; -import java.util.Arrays; /** * @author xpenatan */ public class Bullet { - public final static int VERSION = LinearMathConstants.BT_BULLET_VERSION; - - protected static boolean useRefCounting = false; - protected static boolean enableLogging = true; - - private static boolean bulletInit = false; - - public static void init() { - init(false); - } - - public static void init(boolean useRefCounting) { - init(useRefCounting, true); - } - - public static void init(boolean useRefCounting, boolean logging) { - if(Bullet.bulletInit) - return; - loadBullet(); - Bullet.bulletInit = true; - Bullet.useRefCounting = useRefCounting; - Bullet.enableLogging = logging; - final int version = LinearMath.btGetVersion(); - if(version != VERSION) - throw new GdxRuntimeException("Bullet binaries version (" + version + ") does not match source version (" + VERSION - + ")"); - } - - private static void loadBullet() { - JParserLibraryLoader loader = new JParserLibraryLoader(); - loader.load("gdx-bullet"); - } - - /** - * Dispose temp objects - */ - public static void dispose() { - btVector3.TEMP_0.dispose(); - btVector3.TEMP_1.dispose(); - btVector3.TEMP_2.dispose(); - btVector3.TEMP_3.dispose(); - btVector3.TEMP_4.dispose(); - btTransform.TEMP_0.dispose(); - btTransform.TEMP_1.dispose(); - btTransform.TEMP_2.dispose(); - btTransform.TEMP_3.dispose(); - btTransform.TEMP_4.dispose(); - } - - protected static class ShapePart { - public Array parts = new Array(); - public Matrix4 transform = new Matrix4(); - } - - private final static Pool shapePartPool = new Pool() { - @Override - protected ShapePart newObject() { - return new ShapePart(); + /*[-teaVM;-ADD] + @org.teavm.jso.JSFunctor + public interface OnInitFunction extends org.teavm.jso.JSObject { + void onInit(); } - }; - private final static Array shapePartArray = new Array(); - - private final static Matrix4 idt = new Matrix4(); - private final static Matrix4 tmpM = new Matrix4(); - - public static void getShapeParts(final Node node, final boolean applyTransform, final Array out, final int offset, - final Pool pool) { - final Matrix4 transform = applyTransform ? node.localTransform : idt; - if(node.parts.size > 0) { - ShapePart part = null; - for(int i = offset, n = out.size; i < n; i++) { - final ShapePart p = out.get(i); - if(Arrays.equals(p.transform.val, transform.val)) { - part = p; - break; - } - } - if(part == null) { - part = pool.obtain(); - part.parts.clear(); - part.transform.set(transform); - out.add(part); + */ + + /*[-teaVM;-REPLACE] + public static void init(Runnable run) { + JParserLibraryLoader libraryLoader = new JParserLibraryLoader(); + OnInitFunction onInitFunction = new OnInitFunction() { + @Override + public void onInit() { + run.run(); } - for(int i = 0, n = node.parts.size; i < n; i++) - part.parts.add(node.parts.get(i).meshPart); - } - if(node.hasChildren()) { - final boolean transformed = applyTransform && !Arrays.equals(transform.val, idt.val); - final int o = transformed ? out.size : offset; - getShapeParts(node.getChildren(), out, o, pool); - if(transformed) { - for(int i = o, n = out.size; i < n; i++) { - final ShapePart part = out.get(i); - tmpM.set(part.transform); - part.transform.set(transform).mul(tmpM); - } - } - } - } - - public static void getShapeParts(final Iterable nodes, final Array out, final int offset, - final Pool pool) { - for(T node : nodes) - getShapeParts(node, true, out, offset, pool); - } - - public static btCollisionShape obtainStaticNodeShape(final Node node, final boolean applyTransform) { - getShapeParts(node, applyTransform, shapePartArray, 0, shapePartPool); - btCollisionShape result = obtainStaticShape(shapePartArray); - shapePartPool.freeAll(shapePartArray); - shapePartArray.clear(); - return result; - } - - /** - * Obtain a {@link btCollisionShape} based on the specified nodes, which can be used for a static body but not for a dynamic - * body. Depending on the specified nodes the result will be either a {@link com.badlogic.gdx.physics.bullet.collision.btBvhTriangleMeshShape} or a - * {@link com.badlogic.gdx.physics.bullet.collision.btCompoundShape} of multiple btBvhTriangleMeshShape's. Where possible, the same btBvhTriangleMeshShape will be reused - * if multiple nodes use the same (mesh) part. The node transformation (translation and rotation) will be included, but scaling - * will be ignored. - * - * @param nodes The nodes for which to obtain a node, typically this would be: `model.nodes`. - * @return The obtained shape, if you're using reference counting then you can release the shape when no longer needed. - */ - public static btCollisionShape obtainStaticNodeShape(final Array nodes) { - getShapeParts(nodes, shapePartArray, 0, shapePartPool); - btCollisionShape result = obtainStaticShape(shapePartArray); - shapePartPool.freeAll(shapePartArray); - shapePartArray.clear(); - return result; - } - - public static btCollisionShape obtainStaticShape(final Array parts) { - if(parts.size == 0) return null; - if(parts.size == 1 && Arrays.equals(parts.get(0).transform.val, idt.val)) - return btBvhTriangleMeshShape.obtain(parts.get(0).parts); - btCompoundShape result = new btCompoundShape(); - result.obtain(); - for(int i = 0, n = parts.size; i < n; i++) { - final btBvhTriangleMeshShape shape = btBvhTriangleMeshShape.obtain(parts.get(i).parts); - //TODO - result.addChildShape(parts.get(i).transform, shape); - shape.release(); - } - return result; - } - - public static void set(byte[] in, boolean[] out) { - out[0] = in[0] == 0; - out[1] = in[1] == 0; - out[2] = in[2] == 0; - } - - public static void set(boolean[] in, byte[] out) { - if(in[0]) out[0] = 1; else out[0] = 0; - if(in[1]) out[1] = 1; else out[1] = 0; - if(in[2]) out[2] = 1; else out[2] = 0; - } + }; + setOnLoadInit(onInitFunction); + libraryLoader.load("bullet.wasm"); + } + */ + public static void init(Runnable run) { + JParserLibraryLoader libraryLoader = new JParserLibraryLoader(); + libraryLoader.load("bullet"); + run.run(); + } + + /*[-teaVM;-REPLACE] + @org.teavm.jso.JSBody(params = { "onInitFunction" }, script = "window.BulletOnInit = onInitFunction;") + private static native void setOnLoadInit(OnInitFunction onInitFunction); + */ + /*[-C++;-REMOVE] */ + public static native void setOnLoadInit(); } diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/BulletBase.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/BulletBase.java deleted file mode 100644 index 5923df3e..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/BulletBase.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.badlogic.gdx.physics.bullet; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.utils.Disposable; - -/** - * @author xpenatan - */ -public abstract class BulletBase implements Disposable { - - public static final float [] FLOAT_4 = new float[4]; - - protected long cPointer; - protected boolean cMemOwn; - private boolean disposed; - protected boolean destroyed; - public String className; - private int refCount; - - public BulletBase() { - } - - protected void initObject(long cPtr, boolean cMemoryOwn) { - cMemOwn = cMemoryOwn; - cPointer = cPtr; - } - - /** - * Set pointer if it's not owned by this object. Useful for setting temp objets - */ - public void setPointer(long cPtr) { - if(!cMemOwn) { - cPointer = cPtr; - } - } - - /** - * Obtains a reference to this object, call release to free the reference. - */ - public void obtain() { - refCount++; - } - - /** - * Release a previously obtained reference, causing the object to be disposed when this was the last reference. - */ - public void release() { - if(--refCount <= 0 && Bullet.useRefCounting) dispose(); - } - - /** - * @return Whether this instance is obtained using the {@link #obtain()} method. - */ - public boolean isObtained() { - return refCount > 0; - } - - protected void construct() { - destroyed = false; - } - - protected void reset(long cPtr, boolean cMemoryOwn) { - if(!destroyed) destroy(); - cMemOwn = cMemoryOwn; - cPointer = cPtr; - construct(); - } - - @Override - public boolean equals(Object obj) { - return (obj instanceof BulletBase) && (((BulletBase)obj).cPointer == this.cPointer); - } - - @Override - public int hashCode() { - return (int)cPointer; - } - - /** - * @return The memory location (pointer) of this instance. - */ - public long getCPointer() { - return cPointer; - } - - /** - * Take ownership of the native instance, causing the native object to be deleted when this object gets out of scope. - */ - public void takeOwnership() { - cMemOwn = true; - } - - /** - * Release ownership of the native instance, causing the native object NOT to be deleted when this object gets out of - * scope. - */ - public void releaseOwnership() { - cMemOwn = false; - } - - /** - * @return True if the native is destroyed when this object gets out of scope, false otherwise. - */ - public boolean hasOwnership() { - return cMemOwn; - } - - /** - * Deletes the bullet object this class encapsulates. Do not call directly, instead use the {@link #dispose()} method. - */ - protected void deleteNative() { - - } - - @Override - public void dispose() { - if(refCount > 0 && Bullet.useRefCounting && Bullet.enableLogging) - Gdx.app.error("Bullet", "Disposing " + toString() + " while it still has " + refCount + " references."); - if(cMemOwn) { - // Don't try to delete if this object did not create the pointer - disposed = true; - deleteNative(); - cPointer = 0; - } - } - - /** - * @return Whether the {@link #dispose()} method of this instance is called. - */ - public boolean isDisposed() { - return disposed; - } - - @Override - public String toString() { - return className + "(" + cPointer + "," + cMemOwn + ")"; - } - - protected void destroy() { - try { - if(destroyed && Bullet.enableLogging) Gdx.app.error("Bullet", "Already destroyed " + toString()); - destroyed = true; - - if(cMemOwn && !disposed) { - if(Bullet.enableLogging) - Gdx.app.error("Bullet", "Disposing " + toString() + " due to garbage collection."); - dispose(); - } - } - catch(Throwable e) { - Gdx.app.error("Bullet", "Exception while destroying " + toString(), e); - } - } - - @Override - protected void finalize() throws Throwable { - if(!destroyed && Bullet.enableLogging) - Gdx.app.error("Bullet", "The " + className + " class does not override the finalize method."); - super.finalize(); - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/DebugDrawer.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/DebugDrawer.java deleted file mode 100644 index 188a95bc..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/DebugDrawer.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.badlogic.gdx.physics.bullet; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Camera; -import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.graphics.glutils.ShapeRenderer; -import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.Disposable; -import com.badlogic.gdx.utils.viewport.Viewport; - -/** - * @author xpenatan - */ -public class DebugDrawer extends btIDebugDraw implements Disposable { - - public DebugDrawer() { - } - - private ShapeRenderer shapeRenderer = new ShapeRenderer(); - private SpriteBatch spriteBatch; - private BitmapFont font; - - private boolean ownsShapeRenderer = true, ownsSpriteBatch = true, ownsFont = true; - - private Camera camera; - private Viewport viewport; - private int debugMode = btIDebugDraw.DebugDrawModes.DBG_NoDebug; - - @Override - protected void deleteNative() { - if(ownsShapeRenderer) { - shapeRenderer.dispose(); - } - if(ownsSpriteBatch && spriteBatch != null) { - spriteBatch.dispose(); - } - if(ownsFont && font != null) { - font.dispose(); - } - } - - @Override - public void drawLine(Vector3 from, Vector3 to, Vector3 color) { - shapeRenderer.setColor(color.x, color.y, color.z, 1f); - shapeRenderer.line(from, to); - } - - @Override - public void drawContactPoint(Vector3 pointOnB, Vector3 normalOnB, float distance, int lifeTime, Vector3 color) { - shapeRenderer.setColor(color.x, color.y, color.z, 1f); - float size = 0.04f; - shapeRenderer.box(pointOnB.x - size / 2f, pointOnB.y - size / 2f, pointOnB.z + size / 2f, size, size, size); - shapeRenderer.setColor(1, 0, 0, 1f); - shapeRenderer.line(pointOnB, normalOnB.scl(distance + 0.2f).add(pointOnB)); - } - - @Override - public void reportErrorWarning(String warningString) { - Gdx.app.error("Bullet", warningString); - } - - @Override - public void draw3dText(Vector3 location, String textString) { - if(spriteBatch == null) { - spriteBatch = new SpriteBatch(); - } - if(font == null) { - font = new BitmapFont(); - } - - // this check is necessary to avoid "mirrored" instances of the text - if(camera.frustum.pointInFrustum(location)) { - if(viewport != null) { - camera.project(location, viewport.getScreenX(), viewport.getScreenY(), viewport.getScreenWidth(), - viewport.getScreenHeight()); - } - else { - camera.project(location); - } - - shapeRenderer.end(); - spriteBatch.begin(); - - // the text will be centered on the position - font.draw(spriteBatch, textString, location.x, location.y, 0, textString.length(), 0, Align.center, false); - - spriteBatch.end(); - shapeRenderer.begin(ShapeType.Line); - } - } - - @Override - public void setDebugMode(int debugMode) { - this.debugMode = debugMode; - super.setDebugMode(debugMode); - } - - @Override - public int getDebugMode() { - return debugMode; - } - - /** - * Use this in case no {@code glViewport} is in use. Otherwise please supply the used {@link com.badlogic.gdx.utils.viewport.Viewport} to - * {@link #begin(com.badlogic.gdx.utils.viewport.Viewport)}. - * - * @param camera The (perspective) camera to be used when doing the debug rendering. - */ - public void begin(Camera camera) { - this.camera = camera; - - shapeRenderer.setProjectionMatrix(camera.combined); - shapeRenderer.begin(ShapeType.Line); - } - - /** - * This has to be used in case the camera to be used is managed via a {@link com.badlogic.gdx.utils.viewport.Viewport}. - * - * @param viewport The currently used viewport with its managed (perspective) camera. - */ - public void begin(Viewport viewport) { - this.viewport = viewport; - begin(viewport.getCamera()); - } - - /** - * Ends the debug rendering process and leads to a flush. - */ - public void end() { - shapeRenderer.end(); - } - - public ShapeRenderer getShapeRenderer() { - return shapeRenderer; - } - - /** - * Switches the {@link com.badlogic.gdx.graphics.glutils.ShapeRenderer}. The given shape renderer won't be disposed when {@link #dispose()} is called. - */ - public void setShapeRenderer(ShapeRenderer shapeRenderer) { - if(ownsShapeRenderer) { - this.shapeRenderer.dispose(); - } - this.shapeRenderer = shapeRenderer; - ownsShapeRenderer = false; - } - - public SpriteBatch getSpriteBatch() { - return spriteBatch; - } - - /** - * Switches the {@link com.badlogic.gdx.graphics.g2d.SpriteBatch}. The given sprite batch won't be disposed when {@link #dispose()} is called. - */ - public void setSpriteBatch(SpriteBatch spriteBatch) { - if(ownsSpriteBatch && this.spriteBatch != null) { - this.spriteBatch.dispose(); - } - this.spriteBatch = spriteBatch; - ownsSpriteBatch = false; - } - - public BitmapFont getFont() { - return font; - } - - /** - * Switches the {@link com.badlogic.gdx.graphics.g2d.BitmapFont}. The given font won't be disposed when {@link #dispose()} is called. - */ - public void setFont(BitmapFont font) { - if(ownsFont && this.font != null) { - this.font.dispose(); - } - this.font = font; - ownsFont = false; - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/BroadphaseNativeTypes.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/BroadphaseNativeTypes.java deleted file mode 100644 index 96c38062..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/BroadphaseNativeTypes.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -public final class BroadphaseNativeTypes { - public final static int BOX_SHAPE_PROXYTYPE = 0; - public final static int TRIANGLE_SHAPE_PROXYTYPE = BOX_SHAPE_PROXYTYPE + 1; - public final static int TETRAHEDRAL_SHAPE_PROXYTYPE = TRIANGLE_SHAPE_PROXYTYPE + 1; - public final static int CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE = TETRAHEDRAL_SHAPE_PROXYTYPE + 1; - public final static int CONVEX_HULL_SHAPE_PROXYTYPE = CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE + 1; - public final static int CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE = CONVEX_HULL_SHAPE_PROXYTYPE + 1; - public final static int CUSTOM_POLYHEDRAL_SHAPE_TYPE = CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE + 1; - public final static int IMPLICIT_CONVEX_SHAPES_START_HERE = CUSTOM_POLYHEDRAL_SHAPE_TYPE + 1; - public final static int SPHERE_SHAPE_PROXYTYPE = IMPLICIT_CONVEX_SHAPES_START_HERE + 1; - public final static int MULTI_SPHERE_SHAPE_PROXYTYPE = SPHERE_SHAPE_PROXYTYPE + 1; - public final static int CAPSULE_SHAPE_PROXYTYPE = MULTI_SPHERE_SHAPE_PROXYTYPE + 1; - public final static int CONE_SHAPE_PROXYTYPE = CAPSULE_SHAPE_PROXYTYPE + 1; - public final static int CONVEX_SHAPE_PROXYTYPE = CONE_SHAPE_PROXYTYPE + 1; - public final static int CYLINDER_SHAPE_PROXYTYPE = CONVEX_SHAPE_PROXYTYPE + 1; - public final static int UNIFORM_SCALING_SHAPE_PROXYTYPE = CYLINDER_SHAPE_PROXYTYPE + 1; - public final static int MINKOWSKI_SUM_SHAPE_PROXYTYPE = UNIFORM_SCALING_SHAPE_PROXYTYPE + 1; - public final static int MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE = MINKOWSKI_SUM_SHAPE_PROXYTYPE + 1; - public final static int BOX_2D_SHAPE_PROXYTYPE = MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE + 1; - public final static int CONVEX_2D_SHAPE_PROXYTYPE = BOX_2D_SHAPE_PROXYTYPE + 1; - public final static int CUSTOM_CONVEX_SHAPE_TYPE = CONVEX_2D_SHAPE_PROXYTYPE + 1; - public final static int CONCAVE_SHAPES_START_HERE = CUSTOM_CONVEX_SHAPE_TYPE + 1; - public final static int TRIANGLE_MESH_SHAPE_PROXYTYPE = CONCAVE_SHAPES_START_HERE + 1; - public final static int SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE = TRIANGLE_MESH_SHAPE_PROXYTYPE + 1; - public final static int FAST_CONCAVE_MESH_PROXYTYPE = SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE + 1; - public final static int TERRAIN_SHAPE_PROXYTYPE = FAST_CONCAVE_MESH_PROXYTYPE + 1; - public final static int GIMPACT_SHAPE_PROXYTYPE = TERRAIN_SHAPE_PROXYTYPE + 1; - public final static int MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE = GIMPACT_SHAPE_PROXYTYPE + 1; - public final static int EMPTY_SHAPE_PROXYTYPE = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE + 1; - public final static int STATIC_PLANE_PROXYTYPE = EMPTY_SHAPE_PROXYTYPE + 1; - public final static int CUSTOM_CONCAVE_SHAPE_TYPE = STATIC_PLANE_PROXYTYPE + 1; - public final static int CONCAVE_SHAPES_END_HERE = CUSTOM_CONCAVE_SHAPE_TYPE + 1; - public final static int COMPOUND_SHAPE_PROXYTYPE = CONCAVE_SHAPES_END_HERE + 1; - public final static int SOFTBODY_SHAPE_PROXYTYPE = COMPOUND_SHAPE_PROXYTYPE + 1; - public final static int HFFLUID_SHAPE_PROXYTYPE = SOFTBODY_SHAPE_PROXYTYPE + 1; - public final static int HFFLUID_BUOYANT_CONVEX_SHAPE_PROXYTYPE = HFFLUID_SHAPE_PROXYTYPE + 1; - public final static int INVALID_SHAPE_PROXYTYPE = HFFLUID_BUOYANT_CONVEX_SHAPE_PROXYTYPE + 1; - public final static int MAX_BROADPHASE_COLLISION_TYPES = INVALID_SHAPE_PROXYTYPE + 1; -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ClosestRayResultCallback.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ClosestRayResultCallback.java deleted file mode 100644 index 015011d3..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ClosestRayResultCallback.java +++ /dev/null @@ -1,244 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class ClosestRayResultCallback extends RayResultCallback { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - /*[-C++;-NATIVE] - - static jclass closestRayResultClass = 0; - static jmethodID onAddSingleResultID = 0; - - class CustomClosestRayResultCallback : public btCollisionWorld::ClosestRayResultCallback - { - - private: - JNIEnv* env; - jobject obj; - - public: - CustomClosestRayResultCallback(JNIEnv* env, jobject obj, const btVector3& rayFromWorld, const btVector3& rayToWorld) - : btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld) - { - this->env = env; - this->obj = obj; - } - - virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) - { - return env->CallFloatMethod(obj, onAddSingleResultID, (jlong)&rayResult, normalInWorldSpace); - } - }; - */ - - public ClosestRayResultCallback(Vector3 rayFromWorld, Vector3 rayToWorld) { - btVector3 btFrom = btVector3.TEMP_0; - btVector3 btTo = btVector3.TEMP_1; - btVector3.convert(rayFromWorld, btFrom); - btVector3.convert(rayToWorld, btTo); - initJavaObject(btFrom, btTo); - } - /*[-teaVM;-ADD] - @org.teavm.jso.JSFunctor - public interface AddSingleResultFunction extends org.teavm.jso.JSObject { - float addSingleResultJS(int rayResultAddr, boolean normalInWorldSpace); - } - */ - - /*[-teaVM;-REPLACE] - private void initJavaObject(btVector3 from, btVector3 to) { - AddSingleResultFunction addSingleResultFunction = new AddSingleResultFunction() { - @Override - public float addSingleResultJS(int rayResultAddr, boolean normalInWorldSpace) { - LocalRayResult.temp01.setPointer(rayResultAddr); - return addSingleResult(LocalRayResult.temp01, normalInWorldSpace); - } - }; - int pointer = createNative(from.getCPointer(), to.getCPointer(), addSingleResultFunction); - initObject(pointer, true); - } - */ - private void initJavaObject(btVector3 from, btVector3 to) { - initObject(createNative(from.getCPointer(), to.getCPointer()), true); - } - - /*[-C++;-NATIVE] - if(closestRayResultClass == 0) { - closestRayResultClass = (jclass)env->NewGlobalRef(env->GetObjectClass(object)); - onAddSingleResultID = env->GetMethodID(closestRayResultClass, "onAddSingleResult", "(JZ)F"); - } - return (jlong)new CustomClosestRayResultCallback(env, env->NewGlobalRef(object), *((btVector3*)fromAddr), *((btVector3*)toAddr)); - */ - /*[-teaVM;-REPLACE] - @org.teavm.jso.JSBody(params = { "rayFromWorldAddr", "rayToWorldAddr", "addSingleResultFunction" }, script = "var callback = new Bullet.MyClosestRayResultCallback(rayFromWorldAddr, rayToWorldAddr); callback.addSingleResult = addSingleResultFunction; return Bullet.getPointer(callback);") - private static native int createNative(long rayFromWorldAddr, long rayToWorldAddr, AddSingleResultFunction addSingleResultFunction); - */ - private native long createNative(long fromAddr, long toAddr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (CustomClosestRayResultCallback*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public void getRayFromWorld(Vector3 out) { - long outAddr = getRayFromWorld(cPointer); - btVector3.convert(outAddr, out); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - return (jlong)&nativeObject->m_rayFromWorld; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - return Bullet.getPointer(jsObj.get_m_rayFromWorld()); - */ - private static native long getRayFromWorld(long addr); - - public void setRayFromWorld(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_1); - setRayFromWorld(cPointer, btVector3.TEMP_1.getCPointer()); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - nativeObject->m_rayFromWorld = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); - jsObj.set_m_rayFromWorld(jsVec3Obj); - */ - private static native long setRayFromWorld(long addr, long valueAddr); - - public void getRayToWorld(Vector3 out) { - long outAddr = getRayToWorld(cPointer); - btVector3.convert(outAddr, out); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - return (jlong)&nativeObject->m_rayToWorld; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - return Bullet.getPointer(jsObj.get_m_rayToWorld()); - */ - private static native long getRayToWorld(long addr); - - public void setRayToWorld(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_1); - setRayToWorld(cPointer, btVector3.TEMP_1.getCPointer()); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - nativeObject->m_rayToWorld = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); - jsObj.set_m_rayToWorld(jsVec3Obj); - */ - private static native long setRayToWorld(long addr, long valueAddr); - - public void getHitNormalWorld(Vector3 out) { - long outAddr = getHitNormalWorld(cPointer); - btVector3.convert(outAddr, out); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - return (jlong)&nativeObject->m_hitNormalWorld; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - return Bullet.getPointer(jsObj.get_m_hitNormalWorld()); - */ - private static native long getHitNormalWorld(long addr); - - public void setHitNormalWorld(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_1); - setHitNormalWorld(cPointer, btVector3.TEMP_1.getCPointer()); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - nativeObject->m_hitNormalWorld = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); - jsObj.set_m_hitNormalWorld(jsVec3Obj); - */ - private static native long setHitNormalWorld(long addr, long valueAddr); - - public void getHitPointWorld(Vector3 out) { - long outAddr = getHitPointWorld(cPointer); - btVector3.convert(outAddr, out); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - return (jlong)&nativeObject->m_hitPointWorld; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - return Bullet.getPointer(jsObj.get_m_hitPointWorld()); - */ - private static native long getHitPointWorld(long addr); - - public void setHitPointWorld(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_1); - setHitPointWorld(cPointer, btVector3.TEMP_1.getCPointer()); - } - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - nativeObject->m_hitPointWorld = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); - jsObj.set_m_hitPointWorld(jsVec3Obj); - */ - private static native long setHitPointWorld(long addr, long valueAddr); - - public float addSingleResult(LocalRayResult rayResult, boolean normalInWorldSpace) { - return addSingleResult(cPointer, rayResult.getCPointer(), normalInWorldSpace); - } - - //TODO native code must call single result - - /*[-C++;-NATIVE] - CustomClosestRayResultCallback* nativeObject = (CustomClosestRayResultCallback*)addr; - return nativeObject->ClosestRayResultCallback::addSingleResult(*((btCollisionWorld::LocalRayResult*)rayResultAddr), normalInWorldSpace); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); - return jsObj.addSingleResultSuper(rayResultAddr, normalInWorldSpace); - */ - private static native float addSingleResult(long addr, long rayResultAddr, boolean normalInWorldSpace); - - private float onAddSingleResult(long rayResultAddr, boolean normalInWorldSpace) { - LocalRayResult.temp01.setPointer(rayResultAddr); - return addSingleResult(LocalRayResult.temp01, normalInWorldSpace); - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/Collision.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/Collision.java deleted file mode 100644 index 336e516b..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/Collision.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -public class Collision implements CollisionConstants { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/CollisionConstants.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/CollisionConstants.java deleted file mode 100644 index 6944cd8b..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/CollisionConstants.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -public interface CollisionConstants { - final static String btQuantizedBvhDataName = "btQuantizedBvhFloatData"; - final static int MAX_SUBTREE_SIZE_IN_BYTES = 2048; - final static int MAX_NUM_PARTS_IN_BITS = 10; - final static int USE_OVERLAP_TEST_ON_REMOVES = 1; - final static int MAX_PREFERRED_PENETRATION_DIRECTIONS = 10; - final static int TRI_INFO_V0V1_CONVEX = 1; - final static int TRI_INFO_V1V2_CONVEX = 2; - final static int TRI_INFO_V2V0_CONVEX = 4; - final static int TRI_INFO_V0V1_SWAP_NORMALB = 8; - final static int TRI_INFO_V1V2_SWAP_NORMALB = 16; - final static int TRI_INFO_V2V0_SWAP_NORMALB = 32; - final static int TEST_INTERNAL_OBJECTS = 1; - final static int ACTIVE_TAG = 1; - final static int ISLAND_SLEEPING = 2; - final static int WANTS_DEACTIVATION = 3; - final static int DISABLE_DEACTIVATION = 4; - final static int DISABLE_SIMULATION = 5; - final static String btCollisionObjectDataName = "btCollisionObjectFloatData"; - final static int DBVT_IMPL_GENERIC = 0; - final static int DBVT_IMPL_SSE = 1; - final static int DBVT_USE_TEMPLATE = 0; - final static int DBVT_USE_INTRINSIC_SSE = 1; - final static int DBVT_USE_MEMMOVE = 1; - final static int DBVT_ENABLE_BENCHMARK = 0; - final static int DBVT_SELECT_IMPL = 0; - final static int DBVT_MERGE_IMPL = 0; - final static int DBVT_INT0_IMPL = 0; - final static int DBVT_BP_PROFILE = 0; - final static int DBVT_BP_PREVENTFALSEUPDATE = 0; - final static int DBVT_BP_ACCURATESLEEPING = 0; - final static int DBVT_BP_ENABLE_BENCHMARK = 0; - final static int USE_PATH_COMPRESSION = 1; - final static int STATIC_SIMULATION_ISLAND_OPTIMIZATION = 1; - final static int USE_DISPATCH_REGISTRY_ARRAY = 1; - final static int MANIFOLD_CACHE_SIZE = 4; - final static int NO_VIRTUAL_INTERFACE = 1; - final static int VORONOI_SIMPLEX_MAX_VERTS = 5; - final static double VORONOI_DEFAULT_EQUAL_VERTEX_THRESHOLD = 0.0001; - final static double BOX_PLANE_EPSILON = 0.000001; - final static double PLANEDIREPSILON = 0.0000001; - final static double PARALELENORMALS = 0.000001; - final static int MAX_TRI_CLIPPING = 16; - final static int NORMAL_CONTACT_AVERAGE = 1; - final static double CONTACT_DIFF_EPSILON = 0.00001; - final static int BT_DEFAULT_MAX_POOLS = 16; - final static int GIMPACT_VS_PLANE_COLLISION = 1; - final static int GIM_ARRAY_GROW_INCREMENT = 2; - final static int GIM_ARRAY_GROW_FACTOR = 2; - final static int GUINT_BIT_COUNT = 32; - final static int GUINT_EXPONENT = 5; - final static int GIM_INVALID_HASH = 0xffffffff; - final static int GIM_DEFAULT_HASH_TABLE_SIZE = 380; - final static int GIM_DEFAULT_HASH_TABLE_NODE_SIZE = 4; - final static int GIM_HASH_TABLE_GROW_FACTOR = 2; - final static int GIM_MIN_RADIX_SORT_SIZE = 860; - final static int GIM_NUM_PRIME = 28; - final static double G_PI = 3.14159265358979; - final static double G_HALF_PI = 1.5707963; - final static double G_TWO_PI = 6.28318530; - final static double G_ROOT3 = 1.73205; - final static double G_ROOT2 = 1.41421; - final static int G_UINT_INFINITY = 0xffffffff; - final static int G_SIGN_BITMASK = 0x80000000; - final static int kHist = 2048; - final static int GJK_MAX_ITERATIONS = 128; - final static int EPA_MAX_VERTICES = 64; - final static int EPA_MAX_FACES = (64 * 2); - final static int EPA_MAX_ITERATIONS = 255; - final static double BT_MPR_TOLERANCE = 1E-6; - final static int BT_MPR_MAX_ITERATIONS = 1000; -} diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ContactResultCallback.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ContactResultCallback.java deleted file mode 100644 index 40bf7625..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ContactResultCallback.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class ContactResultCallback extends BulletBase { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public float addSingleResult(btManifoldPoint cp, btCollisionObjectWrapper colObj0Wrap, int partId0, int index0, btCollisionObjectWrapper colObj1Wrap, int partId1, int index1) { - return addSingleResultNATIVE(cPointer, (int) cp.getCPointer(), (int) colObj0Wrap.getCPointer(), partId0, index0, (int) colObj1Wrap.getCPointer(), partId1, index1); - } - - /*[-C++;-NATIVE] - btCollisionWorld::ContactResultCallback* nativeObject = (btCollisionWorld::ContactResultCallback*)addr; - btManifoldPoint * manifold = (btManifoldPoint*)cpAddr; - return nativeObject->addSingleResult(*manifold, (btCollisionObjectWrapper*)colObj0WrapAddr, partId0, index0, (btCollisionObjectWrapper*)colObj1WrapAddr, partId1, index1); - */ - private static native float addSingleResultNATIVE(long addr, long cpAddr, long colObj0WrapAddr, int partId0, int index0, long colObj1WrapAddr, int partId1, int index1); - - public boolean needsCollision(btBroadphaseProxy proxy0) { - return needsCollisionNATIVE(cPointer, (int) proxy0.getCPointer()); - } - - /*[-C++;-NATIVE] - btCollisionWorld::ContactResultCallback* nativeObject = (btCollisionWorld::ContactResultCallback*)addr; - return nativeObject->needsCollision((btBroadphaseProxy*)proxy0Addr); - */ - private static native boolean needsCollisionNATIVE(long addr, long proxy0Addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ConvexResultCallback.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ConvexResultCallback.java deleted file mode 100644 index fe17e1b7..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/ConvexResultCallback.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class ConvexResultCallback extends BulletBase { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public boolean hasHit() { - return hasHitNATIVE(cPointer); - } - - /*[-C++;-NATIVE] - btCollisionWorld::ConvexResultCallback* nativeObject = (btCollisionWorld::ConvexResultCallback*)addr; - return nativeObject->hasHit(); - */ - private static native boolean hasHitNATIVE(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalRayResult.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalRayResult.java deleted file mode 100644 index 13125521..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalRayResult.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class LocalRayResult extends BulletBase { - - public static LocalRayResult temp01 = new LocalRayResult(); - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public LocalRayResult() { - initObject(0, false); - } - - public btCollisionObject getCollisionObject() { - btCollisionObject.temp01.setPointer(getCollisionObject(cPointer)); - return btCollisionObject.temp01; - } - - /*[-C++;-NATIVE] - btCollisionWorld::LocalRayResult* nativeObject = (btCollisionWorld::LocalRayResult*)addr; - return (jlong)nativeObject->m_collisionObject; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.LocalRayResult); - var colJSObj = jsObj.get_m_collisionObject(); - return Bullet.getPointer(colJSObj); - */ - private static native long getCollisionObject(long addr); - - public btVector3 getHitNormalLocal() { - btVector3.emptyTransform.setPointer(getHitNormalLocal(cPointer)); - return btVector3.emptyTransform; - } - - /*[-C++;-NATIVE] - btCollisionWorld::LocalRayResult* nativeObject = (btCollisionWorld::LocalRayResult*)addr; - return (jlong)&nativeObject->m_hitNormalLocal; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.LocalRayResult); - var vec3JSObj = jsObj.get_m_hitNormalLocal(); - return Bullet.getPointer(vec3JSObj); - */ - private static native long getHitNormalLocal(long addr); - - public void setHitFraction(float value) { - setHitFraction(cPointer, value); - } - - /*[-C++;-NATIVE] - btCollisionWorld::LocalRayResult* nativeObject = (btCollisionWorld::LocalRayResult*)addr; - nativeObject->m_hitFraction = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.LocalRayResult); - jsObj.set_m_hitFraction(value); - */ - private static native void setHitFraction(long addr, float value); - - public float getHitFraction() { - return getHitFraction(cPointer); - } - - /*[-C++;-NATIVE] - btCollisionWorld::LocalRayResult* nativeObject = (btCollisionWorld::LocalRayResult*)addr; - return nativeObject->m_hitFraction; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.LocalRayResult); - return jsObj.get_m_hitFraction(); - */ - private static native float getHitFraction(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalShapeInfo.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalShapeInfo.java deleted file mode 100644 index c73ab991..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/LocalShapeInfo.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class LocalShapeInfo extends BulletBase { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/PHY_ScalarType.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/PHY_ScalarType.java deleted file mode 100644 index 5609d031..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/PHY_ScalarType.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class PHY_ScalarType { - public final static int PHY_FLOAT = 0; - public final static int PHY_DOUBLE = PHY_FLOAT + 1; - public final static int PHY_INTEGER = PHY_DOUBLE + 1; - public final static int PHY_SHORT = PHY_INTEGER + 1; - public final static int PHY_FIXEDPOINT88 = PHY_SHORT + 1; - public final static int PHY_UCHAR = PHY_FIXEDPOINT88 + 1; - - public PHY_ScalarType() { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/RayResultCallback.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/RayResultCallback.java deleted file mode 100644 index 1c132b05..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/RayResultCallback.java +++ /dev/null @@ -1,201 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class RayResultCallback extends BulletBase { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - private btCollisionWorld world; - - void init(btCollisionWorld world) { - this.world = world; - } - - public void setCollisionObject(btCollisionObject value) { - setCollisionObject(cPointer, value != null ? value.getCPointer() : 0); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - nativeObject->m_collisionObject = collisionObjAddr == 0 ? NULL : (btCollisionObject*)collisionObjAddr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - if(collisionObjAddr == 0) { - jsObj.set_m_collisionObject(0); - } - else { - var jsColObj = Bullet.wrapPointer(collisionObjAddr, Bullet.btCollisionObject); - jsObj.set_m_collisionObject(jsColObj); - } - */ - private static native void setCollisionObject(long addr, long collisionObjAddr); - - public btCollisionObject getCollisionObject() { - long collisionObjectAddr = getCollisionObject(cPointer); - if(collisionObjectAddr != 0) { - return world.bodies.get(collisionObjectAddr); - } - return null; - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - return (jlong)nativeObject->m_collisionObject; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - return Bullet.getPointer(jsObj.get_m_collisionObject()); - */ - private static native long getCollisionObject(long addr); - - public void setClosestHitFraction(float value) { - setClosestHitFraction(cPointer, value); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - nativeObject->m_closestHitFraction = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - jsObj.set_m_closestHitFraction(value); - */ - private static native void setClosestHitFraction(long addr, float value); - - public float getClosestHitFraction() { - return getClosestHitFraction(cPointer); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - return nativeObject->m_closestHitFraction; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - return jsObj.get_m_closestHitFraction(); - */ - private static native float getClosestHitFraction(long addr); - - public void setCollisionFilterGroup(int value) { - setCollisionFilterGroup(cPointer, value); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - nativeObject->m_collisionFilterGroup = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - jsObj.set_m_collisionFilterGroup(value); - */ - private static native void setCollisionFilterGroup(long addr, int value); - - public int getCollisionFilterGroup() { - return getCollisionFilterGroup(cPointer); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - return nativeObject->m_collisionFilterGroup; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - return jsObj.get_m_collisionFilterGroup(); - */ - private static native int getCollisionFilterGroup(long addr); - - public void setCollisionFilterMask(int value) { - setCollisionFilterMask(cPointer, value); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - nativeObject->m_collisionFilterMask = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - jsObj.set_m_collisionFilterMask(value); - */ - private static native void setCollisionFilterMask(long addr, int value); - - public int getCollisionFilterMask() { - return getCollisionFilterMask(cPointer); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - return nativeObject->m_collisionFilterMask; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - return jsObj.get_m_collisionFilterMask(); - */ - private static native int getCollisionFilterMask(long addr); - - /*[-teaVM;-REPLACE] - public void setFlags (long value) { - setFlags(cPointer, (int)value); - } - */ - public void setFlags(long value) { - setFlags(cPointer, value); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - nativeObject->m_flags = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - jsObj.set_m_flags(value); - */ - private static native void setFlags(long addr, long value); - - public long getFlags() { - return getFlags(cPointer); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - return nativeObject->m_flags; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - return jsObj.get_m_flags(); - */ - private static native long getFlags(long addr); - - public boolean hasHit() { - return hasHitNATIVE(cPointer); - } - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - return nativeObject->hasHit(); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.RayResultCallback); - return jsObj.hasHit(); - */ - private static native boolean hasHitNATIVE(long addr); - - public float addSingleResult(LocalRayResult rayResult, boolean normalInWorldSpace) { - return addSingleResultNATIVE(cPointer, (int) rayResult.getCPointer(), normalInWorldSpace); - } - - //TODO native code must call single result - - /*[-C++;-NATIVE] - btCollisionWorld::RayResultCallback* nativeObject = (btCollisionWorld::RayResultCallback*)addr; - btCollisionWorld::LocalRayResult * result = (btCollisionWorld::LocalRayResult*)rayResultAddr; - return nativeObject->addSingleResult(*result, normalInWorldSpace); - */ - private static native float addSingleResultNATIVE(long addr, long rayResultAddr, boolean normalInWorldSpace); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3.java deleted file mode 100644 index 89d32338..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -public class btAxisSweep3 extends btAxisSweep3InternalShort{ - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btAxisSweep3 (Vector3 worldAabbMin, Vector3 worldAabbMax, int maxHandles) { - btVector3 btWorldAabbMin = new btVector3(); - btVector3 btWorldAabbMax = new btVector3(); - btVector3.convert(worldAabbMin, btWorldAabbMin); - btVector3.convert(worldAabbMax, btWorldAabbMax); - initObject(createNative(btWorldAabbMin.getCPointer(), btWorldAabbMax.getCPointer(), maxHandles), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btAxisSweep3(*((btVector3*)worldAabbMinAddr), *((btVector3*)worldAabbMaxAddr), maxHandles); - */ - /*[-teaVM;-NATIVE] - var btWorldAabbMin = Bullet.wrapPointer(worldAabbMinAddr, Bullet.btVector3); - var btWorldAabbMax = Bullet.wrapPointer(worldAabbMaxAddr, Bullet.btVector3); - var jsObj = new Bullet.btAxisSweep3(btWorldAabbMin, btWorldAabbMax, maxHandles); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long worldAabbMinAddr, long worldAabbMaxAddr, int maxHandles); - - /*[-C++;-NATIVE] - delete (btAxisSweep3*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btAxisSweep3); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3InternalShort.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3InternalShort.java deleted file mode 100644 index a186230f..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btAxisSweep3InternalShort.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -public class btAxisSweep3InternalShort extends btBroadphaseInterface { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBoxShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBoxShape.java deleted file mode 100644 index 742229f7..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBoxShape.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btBoxShape extends btPolyhedralConvexShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btBoxShape(Vector3 boxHalfExtents) { - btVector3 out = btVector3.TEMP_0; - btVector3.convert(boxHalfExtents, out); - initObject(createNative(out.getCPointer()), true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btBoxShape(*((btVector3*)boxHalfExtentsAddr)); - */ - /*[-teaVM;-NATIVE] - var boxHalfExtentsJSObj = Bullet.wrapPointer(boxHalfExtentsAddr, Bullet.btVector3); - var jsObj = new Bullet.btBoxShape(boxHalfExtentsJSObj); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long boxHalfExtentsAddr); - - /*[-C++;-NATIVE] - delete (btBoxShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btBoxShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public Vector3 getHalfExtentsWithoutMargin() { - long pointer = getHalfExtentsWithoutMarginNATIVE(cPointer); - btVector3.WRAPPER_GEN_01.setPointer(pointer); - btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - // TODO improve generator to get reference pointer - - /*[-C++;-NATIVE] - btBoxShape* nativeObject = (btBoxShape*)addr; - return (jlong)&nativeObject->getHalfExtentsWithoutMargin(); - */ - private static native long getHalfExtentsWithoutMarginNATIVE(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseInterface.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseInterface.java deleted file mode 100644 index db492986..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseInterface.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btBroadphaseInterface extends BulletBase { - /*[-C++;-NATIVE] - #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePair.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePair.java deleted file mode 100644 index 76fd5ddb..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePair.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btBroadphasePair extends BulletBase { - - public static btBroadphasePair WRAPPER_GEN_01 = new btBroadphasePair(false); - - public btBroadphasePair(boolean cMemoryOwn) { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePairArray.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePairArray.java deleted file mode 100644 index 12172b0d..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphasePairArray.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btBroadphasePairArray extends BulletBase { - /*[-C++;-NATIVE] - #include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h" - */ - - public static btBroadphasePairArray WRAPPER_GEN_01 = new btBroadphasePairArray(false); - - protected btBroadphasePairArray(boolean cMemoryOwn) { - } - - public btBroadphasePair at(int n) { - long pointer = atNATIVE(cPointer, n); - btBroadphasePair.WRAPPER_GEN_01.setPointer(pointer); - return btBroadphasePair.WRAPPER_GEN_01; - } - - // TODO improve generator to get reference pointer - - /*[-C++;-NATIVE] - btBroadphasePairArray* nativeObject = (btBroadphasePairArray*)addr; - return (jlong)&nativeObject->at(n); - */ - private static native long atNATIVE(long addr, int n); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseProxy.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseProxy.java deleted file mode 100644 index 23b1ee2a..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBroadphaseProxy.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btBroadphaseProxy extends BulletBase { - - public static btBroadphaseProxy WRAPPER_GEN_01 = new btBroadphaseProxy(false); - - protected btBroadphaseProxy(boolean cMemoryOwn) { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBvhTriangleMeshShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBvhTriangleMeshShape.java deleted file mode 100644 index 41e503f0..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btBvhTriangleMeshShape.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.graphics.g3d.model.MeshPart; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; -import com.badlogic.gdx.utils.Array; - -/** - * @author xpenatan - */ -public class btBvhTriangleMeshShape extends btTriangleMeshShape { - protected final static Array instances = new Array(); - - protected static btBvhTriangleMeshShape getInstance(final Array meshParts) { - for(final btBvhTriangleMeshShape instance : instances) { - if(instance.meshInterface instanceof btTriangleIndexVertexArray - && btTriangleIndexVertexArray.compare((btTriangleIndexVertexArray)(instance.meshInterface), meshParts)) - return instance; - } - return null; - } - - public static btBvhTriangleMeshShape obtain(final Array meshParts) { - btBvhTriangleMeshShape result = getInstance(meshParts); - if(result == null) { - result = new btBvhTriangleMeshShape(btTriangleIndexVertexArray.obtain(meshParts), true); - instances.add(result); - } - result.obtain(); - return result; - } - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btBvhTriangleMeshShape(btStridingMeshInterface meshInterface, boolean useQuantizedAabbCompression) { - initObject(createNative(meshInterface.getCPointer(), useQuantizedAabbCompression), true); - } - - private btStridingMeshInterface meshInterface = null; - - /** - * @return The {@link btStridingMeshInterface} this shape encapsulates. - */ - public btStridingMeshInterface getMeshInterface() { - return meshInterface; - } - - /*[-C++;-NATIVE] - return (jlong)new btBvhTriangleMeshShape((btStridingMeshInterface*)meshInterfaceAddr, useQuantizedAabbCompression); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btBvhTriangleMeshShape(meshInterfaceAddr, useQuantizedAabbCompression); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long meshInterfaceAddr, boolean useQuantizedAabbCompression); - - /*[-C++;-NATIVE] - delete (btBvhTriangleMeshShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btBvhTriangleMeshShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public void performRaycast(btTriangleCallback callback, btVector3 raySource, btVector3 rayTarget) { - performRaycastNATIVE(cPointer, (int) callback.getCPointer(), (int) raySource.getCPointer(), (int) rayTarget.getCPointer()); - } - - //TODO Improve generator pointer casting - - /*[-C++;-NATIVE] - btBvhTriangleMeshShape* nativeObject = (btBvhTriangleMeshShape*)addr; - btVector3 * raySource = (btVector3*)raySourceAddr; - btVector3 * rayTarget = (btVector3*)rayTargetAddr; - btTriangleCallback * callback = (btTriangleCallback*)callbackAddr; - nativeObject->performRaycast(callback, *raySource, *rayTarget); - */ - private static native void performRaycastNATIVE(long addr, long callbackAddr, long raySourceAddr, long rayTargetAddr); - -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCapsuleShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCapsuleShape.java deleted file mode 100644 index 8ad4412f..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCapsuleShape.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btCapsuleShape extends btConvexInternalShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btCapsuleShape(float radius, float height) { - initObject(createNative(radius, height), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btCapsuleShape(radius, height); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btCapsuleShape(radius, height); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(float radius, float height); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btCapsuleShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCapsuleShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionConfiguration.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionConfiguration.java deleted file mode 100644 index c6f1d4ac..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionConfiguration.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btCollisionConfiguration extends BulletBase { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionDispatcher.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionDispatcher.java deleted file mode 100644 index b9fc860d..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionDispatcher.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btCollisionDispatcher extends btDispatcher { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btCollisionDispatcher(btCollisionConfiguration config) { - initObject(createNative(config.getCPointer()), true); - } - - /*[-C++;-NATIVE] - btCollisionConfiguration * conf = (btCollisionConfiguration *)addr; - return (jlong)new btCollisionDispatcher(conf); - */ - /*[-teaVM;-NATIVE] - var otherJSObj = Bullet.wrapPointer(addr, Bullet.btCollisionConfiguration); - var jsObj = new Bullet.btCollisionDispatcher(otherJSObj); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long addr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btCollisionDispatcher*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionDispatcher); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObject.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObject.java deleted file mode 100644 index e094c1ed..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObject.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.linearmath.VoidPtr; - -/** - * @author xpenatan - */ -public class btCollisionObject extends BulletBase { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public static btCollisionObject temp01 = new btCollisionObject(0); - - public static btCollisionObject WRAPPER_GEN_01 = new btCollisionObject(false); - - protected btCollisionObject(boolean cMemoryOwn) { - } - - public btCollisionObject() { - //TODO add native code - } - - protected btCollisionObject(long cPointer) { - initObject(cPointer, false); - } - - btCollisionShape collisionShape; - - public void setCollisionShape(btCollisionShape collisionShape) { - this.collisionShape = collisionShape; - setCollisionShape(cPointer, collisionShape != null ? collisionShape.getCPointer() : 0); - } - - /*[-C++;-NATIVE] - btCollisionObject* nativeObject = (btCollisionObject*)addr; - nativeObject->setCollisionShape((btCollisionShape*)collisionShapeAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionObject); - jsObj.setCollisionShape(collisionShapeAddr); - */ - private static native void setCollisionShape(long addr, long collisionShapeAddr); - - public btCollisionShape getCollisionShape() { - return collisionShape; - } - - public void setUserPointer(VoidPtr userPointer) { - } - - public void setUserPointer(long userPointer) { - setUserPointerNATIVE(cPointer, userPointer); - } - - /*[-C++;-NATIVE] - btCollisionObject* nativeObject = (btCollisionObject*)addr; - nativeObject->setUserPointer((void*)userPointer); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionObject); - jsObj.setUserPointer(userPointer); - */ - private static native void setUserPointerNATIVE(long addr, long userPointer); - - /*[-teaVM;-REPLACE] - public long getUserPointer () { - int userPointer = getUserPointer(cPointer); - long longPointer = (long)userPointer; - return longPointer; - } - */ - public long getUserPointer() { - long userPointer = getUserPointer(cPointer); - return userPointer; - } - - /*[-C++;-NATIVE] - btCollisionObject* nativeObject = (btCollisionObject*)addr; - return (jlong)nativeObject->getUserPointer(); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionObject); - var intPointer = jsObj.getUserPointer(); - return intPointer; - */ - private static native long getUserPointer(long addr); - - public final static class CollisionFlags { - public final static int CF_STATIC_OBJECT = 1; - public final static int CF_KINEMATIC_OBJECT = 2; - public final static int CF_NO_CONTACT_RESPONSE = 4; - public final static int CF_CUSTOM_MATERIAL_CALLBACK = 8; - public final static int CF_CHARACTER_OBJECT = 16; - public final static int CF_DISABLE_VISUALIZE_OBJECT = 32; - public final static int CF_DISABLE_SPU_COLLISION_PROCESSING = 64; - public final static int CF_HAS_CONTACT_STIFFNESS_DAMPING = 128; - public final static int CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR = 256; - public final static int CF_HAS_FRICTION_ANCHOR = 512; - public final static int CF_HAS_COLLISION_SOUND_TRIGGER = 1024; - } - - public final static class CollisionObjectTypes { - public final static int CO_COLLISION_OBJECT = 1; - public final static int CO_RIGID_BODY = 2; - public final static int CO_GHOST_OBJECT = 4; - public final static int CO_SOFT_BODY = 8; - public final static int CO_HF_FLUID = 16; - public final static int CO_USER_TYPE = 32; - public final static int CO_FEATHERSTONE_LINK = 64; - } - - public final static class AnisotropicFrictionFlags { - public final static int CF_ANISOTROPIC_FRICTION_DISABLED = 0; - public final static int CF_ANISOTROPIC_FRICTION = 1; - public final static int CF_ANISOTROPIC_ROLLING_FRICTION = 2; - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectArray.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectArray.java deleted file mode 100644 index 28c11138..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectArray.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btCollisionObjectArray extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletCollision/CollisionDispatch/btCollisionObject.h" - */ - - private btCollisionWorld world; - - protected btCollisionObjectArray(boolean cMemoryOwn) { - } - - void init(btCollisionWorld world) { - this.world = world; - } - - public btCollisionObject at(int n) { - return world.bodies.get(atNATIVE(cPointer, n)); - } - - /*[-C++;-NATIVE] - btCollisionObjectArray* nativeObject = (btCollisionObjectArray*)addr; - return (jlong)nativeObject->at(n); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionObjectArray); - var returnedJSObj = jsObj.at(n); - return Bullet.getPointer(returnedJSObj); - */ - private static native long atNATIVE(long addr, int n); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectWrapper.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectWrapper.java deleted file mode 100644 index efac573c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionObjectWrapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btCollisionObjectWrapper extends BulletBase { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionShape.java deleted file mode 100644 index 6ab7032f..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionShape.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btCollisionShape extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletCollision/CollisionShapes/btCollisionShape.h" - */ - - public static btCollisionShape WRAPPER_GEN_01 = new btCollisionShape(false); - - protected btCollisionShape(boolean cMemoryOwn) { - } - - protected btCollisionShape() { - } - - public void calculateLocalInertia(float mass, Vector3 inertia) { - btVector3 out = btVector3.TEMP_0; - btVector3.convert(inertia, out); - calculateLocalInertia(cPointer, mass, out.getCPointer()); - btVector3.convert(out, inertia); - } - - /*[-C++;-NATIVE] - ((btCollisionShape*)addr)->calculateLocalInertia(mass, *((btVector3*)inertiaAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btBoxShape); - var inertiaJSObj = Bullet.wrapPointer(inertiaAddr, Bullet.btVector3); - jsObj.calculateLocalInertia(mass, inertiaJSObj); - */ - private static native void calculateLocalInertia(long addr, float mass, long inertiaAddr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionWorld.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionWorld.java deleted file mode 100644 index 8e2bc29a..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCollisionWorld.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; -import com.badlogic.gdx.utils.LongMap; -import com.badlogic.gdx.utils.Pool; - -/** - * @author xpenatan - */ -public class btCollisionWorld extends BulletBase { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - protected final LongMap bodies = new LongMap<>(100); - - private btCollisionObjectArray objectArray = new btCollisionObjectArray(false); - - protected btDispatcher dispatcher; - - public btCollisionWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btCollisionConfiguration collisionConfiguration) { - this.dispatcher = dispatcher; - dispatcher.init(this); - initObject(createNative(dispatcher.getCPointer(), pairCache.getCPointer(), collisionConfiguration.getCPointer()), true); - } - - protected btCollisionWorld() { - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btCollisionWorld((btDispatcher*)dispatcherAddr, (btBroadphaseInterface*)pairCacheAddr, (btCollisionConfiguration*)collisionConfigurationAddr); - */ - /*[-teaVM;-NATIVE] - var dispatcherJSObj = Bullet.wrapPointer(dispatcherAddr, Bullet.btDispatcher); - var broadphaceJSObj = Bullet.wrapPointer(pairCacheAddr, Bullet.btBroadphaseInterface); - var configJSObj = Bullet.wrapPointer(collisionConfigurationAddr, Bullet.btCollisionConfiguration); - var jsObj = new Bullet.btCollisionWorld(dispatcherJSObj, broadphaceJSObj, configJSObj); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long dispatcherAddr, long pairCacheAddr, long collisionConfigurationAddr); - - /*[-C++;-NATIVE] - delete (btCollisionWorld*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionWorld); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public void addCollisionObject(btCollisionObject collisionObject, int collisionFilterGroup, int collisionFilterMask) { - bodies.put(collisionObject.getCPointer(), collisionObject); - addCollisionObjectNATIVE(cPointer, collisionObject.getCPointer(), collisionFilterGroup, collisionFilterMask); - } - - /*[-C++;-NATIVE] - btCollisionWorld* nativeObject = (btCollisionWorld*)addr; - nativeObject->addCollisionObject((btCollisionObject* )collisionObjectAddr, collisionFilterGroup, collisionFilterMask); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionWorld); - jsObj.addCollisionObject(collisionObjectAddr, collisionFilterGroup, collisionFilterMask); - */ - private static native void addCollisionObjectNATIVE(long addr, long collisionObjectAddr, int collisionFilterGroup, int collisionFilterMask); - - public void addCollisionObject(btCollisionObject collisionObject, int collisionFilterGroup) { - bodies.put(collisionObject.getCPointer(), collisionObject); - addCollisionObjectNATIVE(cPointer, collisionObject.getCPointer(), collisionFilterGroup); - } - - /*[-C++;-NATIVE] - btCollisionWorld* nativeObject = (btCollisionWorld*)addr; - nativeObject->addCollisionObject((btCollisionObject* )collisionObjectAddr, collisionFilterGroup); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionWorld); - jsObj.addCollisionObject(collisionObjectAddr, collisionFilterGroup); - */ - private static native void addCollisionObjectNATIVE(long addr, long collisionObjectAddr, int collisionFilterGroup); - - public void addCollisionObject(btCollisionObject collisionObject) { - bodies.put(collisionObject.getCPointer(), collisionObject); - addCollisionObjectNATIVE(cPointer, collisionObject.getCPointer()); - } - - /*[-C++;-NATIVE] - btCollisionWorld* nativeObject = (btCollisionWorld*)addr; - nativeObject->addCollisionObject((btCollisionObject* )collisionObjectAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionWorld); - jsObj.addCollisionObject(collisionObjectAddr); - */ - private static native void addCollisionObjectNATIVE(long addr, long collisionObjectAddr); - - public void removeCollisionObject(btCollisionObject collisionObject) { - bodies.remove(collisionObject.getCPointer()); - removeCollisionObjectNATIVE(cPointer, collisionObject.getCPointer()); - } - - /*[-C++;-NATIVE] - btCollisionWorld* nativeObject = (btCollisionWorld*)addr; - nativeObject->removeCollisionObject((btCollisionObject* )collisionObjectAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionWorld); - jsObj.removeCollisionObject(collisionObjectAddr); - */ - private static native void removeCollisionObjectNATIVE(long addr, long collisionObjectAddr); - - public btCollisionObjectArray getCollisionObjectArray() { - long pointer = getCollisionObjectArrayNATIVE(cPointer); - objectArray.setPointer(pointer); - objectArray.init(this); - return objectArray; - } - - /*[-C++;-NATIVE] - btCollisionWorld* nativeObject = (btCollisionWorld*)addr; - return (jlong)&nativeObject->getCollisionObjectArray(); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionWorld); - var returnedJSObj = jsObj.getCollisionObjectArray(); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getCollisionObjectArrayNATIVE(long addr); - - public btDispatcher getDispatcher() { - return dispatcher; - } - - public void rayTest(btVector3 rayFromWorld, btVector3 rayToWorld, RayResultCallback resultCallback) { - resultCallback.init(this); - rayTestNATIVE(cPointer, rayFromWorld.getCPointer(), rayToWorld.getCPointer(), resultCallback.getCPointer()); - } - - /*[-C++;-NATIVE] - btCollisionWorld* nativeObject = (btCollisionWorld*)addr; - nativeObject->rayTest(*((btVector3* )rayFromWorldAddr), *((btVector3* )rayToWorldAddr), *(( btCollisionWorld::RayResultCallback* )resultCallbackAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCollisionWorld); - jsObj.rayTest(rayFromWorldAddr, rayToWorldAddr, resultCallbackAddr); - */ - private static native void rayTestNATIVE(long addr, long rayFromWorldAddr, long rayToWorldAddr, long resultCallbackAddr); - - public void rayTest(Vector3 rayFromWorldGDX, Vector3 rayToWorldGDX, RayResultCallback resultCallback) { - resultCallback.init(this); - btVector3.convert(rayFromWorldGDX, btVector3.TEMP_0); - btVector3 rayFromWorld = btVector3.TEMP_0; - btVector3.convert(rayToWorldGDX, btVector3.TEMP_1); - btVector3 rayToWorld = btVector3.TEMP_1; - rayTestNATIVE(cPointer, rayFromWorld.getCPointer(), rayToWorld.getCPointer(), resultCallback.getCPointer()); - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCompoundShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCompoundShape.java deleted file mode 100644 index 1179e4fe..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCompoundShape.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.physics.bullet.linearmath.btTransform; - -/** - * @author xpenatan - */ -public class btCompoundShape extends btCollisionShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btCompoundShape() { - initObject(createNative(), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btCompoundShape(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btCompoundShape(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btCompoundShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCompoundShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public void addChildShape(Matrix4 localTransform, btCollisionShape shape) { - // Required. it's called from Bullet class - btTransform.convert(localTransform, btTransform.TEMP_0); - btTransform btLocalTransform = btTransform.TEMP_0; - addChildShapeNATIVE(cPointer, btLocalTransform.getCPointer(), shape.getCPointer()); - } - - /*[-C++;-NATIVE] - btCompoundShape* nativeObject = (btCompoundShape*)addr; - nativeObject->addChildShape(*((btTransform* )localTransformAddr), (btCollisionShape* )shapeAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCompoundShape); - jsObj.addChildShape(localTransformAddr, shapeAddr); - */ - private static native void addChildShapeNATIVE(long addr, long localTransformAddr, long shapeAddr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConcaveShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConcaveShape.java deleted file mode 100644 index ee227bf5..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConcaveShape.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btConcaveShape extends btCollisionShape { - - /*[-C++;-NATIVE] - #include "BulletCollision/CollisionShapes/btConcaveShape.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConeShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConeShape.java deleted file mode 100644 index 2345457b..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConeShape.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btConeShape extends btConvexInternalShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btConeShape(float radius, float height) { - initObject(createNative(radius, height), true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btConeShape(radius, height); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btConeShape(radius, height); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(float radius, float height); - - /*[-C++;-NATIVE] - delete (btConeShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btConeShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexHullShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexHullShape.java deleted file mode 100644 index 19f1fb28..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexHullShape.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btConvexHullShape extends btPolyhedralConvexAabbCachingShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btConvexHullShape(java.nio.FloatBuffer points, int numPoints, int stride) { - // Custom constructor from GDX - initObject(createNative(), true); - int remaining = points.limit(); - stride = stride / 4; - int i = 0; - while(i < remaining) { - float x = points.get(i); - float y = points.get(i + 1); - float z = points.get(i + 2); - btVector3.TEMP_0.setValue(x, y, z); - addPoint(btVector3.TEMP_0); - i += stride; - } - } - - public btConvexHullShape(btShapeHull hull) { - // Custom constructor from GDX - initObject(createNative(hull.getCPointer()), true); - } - - /*[-teaVM;-NATIVE] - var shapeHull = Bullet.wrapPointer(btShapeHullAddr, Bullet.btShapeHull); - var jsObj = new Bullet.btConvexHullShape(); - var numVertices = shapeHull.numVertices(); - var i = 0; - while(i < numVertices) { - var vec3 = Bullet.MyClassHelper.prototype.getVertexPointer(shapeHull, i); - jsObj.addPoint(vec3); - i++; - } - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long btShapeHullAddr); - - /*[-C++;-NATIVE] - return (jlong)new btConvexHullShape(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btConvexHullShape(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btConvexHullShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btConvexHullShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public void addPoint(btVector3 point) { - addPointNATIVE(cPointer, point.getCPointer()); - } - - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btConvexHullShape); - jsObj.addPoint(btVector3Addr); - */ - private static native void addPointNATIVE(long addr, long btVector3Addr); - - public Vector3 getScaledPoint(int i) { - getScaledPointNATIVE(cPointer, i, BulletBase.FLOAT_4); - btVector3.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2]); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btConvexHullShape* nativeObject = (btConvexHullShape*)addr; - btVector3 vec3 = nativeObject->getScaledPoint(i); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btConvexHullShape); - var vec3 = nativeObject.getScaledPoint(i); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - private static native void getScaledPointNATIVE(long addr, int i, float [] array); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexInternalShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexInternalShape.java deleted file mode 100644 index 9bfea06d..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexInternalShape.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btConvexInternalShape extends btConvexShape { - - /*[-C++;-NATIVE] - #include "BulletCollision/CollisionShapes/btConvexInternalShape.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexShape.java deleted file mode 100644 index 899a3094..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btConvexShape.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btConvexShape extends btCollisionShape { - /*[-C++;-NATIVE] - #include "BulletCollision/CollisionShapes/btConvexShape.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCylinderShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCylinderShape.java deleted file mode 100644 index 83641612..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btCylinderShape.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btCylinderShape extends btConvexInternalShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btCylinderShape(Vector3 halfExtents) { - btVector3 out = btVector3.TEMP_0; - btVector3.convert(halfExtents, out); - initObject(createNative(out.getCPointer()), true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btCylinderShape(*((btVector3*)halfExtentsAddr)); - */ - /*[-teaVM;-NATIVE] - var boxHalfExtentsJSObj = Bullet.wrapPointer(halfExtentsAddr, Bullet.btVector3); - var jsObj = new Bullet.btCylinderShape(boxHalfExtentsJSObj); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long halfExtentsAddr); - - /*[-C++;-NATIVE] - delete (btCylinderShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btCylinderShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDbvtBroadphase.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDbvtBroadphase.java deleted file mode 100644 index e690e1e8..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDbvtBroadphase.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btDbvtBroadphase extends btBroadphaseInterface { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btDbvtBroadphase() { - initObject(createNative(), true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btDbvtBroadphase(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btDbvtBroadphase(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - /*[-C++;-NATIVE] - delete (btDbvtBroadphase*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btDbvtBroadphase); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDefaultCollisionConfiguration.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDefaultCollisionConfiguration.java deleted file mode 100644 index 17b440da..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDefaultCollisionConfiguration.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btDefaultCollisionConfiguration extends btCollisionConfiguration { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btDefaultCollisionConfiguration() { - initObject(createNative(), true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btDefaultCollisionConfiguration(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btDefaultCollisionConfiguration(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - /*[-C++;-NATIVE] - delete (btDefaultCollisionConfiguration*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btDefaultCollisionConfiguration); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcher.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcher.java deleted file mode 100644 index 660c81bc..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcher.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btDispatcher extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletCollision/BroadphaseCollision/btDispatcher.h" - */ - - public static btDispatcher WRAPPER_GEN_01 = new btDispatcher(false); - - public btPersistentManifold manifold = new btPersistentManifold(false); - - protected btDispatcher() { - } - - protected btDispatcher(boolean cMemoryOwn) { - } - - public void init(btCollisionWorld world) { - manifold.init(world); - } - - public btPersistentManifold getManifoldByIndexInternal(int index) { - long pointer = getManifoldByIndexInternalNATIVE(cPointer, index); - manifold.setPointer(pointer); - return manifold; - } - - /*[-C++;-NATIVE] - btDispatcher* nativeObject = (btDispatcher*)addr; - return (jlong)nativeObject->getManifoldByIndexInternal(index); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btDispatcher); - var returnedJSObj = jsObj.getManifoldByIndexInternal(index); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getManifoldByIndexInternalNATIVE(long addr, int index); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcherInfo.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcherInfo.java deleted file mode 100644 index d31b9791..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btDispatcherInfo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btDispatcherInfo extends BulletBase { - - public static btDispatcherInfo WRAPPER_GEN_01 = new btDispatcherInfo(false); - - protected btDispatcherInfo(boolean cMemoryOwn) { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btIndexedMesh.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btIndexedMesh.java deleted file mode 100644 index 31cb76d0..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btIndexedMesh.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.VertexAttribute; -import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.model.MeshPart; -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.GdxRuntimeException; -import java.nio.FloatBuffer; -import java.nio.ShortBuffer; - -/** - * @author xpenatan - */ -public class btIndexedMesh extends BulletBase { - protected final static Array instances = new Array(); - - protected static btIndexedMesh getInstance(final Object tag) { - final int n = instances.size; - for(int i = 0; i < n; i++) { - final btIndexedMesh mesh = instances.get(i); - if(tag.equals(mesh.tag)) - return mesh; - } - return null; - } - - /** - * Create or reuse a btIndexedMesh instance based on the specified {@link com.badlogic.gdx.graphics.g3d.model.MeshPart}. - * Use {@link #release()} to release the mesh when it's no longer needed. - */ - public static btIndexedMesh obtain(final MeshPart meshPart) { - if(meshPart == null) - throw new GdxRuntimeException("meshPart cannot be null"); - - btIndexedMesh result = getInstance(meshPart); - if(result == null) { - result = new btIndexedMesh(meshPart); - instances.add(result); - } - result.obtain(); - return result; - } - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public Object tag; - - /** - * Construct a new btIndexedMesh based on the supplied {@link MeshPart} - * The specified mesh must be indexed and triangulated and must outlive this btIndexedMesh. - * The buffers for the vertices and indices are shared amonst both. - */ - public btIndexedMesh(final MeshPart meshPart) { - initObject(createNative(), true); - set(meshPart); - } - - /*[-C++;-NATIVE] - return (jlong)new btIndexedMesh(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btIndexedMesh(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btIndexedMesh*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btIndexedMesh); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - /** - * Convenience method to set this btIndexedMesh to the specified {@link MeshPart} - * The specified mesh must be indexed and triangulated and must outlive this btIndexedMesh. - * The buffers for the vertices and indices are shared amonst both. - */ - public void set(final MeshPart meshPart) { - if(meshPart.primitiveType != com.badlogic.gdx.graphics.GL20.GL_TRIANGLES) - throw new com.badlogic.gdx.utils.GdxRuntimeException("Mesh must be indexed and triangulated"); - set(meshPart, meshPart.mesh, meshPart.offset, meshPart.size); - } - - /** - * Convenience method to set this btIndexedMesh to the specified {@link com.badlogic.gdx.graphics.Mesh} - * The specified mesh must be indexed and triangulated and must outlive this btIndexedMesh. - * The buffers for the vertices and indices are shared amonst both. - */ - public void set(final Object tag, final Mesh mesh, int offset, int count) { - if((count <= 0) || ((count % 3) != 0)) - throw new com.badlogic.gdx.utils.GdxRuntimeException("Mesh must be indexed and triangulated"); - - VertexAttribute posAttr = mesh.getVertexAttribute(Usage.Position); - - if(posAttr == null) - throw new com.badlogic.gdx.utils.GdxRuntimeException("Mesh doesn't have a position attribute"); - - set(tag, mesh.getVerticesBuffer(), mesh.getVertexSize(), mesh.getNumVertices(), posAttr.offset, mesh.getIndicesBuffer(), offset, count); - } - - /** - * Convenience method to set this btIndexedMesh to the specified vertex and index data. - * The specified data must be indexed and triangulated and must outlive this btIndexedMesh. - */ - public void set(final Object tag, - final FloatBuffer vertices, int sizeInBytesOfEachVertex, int vertexCount, int positionOffsetInBytes, - final ShortBuffer indices, int indexOffset, int indexCount) { - setVertices(vertices, sizeInBytesOfEachVertex, vertexCount, positionOffsetInBytes); - setIndices(indices, indexOffset, indexCount); - this.tag = tag; - } - - public void setVertices(java.nio.FloatBuffer vertices, int sizeInBytesOfEachVertex, int vertexCount, int positionOffsetInBytes) { - int remaining = vertices.limit(); - float[] array = new float[remaining]; - for(int i = 0; i < remaining; i++) { - array[i] = vertices.get(i); - } - //TODO find a better impl - setVertices(cPointer, array, sizeInBytesOfEachVertex, vertexCount, positionOffsetInBytes); - } - - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btIndexedMesh); - - var nDataBytes1 = vertices.length * vertices.BYTES_PER_ELEMENT; - var dataPtr1 = Bullet._malloc(nDataBytes1); - var dataHeap1 = new Uint8Array(Bullet.HEAPU8.buffer, dataPtr1, nDataBytes1); - dataHeap1.set(new Uint8Array(vertices.buffer)); - - Bullet.MyClassHelper.prototype.setVertices(jsObj, dataHeap1.byteOffset, sizeInBytesOfEachVertex, vertexCount, positionOffsetInBytes); - */ - private static native void setVertices(long addr, float[] vertices, int sizeInBytesOfEachVertex, int vertexCount, int positionOffsetInBytes); - - public void setIndices(java.nio.ShortBuffer indices, int indexOffset, int indexCount) { - int remaining = indices.limit(); - short[] array = new short[remaining]; - for(int i = 0; i < remaining; i++) { - array[i] = indices.get(i); - } - //TODO find a better impl - setIndices(cPointer, array, indexOffset, indexCount); - } - - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btIndexedMesh); - - var nDataBytes2 = indices.length * indices.BYTES_PER_ELEMENT; - var dataPtr2 = Bullet._malloc(nDataBytes2); - var dataHeap2 = new Uint8Array(Bullet.HEAPU8.buffer, dataPtr2, nDataBytes2); - dataHeap2.set(new Uint8Array(indices.buffer)); - - Bullet.MyClassHelper.prototype.setIndices(jsObj, dataHeap2.byteOffset, indexOffset, indexCount); - */ - private static native void setIndices(long addr, short[] indices, int indexOffset, int indexCount); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btManifoldPoint.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btManifoldPoint.java deleted file mode 100644 index 8f8c9ed5..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btManifoldPoint.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btManifoldPoint extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h" - */ - - public static btManifoldPoint WRAPPER_GEN_01 = new btManifoldPoint(false); - - protected btManifoldPoint(boolean cMemoryOwn) { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCache.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCache.java deleted file mode 100644 index 5399a372..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCache.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btOverlappingPairCache extends btOverlappingPairCallback { - - /*[-C++;-NATIVE] - #include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h" - */ - - public static btOverlappingPairCache WRAPPER_GEN_01 = new btOverlappingPairCache(false); - - protected btOverlappingPairCache(boolean cMemoryOwn) { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCallback.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCallback.java deleted file mode 100644 index af6d028c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btOverlappingPairCallback.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btOverlappingPairCallback extends BulletBase { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPersistentManifold.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPersistentManifold.java deleted file mode 100644 index 952c479e..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPersistentManifold.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.linearmath.btTypedObject; - -/** - * @author xpenatan - */ -public class btPersistentManifold extends btTypedObject { - - /*[-C++;-NATIVE] - #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" - */ - - private btCollisionWorld world; - - protected btPersistentManifold(boolean cMemoryOwn) { - } - - void init(btCollisionWorld world) { - this.world = world; - } - - public btCollisionObject getBody0() { - return world.bodies.get(getBody0NATIVE(cPointer)); - } - - /*[-C++;-NATIVE] - btPersistentManifold* nativeObject = (btPersistentManifold*)addr; - return (jlong)nativeObject->getBody0(); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btPersistentManifold); - var returnedJSObj = jsObj.getBody0(); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getBody0NATIVE(long addr); - - public btCollisionObject getBody1() { - return world.bodies.get(getBody1NATIVE(cPointer)); - } - - /*[-C++;-NATIVE] - btPersistentManifold* nativeObject = (btPersistentManifold*)addr; - return (jlong)nativeObject->getBody1(); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btPersistentManifold); - var returnedJSObj = jsObj.getBody1(); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getBody1NATIVE(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexAabbCachingShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexAabbCachingShape.java deleted file mode 100644 index 92851e36..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexAabbCachingShape.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btPolyhedralConvexAabbCachingShape extends btPolyhedralConvexShape { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexShape.java deleted file mode 100644 index e09b7f31..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btPolyhedralConvexShape.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btPolyhedralConvexShape extends btConvexInternalShape { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btShapeHull.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btShapeHull.java deleted file mode 100644 index 12550c3e..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btShapeHull.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btShapeHull extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletCollision/CollisionShapes/btShapeHull.h" - */ - - public btShapeHull(btConvexShape shape) { - initObject(createNative(shape.getCPointer()), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btShapeHull((btConvexShape*)shapeAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btShapeHull(shapeAddr); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long shapeAddr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btShapeHull*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btShapeHull); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btSphereShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btSphereShape.java deleted file mode 100644 index 4b020982..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btSphereShape.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btSphereShape extends btConvexInternalShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - public btSphereShape(float radius) { - initObject(createNative(radius), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btSphereShape(radius); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btSphereShape(radius); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(float radius); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btSphereShape*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btSphereShape); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btStridingMeshInterface.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btStridingMeshInterface.java deleted file mode 100644 index b3846f61..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btStridingMeshInterface.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btStridingMeshInterface extends BulletBase { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleCallback.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleCallback.java deleted file mode 100644 index bb28368c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleCallback.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btTriangleCallback extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletCollision/CollisionShapes/btTriangleCallback.h" - */ - -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleIndexVertexArray.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleIndexVertexArray.java deleted file mode 100644 index ff403335..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleIndexVertexArray.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.graphics.g3d.model.MeshPart; -import com.badlogic.gdx.utils.Array; - -/** - * @author xpenatan - */ -public class btTriangleIndexVertexArray extends btStridingMeshInterface { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - protected final static Array instances = new Array(); - - /** - * @return Whether the supplied array contains all specified tags. - */ - public static boolean compare(final btTriangleIndexVertexArray array, final Array tags) { - if(array.meshes.size != tags.size) return false; - for(final btIndexedMesh mesh : array.meshes) { - boolean found = false; - final Object tag = mesh.tag; - if(tag == null) return false; - for(final T t : tags) { - if(t.equals(tag)) { - found = true; - break; - } - } - if(!found) return false; - } - return true; - } - - protected static btTriangleIndexVertexArray getInstance(final Array tags) { - for(final btTriangleIndexVertexArray instance : instances) { - if(compare(instance, tags)) return instance; - } - return null; - } - - /** - * Create or reuse a btTriangleIndexVertexArray instance based on the specified {@link MeshPart} array. Use {@link #release()} - * to release the mesh when it's no longer needed. - */ - public static btTriangleIndexVertexArray obtain(final Array meshParts) { - btTriangleIndexVertexArray result = getInstance(meshParts); - if(result == null) { - result = new btTriangleIndexVertexArray(meshParts); - instances.add(result); - } - result.obtain(); - return result; - } - - protected final Array meshes = new Array(1); - - public btTriangleIndexVertexArray(final MeshPart meshPart) { - // Gdx constructor - initObject(createNative(), true); - addMeshPart(meshPart); - } - - public btTriangleIndexVertexArray(final Iterable meshParts) { - // Gdx constructor - initObject(createNative(), true); - addMeshParts(meshParts); - } - - /*[-C++;-NATIVE] - return (jlong)new btTriangleIndexVertexArray(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btTriangleIndexVertexArray(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btTriangleIndexVertexArray*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTriangleIndexVertexArray); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - /*[-IDL_SKIP] - */ - public static native void addIndexedMesh(btIndexedMesh mesh, PHY_ScalarType indexType); - - public void addIndexedMesh(btIndexedMesh mesh, int indexType) { - addIndexedMeshNATIVE(cPointer, mesh.getCPointer(), indexType); - } - - /*[-C++;-NATIVE] - btTriangleIndexVertexArray* nativeObj = (btTriangleIndexVertexArray*)addr; - btIndexedMesh* meshObj = (btIndexedMesh*)meshAddr; - nativeObj->addIndexedMesh(*meshObj, (PHY_ScalarType)indexType); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTriangleIndexVertexArray); - var meshJSObj = Bullet.wrapPointer(meshAddr, Bullet.btIndexedMesh); - jsObj.addIndexedMesh(meshJSObj, indexType); - */ - private static native void addIndexedMeshNATIVE(long addr, long meshAddr, int indexType); - - public void addIndexedMesh(btIndexedMesh mesh) { - addIndexedMeshNATIVE(cPointer, mesh.getCPointer()); - } - - /*[-C++;-NATIVE] - btTriangleIndexVertexArray* nativeObj = (btTriangleIndexVertexArray*)addr; - btIndexedMesh* meshObj = (btIndexedMesh*)meshAddr; - nativeObj->addIndexedMesh(*meshObj); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTriangleIndexVertexArray); - var meshJSObj = Bullet.wrapPointer(meshAddr, Bullet.btIndexedMesh); - jsObj.addIndexedMesh(meshJSObj); - */ - private static native void addIndexedMeshNATIVE(long addr, long meshAddr); - - /** - * Add a {@link MeshPart} instance to this btTriangleIndexVertexArray. - * The specified mesh must be indexed and triangulated and must outlive this btTriangleIndexVertexArray. - * The buffers for the vertices and indices are shared amongst both. - */ - public btTriangleIndexVertexArray addMeshPart(final MeshPart meshPart) { - btIndexedMesh mesh = btIndexedMesh.obtain(meshPart); - addIndexedMesh(mesh, PHY_ScalarType.PHY_SHORT); - mesh.release(); - return this; - } - - /** - * Add one or more {@link MeshPart} instances to this btTriangleIndexVertexArray. - * The specified meshes must be indexed and triangulated and must outlive this btTriangleIndexVertexArray. - * The buffers for the vertices and indices are shared amongst both. - */ - public btTriangleIndexVertexArray addMeshParts(final Iterable meshParts) { - for(final MeshPart meshPart : meshParts) - addMeshPart(meshPart); - return this; - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleMeshShape.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleMeshShape.java deleted file mode 100644 index cea8ee18..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleMeshShape.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -/** - * @author xpenatan - */ -public class btTriangleMeshShape extends btConcaveShape { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleRaycastCallback.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleRaycastCallback.java deleted file mode 100644 index a5b76ff8..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/collision/btTriangleRaycastCallback.java +++ /dev/null @@ -1,246 +0,0 @@ -package com.badlogic.gdx.physics.bullet.collision; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btTriangleRaycastCallback extends btTriangleCallback { - - /*[-C++;-NATIVE] - #include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h" - */ - - /*[-C++;-NATIVE] - - static jclass triangleRaycastClass = 0; - static jmethodID onReportHitID = 0; - - class CustombtTriangleRaycastCallback : public btTriangleRaycastCallback - { - - private: - JNIEnv* env; - jobject obj; - - public: - CustombtTriangleRaycastCallback(JNIEnv* env, jobject obj, const btVector3& from, const btVector3& to, unsigned int flags) - : btTriangleRaycastCallback(from, to, flags) - { - this->env = env; - this->obj = obj; - } - - virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex) - { - return env->CallFloatMethod(obj, onReportHitID, (jlong)&hitNormalLocal, hitFraction, partId, triangleIndex); - } - }; - */ - - Vector3 tempVec = new Vector3(); - - public btTriangleRaycastCallback(Vector3 from, Vector3 to) { - btVector3 btFrom = btVector3.TEMP_0; - btVector3 btTo = btVector3.TEMP_1; - btVector3.convert(from, btFrom); - btVector3.convert(to, btTo); - initJavaObject(btFrom, btTo); - } - - /*[-teaVM;-ADD] - @org.teavm.jso.JSFunctor - public interface ReportHitFunction extends org.teavm.jso.JSObject { - float reportHitJS(int hitNormalLocalAddr, float hitFraction, int partId, int triangleIndex); - } - */ - - /*[-teaVM;-REPLACE] - private void initJavaObject(btVector3 from, btVector3 to) { - ReportHitFunction reportHitFunction = new ReportHitFunction() { - @Override - public float reportHitJS(int hitNormalLocalAddr, float hitFraction, int partId, int triangleIndex) { - btVector3.convert(hitNormalLocalAddr, tempVec); - return reportHit(tempVec, hitFraction, partId, triangleIndex); - } - }; - int pointer = createNative(from.getCPointer(), to.getCPointer(), reportHitFunction); - initObject(pointer, true); - } - */ - private void initJavaObject(btVector3 from, btVector3 to) { - initObject(createNative(from.getCPointer(), to.getCPointer()), true); - } - - /*[-C++;-NATIVE] - if(triangleRaycastClass == 0) { - triangleRaycastClass = (jclass)env->NewGlobalRef(env->GetObjectClass(object)); - onReportHitID = env->GetMethodID(triangleRaycastClass, "onReportHit", "(JFII)F"); - } - return (jlong)new CustombtTriangleRaycastCallback(env, env->NewGlobalRef(object), *((btVector3*)fromAddr), *((btVector3*)toAddr), 0); - */ - /*[-teaVM;-REPLACE] - @org.teavm.jso.JSBody(params = { "fromAddr", "toAddr", "hitFunction" }, script = "var callback = new Bullet.MybtTriangleRaycastCallback(fromAddr, toAddr); callback.reportHit = hitFunction; return Bullet.getPointer(callback);") - private static native int createNative(long fromAddr, long toAddr, ReportHitFunction hitFunction); - */ - private native long createNative(long fromAddr, long toAddr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (CustombtTriangleRaycastCallback*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - - /*[-IDL_SKIP] - */ - public float reportHit(Vector3 hitNormalLocal, float hitFraction, int partId, int triangleIndex) { - return 0; - } - - private float onReportHit(long hitNormalLocalAddr, float hitFraction, int partId, int triangleIndex) { - btVector3.convert(hitNormalLocalAddr, btVector3.TEMP_GDX_01); - return reportHit(btVector3.TEMP_GDX_01, hitFraction, partId, triangleIndex); - } - - public void setFrom(btVector3 value) { - setFrom(cPointer, value.getCPointer()); - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - nativeObject->m_from = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); - jsObj.set_m_from(jsVec3Obj); - */ - private static native long setFrom(long addr, long valueAddr); - - public btVector3 getFrom() { - long outAddr = getFrom(cPointer); - btVector3.emptyTransform.setPointer(outAddr); - return btVector3.emptyTransform; - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - return (jlong)&nativeObject->m_from; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - return Bullet.getPointer(jsObj.get_m_from()); - */ - private static native long getFrom(long addr); - - public void setTo(btVector3 value) { - setTo(cPointer, value.getCPointer()); - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - nativeObject->m_to = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); - jsObj.set_m_to(jsVec3Obj); - */ - private static native long setTo(long addr, long valueAddr); - - public btVector3 getTo() { - long outAddr = getTo(cPointer); - btVector3.emptyTransform.setPointer(outAddr); - return btVector3.emptyTransform; - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - return (jlong)&nativeObject->m_to; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - return Bullet.getPointer(jsObj.get_m_to()); - */ - private static native long getTo(long addr); - - /*[-teaVM;-REPLACE] - public void setFlags (long value) { - setFlags(cPointer, (int)value); - } - */ - public void setFlags(long value) { - setFlags(cPointer, value); - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - nativeObject->m_flags = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - jsObj.set_m_flags(value); - */ - private static native void setFlags(long addr, long value); - - public long getFlags() { - return getFlags(cPointer); - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - return nativeObject->m_flags; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - return jsObj.get_m_flags(); - */ - private static native long getFlags(long addr); - - public void setHitFraction(float value) { - setHitFraction(cPointer, value); - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - nativeObject->m_hitFraction = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - jsObj.set_m_hitFraction(value); - */ - private static native void setHitFraction(long addr, float value); - - public float getHitFraction() { - return getHitFraction(cPointer); - } - - /*[-C++;-NATIVE] - CustombtTriangleRaycastCallback* nativeObject = (CustombtTriangleRaycastCallback*)addr; - return nativeObject->m_hitFraction; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); - return jsObj.get_m_hitFraction(); - */ - private static native float getHitFraction(long addr); - - public final static class EFlags { - public final static int kF_None = 0; - public final static int kF_FilterBackfaces = 1 << 0; - public final static int kF_KeepUnflippedNormal = 1 << 1; - public final static int kF_UseSubSimplexConvexCastRaytest = 1 << 2; - public final static int kF_UseGjkConvexCastRaytest = 1 << 3; - public final static int kF_Terminator = 0xFFFFFFFF; - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btActionInterface.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btActionInterface.java deleted file mode 100644 index e2ee7850..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btActionInterface.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btActionInterface extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletDynamics/Dynamics/btActionInterface.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConeTwistConstraint.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConeTwistConstraint.java deleted file mode 100644 index b4c2d8b3..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConeTwistConstraint.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.physics.bullet.linearmath.btTransform; - -/** - * @author xpenatan - */ -public class btConeTwistConstraint extends btTypedConstraint { - - /*[-C++;-NATIVE] - #include "btBulletDynamicsCommon.h" - */ - - public btConeTwistConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame) { - btTransform btframeInA = btTransform.TEMP_0; - btTransform btframeInB = btTransform.TEMP_1; - btTransform.convert(rbAFrame, btframeInA); - btTransform.convert(rbBFrame, btframeInB); - initObject(createNative(rbA.getCPointer(), rbB.getCPointer(), btframeInA.getCPointer(), btframeInB.getCPointer()), true); - } - - public btConeTwistConstraint(btRigidBody rbA, Matrix4 rbAFrame) { - btTransform btrbAFrame = btTransform.TEMP_0; - btTransform.convert(rbAFrame, btrbAFrame); - initObject(createNative(rbA.getCPointer(), btrbAFrame.getCPointer()), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btConeTwistConstraint(*((btRigidBody*)rbAAddr), *((btRigidBody*)rbBAddr), *((btTransform*)frameInAAddr), *((btTransform*)frameInBAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btConeTwistConstraint(rbAAddr, rbBAddr, frameInAAddr, frameInBAddr); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rbAAddr, long rbBAddr, long frameInAAddr, long frameInBAddr); - - /*[-C++;-NATIVE] - return (jlong)new btConeTwistConstraint(*((btRigidBody*)rbAAddr), *((btTransform*)rbAFrameAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btConeTwistConstraint(rbAAddr, rbAFrameAddr); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rbAAddr, long rbAFrameAddr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btConeTwistConstraint*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btConeTwistConstraint); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSetting.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSetting.java deleted file mode 100644 index f6219dee..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSetting.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -public class btConstraintSetting extends BulletBase { - - /*[-C++;-NATIVE] - #include "btBulletDynamicsCommon.h" - */ - - public static btConstraintSetting WRAPPER_GEN_01 = new btConstraintSetting(false); - - protected btConstraintSetting(boolean cMemoryOwn) { - } - - public btConstraintSetting() { - initObject(createNative(), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btConstraintSetting(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btConstraintSetting(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btConstraintSetting*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btConstraintSetting); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - - public void setTau (float value) { - setTauNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btConstraintSetting* nativeObject = (btConstraintSetting*)addr; - nativeObject->m_tau = value; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btConstraintSetting); - nativeObject.m_tau = value; - */ - private static native void setTauNATIVE(long addr, float value); - - public float getTau () { - return getTauNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btConstraintSetting* nativeObject = (btConstraintSetting*)addr; - return nativeObject->m_tau; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btConstraintSetting); - return nativeObject.m_tau; - */ - private static native float getTauNATIVE(long addr); - - public void setDamping (float value) { - setDampingNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btConstraintSetting* nativeObject = (btConstraintSetting*)addr; - nativeObject->m_damping = value; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btConstraintSetting); - nativeObject.m_damping = value; - */ - private static native void setDampingNATIVE(long addr, float value); - - public float getDamping () { - return getDampingNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btConstraintSetting* nativeObject = (btConstraintSetting*)addr; - return nativeObject->m_damping; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btConstraintSetting); - return nativeObject.m_damping; - */ - private static native float getDampingNATIVE(long addr); - - public void setImpulseClamp (float value) { - setImpulseClampNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btConstraintSetting* nativeObject = (btConstraintSetting*)addr; - nativeObject->m_impulseClamp = value; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btConstraintSetting); - nativeObject.m_impulseClamp = value; - */ - private static native void setImpulseClampNATIVE(long addr, float value); - - public float getImpulseClamp () { - return getImpulseClampNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btConstraintSetting* nativeObject = (btConstraintSetting*)addr; - return nativeObject->m_impulseClamp; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btConstraintSetting); - return nativeObject.m_impulseClamp; - */ - private static native float getImpulseClampNATIVE(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSolver.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSolver.java deleted file mode 100644 index 85af90b4..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btConstraintSolver.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btConstraintSolver extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btSolverBody.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfo.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfo.java deleted file mode 100644 index 9164e39c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -/** - * @author xpenatan - */ -public class btContactSolverInfo extends btContactSolverInfoData { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" - */ - - public static btContactSolverInfo WRAPPER_GEN_01 = new btContactSolverInfo(false); - - public btContactSolverInfo(boolean cMemoryOwn) { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfoData.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfoData.java deleted file mode 100644 index 9b156d25..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btContactSolverInfoData.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btContactSolverInfoData extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" - */ -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDiscreteDynamicsWorld.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDiscreteDynamicsWorld.java deleted file mode 100644 index b332171c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDiscreteDynamicsWorld.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.physics.bullet.collision.btBroadphaseInterface; -import com.badlogic.gdx.physics.bullet.collision.btCollisionConfiguration; -import com.badlogic.gdx.physics.bullet.collision.btDispatcher; - -/** - * @author xpenatan - */ -public class btDiscreteDynamicsWorld extends btDynamicsWorld { - - /*[-C++;-NATIVE] - #include "btBulletDynamicsCommon.h" - */ - - public btDiscreteDynamicsWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btConstraintSolver constraintSolver, btCollisionConfiguration collisionConfiguration) { - this.dispatcher = dispatcher; - dispatcher.init(this); - initObject(createNative(dispatcher.getCPointer(), pairCache.getCPointer(), constraintSolver.getCPointer(), collisionConfiguration.getCPointer()), true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btDiscreteDynamicsWorld((btDispatcher*)dispatcherAddr, (btBroadphaseInterface*)pairCacheAddr, (btConstraintSolver*)constraintSolverAddr, (btCollisionConfiguration*)collisionConfigurationAddr); - */ - /*[-teaVM;-NATIVE] - var dispatcherJSObj = Bullet.wrapPointer(dispatcherAddr, Bullet.btDispatcher); - var broadphaceJSObj = Bullet.wrapPointer(pairCacheAddr, Bullet.btBroadphaseInterface); - var solverJSObj = Bullet.wrapPointer(constraintSolverAddr, Bullet.btConstraintSolver); - var configJSObj = Bullet.wrapPointer(collisionConfigurationAddr, Bullet.btCollisionConfiguration); - var jsObj = new Bullet.btDiscreteDynamicsWorld(dispatcherJSObj, broadphaceJSObj, solverJSObj, configJSObj); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long dispatcherAddr, long pairCacheAddr, long constraintSolverAddr, long collisionConfigurationAddr); - - /*[-C++;-NATIVE] - delete (btDiscreteDynamicsWorld*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btDiscreteDynamicsWorld); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDynamicsWorld.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDynamicsWorld.java deleted file mode 100644 index 066838c0..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btDynamicsWorld.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.collision.btCollisionWorld; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btDynamicsWorld extends btCollisionWorld { - - /*[-C++;-NATIVE] - #include "BulletDynamics/Dynamics/btDynamicsWorld.h" - */ - - public Vector3 getGravity() { - getGravityNATIVE(cPointer, BulletBase.FLOAT_4); - btVector3.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2]); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btDynamicsWorld* nativeObject = (btDynamicsWorld*)addr; - btVector3 gravity = nativeObject->getGravity(); - array[0] = gravity.getX(); - array[1] = gravity.getY(); - array[2] = gravity.getZ(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btDynamicsWorld); - var gravity = nativeObject.getGravity(); - array[0] = gravity.getX(); - array[1] = gravity.getY(); - array[2] = gravity.getZ(); - */ - private static native void getGravityNATIVE(long addr, float [] array); - - public void addRigidBody(btRigidBody body) { - bodies.put(body.getCPointer(), body); - addRigidBodyNATIVE(cPointer, body.getCPointer()); - } - - /*[-C++;-NATIVE] - btDynamicsWorld* nativeObject = (btDynamicsWorld*)addr; - nativeObject->addRigidBody((btRigidBody* )bodyAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btDynamicsWorld); - jsObj.addRigidBody(bodyAddr); - */ - private static native void addRigidBodyNATIVE(long addr, long bodyAddr); - - public void addRigidBody(btRigidBody body, int group, int mask) { - bodies.put(body.getCPointer(), body); - addRigidBodyNATIVE(cPointer, body.getCPointer(), group, mask); - } - - /*[-C++;-NATIVE] - btDynamicsWorld* nativeObject = (btDynamicsWorld*)addr; - nativeObject->addRigidBody((btRigidBody* )bodyAddr, group, mask); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btDynamicsWorld); - jsObj.addRigidBody(bodyAddr, group, mask); - */ - private static native void addRigidBodyNATIVE(long addr, long bodyAddr, int group, int mask); - - public void removeRigidBody(btRigidBody body) { - bodies.remove(body.getCPointer()); - removeRigidBodyNATIVE(cPointer, body.getCPointer()); - } - - /*[-C++;-NATIVE] - btDynamicsWorld* nativeObject = (btDynamicsWorld*)addr; - nativeObject->removeRigidBody((btRigidBody* )bodyAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btDynamicsWorld); - jsObj.removeRigidBody(bodyAddr); - */ - private static native void removeRigidBodyNATIVE(long addr, long bodyAddr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btFixedConstraint.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btFixedConstraint.java deleted file mode 100644 index 2eab3291..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btFixedConstraint.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.physics.bullet.linearmath.btTransform; - -/** - * @author xpenatan - */ -public class btFixedConstraint extends btGeneric6DofSpring2Constraint { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btFixedConstraint.h" - */ - - public btFixedConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 frameInA, Matrix4 frameInB) { - btTransform btframeInA = btTransform.TEMP_0; - btTransform btframeInB = btTransform.TEMP_1; - btTransform.convert(frameInA, btframeInA); - btTransform.convert(frameInB, btframeInB); - initObject(createNative(rbA.getCPointer(), rbB.getCPointer(), btframeInA.getCPointer(), btframeInB.getCPointer()), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btFixedConstraint(*((btRigidBody*)rbAAddr), *((btRigidBody*)rbBAddr), *((btTransform*)frameInAAddr), *((btTransform*)frameInBAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btFixedConstraint(rbAAddr, rbBAddr, frameInAAddr, frameInBAddr); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rbAAddr, long rbBAddr, long frameInAAddr, long frameInBAddr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btFixedConstraint*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btFixedConstraint); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btGeneric6DofSpring2Constraint.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btGeneric6DofSpring2Constraint.java deleted file mode 100644 index 14349c3c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btGeneric6DofSpring2Constraint.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.physics.bullet.linearmath.btTransform; - -/** - * @author xpenatan - */ -public class btGeneric6DofSpring2Constraint extends btTypedConstraint { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.h" - */ - - private btTranslationalLimitMotor2 translationalLimitMotor2 = new btTranslationalLimitMotor2(); - private btRotationalLimitMotor2 rotationLimitMotor2X = new btRotationalLimitMotor2(); - private btRotationalLimitMotor2 rotationLimitMotor2Y = new btRotationalLimitMotor2(); - private btRotationalLimitMotor2 rotationLimitMotor2Z = new btRotationalLimitMotor2(); - - protected btGeneric6DofSpring2Constraint() { - } - - public btGeneric6DofSpring2Constraint(btRigidBody rbA, btRigidBody rbB, Matrix4 frameInA, Matrix4 frameInB) { - btTransform btframeInA = btTransform.TEMP_0; - btTransform btframeInB = btTransform.TEMP_1; - btTransform.convert(frameInA, btframeInA); - btTransform.convert(frameInB, btframeInB); - initObject(createNative(rbA.getCPointer(), rbB.getCPointer(), btframeInA.getCPointer(), btframeInB.getCPointer()), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btGeneric6DofSpring2Constraint(*((btRigidBody*)rbAAddr), *((btRigidBody*)rbBAddr), *((btTransform*)frameInAAddr), *((btTransform*)frameInBAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btGeneric6DofSpring2Constraint(rbAAddr, rbBAddr, frameInAAddr, frameInBAddr); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rbAAddr, long rbBAddr, long frameInAAddr, long frameInBAddr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btGeneric6DofSpring2Constraint*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btGeneric6DofSpring2Constraint); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public btRotationalLimitMotor2 getRotationalLimitMotor (int index) { - long pointer = getRotationalLimitMotorNATIVE(getCPointer(), index); - if(index == 0) { - rotationLimitMotor2X.setPointer(pointer); - return rotationLimitMotor2X; - } - else if(index == 1) { - rotationLimitMotor2Y.setPointer(pointer); - return rotationLimitMotor2Y; - } - else if(index == 2) { - rotationLimitMotor2Z.setPointer(pointer); - return rotationLimitMotor2Z; - } - return null; - } - - /*[-C++;-NATIVE] - btGeneric6DofSpring2Constraint* nativeObject = (btGeneric6DofSpring2Constraint*)addr; - btRotationalLimitMotor2 * returnObj = nativeObject->getRotationalLimitMotor(index); - return (jlong)returnObj; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btGeneric6DofSpring2Constraint); - var returnedJSObj = jsObj.getRotationalLimitMotor(index); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getRotationalLimitMotorNATIVE(long addr, long index); - - public btTranslationalLimitMotor2 getTranslationalLimitMotor () { - translationalLimitMotor2.setPointer(getTranslationalLimitMotorNATIVE(getCPointer())); - return translationalLimitMotor2; - } - - /*[-C++;-NATIVE] - btGeneric6DofSpring2Constraint* nativeObject = (btGeneric6DofSpring2Constraint*)addr; - btTranslationalLimitMotor2 * returnObj = nativeObject->getTranslationalLimitMotor(); - return (jlong)returnObj; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btGeneric6DofSpring2Constraint); - var returnedJSObj = jsObj.getTranslationalLimitMotor(); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getTranslationalLimitMotorNATIVE(long addr); - -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btHingeConstraint.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btHingeConstraint.java deleted file mode 100644 index 6445f8af..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btHingeConstraint.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btTransform; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btHingeConstraint extends btTypedConstraint { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btHingeConstraint.h" - */ - - public btHingeConstraint(btRigidBody rbA, Vector3 pivotInA, Vector3 axisInA) { - btVector3 btpivotInA = btVector3.TEMP_0; - btVector3 btaxisInA = btVector3.TEMP_1; - btVector3.convert(pivotInA, btpivotInA); - btVector3.convert(axisInA, btaxisInA); - initObject(createNative(rbA.getCPointer(), btpivotInA.getCPointer(), btaxisInA.getCPointer()), true); - } - - public btHingeConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame) { - this(rbA, rbB, rbAFrame, rbBFrame, false); - } - - public btHingeConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame, boolean useReferenceFrameA) { - btTransform btrbAFrame = btTransform.TEMP_0; - btTransform btrbBFrame = btTransform.TEMP_1; - btTransform.convert(rbAFrame, btrbAFrame); - btTransform.convert(rbBFrame, btrbBFrame); - initObject(createNative(rbA.getCPointer(), rbB.getCPointer(), btrbAFrame.getCPointer(), btrbBFrame.getCPointer(), useReferenceFrameA), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btHingeConstraint(*((btRigidBody*)rigidBodyAddr), *((btVector3*)pivotInAAddr), *((btVector3*)axisInAAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btHingeConstraint(rigidBodyAddr, pivotInAAddr, axisInAAddr, false); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rigidBodyAddr, long pivotInAAddr, long axisInAAddr); - - - /*[-C++;-NATIVE] - return (jlong)new btHingeConstraint(*((btRigidBody*)rbAAddr), *((btRigidBody*)rbBAddr), *((btTransform*)rbAFrameAddr), *((btTransform*)rbBFrameAddr), useReferenceFrameA); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btHingeConstraint(rbAAddr, rbBAddr, rbAFrameAddr, rbBFrameAddr, useReferenceFrameA); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rbAAddr, long rbBAddr, long rbAFrameAddr, long rbBFrameAddr, boolean useReferenceFrameA); - - /*[-C++;-NATIVE] - delete (btHingeConstraint*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btHingeConstraint); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btPoint2PointConstraint.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btPoint2PointConstraint.java deleted file mode 100644 index 354e8d2c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btPoint2PointConstraint.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -public class btPoint2PointConstraint extends btTypedConstraint { - - /*[-C++;-NATIVE] - #include "btBulletDynamicsCommon.h" - */ - - public btPoint2PointConstraint (btRigidBody rbA, btRigidBody rbB, Vector3 pivotInA, Vector3 pivotInB) { - btVector3 btPivotInA = btVector3.TEMP_0; - btVector3 btPivotInB= btVector3.TEMP_1; - btVector3.convert(pivotInA, btPivotInA); - btVector3.convert(pivotInB, btPivotInB); - initObject(createNative(rbA.getCPointer(), rbB.getCPointer(), btPivotInA.getCPointer(), btPivotInB.getCPointer()), true); - } - - public btPoint2PointConstraint (btRigidBody rbA, Vector3 pivotInA) { - btVector3 btPivotInA = btVector3.TEMP_0; - btVector3.convert(pivotInA, btPivotInA); - initObject(createNative(rbA.getCPointer(), btPivotInA.getCPointer()), true); - } - - /*[-C++;-NATIVE] - return (jlong)new btPoint2PointConstraint(*((btRigidBody*)rbAAddr), *((btRigidBody*)rbBAddr), *((btVector3*)pivotInAAddr), *((btVector3*)pivotInBAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btPoint2PointConstraint(rbAAddr, rbBAddr, pivotInAAddr, pivotInBAddr); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rbAAddr, long rbBAddr, long pivotInAAddr, long pivotInBAddr); - - /*[-C++;-NATIVE] - return (jlong)new btPoint2PointConstraint(*((btRigidBody*)rbAAddr), *((btVector3*)pivotInAAddr)); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btPoint2PointConstraint(rbAAddr, pivotInAAddr); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(long rbAAddr, long pivotInAAddr); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btPoint2PointConstraint*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btPoint2PointConstraint); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public btConstraintSetting getSetting () { - btConstraintSetting.WRAPPER_GEN_01.setPointer(getSettingNATIVE(getCPointer())); - return btConstraintSetting.WRAPPER_GEN_01; - } - - //TODO need to check if its working - - /*[-C++;-NATIVE] - btPoint2PointConstraint* nativeObject = (btPoint2PointConstraint*)addr; - return (jlong)&nativeObject->m_setting; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btPoint2PointConstraint); - return Bullet.getPointer(nativeObject.get_m_setting()); - */ - private static native long getSettingNATIVE(long addr); - - public void setSetting (btConstraintSetting value) { - setSettingNATIVE(getCPointer(), value.getCPointer()); - } - - /*[-C++;-NATIVE] - btPoint2PointConstraint* nativeObject = (btPoint2PointConstraint*)addr; - btConstraintSetting* settingsObject = (btConstraintSetting*)settingsAddr; - nativeObject->m_setting = *settingsObject; - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btPoint2PointConstraint); - nativeObject.set_m_setting(settingsAddr); - */ - private static native void setSettingNATIVE(long addr, long settingsAddr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRigidBody.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRigidBody.java deleted file mode 100644 index 86759f71..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRigidBody.java +++ /dev/null @@ -1,251 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Quaternion; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.collision.btCollisionObject; -import com.badlogic.gdx.physics.bullet.collision.btCollisionShape; -import com.badlogic.gdx.physics.bullet.linearmath.btMotionState; -import com.badlogic.gdx.physics.bullet.linearmath.btQuaternion; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -/** - * @author xpenatan - */ -public class btRigidBody extends btCollisionObject { - - public static btRigidBody WRAPPER_GEN_01 = new btRigidBody(false); - public static btRigidBody WRAPPER_GEN_02 = new btRigidBody(false); - - /*[-C++;-NATIVE] - #include "btBulletDynamicsCommon.h" - */ - - public btRigidBody(boolean cMemoryOwn) { - super(0); - } - - public btRigidBody(btRigidBodyConstructionInfo constructionInfo) { - super(0); - btVector3 out = new btVector3(); - btVector3.convert(constructionInfo.localInertia, out); - initObject(createNative(constructionInfo.mass, (int)constructionInfo.motionStateAddr, (int)constructionInfo.collisionShapeAddr, out.getCPointer()), true); - } - - public btRigidBody(float mass, btMotionState motionState, btCollisionShape collisionShape) { - super(0); - long motionStatePointer = motionState != null ? motionState.getCPointer() : 0; - long shapePointer = collisionShape != null ? collisionShape.getCPointer() : 0; - long aNative = createNative(mass, motionStatePointer, shapePointer); - initObject(aNative, true); - } - - public btRigidBody(float mass, btMotionState motionState, btCollisionShape collisionShape, Vector3 localInertia) { - super(0); - btVector3 out = new btVector3(); - btVector3.convert(localInertia != null ? localInertia : btVector3.TEMP_GDX_01.setZero(), out); - long motionStatePointer = motionState != null ? motionState.getCPointer() : 0; - long shapePointer = collisionShape != null ? collisionShape.getCPointer() : 0; - long aNative = createNative(mass, motionStatePointer, shapePointer, out.getCPointer()); - initObject(aNative, true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btRigidBody(mass, (btMotionState*)motionStateAddr, ((btCollisionShape*)collisionShapeAddr), *((btVector3*)localInertiaAddr)); - */ - /*[-teaVM;-NATIVE] - var motionStateJSObj = Bullet.wrapPointer(motionStateAddr, Bullet.btMotionState); - var collisionShapeJSObj = Bullet.wrapPointer(collisionShapeAddr, Bullet.btCollisionShape); - var localInertiaJSObj = Bullet.wrapPointer(localInertiaAddr, Bullet.btVector3); - var jsObj = new Bullet.btRigidBody(mass, motionStateJSObj, collisionShapeJSObj, localInertiaJSObj); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(float mass, long motionStateAddr, long collisionShapeAddr, long localInertiaAddr); - - /*[-C++;-NATIVE] - return (jlong)new btRigidBody(mass, (btMotionState*)motionStateAddr, ((btCollisionShape*)collisionShapeAddr)); - */ - /*[-teaVM;-NATIVE] - var motionStateJSObj = Bullet.wrapPointer(motionStateAddr, Bullet.btMotionState); - var collisionShapeJSObj = Bullet.wrapPointer(collisionShapeAddr, Bullet.btCollisionShape); - var jsObj = new Bullet.btRigidBody(mass, motionStateJSObj, collisionShapeJSObj); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(float mass, long motionStateAddr, long collisionShapeAddr); - - /*[-C++;-NATIVE] - delete (btRigidBody*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public Quaternion getOrientation() { - getOrientationNATIVE(cPointer, BulletBase.FLOAT_4); - btQuaternion.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2], BulletBase.FLOAT_4[3]); - return btQuaternion.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btRigidBody* nativeObject = (btRigidBody*)addr; - btQuaternion quat = nativeObject->getOrientation(); - array[0] = quat.getX(); - array[1] = quat.getY(); - array[2] = quat.getZ(); - array[3] = quat.getW(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btRigidBody); - var quat = nativeObject.getOrientation(); - array[0] = quat.getX(); - array[1] = quat.getY(); - array[2] = quat.getZ(); - array[3] = quat.getW(); - */ - private static native void getOrientationNATIVE(long addr, float [] array); - - public Vector3 getVelocityInLocalPoint(Vector3 relPos) { - btVector3.convert(relPos, btVector3.TEMP_0); - return getVelocityInLocalPoint(btVector3.TEMP_0); - } - - public Vector3 getVelocityInLocalPoint(btVector3 relPos) { - getVelocityInLocalPointNATIVE(cPointer, relPos.getCPointer(), BulletBase.FLOAT_4); - btVector3.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2]); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btRigidBody* nativeObject = (btRigidBody*)addr; - btVector3 & relPos = *((btVector3*)relPosAddr); - btVector3 vec3 = nativeObject->getVelocityInLocalPoint(relPos); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btRigidBody); - var relPos = Bullet.wrapPointer(addr, Bullet.btVector3); - var vec3 = nativeObject.getVelocityInLocalPoint(relPos); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - private static native void getVelocityInLocalPointNATIVE(long addr, long relPosAddr, float [] array); - - public Vector3 computeGyroscopicImpulseImplicit_World(float dt) { - computeGyroscopicImpulseImplicit_WorldNATIVE(cPointer, dt, BulletBase.FLOAT_4); - btVector3.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2]); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btRigidBody* nativeObject = (btRigidBody*)addr; - btVector3 vec3 = nativeObject->computeGyroscopicImpulseImplicit_World(dt); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btRigidBody); - var vec3 = nativeObject.computeGyroscopicImpulseImplicit_World(dt); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - private static native void computeGyroscopicImpulseImplicit_WorldNATIVE(long addr, float dt, float [] array); - - public Vector3 computeGyroscopicImpulseImplicit_Body(float step) { - computeGyroscopicImpulseImplicit_BodyNATIVE(cPointer, step, BulletBase.FLOAT_4); - btVector3.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2]); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btRigidBody* nativeObject = (btRigidBody*)addr; - btVector3 vec3 = nativeObject->computeGyroscopicImpulseImplicit_Body(step); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btRigidBody); - var vec3 = nativeObject.computeGyroscopicImpulseImplicit_Body(step); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - private static native void computeGyroscopicImpulseImplicit_BodyNATIVE(long addr, float step, float [] array); - - public Vector3 computeGyroscopicForceExplicit(float maxGyroscopicForce) { - computeGyroscopicForceExplicitNATIVE(cPointer, maxGyroscopicForce, BulletBase.FLOAT_4); - btVector3.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2]); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btRigidBody* nativeObject = (btRigidBody*)addr; - btVector3 vec3 = nativeObject->computeGyroscopicForceExplicit(maxGyroscopicForce); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btRigidBody); - var vec3 = nativeObject.computeGyroscopicForceExplicit(maxGyroscopicForce); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - private static native void computeGyroscopicForceExplicitNATIVE(long addr, float maxGyroscopicForce, float [] array); - - public Vector3 getLocalInertia() { - getLocalInertiaNATIVE(cPointer, BulletBase.FLOAT_4); - btVector3.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2]); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btRigidBody* nativeObject = (btRigidBody*)addr; - btVector3 vec3 = nativeObject->getLocalInertia(); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btRigidBody); - var vec3 = nativeObject.getLocalInertia(); - array[0] = vec3.getX(); - array[1] = vec3.getY(); - array[2] = vec3.getZ(); - */ - private static native void getLocalInertiaNATIVE(long addr, float [] array); - - static public class btRigidBodyConstructionInfo extends BulletBase { - - public float mass; - public long motionStateAddr; - public long collisionShapeAddr; - public Vector3 localInertia = new Vector3(); - - public btRigidBodyConstructionInfo(float mass, btMotionState motionState, btCollisionShape collisionShape, Vector3 localInertia) { - this.mass = mass; - this.motionStateAddr = motionState != null ? motionState.getCPointer() : 0; - this.collisionShapeAddr = collisionShape != null ? collisionShape.getCPointer() : 0; - this.localInertia.set(localInertia); - } - - public btRigidBodyConstructionInfo(float mass, btMotionState motionState, btCollisionShape collisionShape) { - this.mass = mass; - this.motionStateAddr = motionState != null ? motionState.getCPointer() : 0; - this.collisionShapeAddr = collisionShape != null ? collisionShape.getCPointer() : 0; - } - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRotationalLimitMotor2.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRotationalLimitMotor2.java deleted file mode 100644 index f3bf63e7..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btRotationalLimitMotor2.java +++ /dev/null @@ -1,518 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -public class btRotationalLimitMotor2 extends BulletBase { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.h" - */ - - protected btRotationalLimitMotor2() { - } - - public void setLoLimit (float value) { - setLoLimitNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_loLimit = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_loLimit(value); - */ - private static native void setLoLimitNATIVE(long addr, float value); - - public float getLoLimit () { - return getLoLimitNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_loLimit; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_loLimit(); - */ - private static native float getLoLimitNATIVE(long addr); - - public void setHiLimit (float value) { - setHiLimitNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_hiLimit = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_hiLimit(value); - */ - private static native void setHiLimitNATIVE(long addr, float value); - - public float getHiLimit () { - return getHiLimitNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_hiLimit; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_hiLimit(); - */ - private static native float getHiLimitNATIVE(long addr); - - public void setBounce (float value) { - setBounceNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_bounce = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_bounce(value); - */ - private static native void setBounceNATIVE(long addr, float value); - - public float getBounce () { - return getBounceNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_bounce; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_bounce(); - */ - private static native float getBounceNATIVE(long addr); - - public void setStopERP (float value) { - setStopERPNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_stopERP = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_stopERP(value); - */ - private static native void setStopERPNATIVE(long addr, float value); - - public float getStopERP () { - return getStopERPNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_stopERP; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_stopERP(); - */ - private static native float getStopERPNATIVE(long addr); - - public void setStopCFM (float value) { - setStopCFMNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_stopCFM = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_stopCFM(value); - */ - private static native void setStopCFMNATIVE(long addr, float value); - - public float getStopCFM () { - return getStopCFMNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_stopCFM; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_stopCFM(); - */ - private static native float getStopCFMNATIVE(long addr); - - public void setMotorERP (float value) { - setStopCFMNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_motorERP = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_motorERP(value); - */ - private static native void setMotorERPNATIVE(long addr, float value); - - public float getMotorERP () { - return getMotorERPNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_motorERP; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_motorERP(); - */ - private static native float getMotorERPNATIVE(long addr); - - public void setMotorCFM (float value) { - setMotorCFMNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_motorCFM = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_motorCFM(value); - */ - private static native void setMotorCFMNATIVE(long addr, float value); - - public float getMotorCFM () { - return getMotorCFMNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_motorCFM; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_motorCFM(); - */ - private static native float getMotorCFMNATIVE(long addr); - - public void setEnableMotor (boolean value) { - setEnableMotorNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_enableMotor = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_enableMotor(value); - */ - private static native void setEnableMotorNATIVE(long addr, boolean value); - - public boolean getEnableMotor () { - return getEnableMotorNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_enableMotor; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_enableMotor(); - */ - private static native boolean getEnableMotorNATIVE(long addr); - - public void setTargetVelocity (float value) { - setTargetVelocityNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_targetVelocity = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_targetVelocity(value); - */ - private static native void setTargetVelocityNATIVE(long addr, float value); - - public float getTargetVelocity () { - return getTargetVelocityNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_targetVelocity; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_targetVelocity(); - */ - private static native float getTargetVelocityNATIVE(long addr); - - public void setMaxMotorForce (float value) { - setMaxMotorForceNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_maxMotorForce = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_maxMotorForce(value); - */ - private static native void setMaxMotorForceNATIVE(long addr, float value); - - public float getMaxMotorForce () { - return getMaxMotorForceNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_maxMotorForce; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_maxMotorForce(); - */ - private static native float getMaxMotorForceNATIVE(long addr); - - public void setServoMotor (boolean value) { - setServoMotorNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_servoMotor = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_servoMotor(value); - */ - private static native void setServoMotorNATIVE(long addr, boolean value); - - public boolean getServoMotor () { - return getServoMotorNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_servoMotor; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_servoMotor(); - */ - private static native boolean getServoMotorNATIVE(long addr); - - public void setServoTarget (float value) { - setServoTargetNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_servoTarget = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_servoTarget(value); - */ - private static native void setServoTargetNATIVE(long addr, float value); - - public float getServoTarget () { - return getServoTargetNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_servoTarget; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_servoTarget(); - */ - private static native float getServoTargetNATIVE(long addr); - - public void setEnableSpring (boolean value) { - setEnableSpringNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_enableSpring = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_enableSpring(value); - */ - private static native void setEnableSpringNATIVE(long addr, boolean value); - - public boolean getEnableSpring () { - return getEnableSpringNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_enableSpring; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_enableSpring(); - */ - private static native boolean getEnableSpringNATIVE(long addr); - - public void setSpringStiffness (float value) { - setSpringStiffnessNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_springStiffness = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_springStiffness(value); - */ - private static native void setSpringStiffnessNATIVE(long addr, float value); - - public float getSpringStiffness () { - return getSpringStiffnessNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_springStiffness; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_springStiffness(); - */ - private static native float getSpringStiffnessNATIVE(long addr); - - public void setSpringStiffnessLimited (boolean value) { - setSpringStiffnessLimitedNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_springStiffnessLimited = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_springStiffnessLimited(value); - */ - private static native void setSpringStiffnessLimitedNATIVE(long addr, boolean value); - - public boolean getSpringStiffnessLimited () { - return getSpringStiffnessLimitedNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_springStiffnessLimited; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_springStiffnessLimited(); - */ - private static native boolean getSpringStiffnessLimitedNATIVE(long addr); - - public void setSpringDamping (float value) { - setSpringDampingNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_springDamping = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_springDamping(value); - */ - private static native void setSpringDampingNATIVE(long addr, float value); - - public float getSpringDamping () { - return getSpringDampingNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_springDamping; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_springDamping(); - */ - private static native float getSpringDampingNATIVE(long addr); - - public void setSpringDampingLimited (boolean value) { - setSpringDampingLimitedNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_springDampingLimited = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_springDampingLimited(value); - */ - private static native void setSpringDampingLimitedNATIVE(long addr, boolean value); - - public boolean getSpringDampingLimited () { - return getSpringDampingLimitedNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_springDampingLimited; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_springDampingLimited(); - */ - private static native boolean getSpringDampingLimitedNATIVE(long addr); - - public void setEquilibriumPoint (float value) { - setEquilibriumPointNATIVE(getCPointer(), value); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - nativeObject->m_equilibriumPoint = value; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - jsObj.set_m_equilibriumPoint(value); - */ - private static native void setEquilibriumPointNATIVE(long addr, float value); - - public float getEquilibriumPoint () { - return getEquilibriumPointNATIVE(getCPointer()); - } - - /*[-C++;-NATIVE] - btRotationalLimitMotor2* nativeObject = (btRotationalLimitMotor2*)addr; - return nativeObject->m_equilibriumPoint; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btRotationalLimitMotor2); - return jsObj.get_m_equilibriumPoint(); - */ - private static native float getEquilibriumPointNATIVE(long addr); - -} diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btSequentialImpulseConstraintSolver.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btSequentialImpulseConstraintSolver.java deleted file mode 100644 index a3eae9fa..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btSequentialImpulseConstraintSolver.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -/** - * @author xpenatan - */ -public class btSequentialImpulseConstraintSolver extends btConstraintSolver { - - /*[-C++;-NATIVE] - #include "btBulletDynamicsCommon.h" - */ - - public btSequentialImpulseConstraintSolver() { - initObject(createNative(), true); - } - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - return (jlong)new btSequentialImpulseConstraintSolver(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btSequentialImpulseConstraintSolver(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - /*[-C++;-NATIVE] - delete (btSequentialImpulseConstraintSolver*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btSequentialImpulseConstraintSolver); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTranslationalLimitMotor2.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTranslationalLimitMotor2.java deleted file mode 100644 index 56990ae0..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTranslationalLimitMotor2.java +++ /dev/null @@ -1,618 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.Bullet; -import com.badlogic.gdx.physics.bullet.BulletBase; -import com.badlogic.gdx.physics.bullet.linearmath.btVector3; - -public class btTranslationalLimitMotor2 extends BulletBase { - - private boolean [] tempBoolean = new boolean[3]; - private byte [] tempByte = new byte[3]; - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.h" - */ - - protected btTranslationalLimitMotor2() { - } - - public void setLowerLimit(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setLowerLimitNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_lowerLimit = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_lowerLimit(valueAddr); - */ - private static native void setLowerLimitNATIVE(long addr, long valueAddr); - - public Vector3 getLowerLimit() { - btVector3.convert(getLowerLimitNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_lowerLimit; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_lowerLimit()); - */ - private static native long getLowerLimitNATIVE(long addr); - - public void setUpperLimit(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setUpperLimitNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_upperLimit = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_upperLimit(valueAddr); - */ - private static native void setUpperLimitNATIVE(long addr, long valueAddr); - - public Vector3 getUpperLimit() { - btVector3.convert(getUpperLimitNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_upperLimit; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_upperLimit()); - */ - private static native long getUpperLimitNATIVE(long addr); - - public void setBounce(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setBounceNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_bounce = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_bounce(valueAddr); - */ - private static native void setBounceNATIVE(long addr, long valueAddr); - - public Vector3 getBounce() { - btVector3.convert(getBounceNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_bounce; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_bounce()); - */ - private static native long getBounceNATIVE(long addr); - - public void setStopERP(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setStopERPNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_stopERP = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_stopERP(valueAddr); - */ - private static native void setStopERPNATIVE(long addr, long valueAddr); - - public Vector3 getStopERP() { - btVector3.convert(getStopERPNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_stopERP; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_stopERP()); - */ - private static native long getStopERPNATIVE(long addr); - - public void setStopCFM(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setStopCFMNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_stopCFM = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_stopCFM(valueAddr); - */ - private static native void setStopCFMNATIVE(long addr, long valueAddr); - - public Vector3 getStopCFM() { - btVector3.convert(getStopCFMNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_stopCFM; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_stopCFM()); - */ - private static native long getStopCFMNATIVE(long addr); - - public void setMotorERP(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setMotorERPNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_motorERP = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_motorERP(valueAddr); - */ - private static native void setMotorERPNATIVE(long addr, long valueAddr); - - public Vector3 getMotorERP() { - btVector3.convert(getMotorERPNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_motorERP; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_motorERP()); - */ - private static native long getMotorERPNATIVE(long addr); - - public void setMotorCFM(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setMotorCFMNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_motorCFM = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_motorCFM(valueAddr); - */ - private static native void setMotorCFMNATIVE(long addr, long valueAddr); - - public Vector3 getMotorCFM() { - btVector3.convert(getMotorCFMNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_motorCFM; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_motorCFM()); - */ - private static native long getMotorCFMNATIVE(long addr); - - public void setEnableMotor(boolean[] value) { - Bullet.set(tempBoolean, tempByte); - setEnableMotorNATIVE(getCPointer(), tempByte); - } - - //TODO test javascript enable motor - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_enableMotor[0] = value[0]; - nativeObject->m_enableMotor[1] = value[1]; - nativeObject->m_enableMotor[2] = value[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var array = jsObj.get_m_enableMotor(); - array[0] = value[0]; - array[1] = value[1]; - array[2] = value[2]; - */ - private static native void setEnableMotorNATIVE(long addr, byte[] value); - - public boolean[] getEnableMotor() { - getEnableMotorNATIVE(getCPointer(), tempByte); - Bullet.set(tempByte, tempBoolean); - return tempBoolean; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - value[0] = nativeObject->m_enableMotor[0]; - value[1] = nativeObject->m_enableMotor[1]; - value[2] = nativeObject->m_enableMotor[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var boolArray = jsObj.get_m_enableMotor(); - value[0] = boolArray[0]; - value[1] = boolArray[1]; - value[2] = boolArray[2]; - */ - private static native void getEnableMotorNATIVE(long addr, byte[] value); - - public void setServoMotor(boolean[] value) { - Bullet.set(value, tempByte); - setServoMotorNATIVE(getCPointer(), tempByte); - } - - //TODO test javascript enable motor - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_servoMotor[0] = value[0]; - nativeObject->m_servoMotor[1] = value[1]; - nativeObject->m_servoMotor[2] = value[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var array = jsObj.get_m_servoMotor(); - array[0] = value[0]; - array[1] = value[1]; - array[2] = value[2]; - */ - private static native void setServoMotorNATIVE(long addr, byte[] value); - - public boolean[] getServoMotor() { - getServoMotorNATIVE(getCPointer(), tempByte); - Bullet.set(tempByte, tempBoolean); - return tempBoolean; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - value[0] = nativeObject->m_servoMotor[0]; - value[1] = nativeObject->m_servoMotor[1]; - value[2] = nativeObject->m_servoMotor[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var boolArray = jsObj.get_m_servoMotor(); - value[0] = boolArray[0]; - value[1] = boolArray[1]; - value[2] = boolArray[2]; - */ - private static native void getServoMotorNATIVE(long addr, byte[] value); - - public void setEnableSpring(boolean[] value) { - Bullet.set(value, tempByte); - setEnableSpringNATIVE(getCPointer(), tempByte); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_enableSpring[0] = value[0]; - nativeObject->m_enableSpring[1] = value[1]; - nativeObject->m_enableSpring[2] = value[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var array = jsObj.get_m_enableSpring(); - array[0] = value[0]; - array[1] = value[1]; - array[2] = value[2]; - */ - private static native void setEnableSpringNATIVE(long addr, byte[] value); - - public boolean[] getEnableSpring() { - getEnableSpringNATIVE(getCPointer(), tempByte); - Bullet.set(tempByte, tempBoolean); - return tempBoolean; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - value[0] = nativeObject->m_enableSpring[0]; - value[1] = nativeObject->m_enableSpring[1]; - value[2] = nativeObject->m_enableSpring[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var boolArray = jsObj.get_m_enableSpring(); - value[0] = boolArray[0]; - value[1] = boolArray[1]; - value[2] = boolArray[2]; - */ - private static native void getEnableSpringNATIVE(long addr, byte[] value); - - public void setServoTarget(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setServoTargetNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_servoTarget = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_servoTarget(valueAddr); - */ - private static native void setServoTargetNATIVE(long addr, long valueAddr); - - public Vector3 getServoTarget() { - btVector3.convert(getServoTargetNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_servoTarget; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_servoTarget()); - */ - private static native long getServoTargetNATIVE(long addr); - - public void setSpringStiffness(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setSpringStiffnessNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_springStiffness = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_springStiffness(valueAddr); - */ - private static native void setSpringStiffnessNATIVE(long addr, long valueAddr); - - public Vector3 getSpringStiffness() { - btVector3.convert(getSpringStiffnessTargetNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_springStiffness; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_springStiffness()); - */ - private static native long getSpringStiffnessTargetNATIVE(long addr); - - public void setSpringStiffnessLimited(boolean[] value) { - Bullet.set(value, tempByte); - setSpringStiffnessLimitedNATIVE(getCPointer(), tempByte); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_springStiffnessLimited[0] = value[0]; - nativeObject->m_springStiffnessLimited[1] = value[1]; - nativeObject->m_springStiffnessLimited[2] = value[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var array = jsObj.get_m_springStiffnessLimited(); - array[0] = value[0]; - array[1] = value[1]; - array[2] = value[2]; - */ - private static native void setSpringStiffnessLimitedNATIVE(long addr, byte[] value); - - public boolean[] getSpringStiffnessLimited() { - getSpringStiffnessLimitedNATIVE(getCPointer(), tempByte); - Bullet.set(tempByte, tempBoolean); - return tempBoolean; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - value[0] = nativeObject->m_springStiffnessLimited[0]; - value[1] = nativeObject->m_springStiffnessLimited[1]; - value[2] = nativeObject->m_springStiffnessLimited[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var boolArray = jsObj.get_m_springStiffnessLimited(); - value[0] = boolArray[0]; - value[1] = boolArray[1]; - value[2] = boolArray[2]; - */ - private static native void getSpringStiffnessLimitedNATIVE(long addr, byte[] value); - - public void setSpringDamping(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setSpringDampingNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_springDamping = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_springDamping(valueAddr); - */ - private static native void setSpringDampingNATIVE(long addr, long valueAddr); - - public Vector3 getSpringDamping() { - btVector3.convert(getSpringDampingNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_springDamping; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_springDamping()); - */ - private static native long getSpringDampingNATIVE(long addr); - - public void setSpringDampingLimited(boolean[] value) { - Bullet.set(value, tempByte); - setSpringDampingLimitedNATIVE(getCPointer(), tempByte); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_springDampingLimited[0] = value[0]; - nativeObject->m_springDampingLimited[1] = value[1]; - nativeObject->m_springDampingLimited[2] = value[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var array = jsObj.get_m_springDampingLimited(); - array[0] = value[0]; - array[1] = value[1]; - array[2] = value[2]; - */ - private static native void setSpringDampingLimitedNATIVE(long addr, byte[] value); - - public boolean[] getSpringDampingLimited() { - getSpringDampingLimitedNATIVE(getCPointer(), tempByte); - Bullet.set(tempByte, tempBoolean); - return tempBoolean; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - value[0] = nativeObject->m_springDampingLimited[0]; - value[1] = nativeObject->m_springDampingLimited[1]; - value[2] = nativeObject->m_springDampingLimited[2]; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - var boolArray = jsObj.get_m_springDampingLimited(); - value[0] = boolArray[0]; - value[1] = boolArray[1]; - value[2] = boolArray[2]; - */ - private static native void getSpringDampingLimitedNATIVE(long addr, byte[] value); - - public void setEquilibriumPoint(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setEquilibriumPointNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_equilibriumPoint = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_equilibriumPoint(valueAddr); - */ - private static native void setEquilibriumPointNATIVE(long addr, long valueAddr); - - public Vector3 getEquilibriumPoint() { - btVector3.convert(getEquilibriumPointNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_equilibriumPoint; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_equilibriumPoint()); - */ - private static native long getEquilibriumPointNATIVE(long addr); - - public void setTargetVelocity(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setTargetVelocityNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_targetVelocity = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_targetVelocity(valueAddr); - */ - private static native void setTargetVelocityNATIVE(long addr, long valueAddr); - - public Vector3 getTargetVelocity() { - btVector3.convert(getTargetVelocityNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_targetVelocity; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_targetVelocity()); - */ - private static native long getTargetVelocityNATIVE(long addr); - - public void setMaxMotorForce(Vector3 value) { - btVector3.convert(value, btVector3.TEMP_0); - setMaxMotorForceNATIVE(getCPointer(), btVector3.TEMP_0.getCPointer()); - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - nativeObject->m_maxMotorForce = *((btVector3*)valueAddr); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - jsObj.set_m_maxMotorForce(valueAddr); - */ - private static native void setMaxMotorForceNATIVE(long addr, long valueAddr); - - public Vector3 getMaxMotorForce() { - btVector3.convert(getMaxMotorForceNATIVE(getCPointer()), btVector3.TEMP_GDX_01); - return btVector3.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTranslationalLimitMotor2* nativeObject = (btTranslationalLimitMotor2*)addr; - return (jlong)&nativeObject->m_maxMotorForce; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTranslationalLimitMotor2); - return Bullet.getPointer(jsObj.get_m_maxMotorForce()); - */ - private static native long getMaxMotorForceNATIVE(long addr); -} diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTypedConstraint.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTypedConstraint.java deleted file mode 100644 index e7935225..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/dynamics/btTypedConstraint.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.badlogic.gdx.physics.bullet.dynamics; - -import com.badlogic.gdx.physics.bullet.linearmath.btTypedObject; - -/** - * @author xpenatan - */ -public class btTypedConstraint extends btTypedObject { - - /*[-C++;-NATIVE] - #include "BulletDynamics/ConstraintSolver/btHingeConstraint.h" - */ - - public static btTypedConstraint WRAPPER_GEN_01 = new btTypedConstraint(false); - - protected btTypedConstraint() { - } - - protected btTypedConstraint(boolean cMemoryOwn) { - } - - public btRigidBody getRigidBodyA() { - btRigidBody.WRAPPER_GEN_01.setPointer(getRigidBodyANATIVE(cPointer)); - return btRigidBody.WRAPPER_GEN_01; - } - - /*[-C++;-NATIVE] - btTypedConstraint* nativeObject = (btTypedConstraint*)addr; - btRigidBody & body = nativeObject->getRigidBodyA(); - return (jlong)&body; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTypedConstraint); - var returnedJSObj = jsObj.getRigidBodyA(); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getRigidBodyANATIVE(long addr); - - public btRigidBody getRigidBodyB() { - btRigidBody.WRAPPER_GEN_02.setPointer(getRigidBodyBNATIVE(cPointer)); - return btRigidBody.WRAPPER_GEN_02; - } - - /*[-C++;-NATIVE] - btTypedConstraint* nativeObject = (btTypedConstraint*)addr; - btRigidBody & body = nativeObject->getRigidBodyB(); - return (jlong)&body; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTypedConstraint); - var returnedJSObj = jsObj.getRigidBodyB(); - return Bullet.getPointer(returnedJSObj); - */ - private static native long getRigidBodyBNATIVE(long addr); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMath.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMath.java deleted file mode 100644 index aeff5ac7..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMath.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -/** - * @author xpenatan - */ -public class LinearMath { - - /*[-C++;-NATIVE] - #include "LinearMath/btScalar.h" - */ - - /* [-C++;-NATIVE] - return btGetVersion(); - */ - /* [-teaVM;-NATIVE] - return Bullet.MyClassHelper.prototype.getBTVersion(); - */ - public static native int btGetVersion(); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMathConstants.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMathConstants.java deleted file mode 100644 index 0d51042c..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/LinearMathConstants.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -/** - * @author xpenatan - */ -public interface LinearMathConstants { - public final static int BT_BULLET_VERSION = 320; - public final static double BT_LARGE_FLOAT = 1e18; - public final static double BT_ONE = 1.0; - public final static double BT_ZERO = 0.0; - public final static double BT_TWO = 2.0; - public final static double BT_HALF = 0.5; - public final static String btVector3DataName = "btVector3FloatData"; - public final static String btQuaternionDataName = "btQuaternionFloatData"; - public final static int USE_BANCHLESS = 1; - public final static int BT_USE_PLACEMENT_NEW = 1; -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/VoidPtr.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/VoidPtr.java deleted file mode 100644 index 51012da7..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/VoidPtr.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -/** - * @author xpenatan - */ -public class VoidPtr { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btDefaultMotionState.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btDefaultMotionState.java deleted file mode 100644 index a0f34c88..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btDefaultMotionState.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.math.Matrix4; - -/** - * @author xpenatan - */ -public class btDefaultMotionState extends btMotionState { - - /*[-C++;-NATIVE] - #include "LinearMath/btDefaultMotionState.h" - */ - - private Matrix4 worldTrans; - - public btDefaultMotionState() { - this(new Matrix4()); - } - - public btDefaultMotionState(Matrix4 renderTrans) { - worldTrans = renderTrans; - } - - @Override - public void getWorldTransform(Matrix4 centerOfMassWorldTrans) { - centerOfMassWorldTrans.set(this.worldTrans); - } - - ///synchronizes world transform from physics to user - ///Bullet only calls the update of worldtransform for active objects - public void setWorldTransform(Matrix4 centerOfMassWorldTrans) { - this.worldTrans.set(centerOfMassWorldTrans); - } - - @Override - protected void deleteNative() { - - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btIDebugDraw.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btIDebugDraw.java deleted file mode 100644 index 143bb4b7..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btIDebugDraw.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btIDebugDraw extends BulletBase { - - /*[-C++;-NATIVE] - #include "btBulletCollisionCommon.h" - */ - - /*[-C++;-NATIVE] - static jclass debugClass = 0; - static jmethodID drawLineID = 0; - static jmethodID getDebugModeID = 0; - - class MyDebugDrawer : public btIDebugDraw - { - private: - JNIEnv* env; - jobject obj; - DefaultColors m_ourColors; - public: - - MyDebugDrawer( JNIEnv* env, jobject obj ) - { - this->env = env; - this->obj = obj; - } - - virtual ~MyDebugDrawer() - { - } - - virtual DefaultColors getDefaultColors() const - { - return m_ourColors; - } - - ///the default implementation for setDefaultColors has no effect. A derived class can implement it and store the colors. - virtual void setDefaultColors(const DefaultColors& colors) - { - } - - virtual void drawLine(const btVector3& from1, const btVector3& to1, const btVector3& color1) - { - env->CallVoidMethod(obj, drawLineID, (jlong)&from1, (jlong)&to1, (jlong)&color1); - } - - virtual void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color) - { - } - - virtual void reportErrorWarning(const char* warningString) - { - } - - virtual void draw3dText(const btVector3& location, const char* textString) - { - } - - virtual void setDebugMode(int debugMode) - { - } - - virtual int getDebugMode() const - { - return env->CallIntMethod(obj, getDebugModeID); - } - - virtual void flushLines() - { - } - }; - */ - - private final Vector3 tempVec01 = new Vector3(); - private final Vector3 tempVec02 = new Vector3(); - private final Vector3 tempVec03 = new Vector3(); - - public btIDebugDraw() { - initJavaObject(); - } - - /*[-teaVM;-ADD] - @org.teavm.jso.JSFunctor - public interface DrawLineFunction extends org.teavm.jso.JSObject { - void drawLineJS(int vec3FromAddr, int vec3ToAddr, int vec3ColorAddr); - } - */ - /*[-teaVM;-ADD] - @org.teavm.jso.JSFunctor - public interface DrawContactPointFunction extends org.teavm.jso.JSObject { - void drawContactPointJS(int vec3PointOnBAddr,int vec3NormalOnBAddr, float distanceAddr, int lifeTimeAddr, int vec3ColorAddr); - } - */ - /*[-teaVM;-ADD] - @org.teavm.jso.JSFunctor - public interface GetDebugFunction extends org.teavm.jso.JSObject { - int getDebugFunctionJS(); - } - */ - - /*[-teaVM;-REPLACE] - private void initJavaObject() { - DrawLineFunction drawLineFunction = new DrawLineFunction() { - @Override - public void drawLineJS(int vec3FromAddr, int vec3ToAddr, int vec3ColorAddr) { - btVector3.convert(vec3FromAddr, tempVec01); - btVector3.convert(vec3ToAddr, tempVec02); - btVector3.convert(vec3ColorAddr, tempVec03); - drawLine(tempVec01, tempVec02, tempVec03); - } - }; - DrawContactPointFunction drawContactPointFunction = new DrawContactPointFunction() { - @Override - public void drawContactPointJS(int vec3PointOnBAddr, int vec3NormalOnBAddr, float distance, int lifeTime, int vec3ColorAddr) { - btVector3.convert(vec3PointOnBAddr, tempVec01); - btVector3.convert(vec3NormalOnBAddr, tempVec02); - btVector3.convert(vec3ColorAddr, tempVec03); - drawContactPoint(tempVec01, tempVec02, distance, lifeTime, tempVec03); - } - }; - GetDebugFunction getDebugFunction = new GetDebugFunction() { - @Override - public int getDebugFunctionJS() { - return getDebugMode(); - } - }; - int pointer = createNative(drawLineFunction, drawContactPointFunction, getDebugFunction); - initObject(pointer, true); - } - */ - private void initJavaObject() { - initObject(createNative(), true); - } - - /*[-C++;-NATIVE] - if(debugClass == 0) { - debugClass = (jclass)env->NewGlobalRef(env->GetObjectClass(object)); - drawLineID = env->GetMethodID(debugClass, "drawLine", "(JJJ)V"); - getDebugModeID = env->GetMethodID(debugClass, "getDebugMode", "()I"); - } - return (jlong)new MyDebugDrawer(env, env->NewGlobalRef(object)); - */ - /*[-teaVM;-REPLACE] - @org.teavm.jso.JSBody(params = { "drawLineFunction", "drawContactPointFunction", "getDebugFunction" }, script = "var callback = new Bullet.MyDebugDraw(); callback.drawLine = drawLineFunction; callback.drawContactPoint = drawContactPointFunction; callback.getDebugMode = getDebugFunction; return Bullet.getPointer(callback);") - private static native int createNative(DrawLineFunction drawLineFunction, DrawContactPointFunction drawContactPointFunction, GetDebugFunction getDebugFunction); - */ - private native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (MyDebugDrawer*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyDebugDraw); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public void drawLine(Vector3 from, Vector3 to, Vector3 color) { - } - - private void drawLine(long fromAddr, long toAddr, long colorAddr) { - btVector3.convert(fromAddr, btVector3.TEMP_GDX_01); - btVector3.convert(toAddr, btVector3.TEMP_GDX_02); - btVector3.convert(colorAddr, btVector3.TEMP_GDX_03); - drawLine(btVector3.TEMP_GDX_01, btVector3.TEMP_GDX_02, btVector3.TEMP_GDX_03); - } - - public void drawContactPoint(Vector3 pointOnB, Vector3 normalOnB, float distance, int lifeTime, Vector3 color) { - } - - public void reportErrorWarning(String warningString) { - //FIXME not impl - } - - public void draw3dText(Vector3 location, String textString) { - //FIXME not impl - } - - public void setDebugMode(int debugMode) { - } - - public int getDebugMode() { - return 0; - } - - public static final class DebugDrawModes { - public static final int DBG_NoDebug = 0; - public static final int DBG_DrawWireframe = 1; - public static final int DBG_DrawAabb = 2; - public static final int DBG_DrawFeaturesText = 4; - public static final int DBG_DrawContactPoints = 8; - public static final int DBG_NoDeactivation = 16; - public static final int DBG_NoHelpText = 32; - public static final int DBG_DrawText = 64; - public static final int DBG_ProfileTimings = 128; - public static final int DBG_EnableSatComparison = 256; - public static final int DBG_DisableBulletLCP = 512; - public static final int DBG_EnableCCD = 1024; - public static final int DBG_DrawConstraints = (1 << 11); - public static final int DBG_DrawConstraintLimits = (1 << 12); - public static final int DBG_FastWireframe = (1 << 13); - public static final int DBG_DrawNormals = (1 << 14); - public static final int DBG_DrawFrames = (1 << 15); - public static final int DBG_MAX_DEBUG_DRAW_MODE = DBG_DrawFrames + 1; - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMatrix3x3.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMatrix3x3.java deleted file mode 100644 index 18f0ce9d..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMatrix3x3.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btMatrix3x3 extends BulletBase { - - /*[-C++;-NATIVE] - #include "LinearMath/btMatrix3x3.h" - */ - - public static btMatrix3x3 WRAPPER_GEN_01 = new btMatrix3x3(false); - - public btMatrix3x3() { - this(true); - } - - /** - * Useful on creating temp objects - */ - public btMatrix3x3(boolean cMemoryOwn) { - initObject(cMemoryOwn ? createNative() : 0, cMemoryOwn); - } - - /*[-C++;-NATIVE] - return (jlong)new btMatrix3x3(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btMatrix3x3(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btMatrix3x3*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btMatrix3x3); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - /*[-IDL_SKIP] - */ - public static native btVector3 getRow(int i); - - /*[-IDL_SKIP] - */ - public static native btVector3 getColumn(int i); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMotionState.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMotionState.java deleted file mode 100644 index 6c030127..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btMotionState.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btMotionState extends BulletBase { - - /*[-C++;-NATIVE] - #include "LinearMath/btMotionState.h" - */ - - /*[-C++;-NATIVE] - static jclass motionClass = 0; - static jmethodID getWorldTransformID = 0; - static jmethodID setWorldTransformID = 0; - - class CustomMotionState : public btMotionState - { - - private: - JNIEnv* env; - jobject obj; - - public: - CustomMotionState( JNIEnv* env, jobject obj ) - { - this->env = env; - this->obj = obj; - } - - virtual void getWorldTransform(btTransform & centerOfMassWorldTrans) const - { - env->CallVoidMethod(obj, getWorldTransformID, (jlong)¢erOfMassWorldTrans); - } - - virtual void setWorldTransform(const btTransform& centerOfMassWorldTrans) - { - env->CallVoidMethod(obj, setWorldTransformID, (jlong)¢erOfMassWorldTrans); - } - }; - - */ - - Matrix4 tempMat = new Matrix4(); - - public static btMotionState WRAPPER_GEN_01 = new btMotionState(false); - - protected btMotionState(boolean cMemoryOwn) { - } - - public btMotionState() { - initJavaObject(); - } - - /*[-teaVM;-ADD] - @org.teavm.jso.JSFunctor - public interface SetWorldTransform extends org.teavm.jso.JSObject { - void setWorldTransformJS(int worldTrans); - } - */ - /*[-teaVM;-ADD] - @org.teavm.jso.JSFunctor - public interface GetWorldTransform extends org.teavm.jso.JSObject { - void getWorldTransformJS(int worldTrans); - } - */ - - /*[-teaVM;-REPLACE] - private void initJavaObject() { - SetWorldTransform setWorldTransform = new SetWorldTransform() { - @Override - public void setWorldTransformJS (int worldTransAddr) { - tempMat.idt(); - btTransform.convert(worldTransAddr, tempMat); - setWorldTransform(tempMat); - } - }; - GetWorldTransform getWorldTransform = new GetWorldTransform() { - @Override - public void getWorldTransformJS (int worldTransAddr) { - tempMat.idt(); - getWorldTransform(tempMat); - btTransform.convert(tempMat, worldTransAddr); - } - }; - int pointer = createNative(setWorldTransform, getWorldTransform); - initObject(pointer, true); - } - */ - private void initJavaObject() { - initObject(createNative(), true); - } - - /*[-C++;-NATIVE] - if(motionClass == 0) { - motionClass = (jclass)env->NewGlobalRef(env->GetObjectClass(object)); - getWorldTransformID = env->GetMethodID(motionClass, "getWorldTransformCPP", "(J)V"); - setWorldTransformID = env->GetMethodID(motionClass, "setWorldTransformCPP", "(J)V"); - } - return (jlong)new CustomMotionState(env, env->NewGlobalRef(object)); - */ - /*[-teaVM;-REPLACE] - @org.teavm.jso.JSBody(params = { "setWorldTransform", "getWorldTransform" }, script = "var jsMotionState = new Bullet.MyMotionState(); jsMotionState.setWorldTransform = setWorldTransform; jsMotionState.getWorldTransform = getWorldTransform; return Bullet.getPointer(jsMotionState);") - private static native int createNative(SetWorldTransform setWorldTransform, GetWorldTransform getWorldTransform); - */ - private native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (CustomMotionState*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.MyMotionState); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - /** - * Called to initialize body position. Modify worldTrans. - */ - public void getWorldTransform(Matrix4 worldTrans) { - } - - /** - * Called when rigid body change position. Update your render matrix with worldTrans. - */ - public void setWorldTransform(Matrix4 worldTrans) { - } - - private void getWorldTransformCPP(long worldTransAddr) { - btTransform.TEMP_GDX_01.idt(); - getWorldTransform(btTransform.TEMP_GDX_01); - btTransform.convert(btTransform.TEMP_GDX_01, worldTransAddr); - } - - private void setWorldTransformCPP(long worldTransAddr) { - btTransform.convert(worldTransAddr, btTransform.TEMP_GDX_01); - setWorldTransform(btTransform.TEMP_GDX_01); - } - - /*[-IDL_SKIP] - */ - private void getWorldTransform(btTransform worldTrans) { - } - - /*[-IDL_SKIP] - */ - private void setWorldTransform(btTransform worldTrans) { - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuadWord.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuadWord.java deleted file mode 100644 index d0d747f3..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuadWord.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -public class btQuadWord extends BulletBase { - - /*[-C++;-NATIVE] - #include "LinearMath/btQuadWord.h" - */ - - public native float getX(); - public native float getY(); - public native float getZ(); -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuaternion.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuaternion.java deleted file mode 100644 index 319d91d5..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btQuaternion.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.math.Quaternion; - -/** - * @author xpenatan - */ -public class btQuaternion extends btQuadWord { - - /*[-C++;-NATIVE] - #include "LinearMath/btQuaternion.h" - */ - - public static btQuaternion TEMP_0 = new btQuaternion(true); - public static btQuaternion TEMP_1 = new btQuaternion(true); - public static btQuaternion TEMP_2 = new btQuaternion(true); - public static btQuaternion TEMP_3 = new btQuaternion(true); - public static btQuaternion TEMP_4 = new btQuaternion(true); - - public static Quaternion TEMP_GDX_01 = new Quaternion(); - - public static btQuaternion emptyTransform = new btQuaternion(false); - - public btQuaternion() { - this(true); - } - - /** - * Useful on creating temp objects - */ - protected btQuaternion(boolean cMemoryOwn) { - initObject(cMemoryOwn ? createNative() : 0, cMemoryOwn); - } - - /*[-C++;-NATIVE] - return (jlong)new btQuaternion(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btQuaternion(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btQuaternion*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btQuaternion); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public native float getW(); - - public native void setValue(float x, float y, float z, float w); - - public static void convert(Quaternion in, btQuaternion out) { - out.setValue(in.x, in.y, in.z, in.w); - } - - public static void convert(btQuaternion in, Quaternion out) { - out.x = in.getX(); - out.y = in.getY(); - out.z = in.getZ(); - out.w = in.getW(); - } - - public static void convert(Quaternion in, long outAddr) { - emptyTransform.setPointer(outAddr); - convert(in, emptyTransform); - } - - public static void convert(long inAddr, Quaternion out) { - emptyTransform.setPointer(inAddr); - convert(emptyTransform, out); - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTransform.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTransform.java deleted file mode 100644 index 619275d6..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTransform.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.math.Quaternion; -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btTransform extends BulletBase { - - /*[-C++;-NATIVE] - #include "LinearMath/btTransform.h" - */ - - public static btTransform WRAPPER_GEN_01 = new btTransform(false); - - public static btTransform TEMP_0 = new btTransform(true); - public static btTransform TEMP_1 = new btTransform(true); - public static btTransform TEMP_2 = new btTransform(true); - public static btTransform TEMP_3 = new btTransform(true); - public static btTransform TEMP_4 = new btTransform(true); - - public static btTransform emptyTransform = new btTransform(false); - - public static Matrix4 TEMP_GDX_01 = new Matrix4(); - - public btTransform() { - this(true); - } - - /** - * Useful on creating temp objects - */ - public btTransform(boolean cMemoryOwn) { - initObject(cMemoryOwn ? createNative() : 0, cMemoryOwn); - } - - /*[-C++;-NATIVE] - return (jlong)new btTransform(); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btTransform(); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btTransform*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTransform); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public void setFromOpenGLMatrix(float[] m) { - setFromOpenGLMatrix(cPointer, m); - } - - /*[-C++;-NATIVE] - ((btTransform*)addr)->setFromOpenGLMatrix(m); - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btTransform); - jsObj.setFromOpenGLMatrix(m); - */ - private static native void setFromOpenGLMatrix(long addr, float[] m); - - public void getOpenGLMatrix(float[] m) { - getOpenGLMatrix(cPointer, m); - } - - /*[-C++;-NATIVE] - btTransform * transform = (btTransform*)addr; - btVector3 & origin = transform->getOrigin(); - btMatrix3x3 & matrix3x3 = transform->getBasis(); - const btVector3 & row0 = matrix3x3.getRow(0); - const btVector3 & row1 = matrix3x3.getRow(1); - const btVector3 & row2 = matrix3x3.getRow(2); - - m[0] = row0.getX(); - m[1] = row1.getX(); - m[2] = row2.getX(); - m[3] = 0; - m[4] = row0.getY(); - m[5] = row1.getY(); - m[6] = row2.getY(); - m[7] = 0; - m[8] = row0.getZ(); - m[9] = row1.getZ(); - m[10] = row2.getZ(); - m[11] = 0; - m[12] = origin.getX(); - m[13] = origin.getY(); - m[14] = origin.getZ(); - m[15] = 1.0; - */ - /*[-teaVM;-NATIVE] - var worldTrans = Bullet.wrapPointer(addr, Bullet.btTransform); - var origin = worldTrans.getOrigin(); - var matrix3x3 = worldTrans.getBasis(); - var row0 = matrix3x3.getRow(0); - var row1 = matrix3x3.getRow(1); - var row2 = matrix3x3.getRow(2); - - m[0] = row0.getX(); - m[1] = row1.getX(); - m[2] = row2.getX(); - m[3] = 0; - m[4] = row0.getY(); - m[5] = row1.getY(); - m[6] = row2.getY(); - m[7] = 0; - m[8] = row0.getZ(); - m[9] = row1.getZ(); - m[10] = row2.getZ(); - m[11] = 0; - m[12] = origin.getX(); - m[13] = origin.getY(); - m[14] = origin.getZ(); - m[15] = 1.0; - */ - private static native void getOpenGLMatrix(long addr, float[] m); - - public Quaternion getRotation() { - getRotationNATIVE(cPointer, BulletBase.FLOAT_4); - btQuaternion.TEMP_GDX_01.set(BulletBase.FLOAT_4[0], BulletBase.FLOAT_4[1], BulletBase.FLOAT_4[2], BulletBase.FLOAT_4[3]); - return btQuaternion.TEMP_GDX_01; - } - - /*[-C++;-NATIVE] - btTransform* nativeObject = (btTransform*)addr; - btQuaternion quat = nativeObject->getRotation(); - array[0] = quat.getX(); - array[1] = quat.getY(); - array[2] = quat.getZ(); - array[3] = quat.getW(); - */ - /*[-teaVM;-NATIVE] - var nativeObject = Bullet.wrapPointer(addr, Bullet.btTransform); - var quat = nativeObject.getRotation(); - array[0] = quat.getX(); - array[1] = quat.getY(); - array[2] = quat.getZ(); - array[3] = quat.getW(); - */ - private static native void getRotationNATIVE(long addr, float [] array); - - public static void convert(Matrix4 in, btTransform out) { - out.setFromOpenGLMatrix(in.val); - } - - public static void convert(btTransform in, Matrix4 out) { - in.getOpenGLMatrix(out.val); - } - - public static void convert(Matrix4 in, long outAddr) { - emptyTransform.setPointer(outAddr); - convert(in, emptyTransform); - } - - public static void convert(long inAddr, Matrix4 out) { - emptyTransform.setPointer(inAddr); - convert(emptyTransform, out); - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTypedObject.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTypedObject.java deleted file mode 100644 index 12af1631..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btTypedObject.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btTypedObject extends BulletBase { -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btVector3.java b/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btVector3.java deleted file mode 100644 index 639e7140..00000000 --- a/extensions/gdx-bullet/gdx-bullet-base/src/main/java/com/badlogic/gdx/physics/bullet/linearmath/btVector3.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.badlogic.gdx.physics.bullet.linearmath; - -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.bullet.BulletBase; - -/** - * @author xpenatan - */ -public class btVector3 extends BulletBase { - - /*[-C++;-NATIVE] - #include "LinearMath/btVector3.h" - */ - - public static btVector3 WRAPPER_GEN_01 = new btVector3(false); - - public static btVector3 TEMP_0 = new btVector3(true); - public static btVector3 TEMP_1 = new btVector3(true); - public static btVector3 TEMP_2 = new btVector3(true); - public static btVector3 TEMP_3 = new btVector3(true); - public static btVector3 TEMP_4 = new btVector3(true); - - public static btVector3 emptyTransform = new btVector3(false); - - public static Vector3 TEMP_GDX_01 = new Vector3(); - public static Vector3 TEMP_GDX_02 = new Vector3(); - public static Vector3 TEMP_GDX_03 = new Vector3(); - - public btVector3() { - this(true); - } - - public btVector3(float x, float y, float z) { - initObject(createNative(x, y, z), true); - } - - /** - * Useful on creating temp objects - */ - public btVector3(boolean cMemoryOwn) { - initObject(cMemoryOwn ? createNative(0, 0, 0) : 0, cMemoryOwn); - } - - /*[-C++;-NATIVE] - return (jlong)new btVector3(x,y,z); - */ - /*[-teaVM;-NATIVE] - var jsObj = new Bullet.btVector3(x,y,z); - return Bullet.getPointer(jsObj); - */ - private static native long createNative(float x, float y, float z); - - @Override - protected void deleteNative() { - deleteNative(cPointer); - } - - /*[-C++;-NATIVE] - delete (btVector3*)addr; - */ - /*[-teaVM;-NATIVE] - var jsObj = Bullet.wrapPointer(addr, Bullet.btVector3); - Bullet.destroy(jsObj); - */ - private static native void deleteNative(long addr); - - public native float getX(); - - public native float getY(); - - public native float getZ(); - - public native void setValue(float x, float y, float z); - - public static void convert(Vector3 in, btVector3 out) { - out.setValue(in.x, in.y, in.z); - } - - public static void convert(btVector3 in, Vector3 out) { - float x = in.getX(); - float y = in.getY(); - float z = in.getZ(); - out.set(x, y, z); - } - - public static void convert(Vector3 in, long outAddr) { - emptyTransform.setPointer(outAddr); - convert(in, emptyTransform); - } - - public static void convert(long inAddr, Vector3 out) { - emptyTransform.setPointer(inAddr); - convert(emptyTransform, out); - } -} \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-build/jni/bullet.idl b/extensions/gdx-bullet/gdx-bullet-build/jni/bullet.idl index a3e5d5fd..3a25018a 100644 --- a/extensions/gdx-bullet/gdx-bullet-build/jni/bullet.idl +++ b/extensions/gdx-bullet/gdx-bullet-build/jni/bullet.idl @@ -1,1240 +1,1246 @@ // Custom Glue - -interface MybtTriangleRaycastCallback { - void MybtTriangleRaycastCallback([Const, Ref]btVector3 from, [Const, Ref]btVector3 to, optional long flags); - float reportHit([Const, Ref]btVector3 hitNormalLocal, float hitFraction, long partId, long triangleIndex); -}; -MybtTriangleRaycastCallback implements btTriangleRaycastCallback; - -interface MyDebugDraw { - void MyDebugDraw(); - void drawLine([Const, Ref] btVector3 vecFrom, [Const, Ref] btVector3 vecTo, [Const, Ref] btVector3 color); - void drawContactPoint([Const, Ref] btVector3 PointOnB, [Const, Ref] btVector3 normalOnB, float distance, long lifeTime, [Const, Ref] btVector3 color); - void draw3dText([Const, Ref] btVector3 loc, [Const] DOMString textString); - long getDebugMode(); -}; -MyDebugDraw implements btIDebugDraw; - -interface MyMotionState { - void MyMotionState(); -}; -MyMotionState implements btMotionState; - -interface MyClassHelper { - long getBTVersion(); - void setVertices(btIndexedMesh mesh, float [] vertices, long sizeInBytesOfEachVertex, long vertexCount, long positionOffsetInBytes); - void setIndices(btIndexedMesh mesh, short [] indices, long indexOffset, long indexCount); - [Const, Ref]btVector3 getVertexPointer(btShapeHull hull, long index); -}; - -interface MyTemp { - [Value]btVector3 btVec3_1(float x, float y, float z); - [Value]btVector3 btVec3_2(float x, float y, float z); - [Value]btQuaternion btQuat(); - [Value]btTransform btTran(); - [Value]btMatrix3x3 btMat3(); -}; - -interface MyCollisionObjectArray { - void MyCollisionObjectArray(); - [Const] long size(); - [Const] btCollisionObject at(long n); - void resize(long value); - long capacity(); -}; - -interface MyVector3Array { - void MyVector3Array(); - [Const] long size(); - [Value] btVector3 at(long n); - void resize(long value); - long capacity(); -}; - -interface MyScalarArray { - void MyScalarArray(); - [Const] long size(); - float at(long n); - void resize(long value); - long capacity(); -}; - -interface MyClosestRayResultCallback { - void MyClosestRayResultCallback([Const, Ref] btVector3 from, [Const, Ref] btVector3 to); - float addSingleResult([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); - float addSingleResultSuper([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); -}; -MyClosestRayResultCallback implements ClosestRayResultCallback; - -interface MyAllHitsRayResultCallback { - void MyAllHitsRayResultCallback([Const, Ref] btVector3 from, [Const, Ref] btVector3 to); - float addSingleResult([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); - float addSingleResultSuper([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); -}; -MyAllHitsRayResultCallback implements AllHitsRayResultCallback; - - -interface MyRayResultCallback { - void MyRayResultCallback(); - float addSingleResult([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); -}; -MyRayResultCallback implements RayResultCallback; - -// Custom Class -[Prefix = "btCollisionWorld::"] -interface ContactResultCallback { - float addSingleResult([Ref]btManifoldPoint cp, [Const]btCollisionObjectWrapper colObj0Wrap, long partId0, long index0, [Const]btCollisionObjectWrapper colObj1Wrap, long partId1, long index1); - boolean needsCollision(btBroadphaseProxy proxy0); -}; - -[NoDelete] -interface btCollisionObjectWrapper { -}; - -[JSImplementation="ContactResultCallback"] -interface ConcreteContactResultCallback { - void ConcreteContactResultCallback(); - float addSingleResult([Ref] btManifoldPoint cp, [Const] btCollisionObjectWrapper colObj0Wrap, long partId0, long index0, [Const] btCollisionObjectWrapper colObj1Wrap, long partId1, long index1); -}; - -// Linear Math - +// +//interface MybtTriangleRaycastCallback { +// void MybtTriangleRaycastCallback([Const, Ref]btVector3 from, [Const, Ref]btVector3 to, optional long flags); +// float reportHit([Const, Ref]btVector3 hitNormalLocal, float hitFraction, long partId, long triangleIndex); +//}; +//MybtTriangleRaycastCallback implements btTriangleRaycastCallback; +// +//interface MyDebugDraw { +// void MyDebugDraw(); +// void drawLine([Const, Ref] btVector3 vecFrom, [Const, Ref] btVector3 vecTo, [Const, Ref] btVector3 color); +// void drawContactPoint([Const, Ref] btVector3 PointOnB, [Const, Ref] btVector3 normalOnB, float distance, long lifeTime, [Const, Ref] btVector3 color); +//// void draw3dText([Const, Ref] btVector3 loc, [Const] DOMString textString); +// long getDebugMode(); +//}; +//MyDebugDraw implements btIDebugDraw; +// +//interface MyMotionState { +// void MyMotionState(); +//}; +//MyMotionState implements btMotionState; +// +//interface MyClassHelper { +// long getBTVersion(); +//// void setVertices(btIndexedMesh mesh, float [] vertices, long sizeInBytesOfEachVertex, long vertexCount, long positionOffsetInBytes); +//// void setIndices(btIndexedMesh mesh, short [] indices, long indexOffset, long indexCount); +// [Const, Ref]btVector3 getVertexPointer(btShapeHull hull, long index); +//}; +// +//interface MyTemp { +// [Value]btVector3 btVec3_1(float x, float y, float z); +// [Value]btVector3 btVec3_2(float x, float y, float z); +// [Value]btQuaternion btQuat(); +// [Value]btTransform btTran(); +// [Value]btMatrix3x3 btMat3(); +//}; +// +//interface MyCollisionObjectArray { +// void MyCollisionObjectArray(); +// [Const] long size(); +// [Const] btCollisionObject at(long n); +// void resize(long value); +// long capacity(); +//}; +// +//interface MyVector3Array { +// void MyVector3Array(); +// [Const] long size(); +// [Value] btVector3 at(long n); +// void resize(long value); +// long capacity(); +//}; +// +//interface MyScalarArray { +// void MyScalarArray(); +// [Const] long size(); +// float at(long n); +// void resize(long value); +// long capacity(); +//}; +// +//interface MyClosestRayResultCallback { +// void MyClosestRayResultCallback([Const, Ref] btVector3 from, [Const, Ref] btVector3 to); +// float addSingleResult([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); +// float addSingleResultSuper([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); +//}; +//MyClosestRayResultCallback implements ClosestRayResultCallback; +// +//interface MyAllHitsRayResultCallback { +// void MyAllHitsRayResultCallback([Const, Ref] btVector3 from, [Const, Ref] btVector3 to); +// float addSingleResult([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); +// float addSingleResultSuper([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); +//}; +//MyAllHitsRayResultCallback implements AllHitsRayResultCallback; +// +// +//interface MyRayResultCallback { +// void MyRayResultCallback(); +// float addSingleResult([Ref] LocalRayResult rayResult, boolean normalInWorldSpace); +//}; +//MyRayResultCallback implements RayResultCallback; +// +//// Custom Class +//[Prefix = "btCollisionWorld::"] +//interface ContactResultCallback { +// float addSingleResult([Ref]btManifoldPoint cp, [Const]btCollisionObjectWrapper colObj0Wrap, long partId0, long index0, [Const]btCollisionObjectWrapper colObj1Wrap, long partId1, long index1); +// boolean needsCollision(btBroadphaseProxy proxy0); +//}; +// +//[NoDelete] +//interface btCollisionObjectWrapper { +//}; +// +//[JSImplementation="ContactResultCallback"] +//interface ConcreteContactResultCallback { +// void ConcreteContactResultCallback(); +// float addSingleResult([Ref] btManifoldPoint cp, [Const] btCollisionObjectWrapper colObj0Wrap, long partId0, long index0, [Const] btCollisionObjectWrapper colObj1Wrap, long partId1, long index1); +//}; +// +//// Linear Math +// interface btVector3 { - void btVector3(); - void btVector3(float x, float y, float z); - float length(); - float getX(); - float getY(); - float getZ(); - void setX(float x); - void setY(float y); - void setZ(float z); - void setValue(float x, float y, float z); -}; - -interface btQuadWord { - float getX(); - float getY(); - float getZ(); - void setX(float x); - void setY(float y); - void setZ(float z); - void setW(float w); -}; - -interface btQuaternion { - void btQuaternion(float x, float y, float z, float w); - void setValue(float x, float y, float z, float w); - void setEulerZYX(float z, float y, float x); - void setRotation([Const, Ref] btVector3 axis, float angle); - float getW(); - void normalize(); -}; -btQuaternion implements btQuadWord; - -interface btMatrix3x3 { - void btMatrix3x3(); - void setEulerZYX(float ex, float ey, float ez); - void getRotation([Ref]btQuaternion q); - [Operator="[]", Ref] btVector3 getRow(long i); - [Value]btVector3 getColumn(long y); - -}; - -interface btTransform { - void btTransform(); - void btTransform([Ref]btQuaternion q, [Ref]btVector3 v); - void setIdentity(); - void setOrigin([Ref]btVector3 origin); - void setRotation([Ref]btQuaternion rotation); - [Ref]btVector3 getOrigin(); - [Value]btQuaternion getRotation(); - [Ref]btMatrix3x3 getBasis(); - void setFromOpenGLMatrix(float[] m); - void getOpenGLMatrix(float[] m); -}; - -interface btMotionState { - void getWorldTransform([Ref]btTransform worldTrans); - void setWorldTransform([Const, Ref]btTransform worldTrans); -}; - -// Collision - -interface btCollisionWorld { - void btCollisionWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btCollisionConfiguration collisionConfiguration); - void setBroadphase(btBroadphaseInterface pairCache); - //btBroadphaseInterface getBroadphase(); //Not needed - //btOverlappingPairCache getPairCache(); //Not needed - btDispatcher getDispatcher(); - void updateSingleAabb(btCollisionObject colObj); - void updateAabbs(); - void computeOverlappingPairs(); - void setDebugDrawer(btIDebugDraw debugDrawer); - //btIDebugDraw getDebugDrawer(); //Not needed - void debugDrawWorld(); - void debugDrawObject ([Const, Ref] btTransform worldTransform, [Const] btCollisionShape shape, [Const, Ref] btVector3 color); - long getNumCollisionObjects(); - void rayTest([Const, Ref]btVector3 rayFromWorld, [Const, Ref]btVector3 rayToWorld, [Ref]RayResultCallback resultCallback); - void convexSweepTest([Const]btConvexShape castShape, [Const, Ref]btTransform from, [Const, Ref]btTransform to, [Ref]ConvexResultCallback resultCallback, optional float allowedCcdPenetration); - void contactTest(btCollisionObject colObj, [Ref]ContactResultCallback resultCallback); - void contactPairTest(btCollisionObject colObjA, btCollisionObject colObjB, [Ref]ContactResultCallback resultCallback); - void addCollisionObject(btCollisionObject collisionObject, optional long collisionFilterGroup, optional long collisionFilterMask); - [Ref]btCollisionObjectArray getCollisionObjectArray(); - void removeCollisionObject(btCollisionObject collisionObject); - void performDiscreteCollisionDetection(); - [Ref]btDispatcherInfo getDispatchInfo(); - boolean getForceUpdateAllAabbs (); - void setForceUpdateAllAabbs(boolean f); -}; - -interface btCollisionConfiguration {}; - -interface btDefaultCollisionConstructionInfo { - void btDefaultCollisionConstructionInfo(); -}; - -interface btDefaultCollisionConfiguration { - void btDefaultCollisionConfiguration([Ref]optional btDefaultCollisionConstructionInfo info); -}; -btDefaultCollisionConfiguration implements btCollisionConfiguration; - -interface btCollisionObject { - void btCollisionObject(); - boolean mergesSimulationIslands(); - [Const, Ref] btVector3 getAnisotropicFriction(); - void setAnisotropicFriction([Const, Ref]btVector3 anisotropicFriction, long frictionMode); - boolean hasAnisotropicFriction(optional long frictionMode); - void setContactProcessingThreshold(float contactProcessingThreshold); - float getContactProcessingThreshold(); - boolean isStaticObject(); - boolean isKinematicObject(); - boolean isStaticOrKinematicObject(); - boolean hasContactResponse(); - void setCollisionShape(btCollisionShape collisionShape); - //btCollisionShape getCollisionShape(); //Not needed - void setIgnoreCollisionCheck([Const] btCollisionObject obj, boolean ignoreCollisionCheck); - boolean checkCollideWithOverride([Const] btCollisionObject obj); - long getActivationState(); - void setActivationState(long newState); - void setDeactivationTime(float time); - float getDeactivationTime(); - void forceActivationState(long newState); - void activate(optional boolean forceActivation); - boolean isActive(); - void setRestitution(float rest); - float getRestitution(); - void setFriction(float frict); - float getFriction(); - void setRollingFriction(float frict); - float getRollingFriction(); - [Ref]btTransform getWorldTransform(); - void setWorldTransform([Const, Ref]btTransform worldTrans); - btBroadphaseProxy getBroadphaseHandle(); - void setBroadphaseHandle(btBroadphaseProxy handle); - [Ref] btTransform getInterpolationWorldTransform(); - void setInterpolationWorldTransform([Const, Ref]btTransform trans); - void setInterpolationLinearVelocity([Const, Ref]btVector3 linvel); - void setInterpolationAngularVelocity([Const, Ref]btVector3 angvel); - [Const, Ref]btVector3 getInterpolationLinearVelocity(); - [Const, Ref]btVector3 getInterpolationAngularVelocity(); - long getIslandTag(); - void setIslandTag(long tag); - long getCompanionId(); - void setCompanionId(long id); - float getHitFraction(); - void setHitFraction(float hitFraction); - long getCollisionFlags(); - void setCollisionFlags(long flags); - float getCcdSweptSphereRadius(); - void setCcdSweptSphereRadius(float radius); - float getCcdMotionThreshold(); - float getCcdSquareMotionThreshold(); - void setCcdMotionThreshold(float ccdMotionThreshold); - any getUserPointer(); - long getUserIndex(); - void setUserPointer(any userPointer); - void setUserIndex(long index); - long getUpdateRevisionInternal(); - boolean checkCollideWith([Const] btCollisionObject co); - -}; - -interface btManifoldPoint { - [Const, Ref]btVector3 getPositionWorldOnA(); - [Const, Ref]btVector3 getPositionWorldOnB(); - float getAppliedImpulse(); - float getDistance(); - [Value]attribute btVector3 m_localPointA; - [Value]attribute btVector3 m_localPointB; - [Value]attribute btVector3 m_positionWorldOnB; - [Value]attribute btVector3 m_positionWorldOnA; - [Value]attribute btVector3 m_normalWorldOnB; - long getLifeTime(); -}; - -interface btBroadphaseProxy {}; - -[Prefix = "btCollisionWorld::"] -interface LocalRayResult { - [Const]attribute btCollisionObject m_collisionObject; - attribute LocalShapeInfo m_localShapeInfo; - [Value]attribute btVector3 m_hitNormalLocal; - attribute float m_hitFraction; -}; - -[Prefix = "btCollisionWorld::"] -interface RayResultCallback { - // abstract base class, no constructor - boolean hasHit(); - attribute float m_closestHitFraction; - attribute long m_collisionFilterGroup; - attribute long m_collisionFilterMask; - [Const]attribute btCollisionObject m_collisionObject; - attribute unsigned long m_flags; - float addSingleResult([Ref]LocalRayResult rayResult, boolean normalInWorldSpace); -}; - -[Prefix = "btCollisionWorld::"] -interface ClosestRayResultCallback { - void ClosestRayResultCallback([Const, Ref]btVector3 from, [Const, Ref]btVector3 to); - [Value]attribute btVector3 m_rayFromWorld; - [Value]attribute btVector3 m_rayToWorld; - [Value]attribute btVector3 m_hitNormalWorld; - [Value]attribute btVector3 m_hitPointWorld; -}; -ClosestRayResultCallback implements RayResultCallback; - -[Prefix = "btCollisionWorld::"] -interface AllHitsRayResultCallback { - void AllHitsRayResultCallback([Const, Ref]btVector3 from, [Const, Ref]btVector3 to); - [Value]attribute MyCollisionObjectArray m_collisionObjects; - [Value]attribute btVector3 m_rayFromWorld; - [Value]attribute btVector3 m_rayToWorld; - [Value]attribute MyVector3Array m_hitNormalWorld; - [Value]attribute MyVector3Array m_hitPointWorld; - [Value]attribute MyScalarArray m_hitFractions; -}; -AllHitsRayResultCallback implements RayResultCallback; - -[Prefix = "btCollisionWorld::"] -interface LocalShapeInfo { - attribute long m_shapePart; - attribute long m_triangleIndex; -}; - -[Prefix = "btCollisionWorld::"] -interface LocalConvexResult { - void LocalConvexResult([Const]btCollisionObject hitCollisionObject, LocalShapeInfo localShapeInfo, [Const, Ref]btVector3 hitNormalLocal, [Const, Ref]btVector3 hitPointLocal, float hitFraction); - [Const]attribute btCollisionObject m_hitCollisionObject; - attribute LocalShapeInfo m_localShapeInfo; - [Value]attribute btVector3 m_hitNormalLocal; - [Value]attribute btVector3 m_hitPointLocal; - attribute float m_hitFraction; -}; - -[Prefix = "btCollisionWorld::"] -interface ConvexResultCallback { - // abstract base class, no constructor - boolean hasHit(); - attribute long m_collisionFilterGroup; - attribute long m_collisionFilterMask; - attribute float m_closestHitFraction; -}; - -[Prefix = "btCollisionWorld::"] -interface ClosestConvexResultCallback { - void ClosestConvexResultCallback([Const, Ref]btVector3 convexFromWorld, [Const, Ref]btVector3 convexToWorld); - [Value]attribute btVector3 m_convexFromWorld; - [Value]attribute btVector3 m_convexToWorld; - [Value]attribute btVector3 m_hitNormalWorld; - [Value]attribute btVector3 m_hitPointWorld; -}; -ClosestConvexResultCallback implements ConvexResultCallback; - -interface btPersistentManifold { - void btPersistentManifold(); - [Const]btCollisionObject getBody0(); - [Const]btCollisionObject getBody1(); - long getNumContacts(); - [Ref]btManifoldPoint getContactPoint(long index); -}; - -interface btDispatcher { - long getNumManifolds(); - btPersistentManifold getManifoldByIndexInternal(long index); -}; - -interface btCollisionDispatcher { - void btCollisionDispatcher(btCollisionConfiguration conf); -}; -btCollisionDispatcher implements btDispatcher; - -interface btOverlappingPairCallback {}; - -interface btCollisionAlgorithm { - void getAllContactManifolds([Ref]btManifoldArray manifoldArray); -}; - -interface btGearConstraint { - void btGearConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btVector3 axisInA, [Const, Ref]btVector3 axisInB, optional float ratio); -}; - -interface btBroadphasePair { - attribute btCollisionAlgorithm m_algorithm; -}; - -interface btOverlappingPairCache { - void setInternalGhostPairCallback(btOverlappingPairCallback ghostPairCallback); - [Ref]btBroadphasePairArray getOverlappingPairArray(); -}; - -interface btAxisSweep3 { - void btAxisSweep3([Ref]btVector3 worldAabbMin, [Ref]btVector3 worldAabbMax, optional long maxHandles, optional btOverlappingPairCache pairCache, optional boolean disableRaycastAccelerator); -}; -btAxisSweep3 implements btBroadphaseInterface; - -interface btBroadphaseInterface { - btOverlappingPairCache getOverlappingPairCache(); -}; - -interface btDbvtBroadphase { - void btDbvtBroadphase(); -}; -btDbvtBroadphase implements btBroadphaseInterface; - -// Arrays - -interface btManifoldArray { - void btManifoldArray(); - [Const]long size(); - [Const]btPersistentManifold at(long n); - void resize(long value); - long capacity(); -}; - -interface btBroadphasePairArray { - [Const]long size(); - [Const, Ref]btBroadphasePair at(long n); - void resize(long value); - long capacity(); -}; - -interface btCollisionObjectArray { - [Const]long size(); - [Const]btCollisionObject at(long n); - void resize(long value); - long capacity(); -}; - -interface btStridingMeshInterface {}; - -// Shapes - -interface btCollisionShape { - void setLocalScaling([Const, Ref]btVector3 scaling); - void calculateLocalInertia(float mass, [Ref]btVector3 inertia); - void setMargin(float margin); - float getMargin(); - long getShapeType(); - void getAabb([Const, Ref]btTransform t, [Ref]btVector3 aabbMin, [Ref]btVector3 aabbMax); -}; - -interface btConvexShape { - long getNumPreferredPenetrationDirections(); - void getPreferredPenetrationDirection(long index, [Ref]btVector3 penetrationVector); -}; -btConvexShape implements btCollisionShape; - -interface btConvexInternalShape { - void setImplicitShapeDimensions([Ref]btVector3 dimensions); -}; -btConvexInternalShape implements btConvexShape; - -interface btPolyhedralConvexShape { -}; -btPolyhedralConvexShape implements btConvexInternalShape; - -interface btPolyhedralConvexAabbCachingShape { -}; -btPolyhedralConvexAabbCachingShape implements btPolyhedralConvexShape; - -interface btConvexTriangleMeshShape { - void btConvexTriangleMeshShape(btStridingMeshInterface meshInterface, optional boolean calcAabb); -}; -btConvexTriangleMeshShape implements btPolyhedralConvexAabbCachingShape; - -interface btBoxShape { - void btBoxShape([Ref]btVector3 boxHalfExtents); - void setMargin(float margin); - [Ref,Const] btVector3 getHalfExtentsWithoutMargin(); - float getMargin(); -}; -btBoxShape implements btPolyhedralConvexShape; - -interface btCapsuleShape { - void btCapsuleShape(float radius, float height); - void setMargin(float margin); - float getMargin(); -}; -btCapsuleShape implements btConvexInternalShape; - -interface btCapsuleShapeX { - void btCapsuleShapeX(float radius, float height); - void setMargin(float margin); - float getMargin(); -}; -btCapsuleShapeX implements btCapsuleShape; - -interface btCapsuleShapeZ { - void btCapsuleShapeZ(float radius, float height); - void setMargin(float margin); - float getMargin(); -}; -btCapsuleShapeZ implements btCapsuleShape; - -interface btCylinderShape { - void btCylinderShape([Ref]btVector3 halfExtents); - void setMargin(float margin); - float getMargin(); -}; -btCylinderShape implements btConvexInternalShape; - -interface btCylinderShapeX { - void btCylinderShapeX([Ref]btVector3 halfExtents); - void setMargin(float margin); - float getMargin(); -}; -btCylinderShapeX implements btCylinderShape; - -interface btCylinderShapeZ { - void btCylinderShapeZ([Ref]btVector3 halfExtents); - void setMargin(float margin); - float getMargin(); -}; -btCylinderShapeZ implements btCylinderShape; - -interface btSphereShape { - void btSphereShape(float radius); - float getRadius(); - void setUnscaledRadius(float radius); - void setMargin(float margin); - float getMargin(); -}; -btSphereShape implements btConvexInternalShape; - -interface btConeShape { - void btConeShape(float radius, float height); -}; -btConeShape implements btConvexInternalShape; - -interface btConvexHullShape { - void btConvexHullShape([Const] optional float[] points, optional long numPoints, optional long stride); - void addPoint([Const, Ref]btVector3 point, optional boolean recalculateLocalAABB); - void setMargin(float margin); - float getMargin(); - long getNumPoints(); - [Value]btVector3 getScaledPoint(long i); - void optimizeConvexHull(); -}; -btConvexHullShape implements btPolyhedralConvexAabbCachingShape; - -interface btConeShapeX { - void btConeShapeX(float radius, float height); -}; -btConeShapeX implements btConeShape; - -interface btConeShapeZ { - void btConeShapeZ(float radius, float height); -}; -btConeShapeZ implements btConeShape; - -interface btCompoundShape { - void btCompoundShape(optional boolean enableDynamicAabbTree); - void addChildShape([Const, Ref]btTransform localTransform, btCollisionShape shape); - void removeChildShapeByIndex(long childShapeindex); - void removeChildShape(btCollisionShape shape); - [Const]long getNumChildShapes(); - btCollisionShape getChildShape(long index); - void setMargin(float margin); - float getMargin(); - void recalculateLocalAabb(); -}; -btCompoundShape implements btCollisionShape; - -interface btConcaveShape {}; -btConcaveShape implements btCollisionShape; - -interface btStaticPlaneShape { - void btStaticPlaneShape([Const, Ref]btVector3 planeNormal, float planeConstant); -}; -btStaticPlaneShape implements btConcaveShape; - -interface btTriangleMeshShape {}; -btTriangleMeshShape implements btConcaveShape; - -interface btBvhTriangleMeshShape { - void btBvhTriangleMeshShape(btStridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, optional boolean buildBvh); - void btBvhTriangleMeshShape(btStridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, [Const, Ref]btVector3 bvhAabbMin, [Const, Ref]btVector3 bvhAabbMax, optional boolean buildBvh); - void performRaycast(btTriangleCallback callback, [Const, Ref]btVector3 raySource, [Const, Ref]btVector3 rayTarget); -}; -btBvhTriangleMeshShape implements btTriangleMeshShape; - -interface btHeightfieldTerrainShape { - void btHeightfieldTerrainShape(long heightStickWidth, long heightStickLength, VoidPtr heightfieldData, float heightScale, float minHeight, float maxHeight, long upAxis, PHY_ScalarType hdt, boolean flipQuadEdges); - void setMargin(float margin); - float getMargin(); -}; -btHeightfieldTerrainShape implements btConcaveShape; - -interface btScaledBvhTriangleMeshShape { - void btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape childShape, [Const, Ref]btVector3 localScaling); -}; - -interface btShapeHull { - void btShapeHull(btConvexShape shape); - long numTriangles(); - long numVertices(); - long numIndices(); - boolean buildHull(float margin); -}; - -// Other stuff - -enum PHY_ScalarType { - "PHY_FLOAT", - "PHY_DOUBLE", - "PHY_INTEGER", - "PHY_SHORT", - "PHY_FIXEDPOINT88", - "PHY_UCHAR" -}; - -interface btIndexedMesh { - void btIndexedMesh(); -}; - -interface btTriangleMesh { - void btTriangleMesh(optional boolean use32bitIndices, optional boolean use4componentVertices); - void addTriangle([Const, Ref]btVector3 vertex0, [Const, Ref]btVector3 vertex1, [Const, Ref]btVector3 vertex2, optional boolean removeDuplicateVertices); - void findOrAddVertex([Const, Ref]btVector3 vertex, boolean removeDuplicateVertices); - void addIndex(long index); -}; -btTriangleMesh implements btStridingMeshInterface; - -interface btTriangleIndexVertexArray { - void btTriangleIndexVertexArray(); - void setPremadeAabb([Const, Ref]btVector3 aabbMin, [Const, Ref]btVector3 aabbMax); - void getPremadeAabb(btVector3 aabbMin, btVector3 aabbMax); - boolean hasPremadeAabb(); - void addIndexedMesh([Const, Ref]btIndexedMesh mesh, optional PHY_ScalarType indexType); -}; -btTriangleIndexVertexArray implements btStridingMeshInterface; - -interface btTriangleRaycastCallback { - [Value]attribute btVector3 m_from; - [Value]attribute btVector3 m_to; - attribute float m_hitFraction; - attribute unsigned long m_flags; - float reportHit([Const, Ref]btVector3 hitNormalLocal, float hitFraction, long partId, long triangleIndex); -}; -btTriangleRaycastCallback implements btTriangleCallback; - -interface btTriangleCallback { - void processTriangle(btVector3 triangle, long partId, long triangleIndex); -}; - -// Dynamics - -[Prefix = "btRigidBody::"] -interface btRigidBodyConstructionInfo { - void btRigidBodyConstructionInfo(float mass, btMotionState motionState, btCollisionShape collisionShape, [Ref]optional btVector3 localInertia); - attribute float m_linearDamping; - attribute float m_angularDamping; - attribute float m_friction; - attribute float m_rollingFriction; - attribute float m_restitution; - attribute float m_linearSleepingThreshold; - attribute float m_angularSleepingThreshold; - attribute boolean m_additionalDamping; - attribute float m_additionalDampingFactor; - attribute float m_additionalLinearDampingThresholdSqr; - attribute float m_additionalAngularDampingThresholdSqr; - attribute float m_additionalAngularDampingFactor; -}; - -interface btRigidBody { - void btRigidBody([Const, Ref]btRigidBodyConstructionInfo constructionInfo); - void btRigidBody (float mass, btMotionState motionState, btCollisionShape collisionShape, [Const, Ref] optional btVector3 localInertia); - attribute long m_contactSolverType; - attribute long m_frictionSolverType; - void proceedToTransform([Const, Ref]btTransform newTrans); - void predictIntegratedTransform(float step, [Ref]btTransform predictedTransform); - void saveKinematicState(float step); - void applyGravity(); - void setGravity([Const, Ref]btVector3 acceleration); - [Const, Ref]btVector3 getGravity(); - void setDamping(float lin_damping, float ang_damping); - float getLinearDamping(); - float getAngularDamping(); - float getLinearSleepingThreshold(); - float getAngularSleepingThreshold(); - void applyDamping(float timeStep); - void setMassProps(float mass, [Const, Ref]btVector3 inertia); - [Const, Ref]btVector3 getLinearFactor(); - void setLinearFactor([Const, Ref]btVector3 linearFactor); - float getInvMass(); - [Const,Ref]btMatrix3x3 getInvInertiaTensorWorld(); - void integrateVelocities(float step); - void setCenterOfMassTransform([Const, Ref]btTransform xform); - void applyCentralForce([Const, Ref]btVector3 force); - [Const, Ref]btVector3 getTotalForce(); - [Const, Ref]btVector3 getTotalTorque(); - [Const, Ref]btVector3 getInvInertiaDiagLocal(); - void setInvInertiaDiagLocal([Const,Ref]btVector3 diagInvInertia); - void setSleepingThresholds(float linear, float angular); - void applyTorque([Const, Ref]btVector3 torque); - void applyForce([Const, Ref]btVector3 force, [Const, Ref]btVector3 rel_pos); - void applyCentralImpulse([Const, Ref]btVector3 impulse); - void applyTorqueImpulse([Const, Ref]btVector3 torque); - void applyImpulse([Const, Ref]btVector3 impulse, [Const, Ref]btVector3 rel_pos); - void clearForces(); - void updateInertiaTensor(); - [Const, Ref]btVector3 getCenterOfMassPosition(); - [Const, Ref]btTransform getCenterOfMassTransform(); - [Const, Ref]btVector3 getLinearVelocity(); - [Const, Ref]btVector3 getAngularVelocity(); - void setLinearVelocity([Const, Ref]btVector3 lin_vel); - void setAngularVelocity([Const, Ref]btVector3 ang_vel); - void translate([Const, Ref]btVector3 trs); - void getAabb([Ref]btVector3 aabbMin, [Ref]btVector3 aabbMax); - float computeImpulseDenominator([Const, Ref]btVector3 pos, [Const, Ref]btVector3 normal); - float computeAngularImpulseDenominator([Const, Ref]btVector3 axis); - void updateDeactivation(float timeStep); - boolean wantsSleeping(); - //btBroadphaseProxy getBroadphaseProxy(); // Not needed. btCollisionObject already have this call - //void setNewBroadphaseProxy(btBroadphaseProxy broadphaseProxy) // Not needed - btMotionState getMotionState(); - void setMotionState(btMotionState motionState); - void setAngularFactor([Const, Ref]btVector3 angFac); - [Const, Ref]btVector3 getAngularFactor(); - boolean isInWorld(); - void addConstraintRef(btTypedConstraint c); - void removeConstraintRef(btTypedConstraint c); - btTypedConstraint getConstraintRef(long index); - long getNumConstraintRefs(); - void setFlags(long flags); - long getFlags(); - [Value]btQuaternion getOrientation(); - [Value]btVector3 getVelocityInLocalPoint([Const, Ref]btVector3 rel_pos); - [Value]btVector3 computeGyroscopicImpulseImplicit_World(float dt); - [Value]btVector3 computeGyroscopicImpulseImplicit_Body(float step); - [Value]btVector3 computeGyroscopicForceExplicit(float maxGyroscopicForce); - [Value]btVector3 getLocalInertia(); -}; -btRigidBody implements btCollisionObject; - -interface btConstraintSetting { - void btConstraintSetting(); - attribute float m_tau; - attribute float m_damping; - attribute float m_impulseClamp; -}; - -interface btTypedConstraint { - void enableFeedback(boolean needsFeedback); - [Const]float getBreakingImpulseThreshold(); - void setBreakingImpulseThreshold([Const]float threshold); - [Const, Ref]btRigidBody getRigidBodyA(); - [Const, Ref]btRigidBody getRigidBodyB(); -}; - -interface btGeneric6DofSpring2Constraint { - void btGeneric6DofSpring2Constraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform frameInA, [Const, Ref]btTransform frameInB); - void setDbgDrawSize(float dbgDrawSize); - void setLinearLowerLimit([Const, Ref]btVector3 linearLower); - void setLinearUpperLimit([Const, Ref]btVector3 linearUpper); - void setAngularLowerLimit([Const, Ref]btVector3 linearLower); - void setAngularUpperLimit([Const, Ref]btVector3 linearUpper); - void setLimit(long axis, float lo, float hi); - void setStiffness(long index, float stiffness); - void setDamping(long index, float damping); - void setBounce(long index, float bounce); - void setServo(long index, boolean onOff); - void setServoTarget(long index, float target); - void enableMotor(long index, boolean onOff); - void enableSpring(long index, boolean onOff); - void setTargetVelocity(long index, float velocity); - void setMaxMotorForce(long index, float force); - void setEquilibriumPoint(); - void setEquilibriumPoint(long index); - void setEquilibriumPoint(long index, float val); - void setFrames([Const, Ref]btTransform frameA, [Const, Ref]btTransform frameB); - btRotationalLimitMotor2 getRotationalLimitMotor(long index); - btTranslationalLimitMotor2 getTranslationalLimitMotor(); -}; -btGeneric6DofSpring2Constraint implements btTypedConstraint; - -interface btRotationalLimitMotor2 { - attribute float m_loLimit; - attribute float m_hiLimit; - attribute float m_bounce; - attribute float m_stopERP; - attribute float m_stopCFM; - attribute float m_motorERP; - attribute float m_motorCFM; - attribute boolean m_enableMotor; - attribute float m_targetVelocity; - attribute float m_maxMotorForce; - attribute boolean m_servoMotor; - attribute float m_servoTarget; - attribute boolean m_enableSpring; - attribute float m_springStiffness; - attribute boolean m_springStiffnessLimited; - attribute float m_springDamping; - attribute boolean m_springDampingLimited; - attribute float m_equilibriumPoint; - boolean isLimited(); - void testLimitValue(float test_value); -}; - -interface btTranslationalLimitMotor2 { - [Value]attribute btVector3 m_lowerLimit; - [Value]attribute btVector3 m_upperLimit; - [Value]attribute btVector3 m_bounce; - [Value]attribute btVector3 m_stopERP; - [Value]attribute btVector3 m_stopCFM; - [Value]attribute btVector3 m_motorERP; - [Value]attribute btVector3 m_motorCFM; - attribute boolean [] m_enableMotor; - attribute boolean [] m_servoMotor; - attribute boolean [] m_enableSpring; - [Value]attribute btVector3 m_servoTarget; - [Value]attribute btVector3 m_springStiffness; - attribute boolean [] m_springStiffnessLimited; - [Value]attribute btVector3 m_springDamping; - attribute boolean [] m_springDampingLimited; - [Value]attribute btVector3 m_equilibriumPoint; - [Value]attribute btVector3 m_targetVelocity; - [Value]attribute btVector3 m_maxMotorForce; - boolean isLimited(long limitIndex); - void testLimitValue(long limitIndex, float test_value); -}; - -interface btFixedConstraint { - void btFixedConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform frameInA, [Const, Ref]btTransform frameInB); -}; -btFixedConstraint implements btTypedConstraint; - -interface btPoint2PointConstraint { - void btPoint2PointConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btVector3 pivotInA, [Ref]btVector3 pivotInB); - void btPoint2PointConstraint([Ref]btRigidBody rbA, [Ref]btVector3 pivotInA); - void setPivotA([Const, Ref]btVector3 pivotA); - void setPivotB([Const, Ref]btVector3 pivotB); - [Const, Ref]btVector3 getPivotInA(); - [Const, Ref]btVector3 getPivotInB(); - [Value]attribute btConstraintSetting m_setting; -}; -btPoint2PointConstraint implements btTypedConstraint; - -interface btGeneric6DofConstraint { - void btGeneric6DofConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btTransform frameInA, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameA); - void btGeneric6DofConstraint([Ref]btRigidBody rbB, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameB); - void setLinearLowerLimit([Const, Ref]btVector3 linearLower); - void setLinearUpperLimit([Const, Ref]btVector3 linearUpper); - void setAngularLowerLimit([Const, Ref]btVector3 angularLower); - void setAngularUpperLimit([Const, Ref]btVector3 angularUpper); -}; -btGeneric6DofConstraint implements btTypedConstraint; - -interface btGeneric6DofSpringConstraint { - void btGeneric6DofSpringConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btTransform frameInA, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameA); - void btGeneric6DofSpringConstraint([Ref]btRigidBody rbB, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameB); - void enableSpring(long index, boolean onOff); - void setStiffness(long index, float stiffness); - void setDamping(long index, float damping); -}; -btGeneric6DofSpringConstraint implements btGeneric6DofConstraint; - -interface btSequentialImpulseConstraintSolver { - void btSequentialImpulseConstraintSolver(); -}; -btSequentialImpulseConstraintSolver implements btConstraintSolver; - -interface btConeTwistConstraint { - void btConeTwistConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btTransform rbAFrame, [Ref]btTransform rbBFrame); - void btConeTwistConstraint([Ref]btRigidBody rbA, [Ref]btTransform rbAFrame); - void setLimit(long limitIndex, float limitValue); - void setLimit(float _swingSpan1, float _swingSpan2, float _twistSpan, optional float _softness, optional float _biasFactor, optional float _relaxationFactor); - void setAngularOnly(boolean angularOnly); - void setDamping(float damping); - void enableMotor(boolean b); - void setMaxMotorImpulse(float maxMotorImpulse); - void setMaxMotorImpulseNormalized(float maxMotorImpulse); - void setMotorTarget([Const, Ref]btQuaternion q); - void setMotorTargetInConstraintSpace([Const, Ref]btQuaternion q); -}; -btConeTwistConstraint implements btTypedConstraint; - -interface btHingeConstraint { - void btHingeConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btVector3 pivotInA, [Const, Ref]btVector3 pivotInB, [Const, Ref]btVector3 axisInA, [Const, Ref]btVector3 axisInB, optional boolean useReferenceFrameA); - void btHingeConstraint([Ref]btRigidBody rbA, [Ref]btVector3 pivotInA, [Const, Ref]btVector3 axisInA, boolean useReferenceFrameA); - void btHingeConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform rbAFrame, [Const, Ref]btTransform rbBFrame, boolean useReferenceFrameA); - void btHingeConstraint([Ref]btRigidBody rbA, [Const, Ref]btTransform rbAFrame, boolean useReferenceFrameA); - void setLimit(float low, float high, optional float softness, optional float biasFactor, optional float relaxationFactor); - void enableAngularMotor(boolean enableMotor, float targetVelocity, float maxMotorImpulse); -}; -btHingeConstraint implements btTypedConstraint; - -interface btSliderConstraint { - void btSliderConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform frameInA, [Const, Ref]btTransform frameInB, boolean useLinearReferenceFrameA); - void btSliderConstraint([Ref]btRigidBody rbB, [Const, Ref]btTransform frameInB, boolean uesLinearReferenceFrameA); - void setLowerLinLimit(float lowerLimit); - void setUpperLinLimit(float upperLimit); - void setLowerAngLimit(float lowerAngLimit); - void setUpperAngLimit(float upperAngLimit); -}; -btSliderConstraint implements btTypedConstraint; - -interface btConstraintSolver {}; - -interface btDispatcherInfo { - attribute float m_timeStep; - attribute long m_stepCount; - attribute long m_dispatchFunc; - attribute float m_timeOfImpact; - attribute boolean m_useContinuous; - attribute boolean m_enableSatConvex; - attribute boolean m_enableSPU; - attribute boolean m_useEpa; - attribute float m_allowedCcdPenetration; - attribute boolean m_useConvexConservativeDistanceUtil; - attribute float m_convexConservativeDistanceThreshold; -}; - -interface btIDebugDraw {}; - -interface btContactSolverInfo { - attribute boolean m_splitImpulse; - attribute long m_splitImpulsePenetrationThreshold; -}; - -interface btDynamicsWorld { - long stepSimulation(float timeStep, optional long maxSubSteps, optional float fixedTimeStep); - void addAction(btActionInterface action); - void removeAction(btActionInterface action); - [Ref]btContactSolverInfo getSolverInfo(); - void addRigidBody(btRigidBody body); - void addRigidBody(btRigidBody body, long group, long mask); - void removeRigidBody(btRigidBody body); - void setGravity([Ref]btVector3 gravity); - [Value]btVector3 getGravity(); - void addConstraint(btTypedConstraint constraint, optional boolean disableCollisionsBetweenLinkedBodies); - void removeConstraint(btTypedConstraint constraint); - void clearForces(); -}; -btDynamicsWorld implements btCollisionWorld; - -interface btDiscreteDynamicsWorld { - void btDiscreteDynamicsWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btConstraintSolver constraintSolver, btCollisionConfiguration collisionConfiguration); -}; -btDiscreteDynamicsWorld implements btDynamicsWorld; - -interface btActionInterface { - void updateAction(btCollisionWorld collisionWorld, float deltaTimeStep); - void debugDraw(btIDebugDraw debugDrawer); -}; - -//Vehicle - - -[Prefix = "btRaycastVehicle::"] -interface btVehicleTuning { - void btVehicleTuning(); - attribute float m_suspensionStiffness; - attribute float m_suspensionCompression; - attribute float m_suspensionDamping; - attribute float m_maxSuspensionTravelCm; - attribute float m_frictionSlip; - attribute float m_maxSuspensionForce; -}; - -interface btVehicleRaycaster {}; - -interface btDefaultVehicleRaycaster { - void btDefaultVehicleRaycaster(btDynamicsWorld world); -}; -btDefaultVehicleRaycaster implements btVehicleRaycaster; - -[Prefix = "btWheelInfo::"] -interface RaycastInfo { - [Value]attribute btVector3 m_contactNormalWS; - [Value]attribute btVector3 m_contactPointWS; - attribute float m_suspensionLength; - [Value]attribute btVector3 m_hardPointWS; - [Value]attribute btVector3 m_wheelDirectionWS; - [Value]attribute btVector3 m_wheelAxleWS; - attribute boolean m_isInContact; - attribute any m_groundObject; -}; - -interface btWheelInfo { - [Value]attribute RaycastInfo m_raycastInfo; - [Value]attribute btTransform m_worldTransform; - [Value]attribute btVector3 m_chassisConnectionPointCS; - [Value]attribute btVector3 m_wheelDirectionCS; - [Value]attribute btVector3 m_wheelAxleCS; - attribute float m_suspensionRestLength1; - attribute float m_maxSuspensionTravelCm; - attribute float m_wheelsRadius; - attribute float m_suspensionStiffness; - attribute float m_wheelsDampingCompression; - attribute float m_wheelsDampingRelaxation; - attribute float m_frictionSlip; - attribute float m_steering; - attribute float m_rotation; - attribute float m_deltaRotation; - attribute float m_rollInfluence; - attribute float m_maxSuspensionForce; - attribute float m_engineForce; - attribute float m_brake; - attribute boolean m_bIsFrontWheel; - attribute float m_clippedInvContactDotSuspension; - attribute float m_suspensionRelativeVelocity; - attribute float m_wheelsSuspensionForce; - attribute float m_skidInfo; - void updateWheel([Const, Ref]btRigidBody chassis, [Ref]RaycastInfo raycastInfo); -}; - -interface btRaycastVehicle { - void btRaycastVehicle([Const, Ref]btVehicleTuning tuning, btRigidBody chassis, btVehicleRaycaster raycaster); - void applyEngineForce(float force, long wheel); - void updateVehicle(float step); - void resetSuspension(); - float rayCast([Ref]btWheelInfo wheel); - float getSteeringValue(long wheel); - void setSteeringValue(float steering, long wheel); - [Const, Ref]btTransform getWheelTransformWS(long wheelIndex); - void updateWheelTransform(long wheelIndex, optional boolean interpolatedTransform); - void updateWheelTransformsWS([Ref]btWheelInfo wheel, optional boolean interpolatedTransform); - [Ref]btWheelInfo addWheel([Const, Ref]btVector3 connectionPointCS0, [Const, Ref]btVector3 wheelDirectionCS0, [Const, Ref]btVector3 wheelAxleCS, float suspensionRestLength, float wheelRadius, [Const, Ref]btVehicleTuning tuning, boolean isFrontWheel); - long getNumWheels(); - btRigidBody getRigidBody(); - [Ref]btWheelInfo getWheelInfo(long index); - void setBrake(float brake, long wheelIndex); - void setCoordinateSystem(long rightIndex, long upIndex, long forwardIndex); - float getCurrentSpeedKmHour(); - long getRightAxis(); - long getUpAxis(); - long getForwardAxis(); - [Value]btVector3 getForwardVector(); - long getUserConstraintType(); - void setUserConstraintType(long userConstraintType); - void setUserConstraintId(long uid); - long getUserConstraintId(); - void updateFriction(float timeStep); - void updateSuspension(float deltaTime); - void setPitchControl(float pitch); -}; -btRaycastVehicle implements btActionInterface; - -interface btKinematicCharacterController { - void btKinematicCharacterController(btPairCachingGhostObject ghostObject, btConvexShape convexShape, float stepHeight, [Ref] optional btVector3 upAxis); - void setUp([Const, Ref]btVector3 up); - void setWalkDirection([Const, Ref]btVector3 walkDirection); - void setVelocityForTimeInterval([Const, Ref]btVector3 velocity, float timeInterval); - //void reset (); - void warp([Const, Ref]btVector3 origin); - void preStep(btCollisionWorld collisionWorld); - void playerStep(btCollisionWorld collisionWorld, float dt); - void setFallSpeed(float fallSpeed); - void setJumpSpeed(float jumpSpeed); - void setMaxJumpHeight(float maxJumpHeight); - boolean canJump(); - void jump([Const, Ref]optional btVector3 v); - void setGravity([Const, Ref]btVector3 gravity); - [Value]btVector3 getGravity(); - void setMaxSlope(float slopeRadians); - float getMaxSlope(); - btPairCachingGhostObject getGhostObject(); - void setUseGhostSweepTest(boolean useGhostObjectSweepTest); - boolean onGround(); -}; -btKinematicCharacterController implements btActionInterface; - -interface btGhostObject { - void btGhostObject(); - long getNumOverlappingObjects(); - btCollisionObject getOverlappingObject(long index); -}; -btGhostObject implements btCollisionObject; - -interface btPairCachingGhostObject { - void btPairCachingGhostObject(); -}; -btPairCachingGhostObject implements btGhostObject; - -interface btGhostPairCallback { - void btGhostPairCallback(); -}; - -// Soft bodies - -// interface btSparseSdf3 { -// void Initialize(btSoftBodyWorldInfo worldInfo, optional long hashsize, optional long clampCells); -// void Reset(btSoftBodyWorldInfo worldInfo); -// void GarbageCollect(btSoftBodyWorldInfo worldInfo, optional long lifetime); -// }; - -interface btSoftBodyWorldInfo { - void btSoftBodyWorldInfo(); - attribute float air_density; - attribute float water_density; - attribute float water_offset; - attribute float m_maxDisplacement; - [Value]attribute btVector3 water_normal; - attribute btBroadphaseInterface m_broadphase; - attribute btDispatcher m_dispatcher; - [Value]attribute btVector3 m_gravity; -}; - -[Prefix = "btSoftBody::"] -interface tNodeArray { - [Const]long size(); - [Const, Ref]Node at(long n); - void resize(long numVertices); -}; - -[Prefix = "btSoftBody::"] -interface tFaceArray { - [Const]long size(); - [Const, Ref]Face at(long n); -}; - -[Prefix = "btSoftBody::"] -interface Node { - [Value]attribute btVector3 m_x; - [Value]attribute btVector3 m_q; - [Value]attribute btVector3 m_v; - [Value]attribute btVector3 m_f; - [Value]attribute btVector3 m_n; - attribute float m_im; - attribute float m_area; -}; - -[Prefix = "btSoftBody::"] -interface Face { - // [Value] attribute Node m_n; - [Value]attribute btVector3 m_normal; - attribute float m_ra; -}; - -[Prefix = "btSoftBody::"] -interface Element { - attribute any m_tag; -}; - -[Prefix = "btSoftBody::"] -interface Material { - attribute float m_kLST; - attribute float m_kAST; - attribute float m_kVST; - attribute long m_flags; -}; -Material implements Element; - -[Prefix = "btSoftBody::"] -interface tMaterialArray { - [Const]long size(); - Material at(long n); -}; - -[Prefix = "btSoftBody::"] -interface Config { - attribute float kVCF; - attribute float kDP; - attribute float kDG; - attribute float kLF; - attribute float kPR; - attribute float kVC; - attribute float kDF; - attribute float kMT; - attribute float kCHR; - attribute float kKHR; - attribute float kSHR; - attribute float kAHR; - attribute float kSRHR_CL; - attribute float kSKHR_CL; - attribute float kSSHR_CL; - attribute float kSR_SPLT_CL; - attribute float kSK_SPLT_CL; - attribute float kSS_SPLT_CL; - attribute float maxvolume; - attribute float timescale; - attribute long viterations; - attribute long piterations; - attribute long diterations; - attribute long citerations; - attribute long collisions; -}; - -interface btSoftBody { - void btSoftBody(btSoftBodyWorldInfo worldInfo); //, long node_count, [Const] btVector3 x, [Const] long m); - - [Value]attribute Config m_cfg; - [Value]attribute tNodeArray m_nodes; - [Value]attribute tFaceArray m_faces; - [Value]attribute tMaterialArray m_materials; - - [Const]boolean checkLink(long node0, long node1); - [Const]boolean checkFace(long node0, long node1, long node2); - Material appendMaterial(); - void appendNode([Const, Ref]btVector3 x, float m); - void appendLink(long node0, long node1, Material mat, boolean bcheckexist); - void appendFace(long node0, long node1, long node2, Material mat); - void appendTetra(long node0, long node1, long node2, long node3, Material mat); - void appendAnchor(long node, btRigidBody body, boolean disableCollisionBetweenLinkedBodies, float influence); - [Const]float getTotalMass(); - void setTotalMass(float mass, optional boolean fromfaces); - void setMass(long node, float mass); - void transform([Const, Ref]btTransform trs); - void translate([Const, Ref]btVector3 trs); - void rotate([Const, Ref]btQuaternion rot); - void scale([Const, Ref]btVector3 scl); - long generateClusters(long k, optional long maxiterations); - void randomizeConstraints(); - long generateBendingConstraints(long distance, optional Material mat); - btSoftBody upcast(btCollisionObject colObj); -}; -btSoftBody implements btCollisionObject; - -interface btSoftBodyRigidBodyCollisionConfiguration { - void btSoftBodyRigidBodyCollisionConfiguration([Ref]optional btDefaultCollisionConstructionInfo info); -}; -btSoftBodyRigidBodyCollisionConfiguration implements btDefaultCollisionConfiguration; - -interface btSoftBodySolver {}; - -interface btDefaultSoftBodySolver { - void btDefaultSoftBodySolver(); -}; -btDefaultSoftBodySolver implements btSoftBodySolver; - -interface btSoftBodyArray { - [Const]long size(); - [Const]btSoftBody at(long n); -}; - -interface btSoftRigidDynamicsWorld { - void btSoftRigidDynamicsWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btConstraintSolver constraintSolver, btCollisionConfiguration collisionConfiguration, optional btSoftBodySolver softBodySolver); - void addSoftBody(btSoftBody body, optional long collisionFilterGroup, optional long collisionFilterMask); - void removeSoftBody(btSoftBody body); - [Ref]btSoftBodyWorldInfo getWorldInfo(); - [Ref]btSoftBodyArray getSoftBodyArray(); - long getDrawFlags(); - void setDrawFlags(long f); -}; -btSoftRigidDynamicsWorld implements btDiscreteDynamicsWorld; + void btVector3(); + void btVector3(float x, float y, float z); + float length(); + float getX(); + float getY(); + float getZ(); + void setX(float x); + void setY(float y); + void setZ(float z); + void setValue(float x, float y, float z); +}; +// +//interface btQuadWord { +// float getX(); +// float getY(); +// float getZ(); +// void setX(float x); +// void setY(float y); +// void setZ(float z); +// void setW(float w); +//}; +// +//interface btQuaternion { +// void btQuaternion(); +// void btQuaternion(float x, float y, float z, float w); +// void setValue(float x, float y, float z, float w); +// void setEulerZYX(float z, float y, float x); +// void setRotation([Const, Ref] btVector3 axis, float angle); +// float getW(); +// void normalize(); +//}; +//btQuaternion implements btQuadWord; +// +//interface btMatrix3x3 { +// void btMatrix3x3(); +// void setEulerZYX(float ex, float ey, float ez); +// void getRotation([Ref]btQuaternion q); +// [Operator="[]", Ref] btVector3 getRow(long i); +// [Value]btVector3 getColumn(long y); +// +//}; +// +//interface btTransform { +// void btTransform(); +// void btTransform([Ref]btQuaternion q, [Ref]btVector3 v); +// void setIdentity(); +// void setOrigin([Ref]btVector3 origin); +// void setRotation([Ref]btQuaternion rotation); +// [Ref]btVector3 getOrigin(); +// [Value]btQuaternion getRotation(); +// [Ref]btMatrix3x3 getBasis(); +//// void setFromOpenGLMatrix(float[] m); +//// void getOpenGLMatrix(float[] m); +//}; +// +//interface btMotionState { +// void getWorldTransform([Ref]btTransform worldTrans); +// void setWorldTransform([Const, Ref]btTransform worldTrans); +//}; +// +//// Collision +// +//interface btCollisionWorld { +// void btCollisionWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btCollisionConfiguration collisionConfiguration); +// void setBroadphase(btBroadphaseInterface pairCache); +// //btBroadphaseInterface getBroadphase(); //Not needed +// //btOverlappingPairCache getPairCache(); //Not needed +// btDispatcher getDispatcher(); +// void updateSingleAabb(btCollisionObject colObj); +// void updateAabbs(); +// void computeOverlappingPairs(); +// void setDebugDrawer(btIDebugDraw debugDrawer); +// //btIDebugDraw getDebugDrawer(); //Not needed +// void debugDrawWorld(); +// void debugDrawObject ([Const, Ref] btTransform worldTransform, [Const] btCollisionShape shape, [Const, Ref] btVector3 color); +// long getNumCollisionObjects(); +// void rayTest([Const, Ref]btVector3 rayFromWorld, [Const, Ref]btVector3 rayToWorld, [Ref]RayResultCallback resultCallback); +// void convexSweepTest([Const]btConvexShape castShape, [Const, Ref]btTransform from, [Const, Ref]btTransform to, [Ref]ConvexResultCallback resultCallback, optional float allowedCcdPenetration); +// void contactTest(btCollisionObject colObj, [Ref]ContactResultCallback resultCallback); +// void contactPairTest(btCollisionObject colObjA, btCollisionObject colObjB, [Ref]ContactResultCallback resultCallback); +// void addCollisionObject(btCollisionObject collisionObject, optional long collisionFilterGroup, optional long collisionFilterMask); +// [Ref]btCollisionObjectArray getCollisionObjectArray(); +// void removeCollisionObject(btCollisionObject collisionObject); +// void performDiscreteCollisionDetection(); +// [Ref]btDispatcherInfo getDispatchInfo(); +// boolean getForceUpdateAllAabbs (); +// void setForceUpdateAllAabbs(boolean f); +//}; +// +//interface btCollisionConfiguration {}; +// +//interface btDefaultCollisionConstructionInfo { +// void btDefaultCollisionConstructionInfo(); +//}; +// +//interface btDefaultCollisionConfiguration { +// void btDefaultCollisionConfiguration([Ref]optional btDefaultCollisionConstructionInfo info); +//}; +//btDefaultCollisionConfiguration implements btCollisionConfiguration; +// +//interface btCollisionObject { +// void btCollisionObject(); +// boolean mergesSimulationIslands(); +// [Const, Ref] btVector3 getAnisotropicFriction(); +// void setAnisotropicFriction([Const, Ref]btVector3 anisotropicFriction, long frictionMode); +// boolean hasAnisotropicFriction(optional long frictionMode); +// void setContactProcessingThreshold(float contactProcessingThreshold); +// float getContactProcessingThreshold(); +// boolean isStaticObject(); +// boolean isKinematicObject(); +// boolean isStaticOrKinematicObject(); +// boolean hasContactResponse(); +// void setCollisionShape(btCollisionShape collisionShape); +// //btCollisionShape getCollisionShape(); //Not needed +// void setIgnoreCollisionCheck([Const] btCollisionObject obj, boolean ignoreCollisionCheck); +// boolean checkCollideWithOverride([Const] btCollisionObject obj); +// long getActivationState(); +// void setActivationState(long newState); +// void setDeactivationTime(float time); +// float getDeactivationTime(); +// void forceActivationState(long newState); +// void activate(optional boolean forceActivation); +// boolean isActive(); +// void setRestitution(float rest); +// float getRestitution(); +// void setFriction(float frict); +// float getFriction(); +// void setRollingFriction(float frict); +// float getRollingFriction(); +// [Ref]btTransform getWorldTransform(); +// void setWorldTransform([Const, Ref]btTransform worldTrans); +// btBroadphaseProxy getBroadphaseHandle(); +// void setBroadphaseHandle(btBroadphaseProxy handle); +// [Ref] btTransform getInterpolationWorldTransform(); +// void setInterpolationWorldTransform([Const, Ref]btTransform trans); +// void setInterpolationLinearVelocity([Const, Ref]btVector3 linvel); +// void setInterpolationAngularVelocity([Const, Ref]btVector3 angvel); +// [Const, Ref]btVector3 getInterpolationLinearVelocity(); +// [Const, Ref]btVector3 getInterpolationAngularVelocity(); +// long getIslandTag(); +// void setIslandTag(long tag); +// long getCompanionId(); +// void setCompanionId(long id); +// float getHitFraction(); +// void setHitFraction(float hitFraction); +// long getCollisionFlags(); +// void setCollisionFlags(long flags); +// float getCcdSweptSphereRadius(); +// void setCcdSweptSphereRadius(float radius); +// float getCcdMotionThreshold(); +// float getCcdSquareMotionThreshold(); +// void setCcdMotionThreshold(float ccdMotionThreshold); +// any getUserPointer(); +// long getUserIndex(); +// void setUserPointer(any userPointer); +// void setUserIndex(long index); +// long getUpdateRevisionInternal(); +// boolean checkCollideWith([Const] btCollisionObject co); +// +//}; +// +//interface btManifoldPoint { +// [Const, Ref]btVector3 getPositionWorldOnA(); +// [Const, Ref]btVector3 getPositionWorldOnB(); +// float getAppliedImpulse(); +// float getDistance(); +// [Value]attribute btVector3 m_localPointA; +// [Value]attribute btVector3 m_localPointB; +// [Value]attribute btVector3 m_positionWorldOnB; +// [Value]attribute btVector3 m_positionWorldOnA; +// [Value]attribute btVector3 m_normalWorldOnB; +// long getLifeTime(); +//}; +// +//interface btBroadphaseProxy {}; +// +//[Prefix = "btCollisionWorld::"] +//interface LocalRayResult { +// [Const]attribute btCollisionObject m_collisionObject; +// attribute LocalShapeInfo m_localShapeInfo; +// [Value]attribute btVector3 m_hitNormalLocal; +// attribute float m_hitFraction; +//}; +// +//[Prefix = "btCollisionWorld::"] +//interface RayResultCallback { +// // abstract base class, no constructor +// boolean hasHit(); +// attribute float m_closestHitFraction; +// attribute long m_collisionFilterGroup; +// attribute long m_collisionFilterMask; +// [Const]attribute btCollisionObject m_collisionObject; +// attribute unsigned long m_flags; +// float addSingleResult([Ref]LocalRayResult rayResult, boolean normalInWorldSpace); +//}; +// +//[Prefix = "btCollisionWorld::"] +//interface ClosestRayResultCallback { +// void ClosestRayResultCallback([Const, Ref]btVector3 from, [Const, Ref]btVector3 to); +// [Value]attribute btVector3 m_rayFromWorld; +// [Value]attribute btVector3 m_rayToWorld; +// [Value]attribute btVector3 m_hitNormalWorld; +// [Value]attribute btVector3 m_hitPointWorld; +//}; +//ClosestRayResultCallback implements RayResultCallback; +// +//[Prefix = "btCollisionWorld::"] +//interface AllHitsRayResultCallback { +// void AllHitsRayResultCallback([Const, Ref]btVector3 from, [Const, Ref]btVector3 to); +// [Value]attribute MyCollisionObjectArray m_collisionObjects; +// [Value]attribute btVector3 m_rayFromWorld; +// [Value]attribute btVector3 m_rayToWorld; +// [Value]attribute MyVector3Array m_hitNormalWorld; +// [Value]attribute MyVector3Array m_hitPointWorld; +// [Value]attribute MyScalarArray m_hitFractions; +//}; +//AllHitsRayResultCallback implements RayResultCallback; +// +//[Prefix = "btCollisionWorld::"] +//interface LocalShapeInfo { +// attribute long m_shapePart; +// attribute long m_triangleIndex; +//}; +// +//[Prefix = "btCollisionWorld::"] +//interface LocalConvexResult { +// void LocalConvexResult([Const]btCollisionObject hitCollisionObject, LocalShapeInfo localShapeInfo, [Const, Ref]btVector3 hitNormalLocal, [Const, Ref]btVector3 hitPointLocal, float hitFraction); +// [Const]attribute btCollisionObject m_hitCollisionObject; +// attribute LocalShapeInfo m_localShapeInfo; +// [Value]attribute btVector3 m_hitNormalLocal; +// [Value]attribute btVector3 m_hitPointLocal; +// attribute float m_hitFraction; +//}; +// +//[Prefix = "btCollisionWorld::"] +//interface ConvexResultCallback { +// // abstract base class, no constructor +// boolean hasHit(); +// attribute long m_collisionFilterGroup; +// attribute long m_collisionFilterMask; +// attribute float m_closestHitFraction; +//}; +// +//[Prefix = "btCollisionWorld::"] +//interface ClosestConvexResultCallback { +// void ClosestConvexResultCallback([Const, Ref]btVector3 convexFromWorld, [Const, Ref]btVector3 convexToWorld); +// [Value]attribute btVector3 m_convexFromWorld; +// [Value]attribute btVector3 m_convexToWorld; +// [Value]attribute btVector3 m_hitNormalWorld; +// [Value]attribute btVector3 m_hitPointWorld; +//}; +//ClosestConvexResultCallback implements ConvexResultCallback; +// +//interface btPersistentManifold { +// void btPersistentManifold(); +// [Const]btCollisionObject getBody0(); +// [Const]btCollisionObject getBody1(); +// long getNumContacts(); +// [Ref]btManifoldPoint getContactPoint(long index); +//}; +// +//interface btDispatcher { +// long getNumManifolds(); +// btPersistentManifold getManifoldByIndexInternal(long index); +//}; +// +//interface btCollisionDispatcher { +// void btCollisionDispatcher(btCollisionConfiguration conf); +//}; +//btCollisionDispatcher implements btDispatcher; +// +//interface btOverlappingPairCallback {}; +// +//interface btCollisionAlgorithm { +// void getAllContactManifolds([Ref]btManifoldArray manifoldArray); +//}; +// +//interface btGearConstraint { +// void btGearConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btVector3 axisInA, [Const, Ref]btVector3 axisInB, optional float ratio); +//}; +// +//interface btBroadphasePair { +// attribute btCollisionAlgorithm m_algorithm; +//}; +// +//interface btOverlappingPairCache { +// void setInternalGhostPairCallback(btOverlappingPairCallback ghostPairCallback); +// [Ref]btBroadphasePairArray getOverlappingPairArray(); +//}; +// +//interface btAxisSweep3 { +// void btAxisSweep3([Ref]btVector3 worldAabbMin, [Ref]btVector3 worldAabbMax, optional long maxHandles, optional btOverlappingPairCache pairCache, optional boolean disableRaycastAccelerator); +//}; +//btAxisSweep3 implements btBroadphaseInterface; +// +//interface btBroadphaseInterface { +// btOverlappingPairCache getOverlappingPairCache(); +//}; +// +//interface btDbvtBroadphase { +// void btDbvtBroadphase(); +//}; +//btDbvtBroadphase implements btBroadphaseInterface; +// +//// Arrays +// +//interface btManifoldArray { +// void btManifoldArray(); +// [Const]long size(); +// [Const]btPersistentManifold at(long n); +// void resize(long value); +// long capacity(); +//}; +// +//interface btBroadphasePairArray { +// [Const]long size(); +// [Const, Ref]btBroadphasePair at(long n); +// void resize(long value); +// long capacity(); +//}; +// +//interface btCollisionObjectArray { +// [Const]long size(); +// [Const]btCollisionObject at(long n); +// void resize(long value); +// long capacity(); +//}; +// +//interface btStridingMeshInterface {}; +// +//// Shapes +// +//interface btCollisionShape { +// void setLocalScaling([Const, Ref]btVector3 scaling); +// void calculateLocalInertia(float mass, [Ref]btVector3 inertia); +// void setMargin(float margin); +// float getMargin(); +// long getShapeType(); +// void getAabb([Const, Ref]btTransform t, [Ref]btVector3 aabbMin, [Ref]btVector3 aabbMax); +//}; +// +//interface btConvexShape { +// long getNumPreferredPenetrationDirections(); +// void getPreferredPenetrationDirection(long index, [Ref]btVector3 penetrationVector); +//}; +//btConvexShape implements btCollisionShape; +// +//interface btConvexInternalShape { +// void setImplicitShapeDimensions([Ref]btVector3 dimensions); +//}; +//btConvexInternalShape implements btConvexShape; +// +//interface btPolyhedralConvexShape { +//}; +//btPolyhedralConvexShape implements btConvexInternalShape; +// +//interface btPolyhedralConvexAabbCachingShape { +//}; +//btPolyhedralConvexAabbCachingShape implements btPolyhedralConvexShape; +// +//interface btConvexTriangleMeshShape { +// void btConvexTriangleMeshShape(btStridingMeshInterface meshInterface, optional boolean calcAabb); +//}; +//btConvexTriangleMeshShape implements btPolyhedralConvexAabbCachingShape; +// +//interface btBoxShape { +// void btBoxShape([Ref]btVector3 boxHalfExtents); +// void setMargin(float margin); +// [Ref,Const] btVector3 getHalfExtentsWithoutMargin(); +// float getMargin(); +//}; +//btBoxShape implements btPolyhedralConvexShape; +// +//interface btCapsuleShape { +// void btCapsuleShape(float radius, float height); +// void setMargin(float margin); +// float getMargin(); +//}; +//btCapsuleShape implements btConvexInternalShape; +// +//interface btCapsuleShapeX { +// void btCapsuleShapeX(float radius, float height); +// void setMargin(float margin); +// float getMargin(); +//}; +//btCapsuleShapeX implements btCapsuleShape; +// +//interface btCapsuleShapeZ { +// void btCapsuleShapeZ(float radius, float height); +// void setMargin(float margin); +// float getMargin(); +//}; +//btCapsuleShapeZ implements btCapsuleShape; +// +//interface btCylinderShape { +// void btCylinderShape([Ref]btVector3 halfExtents); +// void setMargin(float margin); +// float getMargin(); +//}; +//btCylinderShape implements btConvexInternalShape; +// +//interface btCylinderShapeX { +// void btCylinderShapeX([Ref]btVector3 halfExtents); +// void setMargin(float margin); +// float getMargin(); +//}; +//btCylinderShapeX implements btCylinderShape; +// +//interface btCylinderShapeZ { +// void btCylinderShapeZ([Ref]btVector3 halfExtents); +// void setMargin(float margin); +// float getMargin(); +//}; +//btCylinderShapeZ implements btCylinderShape; +// +//interface btSphereShape { +// void btSphereShape(float radius); +// float getRadius(); +// void setUnscaledRadius(float radius); +// void setMargin(float margin); +// float getMargin(); +//}; +//btSphereShape implements btConvexInternalShape; +// +//interface btConeShape { +// void btConeShape(float radius, float height); +//}; +//btConeShape implements btConvexInternalShape; +// +////interface btConvexHullShape { +//// void btConvexHullShape([Const] optional float[] points, optional long numPoints, optional long stride); +//// void addPoint([Const, Ref]btVector3 point, optional boolean recalculateLocalAABB); +//// void setMargin(float margin); +//// float getMargin(); +//// long getNumPoints(); +//// [Value]btVector3 getScaledPoint(long i); +//// void optimizeConvexHull(); +////}; +////btConvexHullShape implements btPolyhedralConvexAabbCachingShape; +// +//interface btConeShapeX { +// void btConeShapeX(float radius, float height); +//}; +//btConeShapeX implements btConeShape; +// +//interface btConeShapeZ { +// void btConeShapeZ(float radius, float height); +//}; +//btConeShapeZ implements btConeShape; +// +//interface btCompoundShape { +// void btCompoundShape(optional boolean enableDynamicAabbTree); +// void addChildShape([Const, Ref]btTransform localTransform, btCollisionShape shape); +// void removeChildShapeByIndex(long childShapeindex); +// void removeChildShape(btCollisionShape shape); +// [Const]long getNumChildShapes(); +// btCollisionShape getChildShape(long index); +// void setMargin(float margin); +// float getMargin(); +// void recalculateLocalAabb(); +//}; +//btCompoundShape implements btCollisionShape; +// +//interface btConcaveShape {}; +//btConcaveShape implements btCollisionShape; +// +//interface btStaticPlaneShape { +// void btStaticPlaneShape([Const, Ref]btVector3 planeNormal, float planeConstant); +//}; +//btStaticPlaneShape implements btConcaveShape; +// +//interface btTriangleMeshShape {}; +//btTriangleMeshShape implements btConcaveShape; +// +//interface btBvhTriangleMeshShape { +// void btBvhTriangleMeshShape(btStridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, optional boolean buildBvh); +// void btBvhTriangleMeshShape(btStridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, [Const, Ref]btVector3 bvhAabbMin, [Const, Ref]btVector3 bvhAabbMax, optional boolean buildBvh); +// void performRaycast(btTriangleCallback callback, [Const, Ref]btVector3 raySource, [Const, Ref]btVector3 rayTarget); +//}; +//btBvhTriangleMeshShape implements btTriangleMeshShape; +// +////interface btHeightfieldTerrainShape { +//// void btHeightfieldTerrainShape(long heightStickWidth, long heightStickLength, VoidPtr heightfieldData, float heightScale, float minHeight, float maxHeight, long upAxis, PHY_ScalarType hdt, boolean flipQuadEdges); +//// void setMargin(float margin); +//// float getMargin(); +////}; +////btHeightfieldTerrainShape implements btConcaveShape; +// +//interface btScaledBvhTriangleMeshShape { +// void btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape childShape, [Const, Ref]btVector3 localScaling); +//}; +// +//interface btShapeHull { +// void btShapeHull(btConvexShape shape); +// long numTriangles(); +// long numVertices(); +// long numIndices(); +// boolean buildHull(float margin); +//}; +// +//// Other stuff +// +//enum PHY_ScalarType { +// "PHY_FLOAT", +// "PHY_DOUBLE", +// "PHY_INTEGER", +// "PHY_SHORT", +// "PHY_FIXEDPOINT88", +// "PHY_UCHAR" +//}; +// +//interface btIndexedMesh { +// void btIndexedMesh(); +//}; +// +//interface btTriangleMesh { +// void btTriangleMesh(optional boolean use32bitIndices, optional boolean use4componentVertices); +// void addTriangle([Const, Ref]btVector3 vertex0, [Const, Ref]btVector3 vertex1, [Const, Ref]btVector3 vertex2, optional boolean removeDuplicateVertices); +// void findOrAddVertex([Const, Ref]btVector3 vertex, boolean removeDuplicateVertices); +// void addIndex(long index); +//}; +//btTriangleMesh implements btStridingMeshInterface; +// +//interface btTriangleIndexVertexArray { +// void btTriangleIndexVertexArray(); +// void setPremadeAabb([Const, Ref]btVector3 aabbMin, [Const, Ref]btVector3 aabbMax); +// void getPremadeAabb(btVector3 aabbMin, btVector3 aabbMax); +// boolean hasPremadeAabb(); +//// void addIndexedMesh([Const, Ref]btIndexedMesh mesh, optional PHY_ScalarType indexType); +//}; +//btTriangleIndexVertexArray implements btStridingMeshInterface; +// +//interface btTriangleRaycastCallback { +// [Value]attribute btVector3 m_from; +// [Value]attribute btVector3 m_to; +// attribute float m_hitFraction; +// attribute unsigned long m_flags; +// float reportHit([Const, Ref]btVector3 hitNormalLocal, float hitFraction, long partId, long triangleIndex); +//}; +//btTriangleRaycastCallback implements btTriangleCallback; +// +//interface btTriangleCallback { +// void processTriangle(btVector3 triangle, long partId, long triangleIndex); +//}; +// +//// Dynamics +// +//[Prefix = "btRigidBody::"] +//interface btRigidBodyConstructionInfo { +// void btRigidBodyConstructionInfo(float mass, btMotionState motionState, btCollisionShape collisionShape, [Ref]optional btVector3 localInertia); +// attribute float m_linearDamping; +// attribute float m_angularDamping; +// attribute float m_friction; +// attribute float m_rollingFriction; +// attribute float m_restitution; +// attribute float m_linearSleepingThreshold; +// attribute float m_angularSleepingThreshold; +// attribute boolean m_additionalDamping; +// attribute float m_additionalDampingFactor; +// attribute float m_additionalLinearDampingThresholdSqr; +// attribute float m_additionalAngularDampingThresholdSqr; +// attribute float m_additionalAngularDampingFactor; +//}; +// +//interface btRigidBody { +// void btRigidBody([Const, Ref]btRigidBodyConstructionInfo constructionInfo); +// void btRigidBody (float mass, btMotionState motionState, btCollisionShape collisionShape, [Const, Ref] optional btVector3 localInertia); +// attribute long m_contactSolverType; +// attribute long m_frictionSolverType; +// void proceedToTransform([Const, Ref]btTransform newTrans); +// void predictIntegratedTransform(float step, [Ref]btTransform predictedTransform); +// void saveKinematicState(float step); +// void applyGravity(); +// void setGravity([Const, Ref]btVector3 acceleration); +// [Const, Ref]btVector3 getGravity(); +// void setDamping(float lin_damping, float ang_damping); +// float getLinearDamping(); +// float getAngularDamping(); +// float getLinearSleepingThreshold(); +// float getAngularSleepingThreshold(); +// void applyDamping(float timeStep); +// void setMassProps(float mass, [Const, Ref]btVector3 inertia); +// [Const, Ref]btVector3 getLinearFactor(); +// void setLinearFactor([Const, Ref]btVector3 linearFactor); +// float getInvMass(); +// [Const,Ref]btMatrix3x3 getInvInertiaTensorWorld(); +// void integrateVelocities(float step); +// void setCenterOfMassTransform([Const, Ref]btTransform xform); +// void applyCentralForce([Const, Ref]btVector3 force); +// [Const, Ref]btVector3 getTotalForce(); +// [Const, Ref]btVector3 getTotalTorque(); +// [Const, Ref]btVector3 getInvInertiaDiagLocal(); +// void setInvInertiaDiagLocal([Const,Ref]btVector3 diagInvInertia); +// void setSleepingThresholds(float linear, float angular); +// void applyTorque([Const, Ref]btVector3 torque); +// void applyForce([Const, Ref]btVector3 force, [Const, Ref]btVector3 rel_pos); +// void applyCentralImpulse([Const, Ref]btVector3 impulse); +// void applyTorqueImpulse([Const, Ref]btVector3 torque); +// void applyImpulse([Const, Ref]btVector3 impulse, [Const, Ref]btVector3 rel_pos); +// void clearForces(); +// void updateInertiaTensor(); +// [Const, Ref]btVector3 getCenterOfMassPosition(); +// [Const, Ref]btTransform getCenterOfMassTransform(); +// [Const, Ref]btVector3 getLinearVelocity(); +// [Const, Ref]btVector3 getAngularVelocity(); +// void setLinearVelocity([Const, Ref]btVector3 lin_vel); +// void setAngularVelocity([Const, Ref]btVector3 ang_vel); +// void translate([Const, Ref]btVector3 trs); +// void getAabb([Ref]btVector3 aabbMin, [Ref]btVector3 aabbMax); +// float computeImpulseDenominator([Const, Ref]btVector3 pos, [Const, Ref]btVector3 normal); +// float computeAngularImpulseDenominator([Const, Ref]btVector3 axis); +// void updateDeactivation(float timeStep); +// boolean wantsSleeping(); +// //btBroadphaseProxy getBroadphaseProxy(); // Not needed. btCollisionObject already have this call +// //void setNewBroadphaseProxy(btBroadphaseProxy broadphaseProxy) // Not needed +// btMotionState getMotionState(); +// void setMotionState(btMotionState motionState); +// void setAngularFactor([Const, Ref]btVector3 angFac); +// [Const, Ref]btVector3 getAngularFactor(); +// boolean isInWorld(); +// void addConstraintRef(btTypedConstraint c); +// void removeConstraintRef(btTypedConstraint c); +// btTypedConstraint getConstraintRef(long index); +// long getNumConstraintRefs(); +// void setFlags(long flags); +// long getFlags(); +// [Value]btQuaternion getOrientation(); +// [Value]btVector3 getVelocityInLocalPoint([Const, Ref]btVector3 rel_pos); +// [Value]btVector3 computeGyroscopicImpulseImplicit_World(float dt); +// [Value]btVector3 computeGyroscopicImpulseImplicit_Body(float step); +// [Value]btVector3 computeGyroscopicForceExplicit(float maxGyroscopicForce); +// [Value]btVector3 getLocalInertia(); +//}; +//btRigidBody implements btCollisionObject; +// +//interface btConstraintSetting { +// void btConstraintSetting(); +// attribute float m_tau; +// attribute float m_damping; +// attribute float m_impulseClamp; +//}; +// +//interface btTypedConstraint { +// void enableFeedback(boolean needsFeedback); +// [Const]float getBreakingImpulseThreshold(); +// void setBreakingImpulseThreshold([Const]float threshold); +// [Const, Ref]btRigidBody getRigidBodyA(); +// [Const, Ref]btRigidBody getRigidBodyB(); +//}; +// +//interface btGeneric6DofSpring2Constraint { +// void btGeneric6DofSpring2Constraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform frameInA, [Const, Ref]btTransform frameInB); +// void setDbgDrawSize(float dbgDrawSize); +// void setLinearLowerLimit([Const, Ref]btVector3 linearLower); +// void setLinearUpperLimit([Const, Ref]btVector3 linearUpper); +// void setAngularLowerLimit([Const, Ref]btVector3 linearLower); +// void setAngularUpperLimit([Const, Ref]btVector3 linearUpper); +// void setLimit(long axis, float lo, float hi); +// void setStiffness(long index, float stiffness); +// void setDamping(long index, float damping); +// void setBounce(long index, float bounce); +// void setServo(long index, boolean onOff); +// void setServoTarget(long index, float target); +// void enableMotor(long index, boolean onOff); +// void enableSpring(long index, boolean onOff); +// void setTargetVelocity(long index, float velocity); +// void setMaxMotorForce(long index, float force); +// void setEquilibriumPoint(); +// void setEquilibriumPoint(long index); +// void setEquilibriumPoint(long index, float val); +// void setFrames([Const, Ref]btTransform frameA, [Const, Ref]btTransform frameB); +// btRotationalLimitMotor2 getRotationalLimitMotor(long index); +// btTranslationalLimitMotor2 getTranslationalLimitMotor(); +//}; +//btGeneric6DofSpring2Constraint implements btTypedConstraint; +// +//interface btRotationalLimitMotor2 { +// attribute float m_loLimit; +// attribute float m_hiLimit; +// attribute float m_bounce; +// attribute float m_stopERP; +// attribute float m_stopCFM; +// attribute float m_motorERP; +// attribute float m_motorCFM; +// attribute boolean m_enableMotor; +// attribute float m_targetVelocity; +// attribute float m_maxMotorForce; +// attribute boolean m_servoMotor; +// attribute float m_servoTarget; +// attribute boolean m_enableSpring; +// attribute float m_springStiffness; +// attribute boolean m_springStiffnessLimited; +// attribute float m_springDamping; +// attribute boolean m_springDampingLimited; +// attribute float m_equilibriumPoint; +// boolean isLimited(); +// void testLimitValue(float test_value); +//}; +// +//interface btTranslationalLimitMotor2 { +// [Value]attribute btVector3 m_lowerLimit; +// [Value]attribute btVector3 m_upperLimit; +// [Value]attribute btVector3 m_bounce; +// [Value]attribute btVector3 m_stopERP; +// [Value]attribute btVector3 m_stopCFM; +// [Value]attribute btVector3 m_motorERP; +// [Value]attribute btVector3 m_motorCFM; +//// attribute boolean [] m_enableMotor; +//// attribute boolean [] m_servoMotor; +//// attribute boolean [] m_enableSpring; +// [Value]attribute btVector3 m_servoTarget; +// [Value]attribute btVector3 m_springStiffness; +//// attribute boolean [] m_springStiffnessLimited; +// [Value]attribute btVector3 m_springDamping; +//// attribute boolean [] m_springDampingLimited; +// [Value]attribute btVector3 m_equilibriumPoint; +// [Value]attribute btVector3 m_targetVelocity; +// [Value]attribute btVector3 m_maxMotorForce; +// boolean isLimited(long limitIndex); +// void testLimitValue(long limitIndex, float test_value); +//}; +// +//interface btFixedConstraint { +// void btFixedConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform frameInA, [Const, Ref]btTransform frameInB); +//}; +//btFixedConstraint implements btTypedConstraint; +// +//interface btPoint2PointConstraint { +// void btPoint2PointConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btVector3 pivotInA, [Ref]btVector3 pivotInB); +// void btPoint2PointConstraint([Ref]btRigidBody rbA, [Ref]btVector3 pivotInA); +// void setPivotA([Const, Ref]btVector3 pivotA); +// void setPivotB([Const, Ref]btVector3 pivotB); +// [Const, Ref]btVector3 getPivotInA(); +// [Const, Ref]btVector3 getPivotInB(); +// [Value]attribute btConstraintSetting m_setting; +//}; +//btPoint2PointConstraint implements btTypedConstraint; +// +//interface btGeneric6DofConstraint { +// void btGeneric6DofConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btTransform frameInA, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameA); +// void btGeneric6DofConstraint([Ref]btRigidBody rbB, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameB); +// void setLinearLowerLimit([Const, Ref]btVector3 linearLower); +// void setLinearUpperLimit([Const, Ref]btVector3 linearUpper); +// void setAngularLowerLimit([Const, Ref]btVector3 angularLower); +// void setAngularUpperLimit([Const, Ref]btVector3 angularUpper); +//}; +//btGeneric6DofConstraint implements btTypedConstraint; +// +//interface btGeneric6DofSpringConstraint { +// void btGeneric6DofSpringConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btTransform frameInA, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameA); +// void btGeneric6DofSpringConstraint([Ref]btRigidBody rbB, [Ref]btTransform frameInB, boolean useLinearFrameReferenceFrameB); +// void enableSpring(long index, boolean onOff); +// void setStiffness(long index, float stiffness); +// void setDamping(long index, float damping); +//}; +//btGeneric6DofSpringConstraint implements btGeneric6DofConstraint; +// +//interface btSequentialImpulseConstraintSolver { +// void btSequentialImpulseConstraintSolver(); +//}; +//btSequentialImpulseConstraintSolver implements btConstraintSolver; +// +//interface btConeTwistConstraint { +// void btConeTwistConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Ref]btTransform rbAFrame, [Ref]btTransform rbBFrame); +// void btConeTwistConstraint([Ref]btRigidBody rbA, [Ref]btTransform rbAFrame); +// void setLimit(long limitIndex, float limitValue); +// void setLimit(float _swingSpan1, float _swingSpan2, float _twistSpan, optional float _softness, optional float _biasFactor, optional float _relaxationFactor); +// void setAngularOnly(boolean angularOnly); +// void setDamping(float damping); +// void enableMotor(boolean b); +// void setMaxMotorImpulse(float maxMotorImpulse); +// void setMaxMotorImpulseNormalized(float maxMotorImpulse); +// void setMotorTarget([Const, Ref]btQuaternion q); +// void setMotorTargetInConstraintSpace([Const, Ref]btQuaternion q); +//}; +//btConeTwistConstraint implements btTypedConstraint; +// +//interface btHingeConstraint { +// void btHingeConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btVector3 pivotInA, [Const, Ref]btVector3 pivotInB, [Const, Ref]btVector3 axisInA, [Const, Ref]btVector3 axisInB, optional boolean useReferenceFrameA); +// void btHingeConstraint([Ref]btRigidBody rbA, [Ref]btVector3 pivotInA, [Const, Ref]btVector3 axisInA, boolean useReferenceFrameA); +// void btHingeConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform rbAFrame, [Const, Ref]btTransform rbBFrame, boolean useReferenceFrameA); +// void btHingeConstraint([Ref]btRigidBody rbA, [Const, Ref]btTransform rbAFrame, boolean useReferenceFrameA); +// void setLimit(float low, float high, optional float softness, optional float biasFactor, optional float relaxationFactor); +// void enableAngularMotor(boolean enableMotor, float targetVelocity, float maxMotorImpulse); +//}; +//btHingeConstraint implements btTypedConstraint; +// +//interface btSliderConstraint { +// void btSliderConstraint([Ref]btRigidBody rbA, [Ref]btRigidBody rbB, [Const, Ref]btTransform frameInA, [Const, Ref]btTransform frameInB, boolean useLinearReferenceFrameA); +// void btSliderConstraint([Ref]btRigidBody rbB, [Const, Ref]btTransform frameInB, boolean uesLinearReferenceFrameA); +// void setLowerLinLimit(float lowerLimit); +// void setUpperLinLimit(float upperLimit); +// void setLowerAngLimit(float lowerAngLimit); +// void setUpperAngLimit(float upperAngLimit); +//}; +//btSliderConstraint implements btTypedConstraint; +// +//interface btConstraintSolver {}; +// +//interface btDispatcherInfo { +// attribute float m_timeStep; +// attribute long m_stepCount; +// attribute long m_dispatchFunc; +// attribute float m_timeOfImpact; +// attribute boolean m_useContinuous; +// attribute boolean m_enableSatConvex; +// attribute boolean m_enableSPU; +// attribute boolean m_useEpa; +// attribute float m_allowedCcdPenetration; +// attribute boolean m_useConvexConservativeDistanceUtil; +// attribute float m_convexConservativeDistanceThreshold; +//}; +// +//interface btIDebugDraw {}; +// +//interface btContactSolverInfo { +// attribute boolean m_splitImpulse; +// attribute long m_splitImpulsePenetrationThreshold; +//}; +// +//interface btDynamicsWorld { +// long stepSimulation(float timeStep, optional long maxSubSteps, optional float fixedTimeStep); +// void addAction(btActionInterface action); +// void removeAction(btActionInterface action); +// [Ref]btContactSolverInfo getSolverInfo(); +// void addRigidBody(btRigidBody body); +// void addRigidBody(btRigidBody body, long group, long mask); +// void removeRigidBody(btRigidBody body); +// void setGravity([Ref]btVector3 gravity); +// [Value]btVector3 getGravity(); +// void addConstraint(btTypedConstraint constraint, optional boolean disableCollisionsBetweenLinkedBodies); +// void removeConstraint(btTypedConstraint constraint); +// void clearForces(); +//}; +//btDynamicsWorld implements btCollisionWorld; +// +//interface btDiscreteDynamicsWorld { +// void btDiscreteDynamicsWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btConstraintSolver constraintSolver, btCollisionConfiguration collisionConfiguration); +//}; +//btDiscreteDynamicsWorld implements btDynamicsWorld; +// +//interface btActionInterface { +// void updateAction(btCollisionWorld collisionWorld, float deltaTimeStep); +// void debugDraw(btIDebugDraw debugDrawer); +//}; +// +////Vehicle +// +// +//[Prefix = "btRaycastVehicle::"] +//interface btVehicleTuning { +// void btVehicleTuning(); +// attribute float m_suspensionStiffness; +// attribute float m_suspensionCompression; +// attribute float m_suspensionDamping; +// attribute float m_maxSuspensionTravelCm; +// attribute float m_frictionSlip; +// attribute float m_maxSuspensionForce; +//}; +// +//interface btVehicleRaycaster {}; +// +//interface btDefaultVehicleRaycaster { +// void btDefaultVehicleRaycaster(btDynamicsWorld world); +//}; +//btDefaultVehicleRaycaster implements btVehicleRaycaster; +// +//[Prefix = "btWheelInfo::"] +//interface RaycastInfo { +// void RaycastInfo(); +// [Value]attribute btVector3 m_contactNormalWS; +// [Value]attribute btVector3 m_contactPointWS; +// attribute float m_suspensionLength; +// [Value]attribute btVector3 m_hardPointWS; +// [Value]attribute btVector3 m_wheelDirectionWS; +// [Value]attribute btVector3 m_wheelAxleWS; +// attribute boolean m_isInContact; +// attribute any m_groundObject; +//}; +// +////interface btWheelInfo { +//// [Value]attribute RaycastInfo m_raycastInfo; +//// [Value]attribute btTransform m_worldTransform; +//// [Value]attribute btVector3 m_chassisConnectionPointCS; +//// [Value]attribute btVector3 m_wheelDirectionCS; +//// [Value]attribute btVector3 m_wheelAxleCS; +//// attribute float m_suspensionRestLength1; +//// attribute float m_maxSuspensionTravelCm; +//// attribute float m_wheelsRadius; +//// attribute float m_suspensionStiffness; +//// attribute float m_wheelsDampingCompression; +//// attribute float m_wheelsDampingRelaxation; +//// attribute float m_frictionSlip; +//// attribute float m_steering; +//// attribute float m_rotation; +//// attribute float m_deltaRotation; +//// attribute float m_rollInfluence; +//// attribute float m_maxSuspensionForce; +//// attribute float m_engineForce; +//// attribute float m_brake; +//// attribute boolean m_bIsFrontWheel; +//// attribute float m_clippedInvContactDotSuspension; +//// attribute float m_suspensionRelativeVelocity; +//// attribute float m_wheelsSuspensionForce; +//// attribute float m_skidInfo; +//// void updateWheel([Const, Ref]btRigidBody chassis, [Ref]RaycastInfo raycastInfo); +////}; +// +//interface btRaycastVehicle { +// void btRaycastVehicle([Const, Ref]btVehicleTuning tuning, btRigidBody chassis, btVehicleRaycaster raycaster); +// void applyEngineForce(float force, long wheel); +// void updateVehicle(float step); +// void resetSuspension(); +// float rayCast([Ref]btWheelInfo wheel); +// float getSteeringValue(long wheel); +// void setSteeringValue(float steering, long wheel); +// [Const, Ref]btTransform getWheelTransformWS(long wheelIndex); +// void updateWheelTransform(long wheelIndex, optional boolean interpolatedTransform); +// void updateWheelTransformsWS([Ref]btWheelInfo wheel, optional boolean interpolatedTransform); +// [Ref]btWheelInfo addWheel([Const, Ref]btVector3 connectionPointCS0, [Const, Ref]btVector3 wheelDirectionCS0, [Const, Ref]btVector3 wheelAxleCS, float suspensionRestLength, float wheelRadius, [Const, Ref]btVehicleTuning tuning, boolean isFrontWheel); +// long getNumWheels(); +// btRigidBody getRigidBody(); +// [Ref]btWheelInfo getWheelInfo(long index); +// void setBrake(float brake, long wheelIndex); +// void setCoordinateSystem(long rightIndex, long upIndex, long forwardIndex); +// float getCurrentSpeedKmHour(); +// long getRightAxis(); +// long getUpAxis(); +// long getForwardAxis(); +// [Value]btVector3 getForwardVector(); +// long getUserConstraintType(); +// void setUserConstraintType(long userConstraintType); +// void setUserConstraintId(long uid); +// long getUserConstraintId(); +// void updateFriction(float timeStep); +// void updateSuspension(float deltaTime); +// void setPitchControl(float pitch); +//}; +//btRaycastVehicle implements btActionInterface; +// +//interface btKinematicCharacterController { +// void btKinematicCharacterController(btPairCachingGhostObject ghostObject, btConvexShape convexShape, float stepHeight, [Ref] optional btVector3 upAxis); +// void setUp([Const, Ref]btVector3 up); +// void setWalkDirection([Const, Ref]btVector3 walkDirection); +// void setVelocityForTimeInterval([Const, Ref]btVector3 velocity, float timeInterval); +// //void reset (); +// void warp([Const, Ref]btVector3 origin); +// void preStep(btCollisionWorld collisionWorld); +// void playerStep(btCollisionWorld collisionWorld, float dt); +// void setFallSpeed(float fallSpeed); +// void setJumpSpeed(float jumpSpeed); +// void setMaxJumpHeight(float maxJumpHeight); +// boolean canJump(); +// void jump([Const, Ref]optional btVector3 v); +// void setGravity([Const, Ref]btVector3 gravity); +// [Value]btVector3 getGravity(); +// void setMaxSlope(float slopeRadians); +// float getMaxSlope(); +// btPairCachingGhostObject getGhostObject(); +// void setUseGhostSweepTest(boolean useGhostObjectSweepTest); +// boolean onGround(); +//}; +//btKinematicCharacterController implements btActionInterface; +// +//interface btGhostObject { +// void btGhostObject(); +// long getNumOverlappingObjects(); +// btCollisionObject getOverlappingObject(long index); +//}; +//btGhostObject implements btCollisionObject; +// +//interface btPairCachingGhostObject { +// void btPairCachingGhostObject(); +//}; +//btPairCachingGhostObject implements btGhostObject; +// +//interface btGhostPairCallback { +// void btGhostPairCallback(); +//}; +// +//// Soft bodies +// +//// interface btSparseSdf3 { +//// void Initialize(btSoftBodyWorldInfo worldInfo, optional long hashsize, optional long clampCells); +//// void Reset(btSoftBodyWorldInfo worldInfo); +//// void GarbageCollect(btSoftBodyWorldInfo worldInfo, optional long lifetime); +//// }; +// +//interface btSoftBodyWorldInfo { +// void btSoftBodyWorldInfo(); +// attribute float air_density; +// attribute float water_density; +// attribute float water_offset; +// attribute float m_maxDisplacement; +// [Value]attribute btVector3 water_normal; +// attribute btBroadphaseInterface m_broadphase; +// attribute btDispatcher m_dispatcher; +// [Value]attribute btVector3 m_gravity; +//}; +// +////[Prefix = "btSoftBody::"] +////interface tNodeArray { +//// void tNodeArray(); +//// [Const]long size(); +//// [Const, Ref]Node at(long n); +//// void resize(long numVertices); +////}; +//// +////[Prefix = "btSoftBody::"] +////interface tFaceArray { +//// void tFaceArray(); +//// [Const]long size(); +//// [Const, Ref]Face at(long n); +////}; +//// +////[Prefix = "btSoftBody::"] +////interface Node { +//// [Value]attribute btVector3 m_x; +//// [Value]attribute btVector3 m_q; +//// [Value]attribute btVector3 m_v; +//// [Value]attribute btVector3 m_f; +//// [Value]attribute btVector3 m_n; +//// attribute float m_im; +//// attribute float m_area; +////}; +// +////[Prefix = "btSoftBody::"] +////interface Face { +//// // [Value] attribute Node m_n; +//// [Value]attribute btVector3 m_normal; +//// attribute float m_ra; +////}; +// +////[Prefix = "btSoftBody::"] +////interface Element { +//// attribute any m_tag; +////}; +// +////[Prefix = "btSoftBody::"] +////interface Material { +//// attribute float m_kLST; +//// attribute float m_kAST; +//// attribute float m_kVST; +//// attribute long m_flags; +////}; +////Material implements Element; +// +////[Prefix = "btSoftBody::"] +////interface tMaterialArray { +//// void tMaterialArray(); +//// [Const]long size(); +//// Material at(long n); +////}; +// +////[Prefix = "btSoftBody::"] +////interface Config { +//// void Config(); +//// attribute float kVCF; +//// attribute float kDP; +//// attribute float kDG; +//// attribute float kLF; +//// attribute float kPR; +//// attribute float kVC; +//// attribute float kDF; +//// attribute float kMT; +//// attribute float kCHR; +//// attribute float kKHR; +//// attribute float kSHR; +//// attribute float kAHR; +//// attribute float kSRHR_CL; +//// attribute float kSKHR_CL; +//// attribute float kSSHR_CL; +//// attribute float kSR_SPLT_CL; +//// attribute float kSK_SPLT_CL; +//// attribute float kSS_SPLT_CL; +//// attribute float maxvolume; +//// attribute float timescale; +//// attribute long viterations; +//// attribute long piterations; +//// attribute long diterations; +//// attribute long citerations; +//// attribute long collisions; +////}; +// +//interface btSoftBody { +// void btSoftBody(btSoftBodyWorldInfo worldInfo); //, long node_count, [Const] btVector3 x, [Const] long m); +// +//// [Value]attribute Config m_cfg; +//// [Value]attribute tNodeArray m_nodes; +//// [Value]attribute tFaceArray m_faces; +//// [Value]attribute tMaterialArray m_materials; +// +// [Const]boolean checkLink(long node0, long node1); +// [Const]boolean checkFace(long node0, long node1, long node2); +//// Material appendMaterial(); +// void appendNode([Const, Ref]btVector3 x, float m); +//// void appendLink(long node0, long node1, Material mat, boolean bcheckexist); +//// void appendFace(long node0, long node1, long node2, Material mat); +//// void appendTetra(long node0, long node1, long node2, long node3, Material mat); +// void appendAnchor(long node, btRigidBody body, boolean disableCollisionBetweenLinkedBodies, float influence); +// [Const]float getTotalMass(); +// void setTotalMass(float mass, optional boolean fromfaces); +// void setMass(long node, float mass); +// void transform([Const, Ref]btTransform trs); +// void translate([Const, Ref]btVector3 trs); +// void rotate([Const, Ref]btQuaternion rot); +// void scale([Const, Ref]btVector3 scl); +// long generateClusters(long k, optional long maxiterations); +// void randomizeConstraints(); +//// long generateBendingConstraints(long distance, optional Material mat); +// btSoftBody upcast(btCollisionObject colObj); +//}; +//btSoftBody implements btCollisionObject; +// +//interface btSoftBodyRigidBodyCollisionConfiguration { +// void btSoftBodyRigidBodyCollisionConfiguration([Ref]optional btDefaultCollisionConstructionInfo info); +//}; +//btSoftBodyRigidBodyCollisionConfiguration implements btDefaultCollisionConfiguration; +// +//interface btSoftBodySolver {}; +// +//interface btDefaultSoftBodySolver { +// void btDefaultSoftBodySolver(); +//}; +//btDefaultSoftBodySolver implements btSoftBodySolver; +// +//interface btSoftBodyArray { +// [Const]long size(); +// [Const]btSoftBody at(long n); +//}; +// +//interface btSoftRigidDynamicsWorld { +// void btSoftRigidDynamicsWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btConstraintSolver constraintSolver, btCollisionConfiguration collisionConfiguration, optional btSoftBodySolver softBodySolver); +// void addSoftBody(btSoftBody body, optional long collisionFilterGroup, optional long collisionFilterMask); +// void removeSoftBody(btSoftBody body); +// [Ref]btSoftBodyWorldInfo getWorldInfo(); +// [Ref]btSoftBodyArray getSoftBodyArray(); +// long getDrawFlags(); +// void setDrawFlags(long f); +//}; +//btSoftRigidDynamicsWorld implements btDiscreteDynamicsWorld; // interface btMultiBody { @@ -1257,16 +1263,16 @@ btSoftRigidDynamicsWorld implements btDiscreteDynamicsWorld; // }; // btMultiBodyDynamicsWorld implements btDiscreteDynamicsWorld; - -interface btSoftBodyHelpers { - void btSoftBodyHelpers(); - btSoftBody CreateRope([Ref]btSoftBodyWorldInfo worldInfo, [Const, Ref]btVector3 from, [Const, Ref]btVector3 to, long res, long fixeds); - btSoftBody CreatePatch([Ref]btSoftBodyWorldInfo worldInfo, [Const, Ref]btVector3 corner00, [Const, Ref]btVector3 corner10, [Const, Ref]btVector3 corner01, [Const, Ref]btVector3 corner11, long resx, long resy, long fixeds, boolean gendiags); - // btSoftBody CreatePatchUV([Ref] btSoftBodyWorldInfo worldInfo, [Const, Ref] btVector3 corner00, [Const, Ref] btVector3 corner10, [Const, Ref] btVector3 corner01, [Const, Ref] btVector3 corner11, long resx, long resy, long fixeds, boolean gendiags, float[] tex_coords); - btSoftBody CreateEllipsoid([Ref]btSoftBodyWorldInfo worldInfo, [Const, Ref]btVector3 center, [Const, Ref]btVector3 radius, long res); - // btSoftBody CreateFromTriMesh([Ref] btSoftBodyWorldInfo worldInfo, float[] vertices, long[] triangles, long ntriangles, boolean randomizeConstraints); - btSoftBody CreateFromConvexHull([Ref]btSoftBodyWorldInfo worldInfo, [Const]btVector3 vertices, long nvertices, boolean randomizeConstraints); -}; +// +//interface btSoftBodyHelpers { +// void btSoftBodyHelpers(); +// btSoftBody CreateRope([Ref]btSoftBodyWorldInfo worldInfo, [Const, Ref]btVector3 from, [Const, Ref]btVector3 to, long res, long fixeds); +// btSoftBody CreatePatch([Ref]btSoftBodyWorldInfo worldInfo, [Const, Ref]btVector3 corner00, [Const, Ref]btVector3 corner10, [Const, Ref]btVector3 corner01, [Const, Ref]btVector3 corner11, long resx, long resy, long fixeds, boolean gendiags); +// // btSoftBody CreatePatchUV([Ref] btSoftBodyWorldInfo worldInfo, [Const, Ref] btVector3 corner00, [Const, Ref] btVector3 corner10, [Const, Ref] btVector3 corner01, [Const, Ref] btVector3 corner11, long resx, long resy, long fixeds, boolean gendiags, float[] tex_coords); +// btSoftBody CreateEllipsoid([Ref]btSoftBodyWorldInfo worldInfo, [Const, Ref]btVector3 center, [Const, Ref]btVector3 radius, long res); +// // btSoftBody CreateFromTriMesh([Ref] btSoftBodyWorldInfo worldInfo, float[] vertices, long[] triangles, long ntriangles, boolean randomizeConstraints); +// btSoftBody CreateFromConvexHull([Ref]btSoftBodyWorldInfo worldInfo, [Const]btVector3 vertices, long nvertices, boolean randomizeConstraints); +//}; diff --git a/extensions/gdx-bullet/gdx-bullet-build/jni/post.js b/extensions/gdx-bullet/gdx-bullet-build/jni/post.js index 326bdde3..ee32d9bf 100644 --- a/extensions/gdx-bullet/gdx-bullet-build/jni/post.js +++ b/extensions/gdx-bullet/gdx-bullet-build/jni/post.js @@ -1,5 +1,4 @@ -async function asyncCall() { - window.Bullet = await Bullet(); -} - -asyncCall(); \ No newline at end of file +Bullet().then(function(r){ + window.Bullet = r; + window.BulletOnInit(); +}); \ No newline at end of file diff --git a/extensions/gdx-bullet/gdx-bullet-build/src/main/java/com/github/xpenatan/gdx/html5/bullet/Main.java b/extensions/gdx-bullet/gdx-bullet-build/src/main/java/com/github/xpenatan/gdx/html5/bullet/Main.java index 563539bb..417cde8a 100644 --- a/extensions/gdx-bullet/gdx-bullet-build/src/main/java/com/github/xpenatan/gdx/html5/bullet/Main.java +++ b/extensions/gdx-bullet/gdx-bullet-build/src/main/java/com/github/xpenatan/gdx/html5/bullet/Main.java @@ -1,15 +1,71 @@ package com.github.xpenatan.gdx.html5.bullet; import com.github.xpenatan.jparser.core.JParser; -import com.github.xpenatan.jparser.idl.IDLFile; +import com.github.xpenatan.jparser.core.util.FileHelper; +import com.github.xpenatan.jparser.cpp.CppCodeParserV2; +import com.github.xpenatan.jparser.cpp.CppGenerator; +import com.github.xpenatan.jparser.cpp.NativeCPPGeneratorV2; import com.github.xpenatan.jparser.idl.IDLReader; import com.github.xpenatan.jparser.cpp.CPPBuildHelper; import com.github.xpenatan.jparser.cpp.CppCodeParser; -import com.github.xpenatan.jparser.cpp.FileCopyHelper; +import com.github.xpenatan.jparser.idl.parser.IDLDefaultCodeParser; import java.io.File; public class Main { + public static void main(String[] args) throws Exception { + +// generateOld(); + generateNew(); + } + + public static void generateNew() throws Exception { + String basePackage = "com.badlogic.gdx.physics.bullet"; + String libName = "bullet"; + String idlPath = "jni\\bullet.idl"; + String baseJavaDir = new File(".").getAbsolutePath() + "./gdx-bullet-base/src/main/java"; + String cppSourceDir = new File("./jni/bullet/src/").getCanonicalPath(); + + IDLReader idlReader = IDLReader.readIDL(idlPath, cppSourceDir); + +// buildClassOnly(idlReader, basePackage, baseJavaDir); + buildBulletCPP(idlReader, libName, basePackage, baseJavaDir, cppSourceDir); + } + + private static void buildClassOnly( + IDLReader idlReader, + String basePackage, + String baseJavaDir + ) throws Exception { + IDLDefaultCodeParser idlParser = new IDLDefaultCodeParser(basePackage, "C++", idlReader); + idlParser.generateClass = true; + String genDir = "../gdx-bullet/src/main/java"; + JParser.generate(idlParser, baseJavaDir, genDir); + } + + private static void buildBulletCPP( + IDLReader idlReader, + String libName, + String basePackage, + String baseJavaDir, + String cppSourceDir + ) throws Exception { + String libsDir = new File("./build/c++/desktop/").getCanonicalPath(); + String genDir = "../gdx-bullet/src/main/java"; + String libBuildPath = new File("./build/c++/").getCanonicalPath(); + String cppDestinationPath = libBuildPath + "/src"; + + CppGenerator cppGenerator = new NativeCPPGeneratorV2(cppSourceDir, cppDestinationPath); + CppCodeParserV2 cppParser = new CppCodeParserV2(cppGenerator, idlReader, basePackage); + cppParser.generateClass = true; + JParser.generate(cppParser, baseJavaDir, genDir); + String [] flags = new String[1]; + flags[0] = " -DBT_USE_INVERSE_DYNAMICS_WITH_BULLET2"; + CPPBuildHelper.DEBUG_BUILD = true; + CPPBuildHelper.build(libName, libBuildPath, flags); + } + + private static void generateOld() throws Exception { String path = "..\\..\\gdx-bullet\\gdx-bullet-build\\jni\\bullet.idl"; IDLReader idlReader = IDLReader.readIDL(path); @@ -25,7 +81,7 @@ private static void buildBulletCPP(IDLReader idlReader) throws Exception { String genDir = bulletPath + "/src/main/java"; String cppPath = new File("./jni/").getCanonicalPath(); String buildPath = cppPath + "/build/c++/"; - FileCopyHelper.copyDir(cppPath + "/bullet/src/", buildPath + "/src"); + FileHelper.copyDir(cppPath + "/bullet/src/", buildPath + "/src"); String sourceDir = "../gdx-bullet-base/src/main/java/"; String classPath = CppCodeParser.getClassPath("bullet-base", "gdx-1", "gdx-jnigen-loader", "jParser"); diff --git a/extensions/gdx-bullet/gdx-bullet/build.gradle.kts b/extensions/gdx-bullet/gdx-bullet/build.gradle.kts index 7cb7f9c8..c6a3110c 100644 --- a/extensions/gdx-bullet/gdx-bullet/build.gradle.kts +++ b/extensions/gdx-bullet/gdx-bullet/build.gradle.kts @@ -3,6 +3,7 @@ val moduleName = "gdx-bullet" dependencies { implementation("com.badlogicgames.gdx:gdx:${LibExt.gdxVersion}") implementation("com.github.xpenatan.jParser:loader-core:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:jParser-base:${LibExt.jParserVersion}") } tasks.named("clean") {