com.badlogic.gdx.physics.bullet.collision.btTriangleRaycastCallback 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 btTriangleRaycastCallback extends btTriangleCallback {
public static btTriangleRaycastCallback WRAPPER_GEN_01 = new btTriangleRaycastCallback(false);
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((int) from.getCPointer(), (int) to.getCPointer(), reportHitFunction);
initObject(pointer, true);
}
@org.teavm.jso.JSFunctor
public interface ReportHitFunction extends org.teavm.jso.JSObject {
float reportHitJS(int hitNormalLocalAddr, float hitFraction, int partId, int triangleIndex);
}
@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(int fromAddr, int toAddr, ReportHitFunction hitFunction);
public void setFlags(long value) {
setFlags((int) cPointer, (int) value);
}
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);
}
@Override
protected void deleteNative() {
deleteNative((int) cPointer);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); Bullet.destroy(jsObj);")
private static native void deleteNative(int addr);
public float reportHit(Vector3 hitNormalLocal, float hitFraction, int partId, int triangleIndex) {
return 0;
}
public void setFrom(btVector3 value) {
setFrom((int) cPointer, (int) value.getCPointer());
}
@org.teavm.jso.JSBody(params = {"addr", "valueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); jsObj.set_m_from(jsVec3Obj);")
private static native int setFrom(int addr, int valueAddr);
public btVector3 getFrom() {
long outAddr = getFrom((int) cPointer);
btVector3.emptyTransform.setPointer(outAddr);
return btVector3.emptyTransform;
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); return Bullet.getPointer(jsObj.get_m_from());")
private static native int getFrom(int addr);
public void setTo(btVector3 value) {
setTo((int) cPointer, (int) value.getCPointer());
}
@org.teavm.jso.JSBody(params = {"addr", "valueAddr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); var jsVec3Obj = Bullet.wrapPointer(valueAddr, Bullet.btVector3); jsObj.set_m_to(jsVec3Obj);")
private static native int setTo(int addr, int valueAddr);
public btVector3 getTo() {
long outAddr = getTo((int) cPointer);
btVector3.emptyTransform.setPointer(outAddr);
return btVector3.emptyTransform;
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); return Bullet.getPointer(jsObj.get_m_to());")
private static native int getTo(int addr);
@org.teavm.jso.JSBody(params = {"addr", "value"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); jsObj.set_m_flags(value);")
private static native void setFlags(int addr, int value);
public long getFlags() {
return getFlags((int) cPointer);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); return jsObj.get_m_flags();")
private static native int getFlags(int addr);
public void setHitFraction(float value) {
setHitFraction((int) cPointer, value);
}
@org.teavm.jso.JSBody(params = {"addr", "value"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); jsObj.set_m_hitFraction(value);")
private static native void setHitFraction(int addr, float value);
public float getHitFraction() {
return getHitFraction((int) cPointer);
}
@org.teavm.jso.JSBody(params = {"addr"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.MybtTriangleRaycastCallback); return jsObj.get_m_hitFraction();")
private static native float getHitFraction(int 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;
}
public btTriangleRaycastCallback(boolean cMemoryOwn) {
}
public btTriangleRaycastCallback() {
}
public float reportHit(btVector3 hitNormalLocal, float hitFraction, int partId, int triangleIndex) {
return reportHitNATIVE((int) cPointer, (int) hitNormalLocal.getCPointer(), hitFraction, partId, triangleIndex);
}
@org.teavm.jso.JSBody(params = {"addr", "hitNormalLocalAddr", "hitFraction", "partId", "triangleIndex"}, script = "var jsObj = Bullet.wrapPointer(addr, Bullet.btTriangleRaycastCallback);var returnedJSObj = jsObj.reportHit(hitNormalLocalAddr, hitFraction, partId, triangleIndex);return returnedJSObj;")
private static native float reportHitNATIVE(int addr, int hitNormalLocalAddr, float hitFraction, int partId, int triangleIndex);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy