All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.badlogic.gdx.physics.bullet.dynamics.btRigidBody Maven / Gradle / Ivy

There is a newer version: 1.0.0-b6
Show newest version
/*-------------------------------------------------------
 * This file was generated by JParser
 *
 * Do not make changes to this file
 *-------------------------------------------------------*/
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.btCollisionObject;
import com.badlogic.gdx.physics.bullet.collision.btCollisionShape;
import com.badlogic.gdx.physics.bullet.linearmath.btMotionState;
import com.badlogic.gdx.physics.bullet.linearmath.btVector3;
import com.badlogic.gdx.physics.bullet.linearmath.btTransform;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.physics.bullet.linearmath.btMatrix3x3;
import com.badlogic.gdx.physics.bullet.linearmath.btQuaternion;
import com.badlogic.gdx.math.Quaternion;

/**
 * @author xpenatan
 */
public class btRigidBody extends btCollisionObject {

    public static btRigidBody WRAPPER_GEN_01 = new btRigidBody(false);

    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, (int) out.getCPointer()), 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;
        initObject(createNative(mass, (int) motionStatePointer, (int) shapePointer, (int) out.getCPointer()), true);
    }

    @Override
    protected void deleteNative() {
        deleteNative((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"mass", "motionStateAddr", "collisionShapeAddr", "localInertiaAddr"}, script = "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 int createNative(float mass, int motionStateAddr, int collisionShapeAddr, int localInertiaAddr);

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody); Bullet.destroy(jsObj);")
    private static native void deleteNative(int addr);

    static public class btRigidBodyConstructionInfo extends BulletBase {

        public static btRigidBodyConstructionInfo WRAPPER_GEN_01 = new btRigidBodyConstructionInfo(false);

        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;
        }

        public btRigidBodyConstructionInfo(boolean cMemoryOwn) {
        }

        public btRigidBodyConstructionInfo() {
        }
    }

    public btRigidBody(boolean cMemoryOwn) {
    }

    public btRigidBody() {
    }

    public void proceedToTransform(btTransform newTrans) {
        proceedToTransformNATIVE((int) cPointer, (int) newTrans.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "newTransAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.proceedToTransform(newTransAddr);")
    private static native void proceedToTransformNATIVE(int addr, int newTransAddr);

    public void proceedToTransform(Matrix4 newTransGDX) {
        btTransform.convert(newTransGDX, btTransform.TEMP_0);
        btTransform newTrans = btTransform.TEMP_0;
        proceedToTransformNATIVE((int) cPointer, (int) newTrans.getCPointer());
    }

    public void predictIntegratedTransform(float step, btTransform predictedTransform) {
        predictIntegratedTransformNATIVE((int) cPointer, step, (int) predictedTransform.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "step", "predictedTransformAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.predictIntegratedTransform(step, predictedTransformAddr);")
    private static native void predictIntegratedTransformNATIVE(int addr, float step, int predictedTransformAddr);

    public void predictIntegratedTransform(float step, Matrix4 predictedTransformGDX) {
        btTransform.convert(predictedTransformGDX, btTransform.TEMP_0);
        btTransform predictedTransform = btTransform.TEMP_0;
        predictIntegratedTransformNATIVE((int) cPointer, step, (int) predictedTransform.getCPointer());
    }

    public void saveKinematicState(float step) {
        saveKinematicStateNATIVE((int) cPointer, step);
    }

    @org.teavm.jso.JSBody(params = {"addr", "step"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.saveKinematicState(step);")
    private static native void saveKinematicStateNATIVE(int addr, float step);

    public void applyGravity() {
        applyGravityNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyGravity();")
    private static native void applyGravityNATIVE(int addr);

    public void setGravity(btVector3 acceleration) {
        setGravityNATIVE((int) cPointer, (int) acceleration.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "accelerationAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setGravity(accelerationAddr);")
    private static native void setGravityNATIVE(int addr, int accelerationAddr);

    public void setGravity(Vector3 accelerationGDX) {
        btVector3.convert(accelerationGDX, btVector3.TEMP_0);
        btVector3 acceleration = btVector3.TEMP_0;
        setGravityNATIVE((int) cPointer, (int) acceleration.getCPointer());
    }

    public Vector3 getGravity() {
        int pointer = getGravityNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getGravity();return Bullet.getPointer(returnedJSObj);")
    private static native int getGravityNATIVE(int addr);

    public void setDamping(float lin_damping, float ang_damping) {
        setDampingNATIVE((int) cPointer, lin_damping, ang_damping);
    }

    @org.teavm.jso.JSBody(params = {"addr", "lin_damping", "ang_damping"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setDamping(lin_damping, ang_damping);")
    private static native void setDampingNATIVE(int addr, float lin_damping, float ang_damping);

    public float getLinearDamping() {
        return getLinearDampingNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getLinearDamping();return returnedJSObj;")
    private static native float getLinearDampingNATIVE(int addr);

    public float getAngularDamping() {
        return getAngularDampingNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getAngularDamping();return returnedJSObj;")
    private static native float getAngularDampingNATIVE(int addr);

    public float getLinearSleepingThreshold() {
        return getLinearSleepingThresholdNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getLinearSleepingThreshold();return returnedJSObj;")
    private static native float getLinearSleepingThresholdNATIVE(int addr);

    public float getAngularSleepingThreshold() {
        return getAngularSleepingThresholdNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getAngularSleepingThreshold();return returnedJSObj;")
    private static native float getAngularSleepingThresholdNATIVE(int addr);

    public void applyDamping(float timeStep) {
        applyDampingNATIVE((int) cPointer, timeStep);
    }

    @org.teavm.jso.JSBody(params = {"addr", "timeStep"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyDamping(timeStep);")
    private static native void applyDampingNATIVE(int addr, float timeStep);

    public void setMassProps(float mass, btVector3 inertia) {
        setMassPropsNATIVE((int) cPointer, mass, (int) inertia.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "mass", "inertiaAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setMassProps(mass, inertiaAddr);")
    private static native void setMassPropsNATIVE(int addr, float mass, int inertiaAddr);

    public void setMassProps(float mass, Vector3 inertiaGDX) {
        btVector3.convert(inertiaGDX, btVector3.TEMP_0);
        btVector3 inertia = btVector3.TEMP_0;
        setMassPropsNATIVE((int) cPointer, mass, (int) inertia.getCPointer());
    }

    public Vector3 getLinearFactor() {
        int pointer = getLinearFactorNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getLinearFactor();return Bullet.getPointer(returnedJSObj);")
    private static native int getLinearFactorNATIVE(int addr);

    public void setLinearFactor(btVector3 linearFactor) {
        setLinearFactorNATIVE((int) cPointer, (int) linearFactor.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "linearFactorAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setLinearFactor(linearFactorAddr);")
    private static native void setLinearFactorNATIVE(int addr, int linearFactorAddr);

    public void setLinearFactor(Vector3 linearFactorGDX) {
        btVector3.convert(linearFactorGDX, btVector3.TEMP_0);
        btVector3 linearFactor = btVector3.TEMP_0;
        setLinearFactorNATIVE((int) cPointer, (int) linearFactor.getCPointer());
    }

    public float getInvMass() {
        return getInvMassNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getInvMass();return returnedJSObj;")
    private static native float getInvMassNATIVE(int addr);

    public btMatrix3x3 getInvInertiaTensorWorld() {
        int pointer = getInvInertiaTensorWorldNATIVE((int) cPointer);
        btMatrix3x3.WRAPPER_GEN_01.setPointer(pointer);
        return btMatrix3x3.WRAPPER_GEN_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getInvInertiaTensorWorld();return Bullet.getPointer(returnedJSObj);")
    private static native int getInvInertiaTensorWorldNATIVE(int addr);

    public void integrateVelocities(float step) {
        integrateVelocitiesNATIVE((int) cPointer, step);
    }

    @org.teavm.jso.JSBody(params = {"addr", "step"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.integrateVelocities(step);")
    private static native void integrateVelocitiesNATIVE(int addr, float step);

    public void setCenterOfMassTransform(btTransform xform) {
        setCenterOfMassTransformNATIVE((int) cPointer, (int) xform.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "xformAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setCenterOfMassTransform(xformAddr);")
    private static native void setCenterOfMassTransformNATIVE(int addr, int xformAddr);

    public void setCenterOfMassTransform(Matrix4 xformGDX) {
        btTransform.convert(xformGDX, btTransform.TEMP_0);
        btTransform xform = btTransform.TEMP_0;
        setCenterOfMassTransformNATIVE((int) cPointer, (int) xform.getCPointer());
    }

    public void applyCentralForce(btVector3 force) {
        applyCentralForceNATIVE((int) cPointer, (int) force.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "forceAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyCentralForce(forceAddr);")
    private static native void applyCentralForceNATIVE(int addr, int forceAddr);

    public void applyCentralForce(Vector3 forceGDX) {
        btVector3.convert(forceGDX, btVector3.TEMP_0);
        btVector3 force = btVector3.TEMP_0;
        applyCentralForceNATIVE((int) cPointer, (int) force.getCPointer());
    }

    public Vector3 getTotalForce() {
        int pointer = getTotalForceNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getTotalForce();return Bullet.getPointer(returnedJSObj);")
    private static native int getTotalForceNATIVE(int addr);

    public Vector3 getTotalTorque() {
        int pointer = getTotalTorqueNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getTotalTorque();return Bullet.getPointer(returnedJSObj);")
    private static native int getTotalTorqueNATIVE(int addr);

    public Vector3 getInvInertiaDiagLocal() {
        int pointer = getInvInertiaDiagLocalNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getInvInertiaDiagLocal();return Bullet.getPointer(returnedJSObj);")
    private static native int getInvInertiaDiagLocalNATIVE(int addr);

    public void setInvInertiaDiagLocal(btVector3 diagInvInertia) {
        setInvInertiaDiagLocalNATIVE((int) cPointer, (int) diagInvInertia.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "diagInvInertiaAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setInvInertiaDiagLocal(diagInvInertiaAddr);")
    private static native void setInvInertiaDiagLocalNATIVE(int addr, int diagInvInertiaAddr);

    public void setInvInertiaDiagLocal(Vector3 diagInvInertiaGDX) {
        btVector3.convert(diagInvInertiaGDX, btVector3.TEMP_0);
        btVector3 diagInvInertia = btVector3.TEMP_0;
        setInvInertiaDiagLocalNATIVE((int) cPointer, (int) diagInvInertia.getCPointer());
    }

    public void setSleepingThresholds(float linear, float angular) {
        setSleepingThresholdsNATIVE((int) cPointer, linear, angular);
    }

    @org.teavm.jso.JSBody(params = {"addr", "linear", "angular"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setSleepingThresholds(linear, angular);")
    private static native void setSleepingThresholdsNATIVE(int addr, float linear, float angular);

    public void applyTorque(btVector3 torque) {
        applyTorqueNATIVE((int) cPointer, (int) torque.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "torqueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyTorque(torqueAddr);")
    private static native void applyTorqueNATIVE(int addr, int torqueAddr);

    public void applyTorque(Vector3 torqueGDX) {
        btVector3.convert(torqueGDX, btVector3.TEMP_0);
        btVector3 torque = btVector3.TEMP_0;
        applyTorqueNATIVE((int) cPointer, (int) torque.getCPointer());
    }

    public void applyForce(btVector3 force, btVector3 rel_pos) {
        applyForceNATIVE((int) cPointer, (int) force.getCPointer(), (int) rel_pos.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "forceAddr", "rel_posAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyForce(forceAddr, rel_posAddr);")
    private static native void applyForceNATIVE(int addr, int forceAddr, int rel_posAddr);

    public void applyForce(Vector3 forceGDX, Vector3 rel_posGDX) {
        btVector3.convert(forceGDX, btVector3.TEMP_0);
        btVector3 force = btVector3.TEMP_0;
        btVector3.convert(rel_posGDX, btVector3.TEMP_1);
        btVector3 rel_pos = btVector3.TEMP_1;
        applyForceNATIVE((int) cPointer, (int) force.getCPointer(), (int) rel_pos.getCPointer());
    }

    public void applyCentralImpulse(btVector3 impulse) {
        applyCentralImpulseNATIVE((int) cPointer, (int) impulse.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "impulseAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyCentralImpulse(impulseAddr);")
    private static native void applyCentralImpulseNATIVE(int addr, int impulseAddr);

    public void applyCentralImpulse(Vector3 impulseGDX) {
        btVector3.convert(impulseGDX, btVector3.TEMP_0);
        btVector3 impulse = btVector3.TEMP_0;
        applyCentralImpulseNATIVE((int) cPointer, (int) impulse.getCPointer());
    }

    public void applyTorqueImpulse(btVector3 torque) {
        applyTorqueImpulseNATIVE((int) cPointer, (int) torque.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "torqueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyTorqueImpulse(torqueAddr);")
    private static native void applyTorqueImpulseNATIVE(int addr, int torqueAddr);

    public void applyTorqueImpulse(Vector3 torqueGDX) {
        btVector3.convert(torqueGDX, btVector3.TEMP_0);
        btVector3 torque = btVector3.TEMP_0;
        applyTorqueImpulseNATIVE((int) cPointer, (int) torque.getCPointer());
    }

    public void applyImpulse(btVector3 impulse, btVector3 rel_pos) {
        applyImpulseNATIVE((int) cPointer, (int) impulse.getCPointer(), (int) rel_pos.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "impulseAddr", "rel_posAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.applyImpulse(impulseAddr, rel_posAddr);")
    private static native void applyImpulseNATIVE(int addr, int impulseAddr, int rel_posAddr);

    public void applyImpulse(Vector3 impulseGDX, Vector3 rel_posGDX) {
        btVector3.convert(impulseGDX, btVector3.TEMP_0);
        btVector3 impulse = btVector3.TEMP_0;
        btVector3.convert(rel_posGDX, btVector3.TEMP_1);
        btVector3 rel_pos = btVector3.TEMP_1;
        applyImpulseNATIVE((int) cPointer, (int) impulse.getCPointer(), (int) rel_pos.getCPointer());
    }

    public void clearForces() {
        clearForcesNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.clearForces();")
    private static native void clearForcesNATIVE(int addr);

    public void updateInertiaTensor() {
        updateInertiaTensorNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.updateInertiaTensor();")
    private static native void updateInertiaTensorNATIVE(int addr);

    public Vector3 getCenterOfMassPosition() {
        int pointer = getCenterOfMassPositionNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getCenterOfMassPosition();return Bullet.getPointer(returnedJSObj);")
    private static native int getCenterOfMassPositionNATIVE(int addr);

    public Quaternion getOrientation() {
        int pointer = getOrientationNATIVE((int) cPointer);
        btQuaternion.WRAPPER_GEN_01.setPointer(pointer);
        btQuaternion.convert(btQuaternion.WRAPPER_GEN_01, btQuaternion.TEMP_GDX_01);
        return btQuaternion.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getOrientation();return Bullet.getPointer(returnedJSObj);")
    private static native int getOrientationNATIVE(int addr);

    public Matrix4 getCenterOfMassTransform() {
        int pointer = getCenterOfMassTransformNATIVE((int) cPointer);
        btTransform.WRAPPER_GEN_01.setPointer(pointer);
        btTransform.convert(btTransform.WRAPPER_GEN_01, btTransform.TEMP_GDX_01);
        return btTransform.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getCenterOfMassTransform();return Bullet.getPointer(returnedJSObj);")
    private static native int getCenterOfMassTransformNATIVE(int addr);

    public Vector3 getLinearVelocity() {
        int pointer = getLinearVelocityNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getLinearVelocity();return Bullet.getPointer(returnedJSObj);")
    private static native int getLinearVelocityNATIVE(int addr);

    public Vector3 getAngularVelocity() {
        int pointer = getAngularVelocityNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getAngularVelocity();return Bullet.getPointer(returnedJSObj);")
    private static native int getAngularVelocityNATIVE(int addr);

    public void setLinearVelocity(btVector3 lin_vel) {
        setLinearVelocityNATIVE((int) cPointer, (int) lin_vel.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "lin_velAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setLinearVelocity(lin_velAddr);")
    private static native void setLinearVelocityNATIVE(int addr, int lin_velAddr);

    public void setLinearVelocity(Vector3 lin_velGDX) {
        btVector3.convert(lin_velGDX, btVector3.TEMP_0);
        btVector3 lin_vel = btVector3.TEMP_0;
        setLinearVelocityNATIVE((int) cPointer, (int) lin_vel.getCPointer());
    }

    public void setAngularVelocity(btVector3 ang_vel) {
        setAngularVelocityNATIVE((int) cPointer, (int) ang_vel.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "ang_velAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setAngularVelocity(ang_velAddr);")
    private static native void setAngularVelocityNATIVE(int addr, int ang_velAddr);

    public void setAngularVelocity(Vector3 ang_velGDX) {
        btVector3.convert(ang_velGDX, btVector3.TEMP_0);
        btVector3 ang_vel = btVector3.TEMP_0;
        setAngularVelocityNATIVE((int) cPointer, (int) ang_vel.getCPointer());
    }

    public Vector3 getVelocityInLocalPoint(btVector3 rel_pos) {
        int pointer = getVelocityInLocalPointNATIVE((int) cPointer, (int) rel_pos.getCPointer());
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr", "rel_posAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getVelocityInLocalPoint(rel_posAddr);return Bullet.getPointer(returnedJSObj);")
    private static native int getVelocityInLocalPointNATIVE(int addr, int rel_posAddr);

    public Vector3 getVelocityInLocalPoint(Vector3 rel_posGDX) {
        btVector3.convert(rel_posGDX, btVector3.TEMP_0);
        btVector3 rel_pos = btVector3.TEMP_0;
        int pointer = getVelocityInLocalPointNATIVE((int) cPointer, (int) rel_pos.getCPointer());
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    public void translate(btVector3 trs) {
        translateNATIVE((int) cPointer, (int) trs.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "trsAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.translate(trsAddr);")
    private static native void translateNATIVE(int addr, int trsAddr);

    public void translate(Vector3 trsGDX) {
        btVector3.convert(trsGDX, btVector3.TEMP_0);
        btVector3 trs = btVector3.TEMP_0;
        translateNATIVE((int) cPointer, (int) trs.getCPointer());
    }

    public void getAabb(btVector3 aabbMin, btVector3 aabbMax) {
        getAabbNATIVE((int) cPointer, (int) aabbMin.getCPointer(), (int) aabbMax.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "aabbMinAddr", "aabbMaxAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.getAabb(aabbMinAddr, aabbMaxAddr);")
    private static native void getAabbNATIVE(int addr, int aabbMinAddr, int aabbMaxAddr);

    public void getAabb(Vector3 aabbMinGDX, Vector3 aabbMaxGDX) {
        btVector3.convert(aabbMinGDX, btVector3.TEMP_0);
        btVector3 aabbMin = btVector3.TEMP_0;
        btVector3.convert(aabbMaxGDX, btVector3.TEMP_1);
        btVector3 aabbMax = btVector3.TEMP_1;
        getAabbNATIVE((int) cPointer, (int) aabbMin.getCPointer(), (int) aabbMax.getCPointer());
    }

    public float computeImpulseDenominator(btVector3 pos, btVector3 normal) {
        return computeImpulseDenominatorNATIVE((int) cPointer, (int) pos.getCPointer(), (int) normal.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "posAddr", "normalAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.computeImpulseDenominator(posAddr, normalAddr);return returnedJSObj;")
    private static native float computeImpulseDenominatorNATIVE(int addr, int posAddr, int normalAddr);

    public float computeImpulseDenominator(Vector3 posGDX, Vector3 normalGDX) {
        btVector3.convert(posGDX, btVector3.TEMP_0);
        btVector3 pos = btVector3.TEMP_0;
        btVector3.convert(normalGDX, btVector3.TEMP_1);
        btVector3 normal = btVector3.TEMP_1;
        return computeImpulseDenominatorNATIVE((int) cPointer, (int) pos.getCPointer(), (int) normal.getCPointer());
    }

    public float computeAngularImpulseDenominator(btVector3 axis) {
        return computeAngularImpulseDenominatorNATIVE((int) cPointer, (int) axis.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "axisAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.computeAngularImpulseDenominator(axisAddr);return returnedJSObj;")
    private static native float computeAngularImpulseDenominatorNATIVE(int addr, int axisAddr);

    public float computeAngularImpulseDenominator(Vector3 axisGDX) {
        btVector3.convert(axisGDX, btVector3.TEMP_0);
        btVector3 axis = btVector3.TEMP_0;
        return computeAngularImpulseDenominatorNATIVE((int) cPointer, (int) axis.getCPointer());
    }

    public void updateDeactivation(float timeStep) {
        updateDeactivationNATIVE((int) cPointer, timeStep);
    }

    @org.teavm.jso.JSBody(params = {"addr", "timeStep"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.updateDeactivation(timeStep);")
    private static native void updateDeactivationNATIVE(int addr, float timeStep);

    public boolean wantsSleeping() {
        return wantsSleepingNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.wantsSleeping();return returnedJSObj;")
    private static native boolean wantsSleepingNATIVE(int addr);

    public btMotionState getMotionState() {
        int pointer = getMotionStateNATIVE((int) cPointer);
        btMotionState.WRAPPER_GEN_01.setPointer(pointer);
        return btMotionState.WRAPPER_GEN_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getMotionState();return Bullet.getPointer(returnedJSObj);")
    private static native int getMotionStateNATIVE(int addr);

    public void setMotionState(btMotionState motionState) {
        setMotionStateNATIVE((int) cPointer, (int) motionState.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "motionStateAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setMotionState(motionStateAddr);")
    private static native void setMotionStateNATIVE(int addr, int motionStateAddr);

    public void setAngularFactor(btVector3 angFac) {
        setAngularFactorNATIVE((int) cPointer, (int) angFac.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "angFacAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setAngularFactor(angFacAddr);")
    private static native void setAngularFactorNATIVE(int addr, int angFacAddr);

    public void setAngularFactor(Vector3 angFacGDX) {
        btVector3.convert(angFacGDX, btVector3.TEMP_0);
        btVector3 angFac = btVector3.TEMP_0;
        setAngularFactorNATIVE((int) cPointer, (int) angFac.getCPointer());
    }

    public Vector3 getAngularFactor() {
        int pointer = getAngularFactorNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getAngularFactor();return Bullet.getPointer(returnedJSObj);")
    private static native int getAngularFactorNATIVE(int addr);

    public boolean isInWorld() {
        return isInWorldNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.isInWorld();return returnedJSObj;")
    private static native boolean isInWorldNATIVE(int addr);

    public void addConstraintRef(btTypedConstraint c) {
        addConstraintRefNATIVE((int) cPointer, (int) c.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "cAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.addConstraintRef(cAddr);")
    private static native void addConstraintRefNATIVE(int addr, int cAddr);

    public void removeConstraintRef(btTypedConstraint c) {
        removeConstraintRefNATIVE((int) cPointer, (int) c.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "cAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.removeConstraintRef(cAddr);")
    private static native void removeConstraintRefNATIVE(int addr, int cAddr);

    public btTypedConstraint getConstraintRef(int index) {
        int pointer = getConstraintRefNATIVE((int) cPointer, index);
        btTypedConstraint.WRAPPER_GEN_01.setPointer(pointer);
        return btTypedConstraint.WRAPPER_GEN_01;
    }

    @org.teavm.jso.JSBody(params = {"addr", "index"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getConstraintRef(index);return Bullet.getPointer(returnedJSObj);")
    private static native int getConstraintRefNATIVE(int addr, int index);

    public int getNumConstraintRefs() {
        return getNumConstraintRefsNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getNumConstraintRefs();return returnedJSObj;")
    private static native int getNumConstraintRefsNATIVE(int addr);

    public void setFlags(int flags) {
        setFlagsNATIVE((int) cPointer, flags);
    }

    @org.teavm.jso.JSBody(params = {"addr", "flags"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);jsObj.setFlags(flags);")
    private static native void setFlagsNATIVE(int addr, int flags);

    public int getFlags() {
        return getFlagsNATIVE((int) cPointer);
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getFlags();return returnedJSObj;")
    private static native int getFlagsNATIVE(int addr);

    public Vector3 computeGyroscopicImpulseImplicit_World(float dt) {
        int pointer = computeGyroscopicImpulseImplicit_WorldNATIVE((int) cPointer, dt);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr", "dt"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.computeGyroscopicImpulseImplicit_World(dt);return Bullet.getPointer(returnedJSObj);")
    private static native int computeGyroscopicImpulseImplicit_WorldNATIVE(int addr, float dt);

    public Vector3 computeGyroscopicImpulseImplicit_Body(float step) {
        int pointer = computeGyroscopicImpulseImplicit_BodyNATIVE((int) cPointer, step);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr", "step"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.computeGyroscopicImpulseImplicit_Body(step);return Bullet.getPointer(returnedJSObj);")
    private static native int computeGyroscopicImpulseImplicit_BodyNATIVE(int addr, float step);

    public Vector3 computeGyroscopicForceExplicit(float maxGyroscopicForce) {
        int pointer = computeGyroscopicForceExplicitNATIVE((int) cPointer, maxGyroscopicForce);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr", "maxGyroscopicForce"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.computeGyroscopicForceExplicit(maxGyroscopicForce);return Bullet.getPointer(returnedJSObj);")
    private static native int computeGyroscopicForceExplicitNATIVE(int addr, float maxGyroscopicForce);

    public Vector3 getLocalInertia() {
        int pointer = getLocalInertiaNATIVE((int) cPointer);
        btVector3.WRAPPER_GEN_01.setPointer(pointer);
        btVector3.convert(btVector3.WRAPPER_GEN_01, btVector3.TEMP_GDX_01);
        return btVector3.TEMP_GDX_01;
    }

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btRigidBody);var returnedJSObj = jsObj.getLocalInertia();return Bullet.getPointer(returnedJSObj);")
    private static native int getLocalInertiaNATIVE(int addr);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy