com.badlogic.gdx.physics.bullet.collision.ClosestRayResultCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx-bullet-teavm Show documentation
Show all versions of gdx-bullet-teavm Show documentation
Tool to generate libgdx to javascript using teaVM
/*-------------------------------------------------------
* 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 ClosestRayResultCallback extends RayResultCallback {
public static ClosestRayResultCallback WRAPPER_GEN_01 = new ClosestRayResultCallback(false);
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((int) from.getCPointer(), (int) to.getCPointer(), addSingleResultFunction);
initObject(pointer, true);
}
@org.teavm.jso.JSFunctor
public interface AddSingleResultFunction extends org.teavm.jso.JSObject {
float addSingleResultJS(int rayResultAddr, boolean normalInWorldSpace);
}
@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(int rayFromWorldAddr, int rayToWorldAddr, AddSingleResultFunction addSingleResultFunction);
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);
}
@Override
protected void deleteNative() {
deleteNative((int) cPointer);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); Bullet.destroy(jsObj);")
private static native void deleteNative(int addr);
public void getRayFromWorld(Vector3 out) {
long outAddr = getRayFromWorld((int) cPointer);
btVector3.convert(outAddr, out);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); return Bullet.getPointer(jsObj.get_m_rayFromWorld());")
private static native int getRayFromWorld(int addr);
public void setRayFromWorld(Vector3 value) {
btVector3.convert(value, btVector3.TEMP_1);
setRayFromWorld((int) cPointer, (int) btVector3.TEMP_1.getCPointer());
}
@org.teavm.jso.JSBody(params = {"addr", "valueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); jsObj.set_m_rayFromWorld(jsVec3Obj);")
private static native int setRayFromWorld(int addr, int valueAddr);
public void getRayToWorld(Vector3 out) {
long outAddr = getRayToWorld((int) cPointer);
btVector3.convert(outAddr, out);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); return Bullet.getPointer(jsObj.get_m_rayToWorld());")
private static native int getRayToWorld(int addr);
public void setRayToWorld(Vector3 value) {
btVector3.convert(value, btVector3.TEMP_1);
setRayToWorld((int) cPointer, (int) btVector3.TEMP_1.getCPointer());
}
@org.teavm.jso.JSBody(params = {"addr", "valueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); jsObj.set_m_rayToWorld(jsVec3Obj);")
private static native int setRayToWorld(int addr, int valueAddr);
public void getHitNormalWorld(Vector3 out) {
long outAddr = getHitNormalWorld((int) cPointer);
btVector3.convert(outAddr, out);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); return Bullet.getPointer(jsObj.get_m_hitNormalWorld());")
private static native int getHitNormalWorld(int addr);
public void setHitNormalWorld(Vector3 value) {
btVector3.convert(value, btVector3.TEMP_1);
setHitNormalWorld((int) cPointer, (int) btVector3.TEMP_1.getCPointer());
}
@org.teavm.jso.JSBody(params = {"addr", "valueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); jsObj.set_m_hitNormalWorld(jsVec3Obj);")
private static native int setHitNormalWorld(int addr, int valueAddr);
public void getHitPointWorld(Vector3 out) {
long outAddr = getHitPointWorld((int) cPointer);
btVector3.convert(outAddr, out);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); return Bullet.getPointer(jsObj.get_m_hitPointWorld());")
private static native int getHitPointWorld(int addr);
public void setHitPointWorld(Vector3 value) {
btVector3.convert(value, btVector3.TEMP_1);
setHitPointWorld((int) cPointer, (int) btVector3.TEMP_1.getCPointer());
}
@org.teavm.jso.JSBody(params = {"addr", "valueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); jsObj.set_m_hitPointWorld(jsVec3Obj);")
private static native int setHitPointWorld(int addr, int valueAddr);
public float addSingleResult(LocalRayResult rayResult, boolean normalInWorldSpace) {
return addSingleResult((int) cPointer, (int) rayResult.getCPointer(), normalInWorldSpace);
}
@org.teavm.jso.JSBody(params = {"addr", "rayResultAddr", "normalInWorldSpace"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MyClosestRayResultCallback); return jsObj.addSingleResultSuper(rayResultAddr, normalInWorldSpace);")
private static native float addSingleResult(int addr, int rayResultAddr, boolean normalInWorldSpace);
public ClosestRayResultCallback(boolean cMemoryOwn) {
}
public ClosestRayResultCallback() {
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy