OSDN Git Service

Swig generated files
[mikumikustudio/libgdx-mikumikustudio.git] / extensions / gdx-bullet / jni / swig-src / com / badlogic / gdx / physics / bullet / btCompoundShape.java
1 /* ----------------------------------------------------------------------------\r
2  * This file was automatically generated by SWIG (http://www.swig.org).\r
3  * Version 2.0.10\r
4  *\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
8 \r
9 package com.badlogic.gdx.physics.bullet;\r
10 \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
16 \r
17 public class btCompoundShape extends btCollisionShape {\r
18         private long swigCPtr;\r
19         \r
20         protected btCompoundShape(final String className, long cPtr, boolean cMemoryOwn) {\r
21                 super(className, gdxBulletJNI.btCompoundShape_SWIGUpcast(cPtr), cMemoryOwn);\r
22                 swigCPtr = cPtr;\r
23         }\r
24         \r
25         protected btCompoundShape(long cPtr, boolean cMemoryOwn) {\r
26                 this("btCompoundShape", cPtr, cMemoryOwn);\r
27                 construct();\r
28         }\r
29         \r
30         public static long getCPtr(btCompoundShape obj) {\r
31                 return (obj == null) ? 0 : obj.swigCPtr;\r
32         }\r
33 \r
34         @Override\r
35         protected void finalize() throws Throwable {\r
36                 if (!destroyed)\r
37                         destroy();\r
38                 super.finalize();\r
39         }\r
40 \r
41   @Override protected synchronized void delete() {\r
42                 if (swigCPtr != 0) {\r
43                         if (swigCMemOwn) {\r
44                                 swigCMemOwn = false;\r
45                                 gdxBulletJNI.delete_btCompoundShape(swigCPtr);\r
46                         }\r
47                         swigCPtr = 0;\r
48                 }\r
49                 super.delete();\r
50         }\r
51 \r
52         protected Array<btCollisionShape> children = new Array<btCollisionShape>();\r
53         \r
54         public void addChildShape(Matrix4 localTransform, btCollisionShape shape) {\r
55                 internalAddChildShape(localTransform, shape);\r
56                 children.add(shape);\r
57                 shape.obtain();\r
58         }\r
59         \r
60         public void removeChildShape(btCollisionShape shape) {\r
61                 internalRemoveChildShape(shape);\r
62                 final int idx = children.indexOf(shape, false);\r
63                 if (idx >= 0)\r
64                         children.removeIndex(idx).release();\r
65         }\r
66         \r
67         public void removeChildShapeByIndex(int index) {\r
68                 internalRemoveChildShapeByIndex(index);\r
69                 children.removeIndex(index).release();\r
70         }\r
71         \r
72         public btCollisionShape getChildShape(int index) {\r
73                 return children.get(index);\r
74         }\r
75         \r
76         @Override\r
77         public void dispose() {\r
78                 for (btCollisionShape child : children)\r
79                         child.release();\r
80                 children.clear();\r
81                 super.dispose();\r
82         }\r
83 \r
84   public btCompoundShape(boolean enableDynamicAabbTree) {\r
85     this(gdxBulletJNI.new_btCompoundShape__SWIG_0(enableDynamicAabbTree), true);\r
86   }\r
87 \r
88   public btCompoundShape() {\r
89     this(gdxBulletJNI.new_btCompoundShape__SWIG_1(), true);\r
90   }\r
91 \r
92   private void internalAddChildShape(Matrix4 localTransform, btCollisionShape shape) {\r
93     gdxBulletJNI.btCompoundShape_internalAddChildShape(swigCPtr, this, localTransform, btCollisionShape.getCPtr(shape), shape);\r
94   }\r
95 \r
96   private void internalRemoveChildShape(btCollisionShape shape) {\r
97     gdxBulletJNI.btCompoundShape_internalRemoveChildShape(swigCPtr, this, btCollisionShape.getCPtr(shape), shape);\r
98   }\r
99 \r
100   private void internalRemoveChildShapeByIndex(int childShapeindex) {\r
101     gdxBulletJNI.btCompoundShape_internalRemoveChildShapeByIndex(swigCPtr, this, childShapeindex);\r
102   }\r
103 \r
104   public int getNumChildShapes() {\r
105     return gdxBulletJNI.btCompoundShape_getNumChildShapes(swigCPtr, this);\r
106   }\r
107 \r
108   public Matrix4 getChildTransform(int index) {\r
109         return gdxBulletJNI.btCompoundShape_getChildTransform__SWIG_0(swigCPtr, this, index);\r
110 }\r
111 \r
112   public void updateChildTransform(int childIndex, Matrix4 newChildTransform, boolean shouldRecalculateLocalAabb) {\r
113     gdxBulletJNI.btCompoundShape_updateChildTransform__SWIG_0(swigCPtr, this, childIndex, newChildTransform, shouldRecalculateLocalAabb);\r
114   }\r
115 \r
116   public void updateChildTransform(int childIndex, Matrix4 newChildTransform) {\r
117     gdxBulletJNI.btCompoundShape_updateChildTransform__SWIG_1(swigCPtr, this, childIndex, newChildTransform);\r
118   }\r
119 \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
123   }\r
124 \r
125   public void recalculateLocalAabb() {\r
126     gdxBulletJNI.btCompoundShape_recalculateLocalAabb(swigCPtr, this);\r
127   }\r
128 \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
132   }\r
133 \r
134   public void createAabbTreeFromChildren() {\r
135     gdxBulletJNI.btCompoundShape_createAabbTreeFromChildren(swigCPtr, this);\r
136   }\r
137 \r
138   public void calculatePrincipalAxisTransform(java.nio.FloatBuffer masses, Matrix4 principal, Vector3 inertia) {\r
139     assert masses.isDirect() : "Buffer must be allocated direct.";\r
140     {\r
141       gdxBulletJNI.btCompoundShape_calculatePrincipalAxisTransform(swigCPtr, this, masses, principal, inertia);\r
142     }\r
143   }\r
144 \r
145   public int getUpdateRevision() {\r
146     return gdxBulletJNI.btCompoundShape_getUpdateRevision(swigCPtr, this);\r
147   }\r
148 \r
149 }\r