2 * Copyright (c) 2009-2010 jMonkeyEngine
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 * Author: Normen Hansen
36 #include "com_jme3_bullet_joints_motors_RotationalLimitMotor.h"
37 #include "jmeBulletUtil.h"
44 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
48 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLoLimit
49 (JNIEnv *env, jobject object, jlong motorId) {
50 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
52 jclass newExc = env->FindClass("java/lang/NullPointerException");
53 env->ThrowNew(newExc, "The native object does not exist.");
56 return motor->m_loLimit;
60 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
64 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLoLimit
65 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
66 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
68 jclass newExc = env->FindClass("java/lang/NullPointerException");
69 env->ThrowNew(newExc, "The native object does not exist.");
72 motor->m_loLimit = value;
76 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
80 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getHiLimit
81 (JNIEnv *env, jobject object, jlong motorId) {
82 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
84 jclass newExc = env->FindClass("java/lang/NullPointerException");
85 env->ThrowNew(newExc, "The native object does not exist.");
88 return motor->m_hiLimit;
92 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
96 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setHiLimit
97 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
98 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
100 jclass newExc = env->FindClass("java/lang/NullPointerException");
101 env->ThrowNew(newExc, "The native object does not exist.");
104 motor->m_hiLimit = value;
108 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
109 * Method: getTargetVelocity
112 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getTargetVelocity
113 (JNIEnv *env, jobject object, jlong motorId) {
114 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
116 jclass newExc = env->FindClass("java/lang/NullPointerException");
117 env->ThrowNew(newExc, "The native object does not exist.");
120 return motor->m_targetVelocity;
124 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
125 * Method: setTargetVelocity
128 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setTargetVelocity
129 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
130 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
132 jclass newExc = env->FindClass("java/lang/NullPointerException");
133 env->ThrowNew(newExc, "The native object does not exist.");
136 motor->m_targetVelocity = value;
140 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
141 * Method: getMaxMotorForce
144 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxMotorForce
145 (JNIEnv *env, jobject object, jlong motorId) {
146 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
148 jclass newExc = env->FindClass("java/lang/NullPointerException");
149 env->ThrowNew(newExc, "The native object does not exist.");
152 return motor->m_maxMotorForce;
156 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
157 * Method: setMaxMotorForce
160 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxMotorForce
161 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
162 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
164 jclass newExc = env->FindClass("java/lang/NullPointerException");
165 env->ThrowNew(newExc, "The native object does not exist.");
168 motor->m_maxMotorForce = value;
172 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
173 * Method: getMaxLimitForce
176 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxLimitForce
177 (JNIEnv *env, jobject object, jlong motorId) {
178 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
180 jclass newExc = env->FindClass("java/lang/NullPointerException");
181 env->ThrowNew(newExc, "The native object does not exist.");
184 return motor->m_maxLimitForce;
188 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
189 * Method: setMaxLimitForce
192 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxLimitForce
193 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
194 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
196 jclass newExc = env->FindClass("java/lang/NullPointerException");
197 env->ThrowNew(newExc, "The native object does not exist.");
200 motor->m_maxLimitForce = value;
204 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
208 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getDamping
209 (JNIEnv *env, jobject object, jlong motorId) {
210 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
212 jclass newExc = env->FindClass("java/lang/NullPointerException");
213 env->ThrowNew(newExc, "The native object does not exist.");
216 return motor->m_damping;
220 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
224 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setDamping
225 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
226 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
228 jclass newExc = env->FindClass("java/lang/NullPointerException");
229 env->ThrowNew(newExc, "The native object does not exist.");
232 motor->m_damping = value;
236 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
237 * Method: getLimitSoftness
240 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLimitSoftness
241 (JNIEnv *env, jobject object, jlong motorId) {
242 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
244 jclass newExc = env->FindClass("java/lang/NullPointerException");
245 env->ThrowNew(newExc, "The native object does not exist.");
248 return motor->m_limitSoftness;
252 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
253 * Method: setLimitSoftness
256 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLimitSoftness
257 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
258 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
260 jclass newExc = env->FindClass("java/lang/NullPointerException");
261 env->ThrowNew(newExc, "The native object does not exist.");
264 motor->m_limitSoftness = value;
268 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
272 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getERP
273 (JNIEnv *env, jobject object, jlong motorId) {
274 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
276 jclass newExc = env->FindClass("java/lang/NullPointerException");
277 env->ThrowNew(newExc, "The native object does not exist.");
280 return motor->m_stopERP;
284 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
288 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setERP
289 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
290 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
292 jclass newExc = env->FindClass("java/lang/NullPointerException");
293 env->ThrowNew(newExc, "The native object does not exist.");
296 motor->m_stopERP = value;
300 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
304 JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getBounce
305 (JNIEnv *env, jobject object, jlong motorId) {
306 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
308 jclass newExc = env->FindClass("java/lang/NullPointerException");
309 env->ThrowNew(newExc, "The native object does not exist.");
312 return motor->m_bounce;
316 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
320 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setBounce
321 (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
322 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
324 jclass newExc = env->FindClass("java/lang/NullPointerException");
325 env->ThrowNew(newExc, "The native object does not exist.");
328 motor->m_bounce = value;
332 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
333 * Method: isEnableMotor
336 JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_isEnableMotor
337 (JNIEnv *env, jobject object, jlong motorId) {
338 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
340 jclass newExc = env->FindClass("java/lang/NullPointerException");
341 env->ThrowNew(newExc, "The native object does not exist.");
344 return motor->m_enableMotor;
348 * Class: com_jme3_bullet_joints_motors_RotationalLimitMotor
349 * Method: setEnableMotor
352 JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setEnableMotor
353 (JNIEnv *env, jobject object, jlong motorId, jboolean value) {
354 btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
356 jclass newExc = env->FindClass("java/lang/NullPointerException");
357 env->ThrowNew(newExc, "The native object does not exist.");
360 motor->m_enableMotor = value;