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

com.badlogic.gdx.physics.bullet.collision.btBoxShape 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.Vector3;
import com.badlogic.gdx.physics.bullet.linearmath.btVector3;

/**
 * @author xpenatan
 */
public class btBoxShape extends btPolyhedralConvexShape {

    public static btBoxShape WRAPPER_GEN_01 = new btBoxShape(false);

    public btBoxShape(Vector3 boxHalfExtents) {
        btVector3 out = btVector3.TEMP_0;
        btVector3.convert(boxHalfExtents, out);
        initObject(createNative((int) out.getCPointer()), true);
    }

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

    @org.teavm.jso.JSBody(params = {"boxHalfExtentsAddr"}, script = "var boxHalfExtentsJSObj = Bullet.wrapPointer(boxHalfExtentsAddr, Bullet.btVector3); var jsObj = new Bullet.btBoxShape(boxHalfExtentsJSObj); return Bullet.getPointer(jsObj);")
    private static native int createNative(int boxHalfExtentsAddr);

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

    public btBoxShape(boolean cMemoryOwn) {
    }

    public btBoxShape() {
    }

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

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

    public Vector3 getHalfExtentsWithoutMargin() {
        int pointer = getHalfExtentsWithoutMarginNATIVE((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.btBoxShape);var returnedJSObj = jsObj.getHalfExtentsWithoutMargin();return Bullet.getPointer(returnedJSObj);")
    private static native int getHalfExtentsWithoutMarginNATIVE(int addr);

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy