Home | History | Annotate | Download | only in softbody
      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.softbody;
     10 
     11 import com.badlogic.gdx.physics.bullet.BulletBase;
     12 import com.badlogic.gdx.physics.bullet.linearmath.*;
     13 import com.badlogic.gdx.physics.bullet.collision.*;
     14 import com.badlogic.gdx.physics.bullet.dynamics.*;
     15 import com.badlogic.gdx.math.Vector3;
     16 import com.badlogic.gdx.math.Quaternion;
     17 import com.badlogic.gdx.math.Matrix3;
     18 import com.badlogic.gdx.math.Matrix4;
     19 
     20 public class Softbody implements SoftbodyConstants {
     21 
     22 	/** Temporary Vector3 instance, used by native methods that return a Vector3 instance */
     23 	public final static Vector3 staticVector3 = new Vector3();
     24 	/** Pool of Vector3, used by native (callback) method for the arguments */
     25 	public final static com.badlogic.gdx.utils.Pool<Vector3> poolVector3 = new com.badlogic.gdx.utils.Pool<Vector3>() {
     26 		@Override
     27 		protected Vector3 newObject() {
     28 			return new Vector3();
     29 		}
     30 	};
     31 
     32 
     33 	/** Temporary Quaternion instance, used by native methods that return a Quaternion instance */
     34 	public final static Quaternion staticQuaternion = new Quaternion();
     35 	/** Pool of Quaternion, used by native (callback) method for the arguments */
     36 	public final static com.badlogic.gdx.utils.Pool<Quaternion> poolQuaternion = new com.badlogic.gdx.utils.Pool<Quaternion>() {
     37 		@Override
     38 		protected Quaternion newObject() {
     39 			return new Quaternion();
     40 		}
     41 	};
     42 
     43 
     44 	/** Temporary Matrix3 instance, used by native methods that return a Matrix3 instance */
     45 	public final static Matrix3 staticMatrix3 = new Matrix3();
     46 	/** Pool of Matrix3, used by native (callback) method for the arguments */
     47 	public final static com.badlogic.gdx.utils.Pool<Matrix3> poolMatrix3 = new com.badlogic.gdx.utils.Pool<Matrix3>() {
     48 		@Override
     49 		protected Matrix3 newObject() {
     50 			return new Matrix3();
     51 		}
     52 	};
     53 
     54 
     55 	/** Temporary Matrix4 instance, used by native methods that return a Matrix4 instance */
     56 	public final static Matrix4 staticMatrix4 = new Matrix4();
     57 	/** Pool of Matrix4, used by native (callback) method for the arguments */
     58 	public final static com.badlogic.gdx.utils.Pool<Matrix4> poolMatrix4 = new com.badlogic.gdx.utils.Pool<Matrix4>() {
     59 		@Override
     60 		protected Matrix4 newObject() {
     61 			return new Matrix4();
     62 		}
     63 	};
     64 
     65   public static Matrix3 Lerp(Matrix3 a, Matrix3 b, float t) {
     66 	return SoftbodyJNI.Lerp(a, b, t);
     67 }
     68 
     69   public static Vector3 Clamp(Vector3 v, float maxlength) {
     70 	return SoftbodyJNI.Clamp(v, maxlength);
     71 }
     72 
     73   public static float ClusterMetric(Vector3 x, Vector3 y) {
     74     return SoftbodyJNI.ClusterMetric(x, y);
     75   }
     76 
     77   public static Matrix3 ScaleAlongAxis(Vector3 a, float s) {
     78 	return SoftbodyJNI.ScaleAlongAxis(a, s);
     79 }
     80 
     81   public static Matrix3 Cross(Vector3 v) {
     82 	return SoftbodyJNI.Cross(v);
     83 }
     84 
     85   public static Matrix3 Diagonal(float x) {
     86 	return SoftbodyJNI.Diagonal(x);
     87 }
     88 
     89   public static Matrix3 Add(Matrix3 a, Matrix3 b) {
     90 	return SoftbodyJNI.Add(a, b);
     91 }
     92 
     93   public static Matrix3 Sub(Matrix3 a, Matrix3 b) {
     94 	return SoftbodyJNI.Sub(a, b);
     95 }
     96 
     97   public static Matrix3 Mul(Matrix3 a, float b) {
     98 	return SoftbodyJNI.Mul(a, b);
     99 }
    100 
    101   public static void Orthogonalize(Matrix3 m) {
    102     SoftbodyJNI.Orthogonalize(m);
    103   }
    104 
    105   public static Matrix3 MassMatrix(float im, Matrix3 iwi, Vector3 r) {
    106 	return SoftbodyJNI.MassMatrix(im, iwi, r);
    107 }
    108 
    109   public static Matrix3 ImpulseMatrix(float dt, float ima, float imb, Matrix3 iwi, Vector3 r) {
    110 	return SoftbodyJNI.ImpulseMatrix__SWIG_0(dt, ima, imb, iwi, r);
    111 }
    112 
    113   public static Matrix3 ImpulseMatrix(float ima, Matrix3 iia, Vector3 ra, float imb, Matrix3 iib, Vector3 rb) {
    114 	return SoftbodyJNI.ImpulseMatrix__SWIG_1(ima, iia, ra, imb, iib, rb);
    115 }
    116 
    117   public static Matrix3 AngularImpulseMatrix(Matrix3 iia, Matrix3 iib) {
    118 	return SoftbodyJNI.AngularImpulseMatrix(iia, iib);
    119 }
    120 
    121   public static Vector3 ProjectOnAxis(Vector3 v, Vector3 a) {
    122 	return SoftbodyJNI.ProjectOnAxis(v, a);
    123 }
    124 
    125   public static Vector3 ProjectOnPlane(Vector3 v, Vector3 a) {
    126 	return SoftbodyJNI.ProjectOnPlane(v, a);
    127 }
    128 
    129   public static void ProjectOrigin(Vector3 a, Vector3 b, Vector3 prj, SWIGTYPE_p_float sqd) {
    130     SoftbodyJNI.ProjectOrigin__SWIG_0(a, b, prj, SWIGTYPE_p_float.getCPtr(sqd));
    131   }
    132 
    133   public static void ProjectOrigin(Vector3 a, Vector3 b, Vector3 c, Vector3 prj, SWIGTYPE_p_float sqd) {
    134     SoftbodyJNI.ProjectOrigin__SWIG_1(a, b, c, prj, SWIGTYPE_p_float.getCPtr(sqd));
    135   }
    136 
    137   public static Vector3 BaryCoord(Vector3 a, Vector3 b, Vector3 c, Vector3 p) {
    138 	return SoftbodyJNI.BaryCoord(a, b, c, p);
    139 }
    140 
    141   public static float ImplicitSolve(btSoftBody.ImplicitFn fn, Vector3 a, Vector3 b, float accuracy, int maxiterations) {
    142     return SoftbodyJNI.ImplicitSolve__SWIG_0(btSoftBody.ImplicitFn.getCPtr(fn), fn, a, b, accuracy, maxiterations);
    143   }
    144 
    145   public static float ImplicitSolve(btSoftBody.ImplicitFn fn, Vector3 a, Vector3 b, float accuracy) {
    146     return SoftbodyJNI.ImplicitSolve__SWIG_1(btSoftBody.ImplicitFn.getCPtr(fn), fn, a, b, accuracy);
    147   }
    148 
    149   public static Vector3 NormalizeAny(Vector3 v) {
    150 	return SoftbodyJNI.NormalizeAny(v);
    151 }
    152 
    153   public static btDbvtAabbMm VolumeOf(btSoftBody.Face f, float margin) {
    154     return new btDbvtAabbMm(SoftbodyJNI.VolumeOf__SWIG_0(btSoftBody.Face.getCPtr(f), f, margin), true);
    155   }
    156 
    157   public static Vector3 CenterOf(btSoftBody.Face f) {
    158 	return SoftbodyJNI.CenterOf(btSoftBody.Face.getCPtr(f), f);
    159 }
    160 
    161   public static float AreaOf(Vector3 x0, Vector3 x1, Vector3 x2) {
    162     return SoftbodyJNI.AreaOf(x0, x1, x2);
    163   }
    164 
    165   public static float VolumeOf(Vector3 x0, Vector3 x1, Vector3 x2, Vector3 x3) {
    166     return SoftbodyJNI.VolumeOf__SWIG_1(x0, x1, x2, x3);
    167   }
    168 
    169   public static void EvaluateMedium(btSoftBodyWorldInfo wfi, Vector3 x, btSoftBody.sMedium medium) {
    170     SoftbodyJNI.EvaluateMedium(btSoftBodyWorldInfo.getCPtr(wfi), wfi, x, btSoftBody.sMedium.getCPtr(medium), medium);
    171   }
    172 
    173   public static void ApplyClampedForce(btSoftBody.Node n, Vector3 f, float dt) {
    174     SoftbodyJNI.ApplyClampedForce(btSoftBody.Node.getCPtr(n), n, f, dt);
    175   }
    176 
    177   public static int MatchEdge(btSoftBody.Node a, btSoftBody.Node b, btSoftBody.Node ma, btSoftBody.Node mb) {
    178     return SoftbodyJNI.MatchEdge(btSoftBody.Node.getCPtr(a), a, btSoftBody.Node.getCPtr(b), b, btSoftBody.Node.getCPtr(ma), ma, btSoftBody.Node.getCPtr(mb), mb);
    179   }
    180 
    181   public static int PolarDecompose(Matrix3 m, Matrix3 q, Matrix3 s) {
    182     return SoftbodyJNI.PolarDecompose(m, q, s);
    183   }
    184 
    185 }
    186