Home | History | Annotate | Download | only in collision
      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 Collision implements CollisionConstants {
     19 
     20 	/** Temporary Vector3 instance, used by native methods that return a Vector3 instance */
     21 	public final static Vector3 staticVector3 = new Vector3();
     22 	/** Pool of Vector3, used by native (callback) method for the arguments */
     23 	public final static com.badlogic.gdx.utils.Pool<Vector3> poolVector3 = new com.badlogic.gdx.utils.Pool<Vector3>() {
     24 		@Override
     25 		protected Vector3 newObject() {
     26 			return new Vector3();
     27 		}
     28 	};
     29 
     30 
     31 	/** Temporary Quaternion instance, used by native methods that return a Quaternion instance */
     32 	public final static Quaternion staticQuaternion = new Quaternion();
     33 	/** Pool of Quaternion, used by native (callback) method for the arguments */
     34 	public final static com.badlogic.gdx.utils.Pool<Quaternion> poolQuaternion = new com.badlogic.gdx.utils.Pool<Quaternion>() {
     35 		@Override
     36 		protected Quaternion newObject() {
     37 			return new Quaternion();
     38 		}
     39 	};
     40 
     41 
     42 	/** Temporary Matrix3 instance, used by native methods that return a Matrix3 instance */
     43 	public final static Matrix3 staticMatrix3 = new Matrix3();
     44 	/** Pool of Matrix3, used by native (callback) method for the arguments */
     45 	public final static com.badlogic.gdx.utils.Pool<Matrix3> poolMatrix3 = new com.badlogic.gdx.utils.Pool<Matrix3>() {
     46 		@Override
     47 		protected Matrix3 newObject() {
     48 			return new Matrix3();
     49 		}
     50 	};
     51 
     52 
     53 	/** Temporary Matrix4 instance, used by native methods that return a Matrix4 instance */
     54 	public final static Matrix4 staticMatrix4 = new Matrix4();
     55 	/** Pool of Matrix4, used by native (callback) method for the arguments */
     56 	public final static com.badlogic.gdx.utils.Pool<Matrix4> poolMatrix4 = new com.badlogic.gdx.utils.Pool<Matrix4>() {
     57 		@Override
     58 		protected Matrix4 newObject() {
     59 			return new Matrix4();
     60 		}
     61 	};
     62 
     63   public static void setGOverlappingPairs(int value) {
     64     CollisionJNI.gOverlappingPairs_set(value);
     65   }
     66 
     67   public static int getGOverlappingPairs() {
     68     return CollisionJNI.gOverlappingPairs_get();
     69   }
     70 
     71   public static void setGRemovePairs(int value) {
     72     CollisionJNI.gRemovePairs_set(value);
     73   }
     74 
     75   public static int getGRemovePairs() {
     76     return CollisionJNI.gRemovePairs_get();
     77   }
     78 
     79   public static void setGAddedPairs(int value) {
     80     CollisionJNI.gAddedPairs_set(value);
     81   }
     82 
     83   public static int getGAddedPairs() {
     84     return CollisionJNI.gAddedPairs_get();
     85   }
     86 
     87   public static void setGFindPairs(int value) {
     88     CollisionJNI.gFindPairs_set(value);
     89   }
     90 
     91   public static int getGFindPairs() {
     92     return CollisionJNI.gFindPairs_get();
     93   }
     94 
     95   public static int getBT_NULL_PAIR() {
     96     return CollisionJNI.BT_NULL_PAIR_get();
     97   }
     98 
     99   public static boolean gdxCheckFilter(int filter, int flag) {
    100     return CollisionJNI.gdxCheckFilter__SWIG_0(filter, flag);
    101   }
    102 
    103   public static boolean gdxCheckFilter(btCollisionObject colObj0, btCollisionObject colObj1) {
    104     return CollisionJNI.gdxCheckFilter__SWIG_1(btCollisionObject.getCPtr(colObj0), colObj0, btCollisionObject.getCPtr(colObj1), colObj1);
    105   }
    106 
    107   public static boolean Intersect(btDbvtAabbMm a, btDbvtAabbMm b) {
    108     return CollisionJNI.Intersect__SWIG_0(btDbvtAabbMm.getCPtr(a), a, btDbvtAabbMm.getCPtr(b), b);
    109   }
    110 
    111   public static boolean Intersect(btDbvtAabbMm a, Vector3 b) {
    112     return CollisionJNI.Intersect__SWIG_1(btDbvtAabbMm.getCPtr(a), a, b);
    113   }
    114 
    115   public static float Proximity(btDbvtAabbMm a, btDbvtAabbMm b) {
    116     return CollisionJNI.Proximity(btDbvtAabbMm.getCPtr(a), a, btDbvtAabbMm.getCPtr(b), b);
    117   }
    118 
    119   public static int Select(btDbvtAabbMm o, btDbvtAabbMm a, btDbvtAabbMm b) {
    120     return CollisionJNI.Select(btDbvtAabbMm.getCPtr(o), o, btDbvtAabbMm.getCPtr(a), a, btDbvtAabbMm.getCPtr(b), b);
    121   }
    122 
    123   public static void Merge(btDbvtAabbMm a, btDbvtAabbMm b, btDbvtAabbMm r) {
    124     CollisionJNI.Merge(btDbvtAabbMm.getCPtr(a), a, btDbvtAabbMm.getCPtr(b), b, btDbvtAabbMm.getCPtr(r), r);
    125   }
    126 
    127   public static boolean NotEqual(btDbvtAabbMm a, btDbvtAabbMm b) {
    128     return CollisionJNI.NotEqual(btDbvtAabbMm.getCPtr(a), a, btDbvtAabbMm.getCPtr(b), b);
    129   }
    130 
    131   public static void setGCompoundCompoundChildShapePairCallback(SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool value) {
    132     CollisionJNI.gCompoundCompoundChildShapePairCallback_set(SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool.getCPtr(value));
    133   }
    134 
    135   public static SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool getGCompoundCompoundChildShapePairCallback() {
    136     long cPtr = CollisionJNI.gCompoundCompoundChildShapePairCallback_get();
    137     return (cPtr == 0) ? null : new SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool(cPtr, false);
    138   }
    139 
    140   public static void setGContactAddedCallback(SWIGTYPE_p_f_r_btManifoldPoint_p_q_const__btCollisionObjectWrapper_int_int_p_q_const__btCollisionObjectWrapper_int_int__bool value) {
    141     CollisionJNI.gContactAddedCallback_set(SWIGTYPE_p_f_r_btManifoldPoint_p_q_const__btCollisionObjectWrapper_int_int_p_q_const__btCollisionObjectWrapper_int_int__bool.getCPtr(value));
    142   }
    143 
    144   public static SWIGTYPE_p_f_r_btManifoldPoint_p_q_const__btCollisionObjectWrapper_int_int_p_q_const__btCollisionObjectWrapper_int_int__bool getGContactAddedCallback() {
    145     long cPtr = CollisionJNI.gContactAddedCallback_get();
    146     return (cPtr == 0) ? null : new SWIGTYPE_p_f_r_btManifoldPoint_p_q_const__btCollisionObjectWrapper_int_int_p_q_const__btCollisionObjectWrapper_int_int__bool(cPtr, false);
    147   }
    148 
    149   public static int getBT_SIMPLE_NULL_PAIR() {
    150     return CollisionJNI.BT_SIMPLE_NULL_PAIR_get();
    151   }
    152 
    153   public static void setGOverlappingSimplePairs(int value) {
    154     CollisionJNI.gOverlappingSimplePairs_set(value);
    155   }
    156 
    157   public static int getGOverlappingSimplePairs() {
    158     return CollisionJNI.gOverlappingSimplePairs_get();
    159   }
    160 
    161   public static void setGRemoveSimplePairs(int value) {
    162     CollisionJNI.gRemoveSimplePairs_set(value);
    163   }
    164 
    165   public static int getGRemoveSimplePairs() {
    166     return CollisionJNI.gRemoveSimplePairs_get();
    167   }
    168 
    169   public static void setGAddedSimplePairs(int value) {
    170     CollisionJNI.gAddedSimplePairs_set(value);
    171   }
    172 
    173   public static int getGAddedSimplePairs() {
    174     return CollisionJNI.gAddedSimplePairs_get();
    175   }
    176 
    177   public static void setGFindSimplePairs(int value) {
    178     CollisionJNI.gFindSimplePairs_set(value);
    179   }
    180 
    181   public static int getGFindSimplePairs() {
    182     return CollisionJNI.gFindSimplePairs_get();
    183   }
    184 
    185   public static void btGenerateInternalEdgeInfo(btBvhTriangleMeshShape trimeshShape, btTriangleInfoMap triangleInfoMap) {
    186     CollisionJNI.btGenerateInternalEdgeInfo(btBvhTriangleMeshShape.getCPtr(trimeshShape), trimeshShape, btTriangleInfoMap.getCPtr(triangleInfoMap), triangleInfoMap);
    187   }
    188 
    189   public static void btAdjustInternalEdgeContacts(btManifoldPoint cp, btCollisionObjectWrapper trimeshColObj0Wrap, btCollisionObjectWrapper otherColObj1Wrap, int partId0, int index0, int normalAdjustFlags) {
    190     CollisionJNI.btAdjustInternalEdgeContacts__SWIG_0(btManifoldPoint.getCPtr(cp), cp, btCollisionObjectWrapper.getCPtr(trimeshColObj0Wrap), trimeshColObj0Wrap, btCollisionObjectWrapper.getCPtr(otherColObj1Wrap), otherColObj1Wrap, partId0, index0, normalAdjustFlags);
    191   }
    192 
    193   public static void btAdjustInternalEdgeContacts(btManifoldPoint cp, btCollisionObjectWrapper trimeshColObj0Wrap, btCollisionObjectWrapper otherColObj1Wrap, int partId0, int index0) {
    194     CollisionJNI.btAdjustInternalEdgeContacts__SWIG_1(btManifoldPoint.getCPtr(cp), cp, btCollisionObjectWrapper.getCPtr(trimeshColObj0Wrap), trimeshColObj0Wrap, btCollisionObjectWrapper.getCPtr(otherColObj1Wrap), otherColObj1Wrap, partId0, index0);
    195   }
    196 
    197   public static void setGCompoundChildShapePairCallback(SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool value) {
    198     CollisionJNI.gCompoundChildShapePairCallback_set(SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool.getCPtr(value));
    199   }
    200 
    201   public static SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool getGCompoundChildShapePairCallback() {
    202     long cPtr = CollisionJNI.gCompoundChildShapePairCallback_get();
    203     return (cPtr == 0) ? null : new SWIGTYPE_p_f_p_q_const__btCollisionShape_p_q_const__btCollisionShape__bool(cPtr, false);
    204   }
    205 
    206   public static void setGContactBreakingThreshold(float value) {
    207     CollisionJNI.gContactBreakingThreshold_set(value);
    208   }
    209 
    210   public static float getGContactBreakingThreshold() {
    211     return CollisionJNI.gContactBreakingThreshold_get();
    212   }
    213 
    214   public static void bt_calc_quantization_parameters(Vector3 outMinBound, Vector3 outMaxBound, Vector3 bvhQuantization, Vector3 srcMinBound, Vector3 srcMaxBound, float quantizationMargin) {
    215     CollisionJNI.bt_calc_quantization_parameters(outMinBound, outMaxBound, bvhQuantization, srcMinBound, srcMaxBound, quantizationMargin);
    216   }
    217 
    218   public static void bt_quantize_clamp(java.nio.IntBuffer out, Vector3 point, Vector3 min_bound, Vector3 max_bound, Vector3 bvhQuantization) {
    219     assert out.isDirect() : "Buffer must be allocated direct.";
    220     {
    221       CollisionJNI.bt_quantize_clamp(out, point, min_bound, max_bound, bvhQuantization);
    222     }
    223   }
    224 
    225   public static Vector3 bt_unquantize(java.nio.IntBuffer vecIn, Vector3 offset, Vector3 bvhQuantization) {
    226     assert vecIn.isDirect() : "Buffer must be allocated direct.";
    227     {
    228 	return CollisionJNI.bt_unquantize(vecIn, offset, bvhQuantization);
    229 }
    230   }
    231 
    232   public static float bt_mat3_dot_col(Matrix3 mat, Vector3 vec3, int colindex) {
    233     return CollisionJNI.bt_mat3_dot_col(mat, vec3, colindex);
    234   }
    235 
    236   public static boolean btCompareTransformsEqual(Matrix4 t1, Matrix4 t2) {
    237     return CollisionJNI.btCompareTransformsEqual(t1, t2);
    238   }
    239 
    240   public static float bt_distance_point_plane(btVector4 plane, Vector3 point) {
    241     return CollisionJNI.bt_distance_point_plane(btVector4.getCPtr(plane), plane, point);
    242   }
    243 
    244   public static void bt_vec_blend(Vector3 vr, Vector3 va, Vector3 vb, float blend_factor) {
    245     CollisionJNI.bt_vec_blend(vr, va, vb, blend_factor);
    246   }
    247 
    248   public static void bt_plane_clip_polygon_collect(Vector3 point0, Vector3 point1, float dist0, float dist1, btVector3 clipped, SWIGTYPE_p_int clipped_count) {
    249     CollisionJNI.bt_plane_clip_polygon_collect(point0, point1, dist0, dist1, btVector3.getCPtr(clipped), clipped, SWIGTYPE_p_int.getCPtr(clipped_count));
    250   }
    251 
    252   public static int bt_plane_clip_polygon(btVector4 plane, btVector3 polygon_points, int polygon_point_count, btVector3 clipped) {
    253     return CollisionJNI.bt_plane_clip_polygon(btVector4.getCPtr(plane), plane, btVector3.getCPtr(polygon_points), polygon_points, polygon_point_count, btVector3.getCPtr(clipped), clipped);
    254   }
    255 
    256   public static int bt_plane_clip_triangle(btVector4 plane, Vector3 point0, Vector3 point1, Vector3 point2, btVector3 clipped) {
    257     return CollisionJNI.bt_plane_clip_triangle(btVector4.getCPtr(plane), plane, point0, point1, point2, btVector3.getCPtr(clipped), clipped);
    258   }
    259 
    260   public static void bt_edge_plane(Vector3 e1, Vector3 e2, Vector3 normal, btVector4 plane) {
    261     CollisionJNI.bt_edge_plane(e1, e2, normal, btVector4.getCPtr(plane), plane);
    262   }
    263 
    264   public static void bt_closest_point_on_segment(Vector3 cp, Vector3 v, Vector3 e1, Vector3 e2) {
    265     CollisionJNI.bt_closest_point_on_segment(cp, v, e1, e2);
    266   }
    267 
    268   public static int bt_line_plane_collision(btVector4 plane, Vector3 vDir, Vector3 vPoint, Vector3 pout, SWIGTYPE_p_float tparam, float tmin, float tmax) {
    269     return CollisionJNI.bt_line_plane_collision(btVector4.getCPtr(plane), plane, vDir, vPoint, pout, SWIGTYPE_p_float.getCPtr(tparam), tmin, tmax);
    270   }
    271 
    272   public static void bt_segment_collision(Vector3 vA1, Vector3 vA2, Vector3 vB1, Vector3 vB2, Vector3 vPointA, Vector3 vPointB) {
    273     CollisionJNI.bt_segment_collision(vA1, vA2, vB1, vB2, vPointA, vPointB);
    274   }
    275 
    276   public static long btPoolAlloc(long size) {
    277     return CollisionJNI.btPoolAlloc(size);
    278   }
    279 
    280   public static long btPoolRealloc(long ptr, long oldsize, long newsize) {
    281     return CollisionJNI.btPoolRealloc(ptr, oldsize, newsize);
    282   }
    283 
    284   public static void btPoolFree(long ptr) {
    285     CollisionJNI.btPoolFree(ptr);
    286   }
    287 
    288   public static Vector3 gim_inertia_add_transformed(Vector3 source_inertia, Vector3 added_inertia, Matrix4 transform) {
    289 	return CollisionJNI.gim_inertia_add_transformed(source_inertia, added_inertia, transform);
    290 }
    291 
    292   public static Vector3 gim_get_point_inertia(Vector3 point, float mass) {
    293 	return CollisionJNI.gim_get_point_inertia(point, mass);
    294 }
    295 
    296 }
    297