1 #include "jmeBulletUtil.h"
2 #include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
3 #include "com_jme3_bullet_collision_PhysicsCollisionEvent.h"
4
5 /*
6 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
7 * Method: getAppliedImpulse
8 * Signature: (J)F
9 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulse(JNIEnv * env,jobject object,jlong manifoldPointObjectId)10 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulse
11 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
12 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
13 if (mp == NULL) {
14 jclass newExc = env->FindClass("java/lang/NullPointerException");
15 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
16 return 0;
17 }
18 return mp -> m_appliedImpulse;
19 }
20
21 /*
22 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
23 * Method: getAppliedImpulseLateral1
24 * Signature: (J)F
25 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral1(JNIEnv * env,jobject object,jlong manifoldPointObjectId)26 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral1
27 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
28 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
29 if (mp == NULL) {
30 jclass newExc = env->FindClass("java/lang/NullPointerException");
31 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
32 return 0;
33 }
34 return mp -> m_appliedImpulseLateral1;
35 }
36
37 /*
38 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
39 * Method: getAppliedImpulseLateral2
40 * Signature: (J)F
41 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral2(JNIEnv * env,jobject object,jlong manifoldPointObjectId)42 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral2
43 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
44 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
45 if (mp == NULL) {
46 jclass newExc = env->FindClass("java/lang/NullPointerException");
47 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
48 return 0;
49 }
50 return mp -> m_appliedImpulseLateral2;
51 }
52
53 /*
54 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
55 * Method: getCombinedFriction
56 * Signature: (J)F
57 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedFriction(JNIEnv * env,jobject object,jlong manifoldPointObjectId)58 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedFriction
59 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
60 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
61 if (mp == NULL) {
62 jclass newExc = env->FindClass("java/lang/NullPointerException");
63 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
64 return 0;
65 }
66 return mp -> m_combinedFriction;
67 }
68
69 /*
70 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
71 * Method: getCombinedRestitution
72 * Signature: (J)F
73 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedRestitution(JNIEnv * env,jobject object,jlong manifoldPointObjectId)74 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedRestitution
75 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
76 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
77 if (mp == NULL) {
78 jclass newExc = env->FindClass("java/lang/NullPointerException");
79 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
80 return 0;
81 }
82 return mp -> m_combinedRestitution;
83 }
84
85 /*
86 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
87 * Method: getDistance1
88 * Signature: (J)F
89 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getDistance1(JNIEnv * env,jobject object,jlong manifoldPointObjectId)90 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getDistance1
91 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
92 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
93 if (mp == NULL) {
94 jclass newExc = env->FindClass("java/lang/NullPointerException");
95 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
96 return 0;
97 }
98 return mp -> m_distance1;
99 }
100
101 /*
102 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
103 * Method: getIndex0
104 * Signature: (J)I
105 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex0(JNIEnv * env,jobject object,jlong manifoldPointObjectId)106 JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex0
107 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
108 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
109 if (mp == NULL) {
110 jclass newExc = env->FindClass("java/lang/NullPointerException");
111 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
112 return 0;
113 }
114 return mp -> m_index0;
115 }
116
117 /*
118 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
119 * Method: getIndex1
120 * Signature: (J)I
121 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex1(JNIEnv * env,jobject object,jlong manifoldPointObjectId)122 JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex1
123 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
124 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
125 if (mp == NULL) {
126 jclass newExc = env->FindClass("java/lang/NullPointerException");
127 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
128 return 0;
129 }
130 return mp -> m_index1;
131 }
132
133 /*
134 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
135 * Method: getLateralFrictionDir1
136 * Signature: (JLcom/jme3/math/Vector3f;)V
137 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir1(JNIEnv * env,jobject object,jlong manifoldPointObjectId,jobject lateralFrictionDir1)138 JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir1
139 (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject lateralFrictionDir1) {
140 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
141 if (mp == NULL) {
142 jclass newExc = env->FindClass("java/lang/NullPointerException");
143 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
144 return;
145 }
146 jmeBulletUtil::convert(env, &mp -> m_lateralFrictionDir1, lateralFrictionDir1);
147 }
148
149 /*
150 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
151 * Method: getLateralFrictionDir2
152 * Signature: (JLcom/jme3/math/Vector3f;)V
153 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir2(JNIEnv * env,jobject object,jlong manifoldPointObjectId,jobject lateralFrictionDir2)154 JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir2
155 (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject lateralFrictionDir2) {
156 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
157 if (mp == NULL) {
158 jclass newExc = env->FindClass("java/lang/NullPointerException");
159 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
160 return;
161 }
162 jmeBulletUtil::convert(env, &mp -> m_lateralFrictionDir2, lateralFrictionDir2);
163 }
164
165 /*
166 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
167 * Method: isLateralFrictionInitialized
168 * Signature: (J)Z
169 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_isLateralFrictionInitialized(JNIEnv * env,jobject object,jlong manifoldPointObjectId)170 JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_isLateralFrictionInitialized
171 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
172 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
173 if (mp == NULL) {
174 jclass newExc = env->FindClass("java/lang/NullPointerException");
175 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
176 return 0;
177 }
178 return mp -> m_lateralFrictionInitialized;
179 }
180
181 /*
182 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
183 * Method: getLifeTime
184 * Signature: (J)I
185 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLifeTime(JNIEnv * env,jobject object,jlong manifoldPointObjectId)186 JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLifeTime
187 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
188 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
189 if (mp == NULL) {
190 jclass newExc = env->FindClass("java/lang/NullPointerException");
191 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
192 return 0;
193 }
194 return mp -> m_lifeTime;
195 }
196
197 /*
198 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
199 * Method: getLocalPointA
200 * Signature: (JLcom/jme3/math/Vector3f;)V
201 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointA(JNIEnv * env,jobject object,jlong manifoldPointObjectId,jobject localPointA)202 JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointA
203 (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject localPointA) {
204 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
205 if (mp == NULL) {
206 jclass newExc = env->FindClass("java/lang/NullPointerException");
207 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
208 return;
209 }
210 jmeBulletUtil::convert(env, &mp -> m_localPointA, localPointA);
211 }
212
213 /*
214 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
215 * Method: getLocalPointB
216 * Signature: (JLcom/jme3/math/Vector3f;)V
217 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointB(JNIEnv * env,jobject object,jlong manifoldPointObjectId,jobject localPointB)218 JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointB
219 (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject localPointB) {
220 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
221 if (mp == NULL) {
222 jclass newExc = env->FindClass("java/lang/NullPointerException");
223 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
224 return;
225 }
226 jmeBulletUtil::convert(env, &mp -> m_localPointB, localPointB);
227 }
228
229 /*
230 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
231 * Method: getNormalWorldOnB
232 * Signature: (JLcom/jme3/math/Vector3f;)V
233 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getNormalWorldOnB(JNIEnv * env,jobject object,jlong manifoldPointObjectId,jobject normalWorldOnB)234 JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getNormalWorldOnB
235 (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject normalWorldOnB) {
236 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
237 if (mp == NULL) {
238 jclass newExc = env->FindClass("java/lang/NullPointerException");
239 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
240 return;
241 }
242 jmeBulletUtil::convert(env, &mp -> m_normalWorldOnB, normalWorldOnB);
243 }
244
245 /*
246 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
247 * Method: getPartId0
248 * Signature: (J)I
249 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId0(JNIEnv * env,jobject object,jlong manifoldPointObjectId)250 JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId0
251 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
252 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
253 if (mp == NULL) {
254 jclass newExc = env->FindClass("java/lang/NullPointerException");
255 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
256 return 0;
257 }
258 return mp -> m_partId0;
259 }
260
261 /*
262 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
263 * Method: getPartId1
264 * Signature: (J)I
265 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId1(JNIEnv * env,jobject object,jlong manifoldPointObjectId)266 JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId1
267 (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
268 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
269 if (mp == NULL) {
270 jclass newExc = env->FindClass("java/lang/NullPointerException");
271 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
272 return 0;
273 }
274 return mp -> m_partId1;
275 }
276
277 /*
278 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
279 * Method: getPositionWorldOnA
280 * Signature: (JLcom/jme3/math/Vector3f;)V
281 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnA(JNIEnv * env,jobject object,jlong manifoldPointObjectId,jobject positionWorldOnA)282 JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnA
283 (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject positionWorldOnA) {
284 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
285 if (mp == NULL) {
286 jclass newExc = env->FindClass("java/lang/NullPointerException");
287 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
288 return;
289 }
290 jmeBulletUtil::convert(env, &mp -> m_positionWorldOnA, positionWorldOnA);
291 }
292
293
294 /*
295 * Class: com_jme3_bullet_collision_PhysicsCollisionEvent
296 * Method: getPositionWorldOnB
297 * Signature: (JLcom/jme3/math/Vector3f;)V
298 */
Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnB(JNIEnv * env,jobject object,jlong manifoldPointObjectId,jobject positionWorldOnB)299 JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnB
300 (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject positionWorldOnB) {
301 btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
302 if (mp == NULL) {
303 jclass newExc = env->FindClass("java/lang/NullPointerException");
304 env->ThrowNew(newExc, "The manifoldPoint does not exist.");
305 return;
306 }
307 jmeBulletUtil::convert(env, &mp -> m_positionWorldOnB, positionWorldOnB);
308 }
309