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

com.badlogic.gdx.physics.bullet.collision.btCompoundShape 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.collision;

import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.physics.bullet.linearmath.btTransform;

/**
 * @author xpenatan
 */
public class btCompoundShape extends btCollisionShape {

    public static btCompoundShape WRAPPER_GEN_01 = new btCompoundShape(false);

    public btCompoundShape() {
        initObject(createNative(), true);
    }

    @org.teavm.jso.JSBody(script = "var jsObj = new Bullet.btCompoundShape(); return Bullet.getPointer(jsObj);")
    private static native int createNative();

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

    @org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btCompoundShape); Bullet.destroy(jsObj);")
    private static native void deleteNative(int 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((int) cPointer, (int) btLocalTransform.getCPointer(), (int) shape.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "localTransformAddr", "shapeAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btCompoundShape); jsObj.addChildShape(localTransformAddr, shapeAddr);")
    private static native void addChildShapeNATIVE(int addr, int localTransformAddr, int shapeAddr);

    public btCompoundShape(boolean cMemoryOwn) {
    }

    public void addChildShape(btTransform localTransform, btCollisionShape shape) {
    }

    public void removeChildShapeByIndex(int childShapeindex) {
        removeChildShapeByIndexNATIVE((int) cPointer, childShapeindex);
    }

    @org.teavm.jso.JSBody(params = {"addr", "childShapeindex"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btCompoundShape);jsObj.removeChildShapeByIndex(childShapeindex);")
    private static native void removeChildShapeByIndexNATIVE(int addr, int childShapeindex);

    public void removeChildShape(btCollisionShape shape) {
        removeChildShapeNATIVE((int) cPointer, (int) shape.getCPointer());
    }

    @org.teavm.jso.JSBody(params = {"addr", "shapeAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btCompoundShape);jsObj.removeChildShape(shapeAddr);")
    private static native void removeChildShapeNATIVE(int addr, int shapeAddr);

    public int getNumChildShapes() {
        return getNumChildShapesNATIVE((int) cPointer);
    }

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

    public btCollisionShape getChildShape(int index) {
        int pointer = getChildShapeNATIVE((int) cPointer, index);
        btCollisionShape.WRAPPER_GEN_01.setPointer(pointer);
        return btCollisionShape.WRAPPER_GEN_01;
    }

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

    public void setMargin(float margin) {
        setMarginNATIVE((int) cPointer, margin);
    }

    @org.teavm.jso.JSBody(params = {"addr", "margin"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btCompoundShape);jsObj.setMargin(margin);")
    private static native void setMarginNATIVE(int addr, float margin);

    public float getMargin() {
        return getMarginNATIVE((int) cPointer);
    }

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

    public void recalculateLocalAabb() {
        recalculateLocalAabbNATIVE((int) cPointer);
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy