1 /* ----------------------------------------------------------------------------
\r
2 * This file was automatically generated by SWIG (http://www.swig.org).
\r
5 * Do not make changes to this file unless you know what you are doing--modify
\r
6 * the SWIG interface file instead.
\r
7 * ----------------------------------------------------------------------------- */
\r
9 package com.badlogic.gdx.physics.bullet;
\r
11 import com.badlogic.gdx.utils.Array;
\r
12 import com.badlogic.gdx.math.Vector3;
\r
13 import com.badlogic.gdx.math.Quaternion;
\r
14 import com.badlogic.gdx.math.Matrix3;
\r
15 import com.badlogic.gdx.math.Matrix4;
\r
17 public class btCompoundShape extends btCollisionShape {
\r
18 private long swigCPtr;
\r
20 protected btCompoundShape(final String className, long cPtr, boolean cMemoryOwn) {
\r
21 super(className, gdxBulletJNI.btCompoundShape_SWIGUpcast(cPtr), cMemoryOwn);
\r
25 protected btCompoundShape(long cPtr, boolean cMemoryOwn) {
\r
26 this("btCompoundShape", cPtr, cMemoryOwn);
\r
30 public static long getCPtr(btCompoundShape obj) {
\r
31 return (obj == null) ? 0 : obj.swigCPtr;
\r
35 protected void finalize() throws Throwable {
\r
41 @Override protected synchronized void delete() {
\r
42 if (swigCPtr != 0) {
\r
44 swigCMemOwn = false;
\r
45 gdxBulletJNI.delete_btCompoundShape(swigCPtr);
\r
52 protected Array<btCollisionShape> children = new Array<btCollisionShape>();
\r
54 public void addChildShape(Matrix4 localTransform, btCollisionShape shape) {
\r
55 internalAddChildShape(localTransform, shape);
\r
56 children.add(shape);
\r
60 public void removeChildShape(btCollisionShape shape) {
\r
61 internalRemoveChildShape(shape);
\r
62 final int idx = children.indexOf(shape, false);
\r
64 children.removeIndex(idx).release();
\r
67 public void removeChildShapeByIndex(int index) {
\r
68 internalRemoveChildShapeByIndex(index);
\r
69 children.removeIndex(index).release();
\r
72 public btCollisionShape getChildShape(int index) {
\r
73 return children.get(index);
\r
77 public void dispose() {
\r
78 for (btCollisionShape child : children)
\r
84 public btCompoundShape(boolean enableDynamicAabbTree) {
\r
85 this(gdxBulletJNI.new_btCompoundShape__SWIG_0(enableDynamicAabbTree), true);
\r
88 public btCompoundShape() {
\r
89 this(gdxBulletJNI.new_btCompoundShape__SWIG_1(), true);
\r
92 private void internalAddChildShape(Matrix4 localTransform, btCollisionShape shape) {
\r
93 gdxBulletJNI.btCompoundShape_internalAddChildShape(swigCPtr, this, localTransform, btCollisionShape.getCPtr(shape), shape);
\r
96 private void internalRemoveChildShape(btCollisionShape shape) {
\r
97 gdxBulletJNI.btCompoundShape_internalRemoveChildShape(swigCPtr, this, btCollisionShape.getCPtr(shape), shape);
\r
100 private void internalRemoveChildShapeByIndex(int childShapeindex) {
\r
101 gdxBulletJNI.btCompoundShape_internalRemoveChildShapeByIndex(swigCPtr, this, childShapeindex);
\r
104 public int getNumChildShapes() {
\r
105 return gdxBulletJNI.btCompoundShape_getNumChildShapes(swigCPtr, this);
\r
108 public Matrix4 getChildTransform(int index) {
\r
109 return gdxBulletJNI.btCompoundShape_getChildTransform__SWIG_0(swigCPtr, this, index);
\r
112 public void updateChildTransform(int childIndex, Matrix4 newChildTransform, boolean shouldRecalculateLocalAabb) {
\r
113 gdxBulletJNI.btCompoundShape_updateChildTransform__SWIG_0(swigCPtr, this, childIndex, newChildTransform, shouldRecalculateLocalAabb);
\r
116 public void updateChildTransform(int childIndex, Matrix4 newChildTransform) {
\r
117 gdxBulletJNI.btCompoundShape_updateChildTransform__SWIG_1(swigCPtr, this, childIndex, newChildTransform);
\r
120 public btCompoundShapeChild getChildList() {
\r
121 long cPtr = gdxBulletJNI.btCompoundShape_getChildList(swigCPtr, this);
\r
122 return (cPtr == 0) ? null : new btCompoundShapeChild(cPtr, false);
\r
125 public void recalculateLocalAabb() {
\r
126 gdxBulletJNI.btCompoundShape_recalculateLocalAabb(swigCPtr, this);
\r
129 public btDbvt getDynamicAabbTree() {
\r
130 long cPtr = gdxBulletJNI.btCompoundShape_getDynamicAabbTree__SWIG_0(swigCPtr, this);
\r
131 return (cPtr == 0) ? null : new btDbvt(cPtr, false);
\r
134 public void createAabbTreeFromChildren() {
\r
135 gdxBulletJNI.btCompoundShape_createAabbTreeFromChildren(swigCPtr, this);
\r
138 public void calculatePrincipalAxisTransform(java.nio.FloatBuffer masses, Matrix4 principal, Vector3 inertia) {
\r
139 assert masses.isDirect() : "Buffer must be allocated direct.";
\r
141 gdxBulletJNI.btCompoundShape_calculatePrincipalAxisTransform(swigCPtr, this, masses, principal, inertia);
\r
145 public int getUpdateRevision() {
\r
146 return gdxBulletJNI.btCompoundShape_getUpdateRevision(swigCPtr, this);
\r