1 /* ---------------------------------------------------------------------------- 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 3.0.8 4 * 5 * Do not make changes to this file unless you know what you are doing--modify 6 * the SWIG interface file instead. 7 * ----------------------------------------------------------------------------- */ 8 9 package com.badlogic.gdx.physics.bullet.collision; 10 11 import com.badlogic.gdx.physics.bullet.BulletBase; 12 import com.badlogic.gdx.physics.bullet.linearmath.*; 13 import com.badlogic.gdx.math.Vector3; 14 import com.badlogic.gdx.math.Quaternion; 15 import com.badlogic.gdx.math.Matrix3; 16 import com.badlogic.gdx.math.Matrix4; 17 18 public class btTriangleRaycastCallback extends btTriangleCallback { 19 private long swigCPtr; 20 btTriangleRaycastCallback(final String className, long cPtr, boolean cMemoryOwn)21 protected btTriangleRaycastCallback(final String className, long cPtr, boolean cMemoryOwn) { 22 super(className, CollisionJNI.btTriangleRaycastCallback_SWIGUpcast(cPtr), cMemoryOwn); 23 swigCPtr = cPtr; 24 } 25 26 /** Construct a new btTriangleRaycastCallback, normally you should not need this constructor it's intended for low-level usage. */ btTriangleRaycastCallback(long cPtr, boolean cMemoryOwn)27 public btTriangleRaycastCallback(long cPtr, boolean cMemoryOwn) { 28 this("btTriangleRaycastCallback", cPtr, cMemoryOwn); 29 construct(); 30 } 31 32 @Override reset(long cPtr, boolean cMemoryOwn)33 protected void reset(long cPtr, boolean cMemoryOwn) { 34 if (!destroyed) 35 destroy(); 36 super.reset(CollisionJNI.btTriangleRaycastCallback_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); 37 } 38 getCPtr(btTriangleRaycastCallback obj)39 public static long getCPtr(btTriangleRaycastCallback obj) { 40 return (obj == null) ? 0 : obj.swigCPtr; 41 } 42 43 @Override finalize()44 protected void finalize() throws Throwable { 45 if (!destroyed) 46 destroy(); 47 super.finalize(); 48 } 49 delete()50 @Override protected synchronized void delete() { 51 if (swigCPtr != 0) { 52 if (swigCMemOwn) { 53 swigCMemOwn = false; 54 CollisionJNI.delete_btTriangleRaycastCallback(swigCPtr); 55 } 56 swigCPtr = 0; 57 } 58 super.delete(); 59 } 60 swigDirectorDisconnect()61 protected void swigDirectorDisconnect() { 62 swigCMemOwn = false; 63 delete(); 64 } 65 swigReleaseOwnership()66 public void swigReleaseOwnership() { 67 swigCMemOwn = false; 68 CollisionJNI.btTriangleRaycastCallback_change_ownership(this, swigCPtr, false); 69 } 70 swigTakeOwnership()71 public void swigTakeOwnership() { 72 swigCMemOwn = true; 73 CollisionJNI.btTriangleRaycastCallback_change_ownership(this, swigCPtr, true); 74 } 75 setFrom(btVector3 value)76 public void setFrom(btVector3 value) { 77 CollisionJNI.btTriangleRaycastCallback_from_set(swigCPtr, this, btVector3.getCPtr(value), value); 78 } 79 getFrom()80 public btVector3 getFrom() { 81 long cPtr = CollisionJNI.btTriangleRaycastCallback_from_get(swigCPtr, this); 82 return (cPtr == 0) ? null : new btVector3(cPtr, false); 83 } 84 setTo(btVector3 value)85 public void setTo(btVector3 value) { 86 CollisionJNI.btTriangleRaycastCallback_to_set(swigCPtr, this, btVector3.getCPtr(value), value); 87 } 88 getTo()89 public btVector3 getTo() { 90 long cPtr = CollisionJNI.btTriangleRaycastCallback_to_get(swigCPtr, this); 91 return (cPtr == 0) ? null : new btVector3(cPtr, false); 92 } 93 setFlags(long value)94 public void setFlags(long value) { 95 CollisionJNI.btTriangleRaycastCallback_flags_set(swigCPtr, this, value); 96 } 97 getFlags()98 public long getFlags() { 99 return CollisionJNI.btTriangleRaycastCallback_flags_get(swigCPtr, this); 100 } 101 setHitFraction(float value)102 public void setHitFraction(float value) { 103 CollisionJNI.btTriangleRaycastCallback_hitFraction_set(swigCPtr, this, value); 104 } 105 getHitFraction()106 public float getHitFraction() { 107 return CollisionJNI.btTriangleRaycastCallback_hitFraction_get(swigCPtr, this); 108 } 109 btTriangleRaycastCallback(Vector3 from, Vector3 to, long flags)110 public btTriangleRaycastCallback(Vector3 from, Vector3 to, long flags) { 111 this(CollisionJNI.new_btTriangleRaycastCallback__SWIG_0(from, to, flags), true); 112 CollisionJNI.btTriangleRaycastCallback_director_connect(this, swigCPtr, swigCMemOwn, true); 113 } 114 btTriangleRaycastCallback(Vector3 from, Vector3 to)115 public btTriangleRaycastCallback(Vector3 from, Vector3 to) { 116 this(CollisionJNI.new_btTriangleRaycastCallback__SWIG_1(from, to), true); 117 CollisionJNI.btTriangleRaycastCallback_director_connect(this, swigCPtr, swigCMemOwn, true); 118 } 119 processTriangle(btVector3 triangle, int partId, int triangleIndex)120 public void processTriangle(btVector3 triangle, int partId, int triangleIndex) { 121 if (getClass() == btTriangleRaycastCallback.class) CollisionJNI.btTriangleRaycastCallback_processTriangle(swigCPtr, this, btVector3.getCPtr(triangle), triangle, partId, triangleIndex); else CollisionJNI.btTriangleRaycastCallback_processTriangleSwigExplicitbtTriangleRaycastCallback(swigCPtr, this, btVector3.getCPtr(triangle), triangle, partId, triangleIndex); 122 } 123 reportHit(Vector3 hitNormalLocal, float hitFraction, int partId, int triangleIndex)124 public float reportHit(Vector3 hitNormalLocal, float hitFraction, int partId, int triangleIndex) { 125 return CollisionJNI.btTriangleRaycastCallback_reportHit(swigCPtr, this, hitNormalLocal, hitFraction, partId, triangleIndex); 126 } 127 128 public final static class EFlags { 129 public final static int kF_None = 0; 130 public final static int kF_FilterBackfaces = 1 << 0; 131 public final static int kF_KeepUnflippedNormal = 1 << 1; 132 public final static int kF_UseSubSimplexConvexCastRaytest = 1 << 2; 133 public final static int kF_UseGjkConvexCastRaytest = 1 << 3; 134 public final static int kF_Terminator = 0xFFFFFFFF; 135 } 136 137 } 138