Преглед на файлове

- big refactoring of engine build and cleaning of sources, totally breaking SDK build for now
- separate jar files for engine components
- resolve dependencies between code parts
- remove Nifty dependency from Cinematics
- remove Physics dependency from TerrainGrid
- add public accessors to Natives Extraction
- remove RenderHint serialization from networking

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8839 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

nor..67 преди 14 години
родител
ревизия
c906508e62
променени са 100 файла, в които са добавени 15315 реда и са изтрити 1624 реда
  1. 248 105
      engine/build.xml
  2. 169 0
      engine/bullet-native-build.txt
  3. 59 59
      engine/lib/nblibraries.properties
  4. 310 0
      engine/nbproject/build-bullet-natives.xml
  5. 1230 1239
      engine/nbproject/build-impl.xml
  6. 35 0
      engine/nbproject/bullet-native.properties
  7. 11 11
      engine/nbproject/genfiles.properties
  8. 123 114
      engine/nbproject/project.properties
  9. 9 10
      engine/nbproject/project.xml
  10. 4 8
      engine/src/android/com/jme3/app/AndroidHarness.java
  11. 2 3
      engine/src/android/com/jme3/asset/plugins/AndroidLocator.java
  12. 53 60
      engine/src/android/com/jme3/system/android/JmeAndroidSystem.java
  13. 0 0
      engine/src/bullet-common/com/jme3/bullet/BulletAppState.java
  14. 0 0
      engine/src/bullet-common/com/jme3/bullet/PhysicsTickListener.java
  15. 0 0
      engine/src/bullet-common/com/jme3/bullet/collision/PhysicsCollisionGroupListener.java
  16. 0 0
      engine/src/bullet-common/com/jme3/bullet/collision/PhysicsCollisionListener.java
  17. 0 0
      engine/src/bullet-common/com/jme3/bullet/collision/RagdollCollisionListener.java
  18. 50 0
      engine/src/bullet-common/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java
  19. 208 0
      engine/src/bullet-common/com/jme3/bullet/control/CharacterControl.java
  20. 178 0
      engine/src/bullet-common/com/jme3/bullet/control/GhostControl.java
  21. 873 0
      engine/src/bullet-common/com/jme3/bullet/control/KinematicRagdollControl.java
  22. 28 0
      engine/src/bullet-common/com/jme3/bullet/control/PhysicsControl.java
  23. 266 0
      engine/src/bullet-common/com/jme3/bullet/control/RigidBodyControl.java
  24. 270 0
      engine/src/bullet-common/com/jme3/bullet/control/VehicleControl.java
  25. 99 0
      engine/src/bullet-common/com/jme3/bullet/control/ragdoll/HumanoidRagdollPreset.java
  26. 106 0
      engine/src/bullet-common/com/jme3/bullet/control/ragdoll/RagdollPreset.java
  27. 273 0
      engine/src/bullet-common/com/jme3/bullet/control/ragdoll/RagdollUtils.java
  28. 0 0
      engine/src/bullet-common/com/jme3/bullet/util/CollisionShapeFactory.java
  29. 259 0
      engine/src/bullet-native/android/Android.mk
  30. 2 0
      engine/src/bullet-native/android/Application.mk
  31. 273 0
      engine/src/bullet-native/android/jmePhysicsSpace.cpp
  32. 450 0
      engine/src/bullet-native/com_jme3_bullet_PhysicsSpace.cpp
  33. 165 0
      engine/src/bullet-native/com_jme3_bullet_PhysicsSpace.h
  34. 308 0
      engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionEvent.cpp
  35. 173 0
      engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionEvent.h
  36. 148 0
      engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionObject.cpp
  37. 87 0
      engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionObject.h
  38. 59 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_BoxCollisionShape.cpp
  39. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_BoxCollisionShape.h
  40. 68 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.cpp
  41. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.h
  42. 110 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CollisionShape.cpp
  43. 45 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CollisionShape.h
  44. 107 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CompoundCollisionShape.cpp
  45. 37 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CompoundCollisionShape.h
  46. 68 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_ConeCollisionShape.cpp
  47. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_ConeCollisionShape.h
  48. 70 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CylinderCollisionShape.cpp
  49. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_CylinderCollisionShape.h
  50. 70 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_GImpactCollisionShape.cpp
  51. 29 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_GImpactCollisionShape.h
  52. 59 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.cpp
  53. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.h
  54. 69 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_HullCollisionShape.cpp
  55. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_HullCollisionShape.h
  56. 70 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_MeshCollisionShape.cpp
  57. 29 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_MeshCollisionShape.h
  58. 60 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_PlaneCollisionShape.cpp
  59. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_PlaneCollisionShape.h
  60. 110 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_SimplexCollisionShape.cpp
  61. 45 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_SimplexCollisionShape.h
  62. 18 15
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_SphereCollisionShape.cpp
  63. 21 0
      engine/src/bullet-native/com_jme3_bullet_collision_shapes_SphereCollisionShape.h
  64. 100 0
      engine/src/bullet-native/com_jme3_bullet_joints_ConeJoint.cpp
  65. 37 0
      engine/src/bullet-native/com_jme3_bullet_joints_ConeJoint.h
  66. 226 0
      engine/src/bullet-native/com_jme3_bullet_joints_HingeJoint.cpp
  67. 101 0
      engine/src/bullet-native/com_jme3_bullet_joints_HingeJoint.h
  68. 61 0
      engine/src/bullet-native/com_jme3_bullet_joints_PhysicsJoint.cpp
  69. 29 0
      engine/src/bullet-native/com_jme3_bullet_joints_PhysicsJoint.h
  70. 162 0
      engine/src/bullet-native/com_jme3_bullet_joints_Point2PointJoint.cpp
  71. 69 0
      engine/src/bullet-native/com_jme3_bullet_joints_Point2PointJoint.h
  72. 170 0
      engine/src/bullet-native/com_jme3_bullet_joints_SixDofJoint.cpp
  73. 69 0
      engine/src/bullet-native/com_jme3_bullet_joints_SixDofJoint.h
  74. 94 0
      engine/src/bullet-native/com_jme3_bullet_joints_SixDofSpringJoint.cpp
  75. 61 0
      engine/src/bullet-native/com_jme3_bullet_joints_SixDofSpringJoint.h
  76. 963 0
      engine/src/bullet-native/com_jme3_bullet_joints_SliderJoint.cpp
  77. 469 0
      engine/src/bullet-native/com_jme3_bullet_joints_SliderJoint.h
  78. 365 0
      engine/src/bullet-native/com_jme3_bullet_joints_motors_RotationalLimitMotor.cpp
  79. 173 0
      engine/src/bullet-native/com_jme3_bullet_joints_motors_RotationalLimitMotor.h
  80. 237 0
      engine/src/bullet-native/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp
  81. 109 0
      engine/src/bullet-native/com_jme3_bullet_joints_motors_TranslationalLimitMotor.h
  82. 388 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsCharacter.cpp
  83. 215 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsCharacter.h
  84. 313 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsGhostObject.cpp
  85. 167 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsGhostObject.h
  86. 849 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsRigidBody.cpp
  87. 415 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsRigidBody.h
  88. 272 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsVehicle.cpp
  89. 143 0
      engine/src/bullet-native/com_jme3_bullet_objects_PhysicsVehicle.h
  90. 147 0
      engine/src/bullet-native/com_jme3_bullet_objects_VehicleWheel.cpp
  91. 61 0
      engine/src/bullet-native/com_jme3_bullet_objects_VehicleWheel.h
  92. 138 0
      engine/src/bullet-native/com_jme3_bullet_objects_infos_RigidBodyMotionState.cpp
  93. 61 0
      engine/src/bullet-native/com_jme3_bullet_objects_infos_RigidBodyMotionState.h
  94. 152 0
      engine/src/bullet-native/com_jme3_bullet_util_DebugShapeFactory.cpp
  95. 21 0
      engine/src/bullet-native/com_jme3_bullet_util_DebugShapeFactory.h
  96. 59 0
      engine/src/bullet-native/com_jme3_bullet_util_NativeMeshUtil.cpp
  97. 21 0
      engine/src/bullet-native/com_jme3_bullet_util_NativeMeshUtil.h
  98. 327 0
      engine/src/bullet-native/jmeBulletUtil.cpp
  99. 61 0
      engine/src/bullet-native/jmeBulletUtil.h
  100. 250 0
      engine/src/bullet-native/jmeClasses.cpp

+ 248 - 105
engine/build.xml

@@ -1,117 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<project name="jMonkeyEngine3" default="default" basedir=".">
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" name="jMonkeyEngine3" default="default" basedir=".">
     <description>Builds, tests, and runs the project jME3_ordered.</description>
     <import file="nbproject/build-impl.xml"/>
-    <!-- <import file="nbproject/profiler-build-impl.xml"/> -->
-
-    <target name="-post-compile" depends="-compile-bullet, -compile-android">
-    </target>
-    
-    <target name="-pre-jar" depends="-prepare-separate-jar-files">
-    </target>
-    
-    <target name="-post-jar" depends="-create-optional-packages">
-        <!--move back classes-->
-        <move file="build/testclasses/jme3test" todir="build/classes/" failonerror="false"/>
-        <move file="build/testclasses/jme3game" todir="build/classes/" failonerror="false"/>
-        <move file="build/jbullet/com/jme3/bullet" todir="build/classes/com/jme3/" failonerror="false"/>
-    </target>
-
-    <!-- compiles the java classes of the native bullet version (works on all systems) -->
-    <target name="-compile-bullet">
-        <echo message="Compiling Bullet"/>
-        <mkdir dir="build/bullet"/>
-        <javac classpath="${javac.classpath}${path.separator}${build.classes.dir}" destdir="build/bullet" srcdir="src/bullet"/>
-        <jar jarfile="build/jME3-bullet.jar" basedir="build/bullet/" compress="true"/>
-    </target>
-    
-    <!-- compiles the android jar for jME3 -->
-    <target name="-compile-android" description="builds the jMonkeyEngine3 distribution for android">
-        <echo message="Compiling Android jMonkeyEngine3.jar"/>
-        <path id="android-classpath">
-            <pathelement path="lib/android/android.jar"/>
-            <pathelement path="build/classes"/>
-        </path>
-        <mkdir dir="build/android"/>
-        <javac  target="1.6"
-                encoding="UTF-8"
-                debug="true"
-                deprecation="on"
-                srcdir="src/android"
-                destdir="build/android"
-                classpathref="android-classpath"
-                excludes="**/OGLESRenderer.java,**/TestsActivity.java,**/AboutActivity.java,nbproject/**"/>
-    </target>
-    
-    <!--this target creates the separate jar files for jme3 and modifies the classpath to include them-->
-    <target name="-prepare-separate-jar-files">
-        <echo message="Preparing jME3 jar files"/>
-        <!--separate test classes-->
-        <mkdir dir="build/testclasses/"/>
-        <move file="build/classes/jme3test" todir="build/testclasses/" failonerror="false"/>
-        <move file="build/classes/jme3game" todir="build/testclasses/" failonerror="false"/>
-        <jar jarfile="build/jME3-test.jar" basedir="build/testclasses/" compress="true"/>
-
-        <!--separate jbullet physics classes-->
-        <mkdir dir="build/jbullet/com/jme3/"/>
-        <move file="build/classes/com/jme3/bullet" todir="build/jbullet/com/jme3/" failonerror="false"/>
-        <jar jarfile="build/jME3-jbullet.jar" basedir="build/jbullet/" compress="true"/>
-
-        <!--separate assets-->
-        <jar jarfile="build/jME3-testdata.jar" basedir="src/test-data" compress="true"/>
-        <property location="src/test-data" name="testdata.dir.resolved"/>
-        <property location="build/jME3-testdata.jar" name="testdata.jar.resolved"/>
-
-        <!--this sets properties that would normally later be created in the build-impl.xml-->
-        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
-        <pathconvert property="run.classpath.without.build.classes.dir">
-            <path path="${run.classpath}"/>
-            <map from="${build.classes.dir.resolved}" to=""/>
-            
-            <!--replace assets folder in dist classpath-->
-            <map from="${testdata.dir.resolved}" to="${testdata.jar.resolved}"/>
-            
-            <!--add both bullet jar files to dist classpath, will both be in manifest-->
-            <path path="build/jME3-jbullet.jar"/>
-            <path path="build/jME3-bullet.jar"/>
-            <path path="build/jME3-test.jar"/>
-        </pathconvert>
-    </target>
-    
-    <!--separates and packs the optional packages-->
-    <target name="-create-optional-packages">
-        <echo message="Creating optional packages"/>
-        <!--native bullet-->
-        <mkdir dir="dist/opt/native-bullet"/>
-        <mkdir dir="dist/opt/native-bullet/lib"/>
-        <!--ant antfile="src/bullet/native/build.xml" target="bullet-api-diff"/-->
-        <!--move file="bullet-api-diff.html" todir="dist/opt/native-bullet" overwrite="true"/-->
-        <move file="dist/lib/jME3-bullet.jar" todir="dist/opt/native-bullet/lib" overwrite="true"/>
-        <move file="dist/lib/jME3-bullet-natives.jar" todir="dist/opt/native-bullet/lib" overwrite="true"/>
-        <copy file="lib/bullet/jME3-bullet-natives-android.jar" todir="dist/opt/native-bullet/lib" overwrite="true"/>
-
-        <!--android-->
-        <mkdir dir="dist/opt/android"/>
-        <jar jarfile="dist/opt/android/jMonkeyEngine3.jar"
-                basedir="build/android"
-                />
-        <jar jarfile="dist/opt/android/jMonkeyEngine3.jar"
-                basedir="build/classes"
-		excludes="com/jme3/system/JmeSystem*"
-                update="true"/>
-        <!--<jar jarfile="dist/opt/jME3-android-tests.jar"
-		basedir="build/testclasses"/>-->
-    </target>
 
     <!-- compiles the *native binary* of the native bullet version (read bullet-native-build.txt for more info) -->
     <target name="build-bullet-natives" description="uses native build tools to build the bulletjme binary (read bullet-native-build.txt for more info)" depends="jar">
-        <ant antfile="src/bullet/native/build.xml" target="build-bullet-natives"/>
+        <ant antfile="nbproject/build-bullet-natives.xml" target="build-bullet-natives"/>
     </target>
     
     <target name="run-bullet-native" description="runs the jMonkeyEngine3 demos using native bullet">
-        <copy file="dist/opt/native-bullet/lib/jME3-bullet-natives.jar" todir="dist/lib" failonerror="false"/>
-        <copy file="dist/opt/native-bullet/lib/jME3-bullet.jar" todir="dist/lib" failonerror="false"/>
+        <copy file="dist/opt/native-bullet/jME3-bullet-natives.jar" todir="dist/lib" failonerror="false"/>
+        <copy file="dist/opt/native-bullet/jME3-bullet.jar" todir="dist/lib" failonerror="false"/>
         <delete file="dist/lib/jME3-jbullet.jar" failonerror="false"/>
         <exec executable="java" dir="dist">
             <arg line="-jar jMonkeyEngine3.jar"/>
@@ -119,7 +19,7 @@
     </target>
     
     <!-- overrides javadoc generation to only include relevant classes -->
-    <target depends="init" if="have.sources" name="-javadoc-build">
+    <!--target depends="init" if="have.sources" name="-javadoc-build">
         <mkdir dir="${dist.javadoc.dir}"/>
         <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
             <classpath>
@@ -182,8 +82,251 @@
                 <include name="**/doc-files/**"/>
             </fileset>
         </copy>
+    </target-->
+
+    <!--Override compile section to compile in different folders-->
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <mkdir dir="${build.dir}/core"/>
+        <mkdir dir="${build.dir}/plugins"/>
+        <mkdir dir="${build.dir}/blender"/>
+        <mkdir dir="${build.dir}/desktop"/>
+        <mkdir dir="${build.dir}/terrain"/>
+        <mkdir dir="${build.dir}/jbullet"/>
+        <mkdir dir="${build.dir}/bullet"/>
+        <mkdir dir="${build.dir}/niftygui"/>
+        <mkdir dir="${build.dir}/lwjgl"/>
+        <mkdir dir="${build.dir}/android"/>
+        <mkdir dir="${build.dir}/test"/>
+        
+        <!--compile core-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/core"
+            srcdir="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.tools.dir}:${src.networking.dir}"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/core">
+            <fileset dir="${src.core.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.core-data.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.core-plugins.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.tools.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/core"/>
+        </copy-->
+        
+        <!--compile non-core plugins (jogg, ogre, xml)-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/plugins"
+            srcdir="${src.jogg.dir}:${src.ogre.dir}:${src.xml.dir}"
+            classpath="${javac.classpath}:${build.dir}/core"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/plugins">
+            <fileset dir="${src.jogg.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.ogre.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.xml.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/plugins"/>
+        </copy-->
+        
+        <!--compile desktop-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/desktop"
+            srcdir="${src.desktop.dir}:${src.desktop-fx.dir}"
+            classpath="${javac.classpath}:${build.dir}/core"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/desktop">
+            <fileset dir="${src.desktop.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.desktop-fx.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/desktop"/>
+        </copy-->
+        
+        <!--compile blender loader-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/blender"
+            srcdir="${src.blender.dir}"
+            classpath="${javac.classpath}:${build.dir}/core:${build.dir}/plugins:${build.dir}/desktop"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/blender">
+            <fileset dir="${src.blender.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/blender"/>
+        </copy-->
+        
+        <!--compile terrain-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/terrain"
+            srcdir="${src.terrain.dir}"
+            classpath="${javac.classpath}:${build.dir}/core:${build.dir}/desktop"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/terrain">
+            <fileset dir="${src.terrain.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/terrain"/>
+        </copy-->
+        
+        <!--compile jbullet-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/jbullet"
+            srcdir="${src.jbullet.dir}:${src.bullet-common.dir}"
+            classpath="${javac.classpath}:${build.dir}/core:${build.dir}/terrain"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/jbullet">
+            <fileset dir="${src.jbullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.bullet-common.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/jbullet"/>
+        </copy-->
+        
+        <!--compile bullet-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/bullet"
+            srcdir="${src.bullet.dir}:${src.bullet-common.dir}"
+            classpath="${javac.classpath}:${build.dir}/core:${build.dir}/terrain"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/bullet">
+            <fileset dir="${src.bullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.bullet-common.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/bullet"/>
+        </copy-->
+        
+        <!--compile nifty-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/niftygui"
+            srcdir="${src.niftygui.dir}"
+            classpath="${javac.classpath}:${build.dir}/core"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/niftygui">
+            <fileset dir="${src.niftygui.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/niftygui"/>
+        </copy-->
+        
+        <!--compile lwjgl-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/lwjgl"
+            srcdir="${src.lwjgl.dir}"
+            classpath="${javac.classpath}:${build.dir}/core:${build.dir}/desktop"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/lwjgl">
+            <fileset dir="${src.lwjgl.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/lwjgl"/>
+        </copy-->
+
+        <!--compile android-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/android"
+            srcdir="${src.android.dir}"
+            classpath="${javac.classpath}:${build.dir}/core:${build.dir}/plugins"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/android">
+            <fileset dir="${src.android.dir}" excludes="${build.classes.excludes},${excludes},**/OGLESRenderer.java,**/TestsActivity.java,**/AboutActivity.java,nbproject/**" includes="${includes}"/>
+        </copy>
+        <!--copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/android"/>
+        </copy-->
+        
+        <!--compile tests-->
+        <j2seproject3:javac 
+            destdir="${build.dir}/test"
+            srcdir="${src.test.dir}"
+            classpath="${javac.classpath}:${build.dir}/core:${build.dir}/plugins:${build.dir}/desktop:${build.dir}/blender:${build.dir}/terrain:${build.dir}/jbullet:${build.dir}/niftygui"
+            gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.dir}/test">
+            <fileset dir="${src.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${build.dir}/test"/>
+        </copy>
     </target>
+    
+    <target name="-pre-jar">
+        <jar jarfile="build/jME3-core.jar" basedir="${build.dir}/core" compress="true"/>
+        <jar jarfile="build/jME3-plugins.jar" basedir="${build.dir}/plugins" compress="true"/>
+        <jar jarfile="build/jME3-desktop.jar" basedir="${build.dir}/desktop" compress="true"/>
+        <jar jarfile="build/jME3-blender.jar" basedir="${build.dir}/blender" compress="true"/>
+        <jar jarfile="build/jME3-terrain.jar" basedir="${build.dir}/terrain" compress="true"/>
+        <jar jarfile="build/jME3-jbullet.jar" basedir="${build.dir}/jbullet" compress="true"/>
+        <jar jarfile="build/jME3-bullet.jar" basedir="${build.dir}/bullet" compress="true"/>
+        <jar jarfile="build/jME3-niftygui.jar" basedir="${build.dir}/niftygui" compress="true"/>
+        <jar jarfile="build/jME3-lwjgl.jar" basedir="${build.dir}/lwjgl" compress="true"/>
+        <jar jarfile="build/jME3-android.jar" basedir="${build.dir}/android" compress="true"/>
+        
+        <jar jarfile="build/jME3-testdata.jar" basedir="test-data" compress="true"/>
+        
+        <!--this sets properties that would normally later be created in the build-impl.xml-->
+        <!--the names here correspont to the run.classpath entries in the project.properties file-->
+        <property location="test-data" name="testdata.dir.resolved"/>
+        <property location="build/jME3-testdata.jar" name="testdata.jar.resolved"/>
+        <property location="lib/android/android.jar" name="android.jar.resolved"/>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        
+        <property location="${build.dir}/core" name="build.core.dir.resolved"/>
+        <property location="${build.dir}/plugins" name="build.plugins.dir.resolved"/>
+        <property location="${build.dir}/desktop" name="build.desktop.dir.resolved"/>
+        <property location="${build.dir}/blender" name="build.blender.dir.resolved"/>
+        <property location="${build.dir}/terrain" name="build.terrain.dir.resolved"/>
+        <property location="${build.dir}/jbullet" name="build.jbullet.dir.resolved"/>
+        <property location="${build.dir}/bullet" name="build.bullet.dir.resolved"/>
+        <property location="${build.dir}/niftygui" name="build.niftygui.dir.resolved"/>
+        <property location="${build.dir}/lwjgl" name="build.lwjgl.dir.resolved"/>
+        <property location="${build.dir}/android" name="build.android.dir.resolved"/>
+        
+        <pathconvert property="run.classpath.without.build.classes.dir">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to=""/>
+            
+            <map from="${build.core.dir.resolved}" to=""/>
+            <map from="${build.plugins.dir.resolved}" to=""/>
+            <map from="${build.desktop.dir.resolved}" to=""/>
+            <map from="${build.blender.dir.resolved}" to=""/>
+            <map from="${build.terrain.dir.resolved}" to=""/>
+            <map from="${build.jbullet.dir.resolved}" to=""/>
+            <map from="${build.bullet.dir.resolved}" to=""/>
+            <map from="${build.niftygui.dir.resolved}" to=""/>
+            <map from="${build.lwjgl.dir.resolved}" to=""/>
+            <map from="${build.android.dir.resolved}" to=""/>
+            
+            <path path="build/jME3-core.jar"/>
+            <path path="build/jME3-plugins.jar"/>
+            <path path="build/jME3-desktop.jar"/>
+            <path path="build/jME3-blender.jar"/>
+            <path path="build/jME3-terrain.jar"/>
+            <path path="build/jME3-jbullet.jar"/>
+            <path path="build/jME3-bullet.jar"/>
+            <path path="build/jME3-niftygui.jar"/>
+            <path path="build/jME3-lwjgl.jar"/>
+            <!--path path="build/jME3-android.jar"/-->
 
+            <map from="${testdata.dir.resolved}" to="${testdata.jar.resolved}"/>
+            <map from="${android.jar.resolved}" to=""/>
+        </pathconvert>        
+    </target>
+    
+    <target name="-post-jar">
+        <echo message="Creating optional packages"/>
+        <mkdir dir="dist/opt"/>
+        <!--native bullet-->
+        <mkdir dir="dist/opt/native-bullet"/>
+        <!--ant antfile="src/bullet/native/build.xml" target="bullet-api-diff"/-->
+        <!--move file="bullet-api-diff.html" todir="dist/opt/native-bullet" overwrite="true"/-->
+        <move file="dist/lib/jME3-bullet.jar" todir="dist/opt/native-bullet" overwrite="true"/>
+        <move file="dist/lib/jME3-bullet-natives.jar" todir="dist/opt/native-bullet" overwrite="true"/>
+        <copy file="lib/bullet/jME3-bullet-natives-android.jar" todir="dist/opt/native-bullet" overwrite="true"/>
+
+        <!--android-->
+        <mkdir dir="dist/opt/android"/>
+        <move file="build/jME3-android.jar" todir="dist/opt/android" overwrite="true"/>
+    </target>
     <!--
        ****************************************************************
        Only Relevant for building the SDK from here on

+ 169 - 0
engine/bullet-native-build.txt

@@ -0,0 +1,169 @@
+***********************************
+* Build info for bulletjme       *
+* (c) 2011 Normen Hansen          *
+***********************************
+
+This document outlines the process of building bullet-jme on different platforms.
+Since bullet-jme is a native java library and bullet gets included statically,
+building requires you to download and build the bullet source first.
+
+
+
+***********************************
+* Building bullet                 *
+***********************************
+
+-----------------------------------
+General info
+-----------------------------------
+Note that the compilation of bullet should not produce dll / so / dylib files
+but static *.a libraries which can later be compiled into the binary of bullet-jme.
+
+-----------------------------------
+Downloading and extracting bullet
+-----------------------------------
+Requirements:
+- Bullet source: http://bullet.googlecode.com/
+
+Extract bullet source and build bullet (see below)
+
+-----------------------------------
+Building on Mac OSX
+-----------------------------------
+Requirements:
+- Apple Developer tools: http://developer.apple.com/
+- CMake: http://www.cmake.org/ (or via http://www.macports.org)
+
+Commands:
+> cd bullet-trunk
+> cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON \
+              -DCMAKE_OSX_ARCHITECTURES='ppc;i386;x86_64' \
+              -DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
+> make
+
+-----------------------------------
+Building on WINDOWS (MinGW/GCC, Recommended)
+-----------------------------------
+Requirements:
+- GNU C++ Compiler: http://www.mingw.org/
+                    http://mingw-w64.sourceforge.net/
+- CMake: http://www.cmake.org/
+
+Commands:
+> cd bullet-trunk
+> cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release . -G "MinGW Makefiles"
+> mingw32-make
+
+-----------------------------------
+Building on WINDOWS (VisualStudio, untested)
+-----------------------------------
+Requirements:
+- Microsoft Visual Studio http://msdn.microsoft.com/
+
+Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8.
+The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version).
+
+Build the project to create static libraries.
+
+
+-----------------------------------
+Building bullet on LINUX
+-----------------------------------
+Requirements:
+- Gnu C++ Compiler: http://gcc.gnu.org/
+- CMake: http://www.cmake.org/ (or via your package manager of choice)
+
+Commands:
+> cd bullet-trunk
+> cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC"\
+              -DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
+> make
+
+-----------------------------------
+More info on building bullet
+-----------------------------------
+http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Installation
+
+
+
+***********************************
+* Building bulletjme             *
+***********************************
+
+-----------------------------------
+Requirements
+-----------------------------------
+- Java SDK 1.5+: http://java.sun.com
+- Apache ANT: http://ant.apache.org
+- C++ Compiler: (see below)
+- jme3 Source: http://jmonkeyengine.googlecode.com/
+- Statically compiled bullet source (see above)
+
+-----------------------------------
+Preparation
+-----------------------------------
+- copy/link bullet-trunk folder into the same folder where the bullet-jme folder is:
+
+disk
+ |
+ +-root folder
+    |
+    +-engine
+    |
+    +-sdk
+    |
+    +-bullet-trunk
+
+- You can alter options in the "src/bullet/native/bullet.properties" file, such as the used bullet
+  version, native compilation options etc. (see below)
+
+-----------------------------------
+Building bulletjme native
+-----------------------------------
+Commands:
+> cd engine
+> ant jar
+> ant build-bullet-natives
+
+Thats all. ANT takes care building native binaries and copies them to th elib directory.
+
+If you get compilation errors, try setting "native.java.include" in the build.properties file to your
+JDK include directory, e.g. /opt/java/include or "c:\Program Files\Java\jdk1.6.0_20\include".
+
+-----------------------------------
+Altering the native build process
+-----------------------------------
+bullet-jme uses cpptasks to compile native code.
+
+To change the used compiler, edit the "native.platform.compiler" entry in the
+"build.properties" file. The following c++ compilers work with cpptasks:
+
+gcc     GCC C++ compiler
+g++     GCC C++ compiler
+c++     GCC C++ compiler
+msvc    Microsoft Visual C++
+bcc     Borland C++ Compiler
+icl     Intel C++ compiler for Windows (IA-32)
+ecl     Intel C++ compiler for Windows (IA-64)
+icc     Intel C++ compiler for Linux (IA-32)
+ecc     Intel C++ compiler for Linux (IA-64)
+CC      Sun ONE C++ compiler
+aCC     HP aC++ C++ Compiler
+wcl     OpenWatcom C/C++ compiler
+
+In the "nbproject" folder you can find "build-native-platform.xml" files containing the commands
+to compile bullet-jme on different platforms. If you want to alter the process,
+you can copy and modify one of the files and import it in the "build.xml" file instead
+of the old one.
+
+-----------------------------------
+Netbeans Project
+-----------------------------------
+The project also includes a Netbeans project to edit and build
+the source in the Netbeans IDE in the /src/bullet/ subfolder.
+
+To have correct syntax highlighting in .cpp/.h files:
+
+- in Netbeans Settings -> C/C++ -> Code Assistance -> C++
+  - add bullet-2.77/src as include directories for c++
+  - add JAVA_HOME/include as include directories for c++

+ 59 - 59
engine/lib/nblibraries.properties

@@ -1,59 +1,59 @@
-libs.android.classpath=\
-    ${base}/android/android.jar
-libs.bullet.classpath=\
-    ${base}/bullet/jME3-bullet-natives.jar
-libs.CopyLibs.classpath=\
-    ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
-libs.jbullet.classpath=\
-    ${base}/jbullet/jbullet.jar:\
-    ${base}/jbullet/stack-alloc.jar:\
-    ${base}/jbullet/vecmath.jar
-libs.jheora.classpath=\
-    ${base}/jheora/jheora-jst-debug-0.6.0.jar
-libs.jme3-test-data.classpath=\
-    ${base}/../src/test-data/
-libs.jogg.classpath=\
-    ${base}/jogg/j-ogg-oggd.jar:\
-    ${base}/jogg/j-ogg-vorbisd.jar
-libs.jogl.classpath=\
-    ${base}/jogl/gluegen-rt.jar:\
-    ${base}/jogl/jME3-jogl-natives.jar:\
-    ${base}/jogl/jogl.jar
-libs.jogl2.classpath=\
-    ${base}/jogl2/jogl.all.jar;\
-    ${base}/jogl2/nativewindow.all.jar;\
-    ${base}/jogl2/newt.all.jar;\
-    ${base}/jogl2/gluegen-rt.jar
-libs.junit_4.classpath=\
-    ${base}/junit_4/junit-4.5.jar
-libs.junit_4.javadoc=\
-    ${base}/junit_4/junit-4.5-api.zip
-libs.junit_4.src=\
-    ${base}/junit_4/junit-4.5-src.jar
-libs.JWSAntTasks.classpath=\
-    ${base}/JWSAntTasks/org-netbeans-modules-javawebstart-anttasks.jar
-libs.lwjgl.classpath=\
-    ${base}/lwjgl/lwjgl.jar;\
-    ${base}/lwjgl/jME3-lwjgl-natives.jar;\
-    ${base}/lwjgl/jinput.jar
-libs.lwjgl.src=\
-    ${base}/../../Libraries/LWJGL2.7.1/src/
-libs.niftygui1.3.classpath=\
-    ${base}/niftygui/eventbus.jar;\
-    ${base}/niftygui/nifty-default-controls.jar;\
-    ${base}/niftygui/nifty-examples.jar;\
-    ${base}/niftygui/nifty-style-black.jar;\
-    ${base}/niftygui/nifty.jar;\
-    ${base}/niftygui/xmlpull-xpp3.jar
-libs.niftygui1.3.javadoc=\
-    ${base}/niftygui/nifty-default-controls-javadoc.jar!//;\
-    ${base}/niftygui/nifty-examples-javadoc.jar!//
-libs.swing-layout.classpath=\
-    ${base}/swing-layout/swing-layout-1.0.4.jar
-libs.swing-layout.javadoc=\
-    ${base}/swing-layout/swing-layout-1.0.4-doc.zip
-libs.swing-layout.src=\
-    ${base}/swing-layout/swing-layout-1.0.4-src.zip
-libs.noise.classpath=\
-    ${base}/noise/noise-0.0.1-SNAPSHOT.jar
-
+libs.android.classpath=\
+    ${base}/android/android.jar
+libs.bullet.classpath=\
+    ${base}/bullet/jME3-bullet-natives.jar
+libs.CopyLibs.classpath=\
+    ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
+libs.jbullet.classpath=\
+    ${base}/jbullet/jbullet.jar:\
+    ${base}/jbullet/stack-alloc.jar:\
+    ${base}/jbullet/vecmath.jar
+libs.jheora.classpath=\
+    ${base}/jheora/jheora-jst-debug-0.6.0.jar
+libs.jme3-test-data.classpath=\
+    ${base}/../test-data/
+libs.jogg.classpath=\
+    ${base}/jogg/j-ogg-oggd.jar:\
+    ${base}/jogg/j-ogg-vorbisd.jar
+libs.jogl.classpath=\
+    ${base}/jogl/gluegen-rt.jar:\
+    ${base}/jogl/jME3-jogl-natives.jar:\
+    ${base}/jogl/jogl.jar
+libs.jogl2.classpath=\
+    ${base}/jogl2/jogl.all.jar;\
+    ${base}/jogl2/nativewindow.all.jar;\
+    ${base}/jogl2/newt.all.jar;\
+    ${base}/jogl2/gluegen-rt.jar
+libs.junit_4.classpath=\
+    ${base}/junit_4/junit-4.5.jar
+libs.junit_4.javadoc=\
+    ${base}/junit_4/junit-4.5-api.zip
+libs.junit_4.src=\
+    ${base}/junit_4/junit-4.5-src.jar
+libs.JWSAntTasks.classpath=\
+    ${base}/JWSAntTasks/org-netbeans-modules-javawebstart-anttasks.jar
+libs.lwjgl.classpath=\
+    ${base}/lwjgl/lwjgl.jar;\
+    ${base}/lwjgl/jME3-lwjgl-natives.jar;\
+    ${base}/lwjgl/jinput.jar
+libs.lwjgl.src=\
+    ${base}/../../Libraries/LWJGL2.7.1/src/
+libs.niftygui1.3.classpath=\
+    ${base}/niftygui/eventbus.jar;\
+    ${base}/niftygui/nifty-default-controls.jar;\
+    ${base}/niftygui/nifty-examples.jar;\
+    ${base}/niftygui/nifty-style-black.jar;\
+    ${base}/niftygui/nifty.jar;\
+    ${base}/niftygui/xmlpull-xpp3.jar
+libs.niftygui1.3.javadoc=\
+    ${base}/niftygui/nifty-default-controls-javadoc.jar!//;\
+    ${base}/niftygui/nifty-examples-javadoc.jar!//
+libs.swing-layout.classpath=\
+    ${base}/swing-layout/swing-layout-1.0.4.jar
+libs.swing-layout.javadoc=\
+    ${base}/swing-layout/swing-layout-1.0.4-doc.zip
+libs.swing-layout.src=\
+    ${base}/swing-layout/swing-layout-1.0.4-src.zip
+libs.noise.classpath=\
+    ${base}/noise/noise-0.0.1-SNAPSHOT.jar
+

+ 310 - 0
engine/nbproject/build-bullet-natives.xml

@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="build bullet natives" default="all" basedir="../">
+    <!-- load cpp compiler ant task -->
+    <taskdef resource="cpptasks.tasks" classpath="lib/antlibs/cpptasks.jar"/>
+    <!-- load properties -->
+    <property file="nbproject/bullet-native.properties"/>
+    <!-- condition for mac platform check -->
+    <condition property="isSolaris">
+        <os name="SunOS"/>
+    </condition>
+    <condition property="isMac">
+        <and>
+            <os family="mac" />
+            <os family="unix" />
+        </and>
+    </condition>
+    <!-- condition for windows platform check -->
+    <condition property="isWindows">
+        <os family="windows" />
+    </condition>
+    <!-- condition for linux platform check -->
+    <condition property="isLinux">
+        <and>
+            <os family="unix"/>
+            <not>
+                <os family="mac"/>
+            </not>
+            <not>
+                <os name="SunOS"/>
+            </not>
+        </and>
+    </condition>
+    <!-- condition for x86_64 check -->
+    <condition property="isx86_64">
+        <os arch="x86_64" />
+    </condition>
+    
+    <condition property="ndk-build-name" value="ndk-build.cmd" else="ndk-build">
+        <os family="windows" />
+    </condition>
+    
+    <fileset id="lib.jars" dir="${bullet.lib.dir}">
+        <include name="**/*.jar"/>
+    </fileset>
+    <fileset id="lib.jme.jars" dir="${bullet.jme.dir}">
+        <include name="**/*.jar"/>
+    </fileset>
+    
+    <pathconvert property="lib.importpath">
+        <fileset refid="lib.jars"/>
+        <fileset refid="lib.jme.jars"/>
+    </pathconvert>
+
+    <target name="build-bullet-natives" description="builds the native bullet library for the platform being run on" depends="-create-folders, create-native-headers, -nativelib-osx, -nativelib-windows, -nativelib-linux, -nativelib-solaris, -nativelib-android">
+        <echo message="Updating native jME3-bullet-natives.jar"/>
+        <zip basedir="${bullet.output.base}/jarcontent" file="${bullet.output.base}/jME3-bullet-natives.jar" compress="true"/>
+        <zip basedir="${bullet.output.base}/android" file="${bullet.output.base}/jME3-bullet-natives-android.jar" compress="true"/>
+        <copy file="${bullet.output.base}/jME3-bullet-natives.jar" todir="dist/opt/native-bullet/lib/"/>
+        <copy file="${bullet.output.base}/jME3-bullet-natives-android.jar" todir="dist/opt/native-bullet/lib/"/>
+    </target>
+    
+    <target name="create-native-headers" description="creates the native headers">
+        <javah destdir="${bullet.source.dir}" classpath="${bullet.build.dir}${path.separator}${lib.importpath}" force="yes">
+            <class name="com.jme3.bullet.PhysicsSpace"/>
+
+            <class name="com.jme3.bullet.collision.PhysicsCollisionEvent"/>
+            <class name="com.jme3.bullet.collision.PhysicsCollisionObject"/>
+            <class name="com.jme3.bullet.objects.PhysicsCharacter"/>
+            <class name="com.jme3.bullet.objects.PhysicsGhostObject"/>
+            <class name="com.jme3.bullet.objects.PhysicsRigidBody"/>
+            <class name="com.jme3.bullet.objects.PhysicsVehicle"/>
+            <class name="com.jme3.bullet.objects.VehicleWheel"/>
+            <class name="com.jme3.bullet.objects.infos.RigidBodyMotionState"/>
+            
+            <class name="com.jme3.bullet.collision.shapes.CollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.BoxCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.CapsuleCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.CompoundCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.ConeCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.CylinderCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.GImpactCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.HeightfieldCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.HullCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.MeshCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.PlaneCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.SimplexCollisionShape"/>
+            <class name="com.jme3.bullet.collision.shapes.SphereCollisionShape"/>
+
+            <class name="com.jme3.bullet.joints.PhysicsJoint"/>
+            <class name="com.jme3.bullet.joints.ConeJoint"/>
+            <class name="com.jme3.bullet.joints.HingeJoint"/>
+            <class name="com.jme3.bullet.joints.Point2PointJoint"/>
+            <class name="com.jme3.bullet.joints.SixDofJoint"/>
+            <class name="com.jme3.bullet.joints.SixDofSpringJoint"/>
+            <class name="com.jme3.bullet.joints.SliderJoint"/>
+            <class name="com.jme3.bullet.joints.motors.RotationalLimitMotor"/>
+            <class name="com.jme3.bullet.joints.motors.TranslationalLimitMotor"/>
+
+            <class name="com.jme3.bullet.util.NativeMeshUtil"/>
+            <class name="com.jme3.bullet.util.DebugShapeFactory"/>
+        </javah>
+    </target>
+
+    <!-- compares the API of native bullet and java version-->
+    <target name="bullet-api-diff">
+        <echo message="Comparing bullet and jbullet API"/>
+        <property name="dependencyfinder.home" value="lib/antlibs/depfinder"/>
+        <path id="dependencyfinder">
+            <pathelement location="${dependencyfinder.home}/classes"/>
+            <pathelement location="${dependencyfinder.home}/lib/DependencyFinder.jar"/>
+            <pathelement location="${dependencyfinder.home}/lib/jakarta-oro.jar"/>
+            <pathelement location="${dependencyfinder.home}/lib/log4j.jar"/>
+            <pathelement location="${dependencyfinder.home}/lib/guava.jar"/>
+        </path>
+        <taskdef resource="dependencyfindertasks.properties">
+            <classpath refid="dependencyfinder"/>
+        </taskdef>
+        <jarjardiff destfile="bullet-api-diff.xml"
+              name="jMonkeyEngine3 Bullet Physics API Comparison"
+              oldlabel="Java Version"
+              newlabel="Native Version"
+              level="incompatible">
+            <old>
+                <pathelement location="build/jME3-jbullet.jar"/>
+            </old>
+            <new>
+                <pathelement location="build/jME3-bullet.jar"/>
+            </new>
+        </jarjardiff>    
+        <xslt style="${dependencyfinder.home}/etc/DiffToHTML.xsl"
+        in="bullet-api-diff.xml"
+        out="bullet-api-diff.html" force="true"/>
+        <delete file="bullet-api-diff.xml"/>
+    </target>
+
+    <target name="-create-folders" description="creates the native headers">
+        <mkdir dir="${bullet.source.dir}"/>
+        <mkdir dir="${bullet.build.dir}"/>
+        <mkdir dir="${bullet.output.dir}"/>
+        <mkdir dir="build/bullet-native"/>
+    </target>
+    
+    <target name="-nativelib-osx" if="isMac">
+        <echo message="Building MacOSX version of native bullet"/>
+        <mkdir dir="${bullet.output.dir}/macosx"/>
+        <cc name="${bullet.osx.compiler}" warnings="none" debug="${bullet.compile.debug}" link="shared" outfile="${bullet.output.dir}/macosx/${bullet.library.name}" objdir="build/bullet-native">
+            <fileset dir="${bullet.source.dir}">
+                <include name="*.cpp">
+                </include>
+            </fileset>
+            <includepath path="${bullet.osx.java.include}"/>
+            <includepath path="${bullet.bullet.include}"/>
+            <compilerarg value="-syslibroot ${bullet.osx.syslibroot}"/>
+            <!--compilerarg value="-arch"/>
+            <compilerarg value="ppc"/-->
+            <compilerarg value="-arch"/>
+            <compilerarg value="i386"/>
+            <compilerarg value="-arch"/>
+            <compilerarg value="x86_64"/>
+            <linker name="${bullet.osx.compiler}">
+                <!--libset dir="${bullet.folder}/src/BulletSoftBody" libs="BulletSoftBody"/-->
+                <libset dir="${bullet.folder}/src/BulletMultiThreaded" libs="BulletMultiThreaded"/>
+                <libset dir="${bullet.folder}/src/BulletDynamics" libs="BulletDynamics"/>
+                <libset dir="${bullet.folder}/src/BulletCollision" libs="BulletCollision"/>
+                <libset dir="${bullet.folder}/src/LinearMath" libs="LinearMath"/>
+                <!--linkerarg value="-arch"/>
+                <linkerarg value="ppc"/-->
+                <linkerarg value="-arch"/>
+                <linkerarg value="i386"/>
+                <linkerarg value="-arch"/>
+                <linkerarg value="x86_64"/>
+            </linker>
+        </cc>
+        <move file="${bullet.output.dir}/macosx/lib${bullet.library.name}.dylib" tofile="${bullet.output.dir}/macosx/lib${bullet.library.name}.jnilib" failonerror="true" verbose="true"/>
+        <delete file="${bullet.output.dir}/macosx/history.xml"/>
+    </target>
+    
+    <target name="-nativelib-linux" if="isLinux">
+        <echo message="Building Linux version of native bullet"/>
+        <mkdir dir="${bullet.output.dir}/linux"/>
+        <cc name="${bullet.linux.compiler}" warnings="severe" debug="${bullet.compile.debug}" link="shared" outfile="${bullet.output.dir}/linux/${bullet.library.name}" objdir="build/bullet-native">
+            <fileset dir="${bullet.source.dir}">
+                <include name="*.cpp">
+                </include>
+            </fileset>
+            <includepath path="${bullet.java.include}"/>
+            <includepath path="${bullet.java.include}/linux"/>
+            <includepath path="${bullet.bullet.include}"/>
+            <!--compilerarg value="-m32"/-->
+            <!--compilerarg value="-static-libgcc"/>
+            <compilerarg value="-fPIC"/-->
+            <linker name="${bullet.linux.compiler}">
+                <!-- linkerarg value="-static-libgcc"/ -->
+                <libset dir="${bullet.folder}/src/BulletMultiThreaded" libs="BulletMultiThreaded"/>
+                <libset dir="${bullet.folder}/src/BulletDynamics" libs="BulletDynamics"/>
+                <libset dir="${bullet.folder}/src/BulletCollision" libs="BulletCollision"/>
+                <libset dir="${bullet.folder}/src/LinearMath" libs="LinearMath"/>
+            </linker>
+        </cc>
+        <delete file="${bullet.output.dir}/linux/history.xml"/>
+    </target>
+    
+    <target name="-nativelib-solaris" if="isSolaris">
+        <echo message="Building Solaris version of native bullet"/>
+        <mkdir dir="${bullet.output.dir}/linux"/>
+        <cc name="${bullet.solaris.compiler}" warnings="severe" debug="${bullet.compile.debug}" link="shared" outfile="${bullet.output.dir}/solaris/${bullet.library.name}" objdir="build/bullet-native">
+            <fileset dir="${bullet.source.dir}">
+                <include name="*.cpp">
+                </include>
+            </fileset>
+            <includepath path="${bullet.java.include}"/>
+            <includepath path="${bullet.java.include}/solaris"/>
+            <includepath path="${bullet.bullet.include}"/>
+            <!--compilerarg value="-m32"/-->
+            <compilerarg value="-m32"/>
+            <compilerarg value="-fno-strict-aliasing"/>
+            <compilerarg value="-pthread"/>
+            <compilerarg value="-fPIC"/>
+            <compilerarg value="-D_REENTRANT"/>
+            <compilerarg value="-static-libstdc++"/>
+            <compilerarg value="-static-libgcc"/>
+            <compilerarg value="-D_REENTRANT"/>
+            <linker name="${bullet.solaris.compiler}">
+                <linkerarg value="-R/usr/sfw/lib"/>
+                <libset dir="${bullet.folder}/src/BulletMultiThreaded" libs="BulletMultiThreaded"/>
+                <libset dir="${bullet.folder}/src/BulletDynamics" libs="BulletDynamics"/>
+                <libset dir="${bullet.folder}/src/BulletCollision" libs="BulletCollision"/>
+                <libset dir="${bullet.folder}/src/LinearMath" libs="LinearMath"/>
+            </linker>
+        </cc>
+        <delete file="${bullet.output.dir}/solaris/history.xml"/>
+    </target>
+
+    <target name="-nativelib-windows" if="isWindows">
+        <echo message="Building Windows version of native bullet"/>
+        <mkdir dir="${bullet.output.dir}/windows"/>
+        <cc multithreaded="" name="${bullet.windows.compiler}" warnings="none" debug="${bullet.compile.debug}" outtype="shared" outfile="${bullet.output.dir}/windows/${bullet.library.name}" objdir="build/bullet-native">
+            <fileset dir="${bullet.source.dir}">
+                <include name="*.cpp">
+                </include>
+            </fileset>
+            <includepath path="${bullet.java.include}"/>
+            <includepath path="${bullet.java.include}/win32"/>
+            <includepath path="${bullet.bullet.include}"/>
+            <!--compilerarg value="-m32"/-->
+            <linker name="${bullet.windows.compiler}" debug="${bullet.compile.debug}" >
+                <linkerarg value="-o${bullet.library.name}.dll" />
+                <linkerarg value="--kill-at" />
+                <linkerarg value="-static"/>
+                <libset dir="${bullet.folder}/lib" libs="BulletMultiThreaded,BulletDynamics,BulletCollision,LinearMath"/> 
+            </linker>
+        </cc>
+        <delete file="${bullet.output.dir}/windows/history.xml"/>
+    </target>
+
+    <target name="-nativelib-android" depends="-check-android-ndk" if="haveAndoidNdk">
+        <!-- delete previous android jni, libs, and obj subdirectories for a clean start -->
+        <delete dir="build/bullet-android/jni" failonerror="false"/>
+        <delete dir="build/bullet-android/libs" failonerror="false"/>
+        <delete dir="build/bullet-android/obj" failonerror="false"/>
+        <!-- create the android subdirectory in jarcontent for the libbulletjme.so shared library -->
+        <mkdir dir="${bullet.output.base}/android"/>
+        <!-- create the jni subdirectory -->
+        <mkdir dir="build/bullet-android/jni" />
+        <!-- copy Android.mk and Application.mk files into jni directory -->
+        <copy file="${bullet.source.dir}/android/Android.mk" todir="build/bullet-android/jni" verbose="true"/>
+        <copy file="${bullet.source.dir}/android/Application.mk" todir="build/bullet-android/jni" verbose="true"/>
+
+        <!-- copy edited version of jmePhysicsSpace to remove NDK compile error -->
+        <copy file="${bullet.source.dir}/android/jmePhysicsSpace.cpp" todir="build/bullet-android/jni" verbose="true"/>
+
+        <!-- copy jME3 Native Bullet files into jni directory -->
+        <copy todir="build/bullet-android/jni" verbose="true" flatten="false">
+            <fileset dir="${bullet.source.dir}">
+                <include name="*.cpp" />
+                <include name="*.h" />
+               <!-- skip jmePhysicsSpace (use edited one) to remove NDK compile error -->
+                <exclude name="jmePhysicsSpace.cpp" />
+            </fileset>
+        </copy>
+
+        <!-- copy Bullet-2.79 files into jni directory -->
+        <copy todir="build/bullet-android/jni" verbose="true" flatten="false">
+            <fileset dir="${bullet.bullet.include}">
+                <include name="**/*.cpp"/>
+                <include name="**/*.h"/>
+                <include name="**/*.cl"/>
+            </fileset>
+        </copy>
+
+        <exec executable="${ndk.dir}/${ndk-build-name}" failonerror="true" >
+            <arg line="-C build/bullet-android/"/>
+        </exec>
+
+        <!-- copy resulting library directories to jarcontent directory -->
+        <copy todir="${bullet.output.base}/android" verbose="true" flatten="false">
+            <fileset dir="build/bullet-android/libs">
+                <include name="**/*.*"/>
+                <include name="**/*.*"/>
+                <!--exclude name="**/x86/*.*"/-->
+            </fileset>
+        </copy>
+
+    </target>
+    
+    <target name="-check-android-ndk">
+        <available file="${ndk.dir}/${ndk-build-name}" property="haveAndoidNdk"/>
+    </target>
+    
+</project>

+ 1230 - 1239
engine/nbproject/build-impl.xml

@@ -1,1239 +1,1230 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT  ***
-***         EDIT ../build.xml INSTEAD         ***
-
-For the purpose of easier reading the script
-is divided into following sections:
-
-  - initialization
-  - compilation
-  - jar
-  - execution
-  - debugging
-  - javadoc
-  - junit compilation
-  - junit execution
-  - junit debugging
-  - applet
-  - cleanup
-
-        -->
-<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="jMonkeyEngine3-impl">
-    <import file="jnlp-impl.xml"/>
-    <fail message="Please build using Ant 1.7.1 or higher.">
-        <condition>
-            <not>
-                <antversion atleast="1.7.1"/>
-            </not>
-        </condition>
-    </fail>
-    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
-    <!-- 
-                ======================
-                INITIALIZATION SECTION 
-                ======================
-            -->
-    <target name="-pre-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="-pre-init" name="-init-private">
-        <property file="nbproject/private/config.properties"/>
-        <property file="nbproject/private/configs/${config}.properties"/>
-        <property file="nbproject/private/private.properties"/>
-    </target>
-    <target name="-pre-init-libraries">
-        <property location="./lib/nblibraries.properties" name="libraries.path"/>
-        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
-        <pathconvert dirsep="/" property="libraries.dir">
-            <path path="${libraries.dir.nativedirsep}"/>
-        </pathconvert>
-        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
-        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
-    </target>
-    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
-        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
-            <filterchain>
-                <replacestring from="$${base}" to="${libraries.dir}"/>
-                <escapeunicode/>
-            </filterchain>
-        </loadproperties>
-    </target>
-    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
-        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
-            <filterchain>
-                <replacestring from="$${base}" to="${libraries.dir}"/>
-                <escapeunicode/>
-            </filterchain>
-        </loadproperties>
-    </target>
-    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
-        <property file="${user.properties.file}"/>
-        <!-- The two properties below are usually overridden -->
-        <!-- by the active platform. Just a fallback. -->
-        <property name="default.javac.source" value="1.4"/>
-        <property name="default.javac.target" value="1.4"/>
-    </target>
-    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
-        <property file="nbproject/configs/${config}.properties"/>
-        <property file="nbproject/project.properties"/>
-    </target>
-    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
-        <available file="${manifest.file}" property="manifest.available"/>
-        <condition property="splashscreen.available">
-            <and>
-                <not>
-                    <equals arg1="${application.splash}" arg2="" trim="true"/>
-                </not>
-                <available file="${application.splash}"/>
-            </and>
-        </condition>
-        <condition property="main.class.available">
-            <and>
-                <isset property="main.class"/>
-                <not>
-                    <equals arg1="${main.class}" arg2="" trim="true"/>
-                </not>
-            </and>
-        </condition>
-        <condition property="manifest.available+main.class">
-            <and>
-                <isset property="manifest.available"/>
-                <isset property="main.class.available"/>
-            </and>
-        </condition>
-        <condition property="do.archive">
-            <not>
-                <istrue value="${jar.archive.disabled}"/>
-            </not>
-        </condition>
-        <condition property="do.mkdist">
-            <and>
-                <isset property="do.archive"/>
-                <isset property="libs.CopyLibs.classpath"/>
-                <not>
-                    <istrue value="${mkdist.disabled}"/>
-                </not>
-            </and>
-        </condition>
-        <condition property="manifest.available+main.class+mkdist.available">
-            <and>
-                <istrue value="${manifest.available+main.class}"/>
-                <isset property="do.mkdist"/>
-            </and>
-        </condition>
-        <condition property="do.archive+manifest.available">
-            <and>
-                <isset property="manifest.available"/>
-                <istrue value="${do.archive}"/>
-            </and>
-        </condition>
-        <condition property="do.archive+main.class.available">
-            <and>
-                <isset property="main.class.available"/>
-                <istrue value="${do.archive}"/>
-            </and>
-        </condition>
-        <condition property="do.archive+splashscreen.available">
-            <and>
-                <isset property="splashscreen.available"/>
-                <istrue value="${do.archive}"/>
-            </and>
-        </condition>
-        <condition property="do.archive+manifest.available+main.class">
-            <and>
-                <istrue value="${manifest.available+main.class}"/>
-                <istrue value="${do.archive}"/>
-            </and>
-        </condition>
-        <condition property="manifest.available-mkdist.available">
-            <or>
-                <istrue value="${manifest.available}"/>
-                <isset property="do.mkdist"/>
-            </or>
-        </condition>
-        <condition property="manifest.available+main.class-mkdist.available">
-            <or>
-                <istrue value="${manifest.available+main.class}"/>
-                <isset property="do.mkdist"/>
-            </or>
-        </condition>
-        <condition property="have.tests">
-            <or>
-                <available file="${test.test.dir}"/>
-            </or>
-        </condition>
-        <condition property="have.sources">
-            <or>
-                <available file="${src.core.dir}"/>
-                <available file="${src.core-data.dir}"/>
-                <available file="${src.core-plugins.dir}"/>
-                <available file="${src.terrain.dir}"/>
-                <available file="${src.networking.dir}"/>
-                <available file="${src.desktop.dir}"/>
-                <available file="${src.desktop-fx.dir}"/>
-                <available file="${src.games.dir}"/>
-                <available file="${src.jbullet.dir}"/>
-                <available file="${src.niftygui.dir}"/>
-                <available file="${src.jogg.dir}"/>
-                <available file="${src.lwjgl-oal.dir}"/>
-                <available file="${src.lwjgl-ogl.dir}"/>
-                <available file="${src.ogre.dir}"/>
-                <available file="${src.blender.dir}"/>
-                <available file="${src.pack.dir}"/>
-                <available file="${src.jheora.dir}"/>
-                <available file="${src.test.dir}"/>
-                <available file="${src.tools.dir}"/>
-                <available file="${src.xml.dir}"/>
-            </or>
-        </condition>
-        <condition property="netbeans.home+have.tests">
-            <and>
-                <isset property="netbeans.home"/>
-                <isset property="have.tests"/>
-            </and>
-        </condition>
-        <condition property="no.javadoc.preview">
-            <and>
-                <isset property="javadoc.preview"/>
-                <isfalse value="${javadoc.preview}"/>
-            </and>
-        </condition>
-        <property name="run.jvmargs" value=""/>
-        <property name="javac.compilerargs" value=""/>
-        <property name="work.dir" value="${basedir}"/>
-        <condition property="no.deps">
-            <and>
-                <istrue value="${no.dependencies}"/>
-            </and>
-        </condition>
-        <property name="javac.debug" value="true"/>
-        <property name="javadoc.preview" value="true"/>
-        <property name="application.args" value=""/>
-        <property name="source.encoding" value="${file.encoding}"/>
-        <property name="runtime.encoding" value="${source.encoding}"/>
-        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
-            <and>
-                <isset property="javadoc.encoding"/>
-                <not>
-                    <equals arg1="${javadoc.encoding}" arg2=""/>
-                </not>
-            </and>
-        </condition>
-        <property name="javadoc.encoding.used" value="${source.encoding}"/>
-        <property name="includes" value="**"/>
-        <property name="excludes" value=""/>
-        <property name="do.depend" value="false"/>
-        <condition property="do.depend.true">
-            <istrue value="${do.depend}"/>
-        </condition>
-        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
-        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
-            <length length="0" string="${endorsed.classpath}" when="greater"/>
-        </condition>
-        <condition else="false" property="jdkBug6558476">
-            <and>
-                <matches pattern="1\.[56]" string="${java.specification.version}"/>
-                <not>
-                    <os family="unix"/>
-                </not>
-            </and>
-        </condition>
-        <property name="javac.fork" value="${jdkBug6558476}"/>
-        <property name="jar.index" value="false"/>
-        <property name="jar.index.metainf" value="${jar.index}"/>
-        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
-    </target>
-    <target name="-post-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
-        <fail unless="src.core.dir">Must set src.core.dir</fail>
-        <fail unless="src.core-data.dir">Must set src.core-data.dir</fail>
-        <fail unless="src.core-plugins.dir">Must set src.core-plugins.dir</fail>
-        <fail unless="src.terrain.dir">Must set src.terrain.dir</fail>
-        <fail unless="src.networking.dir">Must set src.networking.dir</fail>
-        <fail unless="src.desktop.dir">Must set src.desktop.dir</fail>
-        <fail unless="src.desktop-fx.dir">Must set src.desktop-fx.dir</fail>
-        <fail unless="src.games.dir">Must set src.games.dir</fail>
-        <fail unless="src.jbullet.dir">Must set src.jbullet.dir</fail>
-        <fail unless="src.niftygui.dir">Must set src.niftygui.dir</fail>
-        <fail unless="src.jogg.dir">Must set src.jogg.dir</fail>
-        <fail unless="src.lwjgl-oal.dir">Must set src.lwjgl-oal.dir</fail>
-        <fail unless="src.lwjgl-ogl.dir">Must set src.lwjgl-ogl.dir</fail>
-        <fail unless="src.ogre.dir">Must set src.ogre.dir</fail>
-        <fail unless="src.blender.dir">Must set src.blender.dir</fail>
-        <fail unless="src.pack.dir">Must set src.pack.dir</fail>
-        <fail unless="src.jheora.dir">Must set src.jheora.dir</fail>
-        <fail unless="src.test.dir">Must set src.test.dir</fail>
-        <fail unless="src.tools.dir">Must set src.tools.dir</fail>
-        <fail unless="src.xml.dir">Must set src.xml.dir</fail>
-        <fail unless="test.test.dir">Must set test.test.dir</fail>
-        <fail unless="build.dir">Must set build.dir</fail>
-        <fail unless="dist.dir">Must set dist.dir</fail>
-        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
-        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
-        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
-        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
-        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
-        <fail unless="dist.jar">Must set dist.jar</fail>
-    </target>
-    <target name="-init-macrodef-property">
-        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
-            <attribute name="name"/>
-            <attribute name="value"/>
-            <sequential>
-                <property name="@{name}" value="${@{value}}"/>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
-        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.blender.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}" name="srcdir"/>
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <attribute default="${javac.classpath}" name="classpath"/>
-            <attribute default="${javac.processorpath}" name="processorpath"/>
-            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="${javac.debug}" name="debug"/>
-            <attribute default="${empty.dir}" name="sourcepath"/>
-            <attribute default="${empty.dir}" name="gensrcdir"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property location="${build.dir}/empty" name="empty.dir"/>
-                <mkdir dir="${empty.dir}"/>
-                <mkdir dir="@{apgeneratedsrcdir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
-                    <src>
-                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
-                            <include name="*"/>
-                        </dirset>
-                    </src>
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <compilerarg line="${javac.compilerargs}"/>
-                    <compilerarg value="-processorpath"/>
-                    <compilerarg path="@{processorpath}:${empty.dir}"/>
-                    <compilerarg line="${ap.processors.internal}"/>
-                    <compilerarg line="${annotation.processing.processor.options}"/>
-                    <compilerarg value="-s"/>
-                    <compilerarg path="@{apgeneratedsrcdir}"/>
-                    <compilerarg line="${ap.proc.none.internal}"/>
-                    <customize/>
-                </javac>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
-        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.blender.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}" name="srcdir"/>
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <attribute default="${javac.classpath}" name="classpath"/>
-            <attribute default="${javac.processorpath}" name="processorpath"/>
-            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="${javac.debug}" name="debug"/>
-            <attribute default="${empty.dir}" name="sourcepath"/>
-            <attribute default="${empty.dir}" name="gensrcdir"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property location="${build.dir}/empty" name="empty.dir"/>
-                <mkdir dir="${empty.dir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
-                    <src>
-                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
-                            <include name="*"/>
-                        </dirset>
-                    </src>
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <compilerarg line="${javac.compilerargs}"/>
-                    <customize/>
-                </javac>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
-        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.blender.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}" name="srcdir"/>
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <attribute default="${javac.classpath}" name="classpath"/>
-            <sequential>
-                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                </depend>
-            </sequential>
-        </macrodef>
-        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <sequential>
-                <fail unless="javac.includes">Must set javac.includes</fail>
-                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
-                    <path>
-                        <filelist dir="@{destdir}" files="${javac.includes}"/>
-                    </path>
-                    <globmapper from="*.java" to="*.class"/>
-                </pathconvert>
-                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
-                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
-                <delete>
-                    <files includesfile="${javac.includesfile.binary}"/>
-                </delete>
-                <delete>
-                    <fileset file="${javac.includesfile.binary}"/>
-                </delete>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-macrodef-junit">
-        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <sequential>
-                <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
-                    <batchtest todir="${build.test.results.dir}">
-                        <fileset dir="${test.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
-                            <filename name="@{testincludes}"/>
-                        </fileset>
-                    </batchtest>
-                    <classpath>
-                        <path path="${run.test.classpath}"/>
-                    </classpath>
-                    <syspropertyset>
-                        <propertyref prefix="test-sys-prop."/>
-                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <formatter type="brief" usefile="false"/>
-                    <formatter type="xml"/>
-                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <jvmarg value="-ea"/>
-                    <jvmarg line="${run.jvmargs}"/>
-                </junit>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
-    <target name="-profile-pre-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target name="-profile-post-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target name="-profile-init-macrodef-profile">
-        <macrodef name="resolve">
-            <attribute name="name"/>
-            <attribute name="value"/>
-            <sequential>
-                <property name="@{name}" value="${env.@{value}}"/>
-            </sequential>
-        </macrodef>
-        <macrodef name="profile">
-            <attribute default="${main.class}" name="classname"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property environment="env"/>
-                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
-                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
-                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
-                    <jvmarg line="${profiler.info.jvmargs}"/>
-                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
-                    <arg line="${application.args}"/>
-                    <classpath>
-                        <path path="${run.classpath}"/>
-                    </classpath>
-                    <syspropertyset>
-                        <propertyref prefix="run-sys-prop."/>
-                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <customize/>
-                </java>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
-        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
-        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
-    </target>
-    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
-        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
-            <attribute default="${main.class}" name="name"/>
-            <attribute default="${debug.classpath}" name="classpath"/>
-            <attribute default="" name="stopclassname"/>
-            <sequential>
-                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                </nbjpdastart>
-            </sequential>
-        </macrodef>
-        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
-            <attribute default="${build.classes.dir}" name="dir"/>
-            <sequential>
-                <nbjpdareload>
-                    <fileset dir="@{dir}" includes="${fix.classes}">
-                        <include name="${fix.includes}*.class"/>
-                    </fileset>
-                </nbjpdareload>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-debug-args">
-        <property name="version-output" value="java version &quot;${ant.java.version}"/>
-        <condition property="have-jdk-older-than-1.4">
-            <or>
-                <contains string="${version-output}" substring="java version &quot;1.0"/>
-                <contains string="${version-output}" substring="java version &quot;1.1"/>
-                <contains string="${version-output}" substring="java version &quot;1.2"/>
-                <contains string="${version-output}" substring="java version &quot;1.3"/>
-            </or>
-        </condition>
-        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
-            <istrue value="${have-jdk-older-than-1.4}"/>
-        </condition>
-        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
-            <os family="windows"/>
-        </condition>
-        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
-            <isset property="debug.transport"/>
-        </condition>
-    </target>
-    <target depends="-init-debug-args" name="-init-macrodef-debug">
-        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${main.class}" name="classname"/>
-            <attribute default="${debug.classpath}" name="classpath"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <java classname="@{classname}" dir="${work.dir}" fork="true">
-                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <jvmarg line="${debug-args-line}"/>
-                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
-                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
-                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
-                    <jvmarg line="${run.jvmargs}"/>
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                    <syspropertyset>
-                        <propertyref prefix="run-sys-prop."/>
-                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <customize/>
-                </java>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-macrodef-java">
-        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
-            <attribute default="${main.class}" name="classname"/>
-            <attribute default="${run.classpath}" name="classpath"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <java classname="@{classname}" dir="${work.dir}" fork="true">
-                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
-                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
-                    <jvmarg line="${run.jvmargs}"/>
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                    <syspropertyset>
-                        <propertyref prefix="run-sys-prop."/>
-                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <customize/>
-                </java>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-macrodef-copylibs">
-        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${manifest.file}" name="manifest"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
-                <pathconvert property="run.classpath.without.build.classes.dir">
-                    <path path="${run.classpath}"/>
-                    <map from="${build.classes.dir.resolved}" to=""/>
-                </pathconvert>
-                <pathconvert pathsep=" " property="jar.classpath">
-                    <path path="${run.classpath.without.build.classes.dir}"/>
-                    <chainedmapper>
-                        <flattenmapper/>
-                        <globmapper from="*" to="lib/*"/>
-                    </chainedmapper>
-                </pathconvert>
-                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
-                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
-                    <fileset dir="${build.classes.dir}"/>
-                    <manifest>
-                        <attribute name="Class-Path" value="${jar.classpath}"/>
-                        <customize/>
-                    </manifest>
-                </copylibs>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-presetdef-jar">
-        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
-            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
-                <j2seproject1:fileset dir="${build.classes.dir}"/>
-            </jar>
-        </presetdef>
-    </target>
-    <target name="-init-ap-cmdline-properties">
-        <property name="annotation.processing.enabled" value="true"/>
-        <property name="annotation.processing.processors.list" value=""/>
-        <property name="annotation.processing.processor.options" value=""/>
-        <property name="annotation.processing.run.all.processors" value="true"/>
-        <property name="javac.processorpath" value="${javac.classpath}"/>
-        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
-        <condition property="ap.supported.internal" value="true">
-            <not>
-                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
-            </not>
-        </condition>
-    </target>
-    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
-        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
-            <isfalse value="${annotation.processing.run.all.processors}"/>
-        </condition>
-        <condition else="" property="ap.proc.none.internal" value="-proc:none">
-            <isfalse value="${annotation.processing.enabled}"/>
-        </condition>
-    </target>
-    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
-        <property name="ap.cmd.line.internal" value=""/>
-    </target>
-    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
-    <!--
-                ===================
-                COMPILATION SECTION
-                ===================
-            -->
-    <target name="-deps-jar-init" unless="built-jar.properties">
-        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
-        <delete file="${built-jar.properties}" quiet="true"/>
-    </target>
-    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
-        <echo level="warn" message="Cycle detected: jMonkeyEngine3 was already built"/>
-    </target>
-    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
-        <mkdir dir="${build.dir}"/>
-        <touch file="${built-jar.properties}" verbose="false"/>
-        <property file="${built-jar.properties}" prefix="already.built.jar."/>
-        <antcall target="-warn-already-built-jar"/>
-        <propertyfile file="${built-jar.properties}">
-            <entry key="${basedir}" value=""/>
-        </propertyfile>
-    </target>
-    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
-    <target depends="init" name="-check-automatic-build">
-        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
-    </target>
-    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
-        <antcall target="clean"/>
-    </target>
-    <target depends="init,deps-jar" name="-pre-pre-compile">
-        <mkdir dir="${build.classes.dir}"/>
-    </target>
-    <target name="-pre-compile">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target if="do.depend.true" name="-compile-depend">
-        <pathconvert property="build.generated.subdirs">
-            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
-                <include name="*"/>
-            </dirset>
-        </pathconvert>
-        <j2seproject3:depend srcdir="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.blender.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}:${build.generated.subdirs}"/>
-    </target>
-    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
-        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
-        <copy todir="${build.classes.dir}">
-            <fileset dir="${src.core.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.core-data.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.core-plugins.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.terrain.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.networking.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.desktop.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.desktop-fx.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.games.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.jbullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.niftygui.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.jogg.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.lwjgl-oal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.lwjgl-ogl.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.ogre.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.blender.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.pack.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.jheora.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.tools.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.xml.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-    </target>
-    <target if="has.persistence.xml" name="-copy-persistence-xml">
-        <mkdir dir="${build.classes.dir}/META-INF"/>
-        <copy todir="${build.classes.dir}/META-INF">
-            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
-        </copy>
-    </target>
-    <target name="-post-compile">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
-    <target name="-pre-compile-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
-        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
-        <j2seproject3:force-recompile/>
-        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.blender.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}"/>
-    </target>
-    <target name="-post-compile-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
-    <!--
-                ====================
-                JAR BUILDING SECTION
-                ====================
-            -->
-    <target depends="init" name="-pre-pre-jar">
-        <dirname file="${dist.jar}" property="dist.jar.dir"/>
-        <mkdir dir="${dist.jar.dir}"/>
-    </target>
-    <target name="-pre-jar">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
-        <j2seproject1:jar/>
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
-        <j2seproject1:jar manifest="${manifest.file}"/>
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
-        <j2seproject1:jar manifest="${manifest.file}">
-            <j2seproject1:manifest>
-                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
-            </j2seproject1:manifest>
-        </j2seproject1:jar>
-        <echo level="info">To run this application from the command line without Ant, try:</echo>
-        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
-        <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <pathconvert property="run.classpath.with.dist.jar">
-            <path path="${run.classpath}"/>
-            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
-        </pathconvert>
-        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
-    </target>
-    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
-        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
-        <touch file="${tmp.manifest.file}" verbose="false"/>
-    </target>
-    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
-        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
-        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
-    </target>
-    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
-        <manifest file="${tmp.manifest.file}" mode="update">
-            <attribute name="Main-Class" value="${main.class}"/>
-        </manifest>
-    </target>
-    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
-        <basename file="${application.splash}" property="splashscreen.basename"/>
-        <mkdir dir="${build.classes.dir}/META-INF"/>
-        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
-        <manifest file="${tmp.manifest.file}" mode="update">
-            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
-        </manifest>
-    </target>
-    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
-        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
-        <echo level="info">To run this application from the command line without Ant, try:</echo>
-        <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
-    </target>
-    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
-        <delete>
-            <fileset file="${tmp.manifest.file}"/>
-        </delete>
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
-    <target name="-post-jar">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
-    <!--
-                =================
-                EXECUTION SECTION
-                =================
-            -->
-    <target depends="init,compile" description="Run a main class." name="run">
-        <j2seproject1:java>
-            <customize>
-                <arg line="${application.args}"/>
-            </customize>
-        </j2seproject1:java>
-    </target>
-    <target name="-do-not-recompile">
-        <property name="javac.includes.binary" value=""/>
-    </target>
-    <target depends="init,compile-single" name="run-single">
-        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
-        <j2seproject1:java classname="${run.class}"/>
-    </target>
-    <target depends="init,compile-test-single" name="run-test-with-main">
-        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
-        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
-    </target>
-    <!--
-                =================
-                DEBUGGING SECTION
-                =================
-            -->
-    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
-        <j2seproject1:nbjpdastart name="${debug.class}"/>
-    </target>
-    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
-        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
-    </target>
-    <target depends="init,compile" name="-debug-start-debuggee">
-        <j2seproject3:debug>
-            <customize>
-                <arg line="${application.args}"/>
-            </customize>
-        </j2seproject3:debug>
-    </target>
-    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
-    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
-        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
-    </target>
-    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
-    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
-        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
-        <j2seproject3:debug classname="${debug.class}"/>
-    </target>
-    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
-    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
-        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
-        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
-    </target>
-    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
-    <target depends="init" name="-pre-debug-fix">
-        <fail unless="fix.includes">Must set fix.includes</fail>
-        <property name="javac.includes" value="${fix.includes}.java"/>
-    </target>
-    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
-        <j2seproject1:nbjpdareload/>
-    </target>
-    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
-    <!--
-                =================
-                PROFILING SECTION
-                =================
-            -->
-    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
-        <nbprofiledirect>
-            <classpath>
-                <path path="${run.classpath}"/>
-            </classpath>
-        </nbprofiledirect>
-        <profile/>
-    </target>
-    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
-        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
-        <nbprofiledirect>
-            <classpath>
-                <path path="${run.classpath}"/>
-            </classpath>
-        </nbprofiledirect>
-        <profile classname="${profile.class}"/>
-    </target>
-    <!--
-                =========================
-                APPLET PROFILING  SECTION
-                =========================
-            -->
-    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
-        <nbprofiledirect>
-            <classpath>
-                <path path="${run.classpath}"/>
-            </classpath>
-        </nbprofiledirect>
-        <profile classname="sun.applet.AppletViewer">
-            <customize>
-                <arg value="${applet.url}"/>
-            </customize>
-        </profile>
-    </target>
-    <!--
-                =========================
-                TESTS PROFILING  SECTION
-                =========================
-            -->
-    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
-        <nbprofiledirect>
-            <classpath>
-                <path path="${run.test.classpath}"/>
-            </classpath>
-        </nbprofiledirect>
-        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
-            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
-            <jvmarg value="${profiler.info.jvmargs.agent}"/>
-            <jvmarg line="${profiler.info.jvmargs}"/>
-            <test name="${profile.class}"/>
-            <classpath>
-                <path path="${run.test.classpath}"/>
-            </classpath>
-            <syspropertyset>
-                <propertyref prefix="test-sys-prop."/>
-                <mapper from="test-sys-prop.*" to="*" type="glob"/>
-            </syspropertyset>
-            <formatter type="brief" usefile="false"/>
-            <formatter type="xml"/>
-        </junit>
-    </target>
-    <!--
-                ===============
-                JAVADOC SECTION
-                ===============
-            -->
-    <target depends="init" if="have.sources" name="-javadoc-build">
-        <mkdir dir="${dist.javadoc.dir}"/>
-        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
-            <classpath>
-                <path path="${javac.classpath}"/>
-            </classpath>
-            <fileset dir="${src.core.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.core-data.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.core-plugins.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.terrain.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.networking.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.desktop.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.desktop-fx.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.games.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.jbullet.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.niftygui.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.jogg.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.lwjgl-oal.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.lwjgl-ogl.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.ogre.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.blender.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.pack.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.jheora.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.test.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.tools.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${src.xml.dir}" excludes="*.java,${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
-                <include name="**/*.java"/>
-                <exclude name="*.java"/>
-            </fileset>
-        </javadoc>
-        <copy todir="${dist.javadoc.dir}">
-            <fileset dir="${src.core.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.core-data.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.core-plugins.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.terrain.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.networking.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.desktop.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.desktop-fx.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.games.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.jbullet.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.niftygui.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.jogg.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.lwjgl-oal.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.lwjgl-ogl.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.ogre.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.blender.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.pack.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.jheora.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.test.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.tools.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${src.xml.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
-                <include name="**/doc-files/**"/>
-            </fileset>
-        </copy>
-    </target>
-    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
-        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
-    </target>
-    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
-    <!--
-                =========================
-                JUNIT COMPILATION SECTION
-                =========================
-            -->
-    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
-        <mkdir dir="${build.test.classes.dir}"/>
-    </target>
-    <target name="-pre-compile-test">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target if="do.depend.true" name="-compile-test-depend">
-        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.test.dir}"/>
-    </target>
-    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
-        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.test.dir}"/>
-        <copy todir="${build.test.classes.dir}">
-            <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-    </target>
-    <target name="-post-compile-test">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
-    <target name="-pre-compile-test-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
-        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
-        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
-        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.test.dir}" srcdir="${test.test.dir}"/>
-        <copy todir="${build.test.classes.dir}">
-            <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-    </target>
-    <target name="-post-compile-test-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
-    <!--
-                =======================
-                JUNIT EXECUTION SECTION
-                =======================
-            -->
-    <target depends="init" if="have.tests" name="-pre-test-run">
-        <mkdir dir="${build.test.results.dir}"/>
-    </target>
-    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
-        <j2seproject3:junit testincludes="**/*Test.java"/>
-    </target>
-    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
-        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
-    </target>
-    <target depends="init" if="have.tests" name="test-report"/>
-    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
-    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
-    <target depends="init" if="have.tests" name="-pre-test-run-single">
-        <mkdir dir="${build.test.results.dir}"/>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
-        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
-        <j2seproject3:junit excludes="" includes="${test.includes}"/>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
-        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
-    <!--
-                =======================
-                JUNIT DEBUGGING SECTION
-                =======================
-            -->
-    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
-        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
-        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
-        <delete file="${test.report.file}"/>
-        <mkdir dir="${build.test.results.dir}"/>
-        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
-            <customize>
-                <syspropertyset>
-                    <propertyref prefix="test-sys-prop."/>
-                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                </syspropertyset>
-                <arg value="${test.class}"/>
-                <arg value="showoutput=true"/>
-                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
-                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
-            </customize>
-        </j2seproject3:debug>
-    </target>
-    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
-        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
-    </target>
-    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
-    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
-        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
-    </target>
-    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
-    <!--
-                =========================
-                APPLET EXECUTION SECTION
-                =========================
-            -->
-    <target depends="init,compile-single" name="run-applet">
-        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
-        <j2seproject1:java classname="sun.applet.AppletViewer">
-            <customize>
-                <arg value="${applet.url}"/>
-            </customize>
-        </j2seproject1:java>
-    </target>
-    <!--
-                =========================
-                APPLET DEBUGGING  SECTION
-                =========================
-            -->
-    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
-        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
-        <j2seproject3:debug classname="sun.applet.AppletViewer">
-            <customize>
-                <arg value="${applet.url}"/>
-            </customize>
-        </j2seproject3:debug>
-    </target>
-    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
-    <!--
-                ===============
-                CLEANUP SECTION
-                ===============
-            -->
-    <target name="-deps-clean-init" unless="built-clean.properties">
-        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
-        <delete file="${built-clean.properties}" quiet="true"/>
-    </target>
-    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
-        <echo level="warn" message="Cycle detected: jMonkeyEngine3 was already built"/>
-    </target>
-    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
-        <mkdir dir="${build.dir}"/>
-        <touch file="${built-clean.properties}" verbose="false"/>
-        <property file="${built-clean.properties}" prefix="already.built.clean."/>
-        <antcall target="-warn-already-built-clean"/>
-        <propertyfile file="${built-clean.properties}">
-            <entry key="${basedir}" value=""/>
-        </propertyfile>
-    </target>
-    <target depends="init" name="-do-clean">
-        <delete dir="${build.dir}"/>
-        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
-    </target>
-    <target name="-post-clean">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
-    <target name="-check-call-dep">
-        <property file="${call.built.properties}" prefix="already.built."/>
-        <condition property="should.call.dep">
-            <not>
-                <isset property="already.built.${call.subproject}"/>
-            </not>
-        </condition>
-    </target>
-    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
-        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
-            <propertyset>
-                <propertyref prefix="transfer."/>
-                <mapper from="transfer.*" to="*" type="glob"/>
-            </propertyset>
-        </ant>
-    </target>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - junit compilation
+  - junit execution
+  - junit debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="jMonkeyEngine3-impl">
+    <import file="jnlp-impl.xml"/>
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target name="-pre-init-libraries">
+        <property location="./lib/nblibraries.properties" name="libraries.path"/>
+        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
+        <pathconvert dirsep="/" property="libraries.dir">
+            <path path="${libraries.dir.nativedirsep}"/>
+        </pathconvert>
+        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
+        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
+    </target>
+    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
+        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
+            <filterchain>
+                <replacestring from="$${base}" to="${libraries.dir}"/>
+                <escapeunicode/>
+            </filterchain>
+        </loadproperties>
+    </target>
+    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
+        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
+            <filterchain>
+                <replacestring from="$${base}" to="${libraries.dir}"/>
+                <escapeunicode/>
+            </filterchain>
+        </loadproperties>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
+        <condition property="main.class.available">
+            <and>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class">
+            <and>
+                <isset property="manifest.available"/>
+                <isset property="main.class.available"/>
+            </and>
+        </condition>
+        <condition property="do.archive">
+            <not>
+                <istrue value="${jar.archive.disabled}"/>
+            </not>
+        </condition>
+        <condition property="do.mkdist">
+            <and>
+                <isset property="do.archive"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class+mkdist.available">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available">
+            <and>
+                <isset property="manifest.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available+main.class">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="manifest.available-mkdist.available">
+            <or>
+                <istrue value="${manifest.available}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="manifest.available+main.class-mkdist.available">
+            <or>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="have.tests">
+            <or>
+                <available file="${test.test.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.core.dir}"/>
+                <available file="${src.core-data.dir}"/>
+                <available file="${src.core-plugins.dir}"/>
+                <available file="${src.desktop.dir}"/>
+                <available file="${src.desktop-fx.dir}"/>
+                <available file="${src.terrain.dir}"/>
+                <available file="${src.jbullet.dir}"/>
+                <available file="${src.bullet.dir}"/>
+                <available file="${src.bullet-common.dir}"/>
+                <available file="${src.networking.dir}"/>
+                <available file="${src.niftygui.dir}"/>
+                <available file="${src.jogg.dir}"/>
+                <available file="${src.ogre.dir}"/>
+                <available file="${src.blender.dir}"/>
+                <available file="${src.xml.dir}"/>
+                <available file="${src.tools.dir}"/>
+                <available file="${src.test.dir}"/>
+                <available file="${src.lwjgl.dir}"/>
+                <available file="${src.android.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <property name="runtime.encoding" value="${source.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <length length="0" string="${endorsed.classpath}" when="greater"/>
+        </condition>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <property name="javac.fork" value="${jdkBug6558476}"/>
+        <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.core.dir">Must set src.core.dir</fail>
+        <fail unless="src.core-data.dir">Must set src.core-data.dir</fail>
+        <fail unless="src.core-plugins.dir">Must set src.core-plugins.dir</fail>
+        <fail unless="src.desktop.dir">Must set src.desktop.dir</fail>
+        <fail unless="src.desktop-fx.dir">Must set src.desktop-fx.dir</fail>
+        <fail unless="src.terrain.dir">Must set src.terrain.dir</fail>
+        <fail unless="src.jbullet.dir">Must set src.jbullet.dir</fail>
+        <fail unless="src.bullet.dir">Must set src.bullet.dir</fail>
+        <fail unless="src.bullet-common.dir">Must set src.bullet-common.dir</fail>
+        <fail unless="src.networking.dir">Must set src.networking.dir</fail>
+        <fail unless="src.niftygui.dir">Must set src.niftygui.dir</fail>
+        <fail unless="src.jogg.dir">Must set src.jogg.dir</fail>
+        <fail unless="src.ogre.dir">Must set src.ogre.dir</fail>
+        <fail unless="src.blender.dir">Must set src.blender.dir</fail>
+        <fail unless="src.xml.dir">Must set src.xml.dir</fail>
+        <fail unless="src.tools.dir">Must set src.tools.dir</fail>
+        <fail unless="src.test.dir">Must set src.test.dir</fail>
+        <fail unless="src.lwjgl.dir">Must set src.lwjgl.dir</fail>
+        <fail unless="src.android.dir">Must set src.android.dir</fail>
+        <fail unless="test.test.dir">Must set test.test.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.terrain.dir}:${src.jbullet.dir}:${src.bullet.dir}:${src.bullet-common.dir}:${src.networking.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.ogre.dir}:${src.blender.dir}:${src.xml.dir}:${src.tools.dir}:${src.test.dir}:${src.lwjgl.dir}:${src.android.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.terrain.dir}:${src.jbullet.dir}:${src.bullet.dir}:${src.bullet-common.dir}:${src.networking.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.ogre.dir}:${src.blender.dir}:${src.xml.dir}:${src.tools.dir}:${src.test.dir}:${src.lwjgl.dir}:${src.android.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.terrain.dir}:${src.jbullet.dir}:${src.bullet.dir}:${src.bullet-common.dir}:${src.networking.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.ogre.dir}:${src.blender.dir}:${src.xml.dir}:${src.tools.dir}:${src.test.dir}:${src.lwjgl.dir}:${src.android.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-junit">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
+    <target name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <pathconvert pathsep=" " property="jar.classpath">
+                    <path path="${run.classpath.without.build.classes.dir}"/>
+                    <chainedmapper>
+                        <flattenmapper/>
+                        <globmapper from="*" to="lib/*"/>
+                    </chainedmapper>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}"/>
+                    <manifest>
+                        <attribute name="Class-Path" value="${jar.classpath}"/>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+                <j2seproject1:fileset dir="${build.classes.dir}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.processor.options" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target name="-deps-jar-init" unless="built-jar.properties">
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+        <delete file="${built-jar.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+        <echo level="warn" message="Cycle detected: jMonkeyEngine3 was already built"/>
+    </target>
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-jar.properties}" verbose="false"/>
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>
+        <antcall target="-warn-already-built-jar"/>
+        <propertyfile file="${built-jar.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+    <target depends="init" name="-check-automatic-build">
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+    </target>
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+        <antcall target="clean"/>
+    </target>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <pathconvert property="build.generated.subdirs">
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="*"/>
+            </dirset>
+        </pathconvert>
+        <j2seproject3:depend srcdir="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.terrain.dir}:${src.jbullet.dir}:${src.bullet.dir}:${src.bullet-common.dir}:${src.networking.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.ogre.dir}:${src.blender.dir}:${src.xml.dir}:${src.tools.dir}:${src.test.dir}:${src.lwjgl.dir}:${src.android.dir}:${build.generated.subdirs}"/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.core.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.core-data.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.core-plugins.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.desktop.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.desktop-fx.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.terrain.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.jbullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.bullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.bullet-common.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.networking.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.niftygui.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.jogg.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.ogre.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.blender.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.xml.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.tools.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.lwjgl.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.android.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy todir="${build.classes.dir}/META-INF">
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.terrain.dir}:${src.jbullet.dir}:${src.bullet.dir}:${src.bullet-common.dir}:${src.networking.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.ogre.dir}:${src.blender.dir}:${src.xml.dir}:${src.tools.dir}:${src.test.dir}:${src.lwjgl.dir}:${src.android.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
+        <j2seproject1:jar/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}">
+            <j2seproject1:manifest>
+                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+            </j2seproject1:manifest>
+        </j2seproject1:jar>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
+        <basename file="${application.splash}" property="splashscreen.basename"/>
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <!--
+                =========================
+                APPLET PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <!--
+                =========================
+                TESTS PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" if="have.sources" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.core.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.core-data.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.core-plugins.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.desktop.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.desktop-fx.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.terrain.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.jbullet.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.bullet.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.bullet-common.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.networking.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.niftygui.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.jogg.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.ogre.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.blender.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.xml.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.tools.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.test.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.lwjgl.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.android.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+                <exclude name="*.java"/>
+            </fileset>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.core.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.core-data.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.core-plugins.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.desktop.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.desktop-fx.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.terrain.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.jbullet.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.bullet.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.bullet-common.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.networking.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.niftygui.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.jogg.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.ogre.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.blender.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.xml.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.tools.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.test.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.lwjgl.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.android.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                JUNIT COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-test-depend">
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.test.dir}"/>
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.test.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.test.dir}" srcdir="${test.test.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                =======================
+                JUNIT EXECUTION SECTION
+                =======================
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <j2seproject3:junit testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <j2seproject3:junit excludes="" includes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <!--
+                =======================
+                JUNIT DEBUGGING SECTION
+                =======================
+            -->
+    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+        <delete file="${test.report.file}"/>
+        <mkdir dir="${build.test.results.dir}"/>
+        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
+            <customize>
+                <syspropertyset>
+                    <propertyref prefix="test-sys-prop."/>
+                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                </syspropertyset>
+                <arg value="${test.class}"/>
+                <arg value="showoutput=true"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                =========================
+                APPLET EXECUTION SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" name="run-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+                =========================
+                APPLET DEBUGGING  SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject3:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+    <!--
+                ===============
+                CLEANUP SECTION
+                ===============
+            -->
+    <target name="-deps-clean-init" unless="built-clean.properties">
+        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+        <delete file="${built-clean.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+        <echo level="warn" message="Cycle detected: jMonkeyEngine3 was already built"/>
+    </target>
+    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-clean.properties}" verbose="false"/>
+        <property file="${built-clean.properties}" prefix="already.built.clean."/>
+        <antcall target="-warn-already-built-clean"/>
+        <propertyfile file="${built-clean.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init" name="-do-clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target name="-check-call-dep">
+        <property file="${call.built.properties}" prefix="already.built."/>
+        <condition property="should.call.dep">
+            <not>
+                <isset property="already.built.${call.subproject}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+            <propertyset>
+                <propertyref prefix="transfer."/>
+                <mapper from="transfer.*" to="*" type="glob"/>
+            </propertyset>
+        </ant>
+    </target>
+</project>

+ 35 - 0
engine/nbproject/bullet-native.properties

@@ -0,0 +1,35 @@
+#####################################################
+# these are the ant build properties for bullet-jme #
+#####################################################
+bullet.library.name=bulletjme
+bullet.library.version=0.9
+
+# change if bullet folder has different location
+bullet.folder=../bullet-2.79
+
+# compile options
+bullet.compile.debug=false
+
+# native library compilation options
+bullet.osx.compiler=g++
+bullet.osx.syslibroot=/Developer/SDKs/MacOSX10.6.sdk
+# change this to msvc for MS Visual Studio compiler
+bullet.windows.compiler=g++
+bullet.linux.compiler=g++
+bullet.solaris.compiler=g++
+# native header include directories
+bullet.java.include=${java.home}/../include
+# OSX has no JRE, only JDK
+bullet.osx.java.include=/System/Library/Frameworks/JavaVM.framework/Headers
+
+# location of Android NDK
+ndk.dir=/opt/android-ndk-r7
+
+# dont change these..
+bullet.bullet.include=${bullet.folder}/src
+bullet.build.dir=build/bullet/
+bullet.source.dir=src/bullet-native
+bullet.output.base=lib/bullet
+bullet.output.dir=${bullet.output.base}/jarcontent/native
+bullet.jme.dir=dist
+bullet.lib.dir=dist/lib

+ 11 - 11
engine/nbproject/genfiles.properties

@@ -1,11 +1,11 @@
-build.xml.data.CRC32=52f8cb9e
-build.xml.script.CRC32=34d4c2f2
-build.xml.stylesheet.CRC32=958a1d3e
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=8a1eda4b
-nbproject/build-impl.xml.script.CRC32=fc0d2890
-nbproject/[email protected]
-nbproject/profiler-build-impl.xml.data.CRC32=aff514c1
-nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
-nbproject/[email protected]
+build.xml.data.CRC32=52f8cb9e
+build.xml.script.CRC32=34d4c2f2
+build.xml.stylesheet.CRC32=958a1d3e
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=3272ce3a
+nbproject/build-impl.xml.script.CRC32=d1b33dd7
+nbproject/[email protected]
+nbproject/profiler-build-impl.xml.data.CRC32=aff514c1
+nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
+nbproject/[email protected]

+ 123 - 114
engine/nbproject/project.properties

@@ -1,114 +1,123 @@
-annotation.processing.enabled=false
-annotation.processing.enabled.in.editor=false
-annotation.processing.run.all.processors=true
-ant.customtasks.libs=JWSAntTasks
-application.homepage=http://www.jmonkeyengine.com/
-application.title=jMonkeyEngine 3.0
-application.vendor=jMonkeyEngine
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
-    ${run.classpath}
-debug.test.classpath=\
-    ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/jMonkeyEngine3.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-file.reference.src-test-data=src/test-data
-includes=**
-jar.archive.disabled=${jnlp.enabled}
-jar.compress=true
-jar.index=${jnlp.enabled}
-javac.classpath=\
-    ${libs.jogg.classpath}:\
-    ${libs.jbullet.classpath}:\
-    ${libs.bullet.classpath}:\
-    ${libs.lwjgl.classpath}:\
-    ${libs.jheora.classpath}:\
-    ${libs.niftygui1.3.classpath}:\
-    ${libs.jme3-test-data.classpath}:\
-    ${libs.noise.classpath}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.processorpath=\
-    ${javac.classpath}
-javac.source=1.5
-javac.target=1.5
-javac.test.classpath=\
-    ${javac.classpath}:\
-    ${build.classes.dir}:\
-    ${libs.junit_4.classpath}
-javadoc.additionalparam=-public 
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=jMonkeyEngine3
-jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
-jnlp.applet.class=jme3test.awt.AppHarness
-jnlp.applet.height=300
-jnlp.applet.width=300
-jnlp.codebase.type=user
-jnlp.codebase.user=http://jmonkeyengine.com/javawebstart/
-jnlp.descriptor=application
-jnlp.enabled=false
-jnlp.icon=/Users/normenhansen/Pictures/jme/icons/jme-logo48.png
-jnlp.mixed.code=default
-jnlp.offline-allowed=true
-jnlp.signed=true
-jnlp.signing=generated
-jnlp.signing.alias=
-jnlp.signing.keystore=
-main.class=jme3test.TestChooser
-manifest.file=MANIFEST.MF
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=default_platform
-run.classpath=\
-    ${javac.classpath}:\
-    ${build.classes.dir}
-run.jvmargs=-Xms128m -Xmx128m -XX:MaxDirectMemorySize=256M
-run.test.classpath=\
-    ${javac.test.classpath}:\
-    ${build.test.classes.dir}
-source.encoding=UTF-8
-src.blender.dir=src/blender
-src.core-data.dir=src/core-data
-src.core-plugins.dir=src/core-plugins
-src.core.dir=src/core
-src.desktop-fx.dir=src/desktop-fx
-src.desktop.dir=src/desktop
-src.games.dir=src/games
-src.jbullet.dir=src/jbullet
-src.jheora.dir=src/jheora
-src.jogg.dir=src/jogg
-src.lwjgl-oal.dir=src/lwjgl-oal
-src.lwjgl-ogl.dir=src/lwjgl-ogl
-src.networking.dir=src\\networking
-src.niftygui.dir=src/niftygui
-src.ogre.dir=src/ogre
-src.pack.dir=src/pack
-src.terrain.dir=src/terrain
-src.test.dir=src/test
-src.tools.dir=src/tools
-src.xml.dir=src/xml
-test.test.dir=test
+annotation.processing.enabled=false
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+ant.customtasks.libs=JWSAntTasks
+application.homepage=http://www.jmonkeyengine.com/
+application.title=jMonkeyEngine 3.0
+application.vendor=jMonkeyEngine
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/jMonkeyEngine3.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.src-test-data=src/test-data
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=true
+jar.index=${jnlp.enabled}
+javac.classpath=\
+    ${libs.jogg.classpath}:\
+    ${libs.jbullet.classpath}:\
+    ${libs.lwjgl.classpath}:\
+    ${libs.niftygui1.3.classpath}:\
+    ${libs.jme3-test-data.classpath}:\
+    ${libs.noise.classpath}:\
+    ${libs.android.classpath}:\
+    ${libs.bullet.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+    ${javac.classpath}
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit_4.classpath}
+javadoc.additionalparam=-public 
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=jMonkeyEngine3
+jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
+jnlp.applet.class=jme3test.awt.AppHarness
+jnlp.applet.height=300
+jnlp.applet.width=300
+jnlp.codebase.type=user
+jnlp.codebase.user=http://jmonkeyengine.com/javawebstart/
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.icon=/Users/normenhansen/Pictures/jme/icons/jme-logo48.png
+jnlp.mixed.code=default
+jnlp.offline-allowed=true
+jnlp.signed=true
+jnlp.signing=generated
+jnlp.signing.alias=
+jnlp.signing.keystore=
+main.class=jme3test.TestChooser
+manifest.file=MANIFEST.MF
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.dir}/core:\
+    ${build.dir}/plugins:\
+    ${build.dir}/desktop:\
+    ${build.dir}/blender:\
+    ${build.dir}/terrain:\
+    ${build.dir}/jbullet:\
+    ${build.dir}/bullet:\
+    ${build.dir}/niftygui:\
+    ${build.dir}/lwjgl:\
+    ${build.dir}/android:\
+    ${build.classes.dir}
+run.jvmargs=-Xms128m -Xmx128m -XX:MaxDirectMemorySize=256M
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.android.dir=src/android
+src.blender.dir=src/blender
+src.bullet-common.dir=src/bullet-common
+src.bullet.dir=src/bullet
+src.core-data.dir=src/core-data
+src.core-plugins.dir=src/core-plugins
+src.core.dir=src/core
+src.desktop-fx.dir=src/desktop-fx
+src.desktop.dir=src/desktop
+src.jbullet.dir=src/jbullet
+src.jogg.dir=src/jogg
+src.lwjgl.dir=src/lwjgl
+src.networking.dir=src\\networking
+src.niftygui.dir=src/niftygui
+src.ogre.dir=src/ogre
+src.terrain.dir=src/terrain
+src.test.dir=src/test
+src.tools.dir=src/tools
+src.xml.dir=src/xml
+test.test.dir=test

+ 9 - 10
engine/nbproject/project.xml

@@ -14,23 +14,22 @@
                 <root id="src.core.dir" name="Core"/>
                 <root id="src.core-data.dir" name="Core-Data"/>
                 <root id="src.core-plugins.dir" name="Core-Plugins"/>
-                <root id="src.terrain.dir" name="Terrain"/>
-                <root id="src.networking.dir" name="Networking"/>
                 <root id="src.desktop.dir" name="Desktop"/>
                 <root id="src.desktop-fx.dir" name="Desktop-FX"/>
-                <root id="src.games.dir" name="Games"/>
-                <root id="src.jbullet.dir" name="JBullet"/>
+                <root id="src.terrain.dir" name="Terrain"/>
+                <root id="src.jbullet.dir" name="Java Bullet"/>
+                <root id="src.bullet.dir" name="Native Bullet"/>
+                <root id="src.bullet-common.dir" name="Bullet Common"/>
+                <root id="src.networking.dir" name="Networking"/>
                 <root id="src.niftygui.dir" name="NiftyGUI"/>
                 <root id="src.jogg.dir" name="JOGG"/>
-                <root id="src.lwjgl-oal.dir" name="LWJGL-OAL"/>
-                <root id="src.lwjgl-ogl.dir" name="LWJGL-OGL"/>
                 <root id="src.ogre.dir" name="Ogre"/>
                 <root id="src.blender.dir" name="Blender"/>
-                <root id="src.pack.dir" name="Pack"/>
-                <root id="src.jheora.dir" name="Jheora"/>
-                <root id="src.test.dir" name="Test"/>
-                <root id="src.tools.dir" name="Tools"/>
                 <root id="src.xml.dir" name="XML"/>
+                <root id="src.tools.dir" name="Tools"/>
+                <root id="src.test.dir" name="Test"/>
+                <root id="src.lwjgl.dir" name="LWJGL Renderer"/>
+                <root id="src.android.dir" name="Android Renderer"/>
             </source-roots>
             <test-roots>
                 <root id="test.test.dir" name="Unit Test"/>

+ 4 - 8
engine/src/android/com/jme3/app/AndroidHarness.java

@@ -3,7 +3,6 @@ package com.jme3.app;
 import java.util.logging.Handler;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import java.util.logging.SimpleFormatter;
 import com.jme3.util.JmeFormatter;
 import android.app.Activity;
 import android.app.AlertDialog;
@@ -12,22 +11,18 @@ import android.content.pm.ActivityInfo;
 import android.opengl.GLSurfaceView;
 import android.os.Bundle;
 import android.view.Display;
-import android.view.SurfaceView;
-import android.view.View;
 import android.view.Window;
 import android.view.WindowManager;
 import android.widget.TextView;
 
-import com.jme3.app.Application;
-import com.jme3.input.TouchInput;
 import com.jme3.input.android.AndroidInput;
 import com.jme3.input.controls.TouchListener;
-import com.jme3.input.controls.TouchTrigger;
 import com.jme3.input.event.TouchEvent;
 import com.jme3.system.AppSettings;
 import com.jme3.system.JmeSystem;
 import com.jme3.system.android.OGLESContext;
 import com.jme3.system.android.AndroidConfigChooser.ConfigType;
+import com.jme3.system.android.JmeAndroidSystem;
 
 /**
  * <code>AndroidHarness</code> wraps a jme application object and runs it on Android
@@ -115,6 +110,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
             System.loadLibrary("bulletjme");
         } catch (UnsatisfiedLinkError e) {
         }
+        JmeSystem.setSystemDelegate(new JmeAndroidSystem());
     }
 
     @Override
@@ -136,8 +132,8 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
             }
         } while (log != null && !bIsLogFormatSet);
 
-        JmeSystem.setResources(getResources());
-        JmeSystem.setActivity(this);
+        JmeAndroidSystem.setResources(getResources());
+        JmeAndroidSystem.setActivity(this);
 
         if (screenFullScreen) {
             requestWindowFeature(Window.FEATURE_NO_TITLE);

+ 2 - 3
engine/src/android/com/jme3/asset/plugins/AndroidLocator.java

@@ -4,10 +4,9 @@ import android.content.res.Resources;
 import com.jme3.asset.AssetInfo;
 import com.jme3.asset.AssetKey;
 import com.jme3.asset.AssetLocator;
-import com.jme3.system.JmeSystem;
+import com.jme3.system.android.JmeAndroidSystem;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
 public class AndroidLocator implements AssetLocator {
@@ -36,7 +35,7 @@ public class AndroidLocator implements AssetLocator {
 
     public AndroidLocator()
     {
-        resources = JmeSystem.getResources();
+        resources = JmeAndroidSystem.getResources();
         androidManager = resources.getAssets();
     }
     

+ 53 - 60
engine/src/android/com/jme3/system/JmeSystem.java → engine/src/android/com/jme3/system/android/JmeAndroidSystem.java

@@ -1,99 +1,76 @@
-package com.jme3.system;
+package com.jme3.system.android;
 
 import android.app.Activity;
 import android.content.res.Resources;
+import com.jme3.system.AppSettings;
+import com.jme3.system.JmeContext;
+import com.jme3.system.Platform;
 import com.jme3.util.AndroidLogHandler;
 import com.jme3.asset.AndroidAssetManager;
 import com.jme3.asset.AssetManager;
 import com.jme3.audio.AudioRenderer;
 import com.jme3.audio.android.AndroidAudioRenderer;
-//import com.jme3.audio.DummyAudioRenderer;
 import com.jme3.system.JmeContext.Type;
-import com.jme3.system.android.OGLESContext;
+import com.jme3.system.JmeSystemDelegate;
 import com.jme3.util.JmeFormatter;
 import java.util.logging.Handler;
 import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import java.net.URL;
 
-public class JmeSystem {
+public class JmeAndroidSystem extends JmeSystemDelegate{
 
-    private static final Logger logger = Logger.getLogger(JmeSystem.class.getName());
-    private static boolean initialized = false;
-    private static boolean lowPermissions = false;
     private static Resources res;
     private static Activity activity;
 
-    public static void initialize(AppSettings settings) {
-        if (initialized) {
-            return;
-        }
-
-        initialized = true;
-        try {
-            JmeFormatter formatter = new JmeFormatter();
-
-            Handler consoleHandler = new AndroidLogHandler();
-            consoleHandler.setFormatter(formatter);
-        } catch (SecurityException ex) {
-            logger.log(Level.SEVERE, "Security error in creating log file", ex);
-        }
-        logger.log(Level.INFO, "Running on {0}", getFullName());
-    }
-
-    public static String getFullName() {
-        return "jMonkeyEngine 3.0.0 Beta (Android)";
+    @Override
+    public AssetManager newAssetManager(URL configFile) {
+        logger.log(Level.INFO, "newAssetManager({0})", configFile);
+        return new AndroidAssetManager(configFile);
     }
 
-    public static void setLowPermissions(boolean lowPerm) {
-        lowPermissions = lowPerm;
+    @Override
+    public AssetManager newAssetManager() {
+        logger.log(Level.INFO, "newAssetManager()");
+        return new AndroidAssetManager(null);
     }
 
-    public static boolean isLowPermissions() {
-        return lowPermissions;
+    @Override
+    public boolean showSettingsDialog(AppSettings sourceSettings, boolean loadFromRegistry) {
+        return true;
     }
 
-    public static JmeContext newContext(AppSettings settings, Type contextType) {
+    @Override
+    public JmeContext newContext(AppSettings settings, Type contextType) {
         initialize(settings);
         return new OGLESContext();
     }
 
-    public static AudioRenderer newAudioRenderer(AppSettings settings) {
+    @Override
+    public AudioRenderer newAudioRenderer(AppSettings settings) {
         return new AndroidAudioRenderer(activity);
     }
 
-    public static void setResources(Resources res) {
-        JmeSystem.res = res;
-    }
-
-    public static Resources getResources() {
-        return res;
-    }
-
-    public static void setActivity(Activity activity) {
-        JmeSystem.activity = activity;
-    }
-
-    public static Activity getActivity() {
-        return activity;
-    }
-
-    public static AssetManager newAssetManager() {
-        logger.log(Level.INFO, "newAssetManager()");
-        return new AndroidAssetManager(null);
-    }
+    @Override
+    public void initialize(AppSettings settings) {
+        if (initialized) {
+            return;
+        }
 
-    public static AssetManager newAssetManager(URL url) {
-        logger.log(Level.INFO, "newAssetManager({0})", url);
-        return new AndroidAssetManager(url);
-    }
+        initialized = true;
+        try {
+            JmeFormatter formatter = new JmeFormatter();
 
-    public static boolean showSettingsDialog(AppSettings settings, boolean loadSettings) {
-        return true;
+            Handler consoleHandler = new AndroidLogHandler();
+            consoleHandler.setFormatter(formatter);
+        } catch (SecurityException ex) {
+            logger.log(Level.SEVERE, "Security error in creating log file", ex);
+        }
+        logger.log(Level.INFO, "Running on {0}", getFullName());
     }
 
-    public static Platform getPlatform() {
+    @Override
+    public Platform getPlatform() {
         String arch = System.getProperty("os.arch").toLowerCase();
         if (arch.contains("arm")){
             if (arch.contains("v5")){
@@ -109,4 +86,20 @@ public class JmeSystem {
             throw new UnsupportedOperationException("Unsupported Android Platform");
         }
     }
+    
+    public static void setResources(Resources res) {
+        JmeAndroidSystem.res = res;
+    }
+
+    public static Resources getResources() {
+        return res;
+    }
+
+    public static void setActivity(Activity activity) {
+        JmeAndroidSystem.activity = activity;
+    }
+
+    public static Activity getActivity() {
+        return activity;
+    }
 }

+ 0 - 0
engine/src/bullet/com/jme3/bullet/BulletAppState.java → engine/src/bullet-common/com/jme3/bullet/BulletAppState.java


+ 0 - 0
engine/src/bullet/com/jme3/bullet/PhysicsTickListener.java → engine/src/bullet-common/com/jme3/bullet/PhysicsTickListener.java


+ 0 - 0
engine/src/bullet/com/jme3/bullet/collision/PhysicsCollisionGroupListener.java → engine/src/bullet-common/com/jme3/bullet/collision/PhysicsCollisionGroupListener.java


+ 0 - 0
engine/src/bullet/com/jme3/bullet/collision/PhysicsCollisionListener.java → engine/src/bullet-common/com/jme3/bullet/collision/PhysicsCollisionListener.java


+ 0 - 0
engine/src/bullet/com/jme3/bullet/collision/RagdollCollisionListener.java → engine/src/bullet-common/com/jme3/bullet/collision/RagdollCollisionListener.java


+ 50 - 0
engine/src/bullet-common/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java

@@ -0,0 +1,50 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.collision.shapes.infos;
+
+import com.jme3.bullet.collision.shapes.BoxCollisionShape;
+import com.jme3.bullet.collision.shapes.CollisionShape;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.export.Savable;
+import com.jme3.math.Matrix3f;
+import com.jme3.math.Vector3f;
+import java.io.IOException;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class ChildCollisionShape implements Savable {
+
+    public Vector3f location;
+    public Matrix3f rotation;
+    public CollisionShape shape;
+
+    public ChildCollisionShape() {
+    }
+
+    public ChildCollisionShape(Vector3f location, Matrix3f rotation, CollisionShape shape) {
+        this.location = location;
+        this.rotation = rotation;
+        this.shape = shape;
+    }
+
+    public void write(JmeExporter ex) throws IOException {
+        OutputCapsule capsule = ex.getCapsule(this);
+        capsule.write(location, "location", new Vector3f());
+        capsule.write(rotation, "rotation", new Matrix3f());
+        capsule.write(shape, "shape", new BoxCollisionShape(new Vector3f(1, 1, 1)));
+    }
+
+    public void read(JmeImporter im) throws IOException {
+        InputCapsule capsule = im.getCapsule(this);
+        location = (Vector3f) capsule.readSavable("location", new Vector3f());
+        rotation = (Matrix3f) capsule.readSavable("rotation", new Matrix3f());
+        shape = (CollisionShape) capsule.readSavable("shape", new BoxCollisionShape(new Vector3f(1, 1, 1)));
+    }
+}

+ 208 - 0
engine/src/bullet-common/com/jme3/bullet/control/CharacterControl.java

@@ -0,0 +1,208 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control;
+
+import com.jme3.bullet.PhysicsSpace;
+import com.jme3.bullet.collision.shapes.CollisionShape;
+import com.jme3.bullet.objects.PhysicsCharacter;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.ViewPort;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.control.Control;
+import java.io.IOException;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class CharacterControl extends PhysicsCharacter implements PhysicsControl {
+
+    protected Spatial spatial;
+    protected boolean enabled = true;
+    protected boolean added = false;
+    protected PhysicsSpace space = null;
+    protected Vector3f viewDirection = new Vector3f(Vector3f.UNIT_Z);
+    protected boolean useViewDirection = true;
+    protected boolean applyLocal = false;
+
+    public CharacterControl() {
+    }
+
+    public CharacterControl(CollisionShape shape, float stepHeight) {
+        super(shape, stepHeight);
+    }
+
+    public boolean isApplyPhysicsLocal() {
+        return applyLocal;
+    }
+
+    /**
+     * When set to true, the physics coordinates will be applied to the local
+     * translation of the Spatial
+     * @param applyPhysicsLocal
+     */
+    public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
+        applyLocal = applyPhysicsLocal;
+    }
+
+    private Vector3f getSpatialTranslation() {
+        if (applyLocal) {
+            return spatial.getLocalTranslation();
+        }
+        return spatial.getWorldTranslation();
+    }
+
+    public Control cloneForSpatial(Spatial spatial) {
+        CharacterControl control = new CharacterControl(collisionShape, stepHeight);
+        control.setCcdMotionThreshold(getCcdMotionThreshold());
+        control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());
+        control.setCollideWithGroups(getCollideWithGroups());
+        control.setCollisionGroup(getCollisionGroup());
+        control.setFallSpeed(getFallSpeed());
+        control.setGravity(getGravity());
+        control.setJumpSpeed(getJumpSpeed());
+        control.setMaxSlope(getMaxSlope());
+        control.setPhysicsLocation(getPhysicsLocation());
+        control.setUpAxis(getUpAxis());
+        control.setApplyPhysicsLocal(isApplyPhysicsLocal());
+
+        control.setSpatial(spatial);
+        return control;
+    }
+
+    public void setSpatial(Spatial spatial) {
+        if (getUserObject() == null || getUserObject() == this.spatial) {
+            setUserObject(spatial);
+        }
+        this.spatial = spatial;
+        if (spatial == null) {
+            if (getUserObject() == spatial) {
+                setUserObject(null);
+            }
+            return;
+        }
+        setPhysicsLocation(getSpatialTranslation());
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+        if (space != null) {
+            if (enabled && !added) {
+                if (spatial != null) {
+                    warp(getSpatialTranslation());
+                }
+                space.addCollisionObject(this);
+                added = true;
+            } else if (!enabled && added) {
+                space.removeCollisionObject(this);
+                added = false;
+            }
+        }
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public void setViewDirection(Vector3f vec) {
+        viewDirection.set(vec);
+    }
+
+    public Vector3f getViewDirection() {
+        return viewDirection;
+    }
+
+    public boolean isUseViewDirection() {
+        return useViewDirection;
+    }
+
+    public void setUseViewDirection(boolean viewDirectionEnabled) {
+        this.useViewDirection = viewDirectionEnabled;
+    }
+
+    public void update(float tpf) {
+        if (enabled && spatial != null) {
+            Quaternion localRotationQuat = spatial.getLocalRotation();
+            Vector3f localLocation = spatial.getLocalTranslation();
+            if (!applyLocal && spatial.getParent() != null) {
+                getPhysicsLocation(localLocation);
+                localLocation.subtractLocal(spatial.getParent().getWorldTranslation());
+                localLocation.divideLocal(spatial.getParent().getWorldScale());
+                tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation);
+                spatial.setLocalTranslation(localLocation);
+
+                if (useViewDirection) {
+                    localRotationQuat.lookAt(viewDirection, Vector3f.UNIT_Y);
+                    spatial.setLocalRotation(localRotationQuat);
+                }
+            } else {
+                spatial.setLocalTranslation(getPhysicsLocation());
+                localRotationQuat.lookAt(viewDirection, Vector3f.UNIT_Y);
+                spatial.setLocalRotation(localRotationQuat);
+            }
+        }
+    }
+
+    public void render(RenderManager rm, ViewPort vp) {
+        if (enabled && space != null && space.getDebugManager() != null) {
+            if (debugShape == null) {
+                attachDebugShape(space.getDebugManager());
+            }
+            debugShape.setLocalTranslation(getPhysicsLocation());
+            debugShape.updateLogicalState(0);
+            debugShape.updateGeometricState();
+            rm.renderScene(debugShape, vp);
+        }
+    }
+
+    public void setPhysicsSpace(PhysicsSpace space) {
+        if (space == null) {
+            if (this.space != null) {
+                this.space.removeCollisionObject(this);
+                added = false;
+            }
+        } else {
+            if (this.space == space) {
+                return;
+            }
+            space.addCollisionObject(this);
+            added = true;
+        }
+        this.space = space;
+    }
+
+    public PhysicsSpace getPhysicsSpace() {
+        return space;
+    }
+
+    @Override
+    public void write(JmeExporter ex) throws IOException {
+        super.write(ex);
+        OutputCapsule oc = ex.getCapsule(this);
+        oc.write(enabled, "enabled", true);
+        oc.write(applyLocal, "applyLocalPhysics", false);
+        oc.write(useViewDirection, "viewDirectionEnabled", true);
+        oc.write(viewDirection, "viewDirection", new Vector3f(Vector3f.UNIT_Z));
+        oc.write(spatial, "spatial", null);
+    }
+
+    @Override
+    public void read(JmeImporter im) throws IOException {
+        super.read(im);
+        InputCapsule ic = im.getCapsule(this);
+        enabled = ic.readBoolean("enabled", true);
+        useViewDirection = ic.readBoolean("viewDirectionEnabled", true);
+        viewDirection = (Vector3f) ic.readSavable("viewDirection", new Vector3f(Vector3f.UNIT_Z));
+        applyLocal = ic.readBoolean("applyLocalPhysics", false);
+        spatial = (Spatial) ic.readSavable("spatial", null);
+        setUserObject(spatial);
+    }
+}

+ 178 - 0
engine/src/bullet-common/com/jme3/bullet/control/GhostControl.java

@@ -0,0 +1,178 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control;
+
+import com.jme3.bullet.PhysicsSpace;
+import com.jme3.bullet.collision.shapes.CollisionShape;
+import com.jme3.bullet.objects.PhysicsGhostObject;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.ViewPort;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.control.Control;
+import java.io.IOException;
+
+/**
+ * A GhostControl moves with the spatial it is attached to and can be used to check
+ * overlaps with other physics objects (e.g. aggro radius).
+ * @author normenhansen
+ */
+public class GhostControl extends PhysicsGhostObject implements PhysicsControl {
+
+    protected Spatial spatial;
+    protected boolean enabled = true;
+    protected boolean added = false;
+    protected PhysicsSpace space = null;
+    protected boolean applyLocal = false;
+
+    public GhostControl() {
+    }
+
+    public GhostControl(CollisionShape shape) {
+        super(shape);
+    }
+
+    public boolean isApplyPhysicsLocal() {
+        return applyLocal;
+    }
+
+    /**
+     * When set to true, the physics coordinates will be applied to the local
+     * translation of the Spatial
+     * @param applyPhysicsLocal
+     */
+    public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
+        applyLocal = applyPhysicsLocal;
+    }
+
+    private Vector3f getSpatialTranslation() {
+        if (applyLocal) {
+            return spatial.getLocalTranslation();
+        }
+        return spatial.getWorldTranslation();
+    }
+
+    private Quaternion getSpatialRotation() {
+        if (applyLocal) {
+            return spatial.getLocalRotation();
+        }
+        return spatial.getWorldRotation();
+    }
+
+    public Control cloneForSpatial(Spatial spatial) {
+        GhostControl control = new GhostControl(collisionShape);
+        control.setCcdMotionThreshold(getCcdMotionThreshold());
+        control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());
+        control.setCollideWithGroups(getCollideWithGroups());
+        control.setCollisionGroup(getCollisionGroup());
+        control.setPhysicsLocation(getPhysicsLocation());
+        control.setPhysicsRotation(getPhysicsRotationMatrix());
+        control.setApplyPhysicsLocal(isApplyPhysicsLocal());
+
+        control.setSpatial(spatial);
+        return control;
+    }
+
+    public void setSpatial(Spatial spatial) {
+        if (getUserObject() == null || getUserObject() == this.spatial) {
+            setUserObject(spatial);
+        }
+        this.spatial = spatial;
+        if (spatial == null) {
+            if (getUserObject() == spatial) {
+                setUserObject(null);
+            }
+            return;
+        }
+        setPhysicsLocation(getSpatialTranslation());
+        setPhysicsRotation(getSpatialRotation());
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+        if (space != null) {
+            if (enabled && !added) {
+                if (spatial != null) {
+                    setPhysicsLocation(getSpatialTranslation());
+                    setPhysicsRotation(getSpatialRotation());
+                }
+                space.addCollisionObject(this);
+                added = true;
+            } else if (!enabled && added) {
+                space.removeCollisionObject(this);
+                added = false;
+            }
+        }
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public void update(float tpf) {
+        if (!enabled) {
+            return;
+        }
+        setPhysicsLocation(getSpatialTranslation());
+        setPhysicsRotation(getSpatialRotation());
+    }
+
+    public void render(RenderManager rm, ViewPort vp) {
+        if (enabled && space != null && space.getDebugManager() != null) {
+            if (debugShape == null) {
+                attachDebugShape(space.getDebugManager());
+            }
+            debugShape.setLocalTranslation(spatial.getWorldTranslation());
+            debugShape.setLocalRotation(spatial.getWorldRotation());
+            debugShape.updateLogicalState(0);
+            debugShape.updateGeometricState();
+            rm.renderScene(debugShape, vp);
+        }
+    }
+
+    public void setPhysicsSpace(PhysicsSpace space) {
+        if (space == null) {
+            if (this.space != null) {
+                this.space.removeCollisionObject(this);
+                added = false;
+            }
+        } else {
+            if (this.space == space) {
+                return;
+            }
+            space.addCollisionObject(this);
+            added = true;
+        }
+        this.space = space;
+    }
+
+    public PhysicsSpace getPhysicsSpace() {
+        return space;
+    }
+
+    @Override
+    public void write(JmeExporter ex) throws IOException {
+        super.write(ex);
+        OutputCapsule oc = ex.getCapsule(this);
+        oc.write(enabled, "enabled", true);
+        oc.write(applyLocal, "applyLocalPhysics", false);
+        oc.write(spatial, "spatial", null);
+    }
+
+    @Override
+    public void read(JmeImporter im) throws IOException {
+        super.read(im);
+        InputCapsule ic = im.getCapsule(this);
+        enabled = ic.readBoolean("enabled", true);
+        spatial = (Spatial) ic.readSavable("spatial", null);
+        applyLocal = ic.readBoolean("applyLocalPhysics", false);
+        setUserObject(spatial);
+    }
+}

+ 873 - 0
engine/src/bullet-common/com/jme3/bullet/control/KinematicRagdollControl.java

@@ -0,0 +1,873 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.jme3.bullet.control;
+
+import com.jme3.bullet.control.ragdoll.RagdollPreset;
+import com.jme3.bullet.control.ragdoll.HumanoidRagdollPreset;
+import com.jme3.animation.AnimControl;
+import com.jme3.animation.Bone;
+import com.jme3.animation.Skeleton;
+import com.jme3.animation.SkeletonControl;
+import com.jme3.asset.AssetManager;
+import com.jme3.bullet.PhysicsSpace;
+import com.jme3.bullet.collision.PhysicsCollisionEvent;
+import com.jme3.bullet.collision.PhysicsCollisionListener;
+import com.jme3.bullet.collision.PhysicsCollisionObject;
+import com.jme3.bullet.collision.RagdollCollisionListener;
+import com.jme3.bullet.collision.shapes.BoxCollisionShape;
+import com.jme3.bullet.collision.shapes.HullCollisionShape;
+import com.jme3.bullet.control.ragdoll.RagdollUtils;
+import com.jme3.bullet.joints.SixDofJoint;
+import com.jme3.bullet.objects.PhysicsRigidBody;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.ViewPort;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.control.Control;
+import com.jme3.util.TempVars;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**<strong>This control is still a WIP, use it at your own risk</strong><br>
+ * To use this control you need a model with an AnimControl and a SkeletonControl.<br>
+ * This should be the case if you imported an animated model from Ogre or blender.<br>
+ * Note enabling/disabling the control add/removes it from the physic space<br>
+ * <p>
+ * This control creates collision shapes for each bones of the skeleton when you call spatial.addControl(ragdollControl).
+ * <ul>
+ *     <li>The shape is HullCollision shape based on the vertices associated with each bone and based on a tweakable weight threshold (see setWeightThreshold)</li>
+ *     <li>If you don't want each bone to be a collision shape, you can specify what bone to use by using the addBoneName method<br>
+ *         By using this method, bone that are not used to create a shape, are "merged" to their parent to create the collision shape.
+ *     </li>
+ * </ul>
+ *</p>
+ *<p>
+ *There are 2 modes for this control : 
+ * <ul>
+ *     <li><strong>The kinematic modes :</strong><br>
+ *        this is the default behavior, this means that the collision shapes of the body are able to interact with physics enabled objects.
+ *        in this mode physic shapes follow the moovements of the animated skeleton (for example animated by a key framed animation)
+ *        this mode is enabled by calling setKinematicMode();                
+ *     </li>
+ *     <li><strong>The ragdoll modes :</strong><br>
+ *        To enable this behavior, you need to call setRagdollMode() method.
+ *        In this mode the charater is entirely controled by physics, so it will fall under the gravity and move if any force is applied to it.
+ *     </li>
+ * </ul>
+ *</p>
+ *
+ * @author Normen Hansen and Rémy Bouquet (Nehon)
+ */
+public class KinematicRagdollControl implements PhysicsControl, PhysicsCollisionListener {
+
+    protected static final Logger logger = Logger.getLogger(KinematicRagdollControl.class.getName());
+    protected Map<String, PhysicsBoneLink> boneLinks = new HashMap<String, PhysicsBoneLink>();
+    protected Skeleton skeleton;
+    protected PhysicsSpace space;
+    protected boolean enabled = true;
+    protected boolean debug = false;
+    protected PhysicsRigidBody baseRigidBody;
+    protected float weightThreshold = -1.0f;
+    protected Spatial targetModel;
+    protected Vector3f initScale;
+    protected Mode mode = Mode.Kinetmatic;
+    protected boolean blendedControl = false;
+    protected float blendTime = 1.0f;
+    protected float blendStart = 0.0f;
+    protected List<RagdollCollisionListener> listeners;
+    protected float eventDispatchImpulseThreshold = 10;
+    protected RagdollPreset preset = new HumanoidRagdollPreset();
+    protected Set<String> boneList = new TreeSet<String>();
+    protected Vector3f modelPosition = new Vector3f();
+    protected Quaternion modelRotation = new Quaternion();
+    protected float rootMass = 15;
+    protected float totalMass = 0;
+    protected boolean added = false;
+
+    public static enum Mode {
+
+        Kinetmatic,
+        Ragdoll
+    }
+
+    protected class PhysicsBoneLink {
+
+        protected Bone bone;
+        protected Quaternion initalWorldRotation;
+        protected SixDofJoint joint;
+        protected PhysicsRigidBody rigidBody;
+        protected Quaternion startBlendingRot = new Quaternion();
+        protected Vector3f startBlendingPos = new Vector3f();
+    }
+
+    /**
+     * contruct a KinematicRagdollControl
+     */
+    public KinematicRagdollControl() {
+    }
+
+    public KinematicRagdollControl(float weightThreshold) {
+        this.weightThreshold = weightThreshold;
+    }
+
+    public KinematicRagdollControl(RagdollPreset preset, float weightThreshold) {
+        this.preset = preset;
+        this.weightThreshold = weightThreshold;
+    }
+
+    public KinematicRagdollControl(RagdollPreset preset) {
+        this.preset = preset;
+    }
+
+    public void update(float tpf) {
+        if (!enabled) {
+            return;
+        }
+        TempVars vars = TempVars.get();
+        
+        Quaternion tmpRot1 = vars.quat1;
+        Quaternion tmpRot2 = vars.quat2;
+
+        //if the ragdoll has the control of the skeleton, we update each bone with its position in physic world space.
+        if (mode == mode.Ragdoll && targetModel.getLocalTranslation().equals(modelPosition)) {
+            for (PhysicsBoneLink link : boneLinks.values()) {
+
+                Vector3f position = vars.vect1;
+
+                //retrieving bone position in physic world space
+                Vector3f p = link.rigidBody.getMotionState().getWorldLocation();
+                //transforming this position with inverse transforms of the model
+                targetModel.getWorldTransform().transformInverseVector(p, position);
+
+                //retrieving bone rotation in physic world space
+                Quaternion q = link.rigidBody.getMotionState().getWorldRotationQuat();
+
+                //multiplying this rotation by the initialWorld rotation of the bone, 
+                //then transforming it with the inverse world rotation of the model
+                tmpRot1.set(q).multLocal(link.initalWorldRotation);
+                tmpRot2.set(targetModel.getWorldRotation()).inverseLocal().mult(tmpRot1, tmpRot1);
+                tmpRot1.normalizeLocal();
+
+                //if the bone is the root bone, we apply the physic's transform to the model, so its position and rotation are correctly updated
+                if (link.bone.getParent() == null) {
+
+                    //offsetting the physic's position/rotation by the root bone inverse model space position/rotaion
+                    modelPosition.set(p).subtractLocal(link.bone.getWorldBindPosition());
+                    targetModel.getParent().getWorldTransform().transformInverseVector(modelPosition, modelPosition);
+                    modelRotation.set(q).multLocal(tmpRot2.set(link.bone.getWorldBindRotation()).inverseLocal());
+
+
+                    //applying transforms to the model
+                    targetModel.setLocalTranslation(modelPosition);
+
+                    targetModel.setLocalRotation(modelRotation);
+
+                    //Applying computed transforms to the bone
+                    link.bone.setUserTransformsWorld(position, tmpRot1);
+
+                } else {
+                    //if boneList is empty, this means that every bone in the ragdoll has a collision shape,
+                    //so we just update the bone position
+                    if (boneList.isEmpty()) {
+                        link.bone.setUserTransformsWorld(position, tmpRot1);
+                    } else {
+                        //boneList is not empty, this means some bones of the skeleton might not be associated with a collision shape.
+                        //So we update them recusively
+                        RagdollUtils.setTransform(link.bone, position, tmpRot1, false, boneList);
+                    }
+                }
+            }
+        } else {
+            //the ragdoll does not have the controll, so the keyframed animation updates the physic position of the physic bonces
+            for (PhysicsBoneLink link : boneLinks.values()) {
+
+                Vector3f position = vars.vect1;
+
+                //if blended control this means, keyframed animation is updating the skeleton, 
+                //but to allow smooth transition, we blend this transformation with the saved position of the ragdoll
+                if (blendedControl) {
+                    Vector3f position2 = vars.vect2;
+                    //initializing tmp vars with the start position/rotation of the ragdoll
+                    position.set(link.startBlendingPos);
+                    tmpRot1.set(link.startBlendingRot);
+
+                    //interpolating between ragdoll position/rotation and keyframed position/rotation
+                    tmpRot2.set(tmpRot1).nlerp(link.bone.getModelSpaceRotation(), blendStart / blendTime);
+                    position2.set(position).interpolate(link.bone.getModelSpacePosition(), blendStart / blendTime);
+                    tmpRot1.set(tmpRot2);
+                    position.set(position2);
+
+                    //updating bones transforms
+                    if (boneList.isEmpty()) {
+                        //we ensure we have the control to update the bone
+                        link.bone.setUserControl(true);
+                        link.bone.setUserTransformsWorld(position, tmpRot1);
+                        //we give control back to the key framed animation.
+                        link.bone.setUserControl(false);
+                    } else {
+                        RagdollUtils.setTransform(link.bone, position, tmpRot1, true, boneList);
+                    }
+
+                }
+                //setting skeleton transforms to the ragdoll
+                matchPhysicObjectToBone(link, position, tmpRot1);
+                modelPosition.set(targetModel.getLocalTranslation());
+
+            }
+
+            //time control for blending
+            if (blendedControl) {
+                blendStart += tpf;
+                if (blendStart > blendTime) {
+                    blendedControl = false;
+                }
+            }
+        }
+        vars.release();
+
+    }
+
+    /**
+     * Set the transforms of a rigidBody to match the transforms of a bone.
+     * this is used to make the ragdoll follow the skeleton motion while in Kinematic mode
+     * @param link the link containing the bone and the rigidBody
+     * @param position just a temp vector for position
+     * @param tmpRot1  just a temp quaternion for rotation
+     */
+    private void matchPhysicObjectToBone(PhysicsBoneLink link, Vector3f position, Quaternion tmpRot1) {
+        //computing position from rotation and scale
+        targetModel.getWorldTransform().transformVector(link.bone.getModelSpacePosition(), position);
+
+        //computing rotation
+        tmpRot1.set(link.bone.getModelSpaceRotation()).multLocal(link.bone.getWorldBindInverseRotation());
+        targetModel.getWorldRotation().mult(tmpRot1, tmpRot1);
+        tmpRot1.normalizeLocal();
+
+        //updating physic location/rotation of the physic bone
+        link.rigidBody.setPhysicsLocation(position);
+        link.rigidBody.setPhysicsRotation(tmpRot1);
+
+    }
+
+    public Control cloneForSpatial(Spatial spatial) {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    /**
+     * rebuild the ragdoll
+     * this is useful if you applied scale on the ragdoll after it's been initialized
+     */
+    public void reBuild() {
+        setSpatial(targetModel);
+        addToPhysicsSpace();
+    }
+
+    public void setSpatial(Spatial model) {
+        if (model == null) {
+            removeFromPhysicsSpace();
+            clearData();
+            return;
+        }
+        targetModel = model;
+        Node parent = model.getParent();
+
+
+        Vector3f initPosition = model.getLocalTranslation().clone();
+        Quaternion initRotation = model.getLocalRotation().clone();
+        initScale = model.getLocalScale().clone();
+
+        model.removeFromParent();
+        model.setLocalTranslation(Vector3f.ZERO);
+        model.setLocalRotation(Quaternion.IDENTITY);
+        model.setLocalScale(1);
+        //HACK ALERT change this
+        //I remove the skeletonControl and readd it to the spatial to make sure it's after the ragdollControl in the stack
+        //Find a proper way to order the controls.
+        SkeletonControl sc = model.getControl(SkeletonControl.class);
+        model.removeControl(sc);
+        model.addControl(sc);
+        //---- 
+
+        removeFromPhysicsSpace();
+        clearData();
+        // put into bind pose and compute bone transforms in model space
+        // maybe dont reset to ragdoll out of animations?
+        scanSpatial(model);
+
+
+        if (parent != null) {
+            parent.attachChild(model);
+
+        }
+        model.setLocalTranslation(initPosition);
+        model.setLocalRotation(initRotation);
+        model.setLocalScale(initScale);
+
+        logger.log(Level.INFO, "Created physics ragdoll for skeleton {0}", skeleton);
+    }
+
+    /**
+     * Add a bone name to this control
+     * Using this method you can specify which bones of the skeleton will be used to build the collision shapes.
+     * @param name 
+     */
+    public void addBoneName(String name) {
+        boneList.add(name);
+    }
+
+    private void scanSpatial(Spatial model) {
+        AnimControl animControl = model.getControl(AnimControl.class);
+        Map<Integer, List<Float>> pointsMap = null;
+        if (weightThreshold == -1.0f) {
+            pointsMap = RagdollUtils.buildPointMap(model);
+        }
+
+        skeleton = animControl.getSkeleton();
+        skeleton.resetAndUpdate();
+        for (int i = 0; i < skeleton.getRoots().length; i++) {
+            Bone childBone = skeleton.getRoots()[i];
+            if (childBone.getParent() == null) {
+                logger.log(Level.INFO, "Found root bone in skeleton {0}", skeleton);
+                baseRigidBody = new PhysicsRigidBody(new BoxCollisionShape(Vector3f.UNIT_XYZ.mult(0.1f)), 1);
+                baseRigidBody.setKinematic(mode == Mode.Kinetmatic);
+                boneRecursion(model, childBone, baseRigidBody, 1, pointsMap);
+            }
+        }
+    }
+
+    private void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int reccount, Map<Integer, List<Float>> pointsMap) {
+        PhysicsRigidBody parentShape = parent;
+        if (boneList.isEmpty() || boneList.contains(bone.getName())) {
+
+            PhysicsBoneLink link = new PhysicsBoneLink();
+            link.bone = bone;
+
+            //creating the collision shape 
+            HullCollisionShape shape = null;
+            if (pointsMap != null) {
+                //build a shape for the bone, using the vertices that are most influenced by this bone
+                shape = RagdollUtils.makeShapeFromPointMap(pointsMap, RagdollUtils.getBoneIndices(link.bone, skeleton, boneList), initScale, link.bone.getModelSpacePosition());
+            } else {
+                //build a shape for the bone, using the vertices associated with this bone with a weight above the threshold
+                shape = RagdollUtils.makeShapeFromVerticeWeights(model, RagdollUtils.getBoneIndices(link.bone, skeleton, boneList), initScale, link.bone.getModelSpacePosition(), weightThreshold);
+            }
+
+            PhysicsRigidBody shapeNode = new PhysicsRigidBody(shape, rootMass / (float) reccount);
+
+            shapeNode.setKinematic(mode == Mode.Kinetmatic);
+            totalMass += rootMass / (float) reccount;
+
+            link.rigidBody = shapeNode;
+            link.initalWorldRotation = bone.getModelSpaceRotation().clone();
+
+            if (parent != null) {
+                //get joint position for parent
+                Vector3f posToParent = new Vector3f();
+                if (bone.getParent() != null) {
+                    bone.getModelSpacePosition().subtract(bone.getParent().getModelSpacePosition(), posToParent).multLocal(initScale);
+                }
+
+                SixDofJoint joint = new SixDofJoint(parent, shapeNode, posToParent, new Vector3f(0, 0, 0f), true);
+                preset.setupJointForBone(bone.getName(), joint);
+
+                link.joint = joint;
+                joint.setCollisionBetweenLinkedBodys(false);
+            }
+            boneLinks.put(bone.getName(), link);
+            shapeNode.setUserObject(link);
+            parentShape = shapeNode;
+        }
+
+        for (Iterator<Bone> it = bone.getChildren().iterator(); it.hasNext();) {
+            Bone childBone = it.next();
+            boneRecursion(model, childBone, parentShape, reccount + 1, pointsMap);
+        }
+    }
+
+    /**
+     * Set the joint limits for the joint between the given bone and its parent.
+     * This method can't work before attaching the control to a spatial
+     * @param boneName the name of the bone
+     * @param maxX the maximum rotation on the x axis (in radians)
+     * @param minX the minimum rotation on the x axis (in radians)
+     * @param maxY the maximum rotation on the y axis (in radians)
+     * @param minY the minimum rotation on the z axis (in radians)
+     * @param maxZ the maximum rotation on the z axis (in radians)
+     * @param minZ the minimum rotation on the z axis (in radians)
+     */
+    public void setJointLimit(String boneName, float maxX, float minX, float maxY, float minY, float maxZ, float minZ) {
+        PhysicsBoneLink link = boneLinks.get(boneName);
+        if (link != null) {
+            RagdollUtils.setJointLimit(link.joint, maxX, minX, maxY, minY, maxZ, minZ);
+        } else {
+            logger.log(Level.WARNING, "Not joint was found for bone {0}. make sure you call spatial.addControl(ragdoll) before setting joints limit", boneName);
+        }
+    }
+
+    /**
+     * Return the joint between the given bone and its parent.
+     * This return null if it's called before attaching the control to a spatial
+     * @param boneName the name of the bone
+     * @return the joint between the given bone and its parent
+     */
+    public SixDofJoint getJoint(String boneName) {
+        PhysicsBoneLink link = boneLinks.get(boneName);
+        if (link != null) {
+            return link.joint;
+        } else {
+            logger.log(Level.WARNING, "Not joint was found for bone {0}. make sure you call spatial.addControl(ragdoll) before setting joints limit", boneName);
+            return null;
+        }
+    }
+
+    private void clearData() {
+        boneLinks.clear();
+        baseRigidBody = null;
+    }
+
+    private void addToPhysicsSpace() {
+        if (space == null) {
+            return;
+        }
+        if (baseRigidBody != null) {
+            space.add(baseRigidBody);
+            added = true;
+        }
+        for (Iterator<PhysicsBoneLink> it = boneLinks.values().iterator(); it.hasNext();) {
+            PhysicsBoneLink physicsBoneLink = it.next();
+            if (physicsBoneLink.rigidBody != null) {
+                space.add(physicsBoneLink.rigidBody);
+                if (physicsBoneLink.joint != null) {
+                    space.add(physicsBoneLink.joint);
+
+                }
+                added = true;
+            }
+        }
+    }
+
+    protected void removeFromPhysicsSpace() {
+        if (space == null) {
+            return;
+        }
+        if (baseRigidBody != null) {
+            space.remove(baseRigidBody);
+        }
+        for (Iterator<PhysicsBoneLink> it = boneLinks.values().iterator(); it.hasNext();) {
+            PhysicsBoneLink physicsBoneLink = it.next();
+            if (physicsBoneLink.joint != null) {
+                space.remove(physicsBoneLink.joint);
+                if (physicsBoneLink.rigidBody != null) {
+                    space.remove(physicsBoneLink.rigidBody);
+                }
+            }
+        }
+        added = false;
+    }
+
+    /**
+     * enable or disable the control
+     * note that if enabled is true and that the physic space has been set on the ragdoll, the ragdoll is added to the physic space     
+     * if enabled is false the ragdoll is removed from physic space.
+     * @param enabled 
+     */
+    public void setEnabled(boolean enabled) {
+        if (this.enabled == enabled) {
+            return;
+        }
+        this.enabled = enabled;
+        if (!enabled && space != null) {
+            removeFromPhysicsSpace();
+        } else if (enabled && space != null) {
+            addToPhysicsSpace();
+        }
+    }
+
+    /**
+     * returns true if the control is enabled
+     * @return 
+     */
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    protected void attachDebugShape(AssetManager manager) {
+        for (Iterator<PhysicsBoneLink> it = boneLinks.values().iterator(); it.hasNext();) {
+            PhysicsBoneLink physicsBoneLink = it.next();
+            physicsBoneLink.rigidBody.createDebugShape(manager);
+        }
+        debug = true;
+    }
+
+    protected void detachDebugShape() {
+        for (Iterator<PhysicsBoneLink> it = boneLinks.values().iterator(); it.hasNext();) {
+            PhysicsBoneLink physicsBoneLink = it.next();
+            physicsBoneLink.rigidBody.detachDebugShape();
+        }
+        debug = false;
+    }
+
+    /**
+     * For internal use only
+     * specific render for the ragdoll(if debugging)      
+     * @param rm
+     * @param vp 
+     */
+    public void render(RenderManager rm, ViewPort vp) {
+        if (enabled && space != null && space.getDebugManager() != null) {
+            if (!debug) {
+                attachDebugShape(space.getDebugManager());
+            }
+            for (Iterator<PhysicsBoneLink> it = boneLinks.values().iterator(); it.hasNext();) {
+                PhysicsBoneLink physicsBoneLink = it.next();
+                Spatial debugShape = physicsBoneLink.rigidBody.debugShape();
+                if (debugShape != null) {
+                    debugShape.setLocalTranslation(physicsBoneLink.rigidBody.getMotionState().getWorldLocation());
+                    debugShape.setLocalRotation(physicsBoneLink.rigidBody.getMotionState().getWorldRotationQuat());
+                    debugShape.updateGeometricState();
+                    rm.renderScene(debugShape, vp);
+                }
+            }
+        }
+    }
+
+    /**
+     * set the physic space to this ragdoll
+     * @param space 
+     */
+    public void setPhysicsSpace(PhysicsSpace space) {
+        if (space == null) {
+            removeFromPhysicsSpace();
+            this.space = space;
+        } else {
+            if (this.space == space) {
+                return;
+            }
+            this.space = space;
+            addToPhysicsSpace();
+            this.space.addCollisionListener(this);
+        }
+    }
+
+    /**
+     * returns the physic space
+     * @return 
+     */
+    public PhysicsSpace getPhysicsSpace() {
+        return space;
+    }
+
+    /**
+     * serialize this control
+     * @param ex
+     * @throws IOException 
+     */
+    public void write(JmeExporter ex) throws IOException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    /**
+     * de-serialize this control
+     * @param im
+     * @throws IOException 
+     */
+    public void read(JmeImporter im) throws IOException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    /**
+     * For internal use only
+     * callback for collisionevent
+     * @param event 
+     */
+    public void collision(PhysicsCollisionEvent event) {
+        PhysicsCollisionObject objA = event.getObjectA();
+        PhysicsCollisionObject objB = event.getObjectB();
+
+        //excluding collisions that involve 2 parts of the ragdoll
+        if (event.getNodeA() == null && event.getNodeB() == null) {
+            return;
+        }
+
+        //discarding low impulse collision
+        if (event.getAppliedImpulse() < eventDispatchImpulseThreshold) {
+            return;
+        }
+
+        boolean hit = false;
+        Bone hitBone = null;
+        PhysicsCollisionObject hitObject = null;
+
+        //Computing which bone has been hit
+        if (objA.getUserObject() instanceof PhysicsBoneLink) {
+            PhysicsBoneLink link = (PhysicsBoneLink) objA.getUserObject();
+            if (link != null) {
+                hit = true;
+                hitBone = link.bone;
+                hitObject = objB;
+            }
+        }
+
+        if (objB.getUserObject() instanceof PhysicsBoneLink) {
+            PhysicsBoneLink link = (PhysicsBoneLink) objB.getUserObject();
+            if (link != null) {
+                hit = true;
+                hitBone = link.bone;
+                hitObject = objA;
+
+            }
+        }
+
+        //dispatching the event if the ragdoll has been hit
+        if (hit && listeners != null) {
+            for (RagdollCollisionListener listener : listeners) {
+                listener.collide(hitBone, hitObject, event);
+            }
+        }
+
+    }
+
+    /**
+     * Enable or disable the ragdoll behaviour.
+     * if ragdollEnabled is true, the character motion will only be powerd by physics
+     * else, the characted will be animated by the keyframe animation, 
+     * but will be able to physically interact with its physic environnement
+     * @param ragdollEnabled 
+     */
+    protected void setMode(Mode mode) {
+        this.mode = mode;
+        AnimControl animControl = targetModel.getControl(AnimControl.class);
+        animControl.setEnabled(mode == Mode.Kinetmatic);
+
+        baseRigidBody.setKinematic(mode == Mode.Kinetmatic);
+        TempVars vars = TempVars.get();
+        
+        for (PhysicsBoneLink link : boneLinks.values()) {
+            link.rigidBody.setKinematic(mode == Mode.Kinetmatic);
+            if (mode == Mode.Ragdoll) {
+                Quaternion tmpRot1 = vars.quat1;
+                Vector3f position = vars.vect1;
+                //making sure that the ragdoll is at the correct place.
+                matchPhysicObjectToBone(link, position, tmpRot1);
+            }
+
+        }
+        vars.release();
+
+        for (Bone bone : skeleton.getRoots()) {
+            RagdollUtils.setUserControl(bone, mode == Mode.Ragdoll);
+        }
+    }
+
+    /**
+     * Smoothly blend from Ragdoll mode to Kinematic mode
+     * This is useful to blend ragdoll actual position to a keyframe animation for example
+     * @param blendTime the blending time between ragdoll to anim.
+     */
+    public void blendToKinematicMode(float blendTime) {
+        if (mode == Mode.Kinetmatic) {
+            return;
+        }
+        blendedControl = true;
+        this.blendTime = blendTime;
+        mode = Mode.Kinetmatic;
+        AnimControl animControl = targetModel.getControl(AnimControl.class);
+        animControl.setEnabled(true);
+
+
+        TempVars vars = TempVars.get();        
+        for (PhysicsBoneLink link : boneLinks.values()) {
+
+            Vector3f p = link.rigidBody.getMotionState().getWorldLocation();
+            Vector3f position = vars.vect1;
+
+            targetModel.getWorldTransform().transformInverseVector(p, position);
+
+            Quaternion q = link.rigidBody.getMotionState().getWorldRotationQuat();
+            Quaternion q2 = vars.quat1;
+            Quaternion q3 = vars.quat2;
+
+            q2.set(q).multLocal(link.initalWorldRotation).normalizeLocal();
+            q3.set(targetModel.getWorldRotation()).inverseLocal().mult(q2, q2);
+            q2.normalizeLocal();
+            link.startBlendingPos.set(position);
+            link.startBlendingRot.set(q2);
+            link.rigidBody.setKinematic(true);
+        }
+        vars.release();
+
+        for (Bone bone : skeleton.getRoots()) {
+            RagdollUtils.setUserControl(bone, false);
+        }
+
+        blendStart = 0;
+    }
+
+    /**
+     * Set the control into Kinematic mode
+     * In theis mode, the collision shapes follow the movements of the skeleton,
+     * and can interact with physical environement
+     */
+    public void setKinematicMode() {
+        if (mode != Mode.Kinetmatic) {
+            setMode(Mode.Kinetmatic);
+        }
+    }
+
+    /**
+     * Sets the control into Ragdoll mode
+     * The skeleton is entirely controlled by physics.
+     */
+    public void setRagdollMode() {
+        if (mode != Mode.Ragdoll) {
+            setMode(Mode.Ragdoll);
+        }
+    }
+
+    /**
+     * retruns the mode of this control
+     * @return 
+     */
+    public Mode getMode() {
+        return mode;
+    }
+
+    /**
+     * add a 
+     * @param listener 
+     */
+    public void addCollisionListener(RagdollCollisionListener listener) {
+        if (listeners == null) {
+            listeners = new ArrayList<RagdollCollisionListener>();
+        }
+        listeners.add(listener);
+    }
+
+    public void setRootMass(float rootMass) {
+        this.rootMass = rootMass;
+    }
+
+    public float getTotalMass() {
+        return totalMass;
+    }
+
+    public float getWeightThreshold() {
+        return weightThreshold;
+    }
+
+    public void setWeightThreshold(float weightThreshold) {
+        this.weightThreshold = weightThreshold;
+    }
+
+    public float getEventDispatchImpulseThreshold() {
+        return eventDispatchImpulseThreshold;
+    }
+
+    public void setEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold) {
+        this.eventDispatchImpulseThreshold = eventDispatchImpulseThreshold;
+    }
+
+    /**
+     * Set the CcdMotionThreshold of all the bone's rigidBodies of the ragdoll
+     * @see PhysicsRigidBody#setCcdMotionThreshold(float) 
+     * @param value 
+     */
+    public void setCcdMotionThreshold(float value) {
+        for (PhysicsBoneLink link : boneLinks.values()) {
+            link.rigidBody.setCcdMotionThreshold(value);
+        }
+    }
+
+    /**
+     * Set the CcdSweptSphereRadius of all the bone's rigidBodies of the ragdoll
+     * @see PhysicsRigidBody#setCcdSweptSphereRadius(float) 
+     * @param value 
+     */
+    public void setCcdSweptSphereRadius(float value) {
+        for (PhysicsBoneLink link : boneLinks.values()) {
+            link.rigidBody.setCcdSweptSphereRadius(value);
+        }
+    }
+
+    /**
+     * Set the CcdMotionThreshold of the given bone's rigidBodies of the ragdoll
+     * @see PhysicsRigidBody#setCcdMotionThreshold(float) 
+     * @param value 
+     * @deprecated use getBoneRigidBody(String BoneName).setCcdMotionThreshold(float) instead
+     */
+    @Deprecated
+    public void setBoneCcdMotionThreshold(String boneName, float value) {
+        PhysicsBoneLink link = boneLinks.get(boneName);
+        if (link != null) {
+            link.rigidBody.setCcdMotionThreshold(value);
+        }
+    }
+
+    /**
+     * Set the CcdSweptSphereRadius of the given bone's rigidBodies of the ragdoll
+     * @see PhysicsRigidBody#setCcdSweptSphereRadius(float) 
+     * @param value 
+     * @deprecated use getBoneRigidBody(String BoneName).setCcdSweptSphereRadius(float) instead
+     */
+    @Deprecated
+    public void setBoneCcdSweptSphereRadius(String boneName, float value) {
+        PhysicsBoneLink link = boneLinks.get(boneName);
+        if (link != null) {
+            link.rigidBody.setCcdSweptSphereRadius(value);
+        }
+    }
+
+    /**
+     * return the rigidBody associated to the given bone
+     * @param boneName the name of the bone
+     * @return the associated rigidBody.
+     */
+    public PhysicsRigidBody getBoneRigidBody(String boneName) {
+        PhysicsBoneLink link = boneLinks.get(boneName);
+        if (link != null) {
+            return link.rigidBody;
+        }
+        return null;
+    }
+}

+ 28 - 0
engine/src/bullet-common/com/jme3/bullet/control/PhysicsControl.java

@@ -0,0 +1,28 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control;
+
+import com.jme3.bullet.PhysicsSpace;
+import com.jme3.scene.control.Control;
+
+/**
+ *
+ * @author normenhansen
+ */
+public interface PhysicsControl extends Control {
+
+    public void setPhysicsSpace(PhysicsSpace space);
+
+    public PhysicsSpace getPhysicsSpace();
+
+    /**
+     * The physics object is removed from the physics space when the control
+     * is disabled. When the control is enabled  again the physics object is
+     * moved to the current location of the spatial and then added to the physics
+     * space. This allows disabling/enabling physics to move the spatial freely.
+     * @param state
+     */
+    public void setEnabled(boolean state);
+}

+ 266 - 0
engine/src/bullet-common/com/jme3/bullet/control/RigidBodyControl.java

@@ -0,0 +1,266 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control;
+
+import com.jme3.bullet.PhysicsSpace;
+import com.jme3.bullet.collision.shapes.BoxCollisionShape;
+import com.jme3.bullet.collision.shapes.CollisionShape;
+import com.jme3.bullet.collision.shapes.SphereCollisionShape;
+import com.jme3.bullet.objects.PhysicsRigidBody;
+import com.jme3.bullet.util.CollisionShapeFactory;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.ViewPort;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Mesh;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.control.Control;
+import com.jme3.scene.shape.Box;
+import com.jme3.scene.shape.Sphere;
+import java.io.IOException;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl {
+
+    protected Spatial spatial;
+    protected boolean enabled = true;
+    protected boolean added = false;
+    protected PhysicsSpace space = null;
+    protected boolean kinematicSpatial = true;
+
+    public RigidBodyControl() {
+    }
+
+    /**
+     * When using this constructor, the CollisionShape for the RigidBody is generated
+     * automatically when the Control is added to a Spatial.
+     * @param mass When not 0, a HullCollisionShape is generated, otherwise a MeshCollisionShape is used. For geometries with box or sphere meshes the proper box or sphere collision shape is used.
+     */
+    public RigidBodyControl(float mass) {
+        this.mass = mass;
+    }
+
+    /**
+     * Creates a new PhysicsNode with the supplied collision shape and mass 1
+     * @param child
+     * @param shape
+     */
+    public RigidBodyControl(CollisionShape shape) {
+        super(shape);
+    }
+
+    public RigidBodyControl(CollisionShape shape, float mass) {
+        super(shape, mass);
+    }
+
+    public Control cloneForSpatial(Spatial spatial) {
+        RigidBodyControl control = new RigidBodyControl(collisionShape, mass);
+        control.setAngularFactor(getAngularFactor());
+        control.setAngularSleepingThreshold(getAngularSleepingThreshold());
+        control.setCcdMotionThreshold(getCcdMotionThreshold());
+        control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());
+        control.setCollideWithGroups(getCollideWithGroups());
+        control.setCollisionGroup(getCollisionGroup());
+        control.setDamping(getLinearDamping(), getAngularDamping());
+        control.setFriction(getFriction());
+        control.setGravity(getGravity());
+        control.setKinematic(isKinematic());
+        control.setKinematicSpatial(isKinematicSpatial());
+        control.setLinearSleepingThreshold(getLinearSleepingThreshold());
+        control.setPhysicsLocation(getPhysicsLocation(null));
+        control.setPhysicsRotation(getPhysicsRotationMatrix(null));
+        control.setRestitution(getRestitution());
+
+        if (mass > 0) {
+            control.setAngularVelocity(getAngularVelocity());
+            control.setLinearVelocity(getLinearVelocity());
+        }
+        control.setApplyPhysicsLocal(isApplyPhysicsLocal());
+
+        control.setSpatial(spatial);
+        return control;
+    }
+
+    public void setSpatial(Spatial spatial) {
+        if (getUserObject() == null || getUserObject() == this.spatial) {
+            setUserObject(spatial);
+        }
+        this.spatial = spatial;
+        if (spatial == null) {
+            if (getUserObject() == spatial) {
+                setUserObject(null);
+            }
+            spatial = null;
+            collisionShape = null;
+            return;
+        }
+        if (collisionShape == null) {
+            createCollisionShape();
+            rebuildRigidBody();
+        }
+        setPhysicsLocation(getSpatialTranslation());
+        setPhysicsRotation(getSpatialRotation());
+    }
+
+    protected void createCollisionShape() {
+        if (spatial == null) {
+            return;
+        }
+        if (spatial instanceof Geometry) {
+            Geometry geom = (Geometry) spatial;
+            Mesh mesh = geom.getMesh();
+            if (mesh instanceof Sphere) {
+                collisionShape = new SphereCollisionShape(((Sphere) mesh).getRadius());
+                return;
+            } else if (mesh instanceof Box) {
+                collisionShape = new BoxCollisionShape(new Vector3f(((Box) mesh).getXExtent(), ((Box) mesh).getYExtent(), ((Box) mesh).getZExtent()));
+                return;
+            }
+        }
+        if (mass > 0) {
+            collisionShape = CollisionShapeFactory.createDynamicMeshShape(spatial);
+        } else {
+            collisionShape = CollisionShapeFactory.createMeshShape(spatial);
+        }
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+        if (space != null) {
+            if (enabled && !added) {
+                if (spatial != null) {
+                    setPhysicsLocation(getSpatialTranslation());
+                    setPhysicsRotation(getSpatialRotation());
+                }
+                space.addCollisionObject(this);
+                added = true;
+            } else if (!enabled && added) {
+                space.removeCollisionObject(this);
+                added = false;
+            }
+        }
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    /**
+     * Checks if this control is in kinematic spatial mode.
+     * @return true if the spatial location is applied to this kinematic rigidbody
+     */
+    public boolean isKinematicSpatial() {
+        return kinematicSpatial;
+    }
+
+    /**
+     * Sets this control to kinematic spatial mode so that the spatials transform will
+     * be applied to the rigidbody in kinematic mode, defaults to true.
+     * @param kinematicSpatial
+     */
+    public void setKinematicSpatial(boolean kinematicSpatial) {
+        this.kinematicSpatial = kinematicSpatial;
+    }
+
+    public boolean isApplyPhysicsLocal() {
+        return motionState.isApplyPhysicsLocal();
+    }
+
+    /**
+     * When set to true, the physics coordinates will be applied to the local
+     * translation of the Spatial instead of the world traslation.
+     * @param applyPhysicsLocal
+     */
+    public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
+        motionState.setApplyPhysicsLocal(applyPhysicsLocal);
+    }
+
+    private Vector3f getSpatialTranslation(){
+        if(motionState.isApplyPhysicsLocal()){
+            return spatial.getLocalTranslation();
+        }
+        return spatial.getWorldTranslation();
+    }
+
+    private Quaternion getSpatialRotation(){
+        if(motionState.isApplyPhysicsLocal()){
+            return spatial.getLocalRotation();
+        }
+        return spatial.getWorldRotation();
+    }
+
+    public void update(float tpf) {
+        if (enabled && spatial != null) {
+            if (isKinematic() && kinematicSpatial) {
+                super.setPhysicsLocation(getSpatialTranslation());
+                super.setPhysicsRotation(getSpatialRotation());
+            } else {
+                getMotionState().applyTransform(spatial);
+            }
+        }
+    }
+
+    public void render(RenderManager rm, ViewPort vp) {
+        if (enabled && space != null && space.getDebugManager() != null) {
+            if (debugShape == null) {
+                attachDebugShape(space.getDebugManager());
+            }
+            //TODO: using spatial traslation/rotation..
+            debugShape.setLocalTranslation(spatial.getWorldTranslation());
+            debugShape.setLocalRotation(spatial.getWorldRotation());
+            debugShape.updateLogicalState(0);
+            debugShape.updateGeometricState();
+            rm.renderScene(debugShape, vp);
+        }
+    }
+
+    public void setPhysicsSpace(PhysicsSpace space) {
+        if (space == null) {
+            if (this.space != null) {
+                this.space.removeCollisionObject(this);
+                added = false;
+            }
+        } else {
+            if(this.space==space) return;
+            space.addCollisionObject(this);
+            added = true;
+        }
+        this.space = space;
+    }
+
+    public PhysicsSpace getPhysicsSpace() {
+        return space;
+    }
+
+    @Override
+    public void write(JmeExporter ex) throws IOException {
+        super.write(ex);
+        OutputCapsule oc = ex.getCapsule(this);
+        oc.write(enabled, "enabled", true);
+        oc.write(motionState.isApplyPhysicsLocal(), "applyLocalPhysics", false);
+        oc.write(kinematicSpatial, "kinematicSpatial", true);
+        oc.write(spatial, "spatial", null);
+    }
+
+    @Override
+    public void read(JmeImporter im) throws IOException {
+        super.read(im);
+        InputCapsule ic = im.getCapsule(this);
+        enabled = ic.readBoolean("enabled", true);
+        kinematicSpatial = ic.readBoolean("kinematicSpatial", true);
+        spatial = (Spatial) ic.readSavable("spatial", null);
+        motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
+        setUserObject(spatial);
+    }
+}

+ 270 - 0
engine/src/bullet-common/com/jme3/bullet/control/VehicleControl.java

@@ -0,0 +1,270 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control;
+
+import com.jme3.bullet.PhysicsSpace;
+import com.jme3.bullet.collision.shapes.CollisionShape;
+import com.jme3.bullet.joints.PhysicsJoint;
+import com.jme3.bullet.objects.PhysicsVehicle;
+import com.jme3.bullet.objects.VehicleWheel;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.ViewPort;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.control.Control;
+import com.jme3.scene.debug.Arrow;
+import java.io.IOException;
+import java.util.Iterator;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class VehicleControl extends PhysicsVehicle implements PhysicsControl {
+
+    protected Spatial spatial;
+    protected boolean enabled = true;
+    protected PhysicsSpace space = null;
+    protected boolean added = false;
+
+    public VehicleControl() {
+    }
+
+    /**
+     * Creates a new PhysicsNode with the supplied collision shape
+     * @param child
+     * @param shape
+     */
+    public VehicleControl(CollisionShape shape) {
+        super(shape);
+    }
+
+    public VehicleControl(CollisionShape shape, float mass) {
+        super(shape, mass);
+    }
+
+    public boolean isApplyPhysicsLocal() {
+        return motionState.isApplyPhysicsLocal();
+    }
+
+    /**
+     * When set to true, the physics coordinates will be applied to the local
+     * translation of the Spatial
+     * @param applyPhysicsLocal
+     */
+    public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
+        motionState.setApplyPhysicsLocal(applyPhysicsLocal);
+        for (Iterator<VehicleWheel> it = wheels.iterator(); it.hasNext();) {
+            VehicleWheel vehicleWheel = it.next();
+            vehicleWheel.setApplyLocal(applyPhysicsLocal);
+        }
+    }
+
+    private Vector3f getSpatialTranslation(){
+        if(motionState.isApplyPhysicsLocal()){
+            return spatial.getLocalTranslation();
+        }
+        return spatial.getWorldTranslation();
+    }
+
+    private Quaternion getSpatialRotation(){
+        if(motionState.isApplyPhysicsLocal()){
+            return spatial.getLocalRotation();
+        }
+        return spatial.getWorldRotation();
+    }
+
+    public Control cloneForSpatial(Spatial spatial) {
+        VehicleControl control = new VehicleControl(collisionShape, mass);
+        control.setAngularFactor(getAngularFactor());
+        control.setAngularSleepingThreshold(getAngularSleepingThreshold());
+        control.setAngularVelocity(getAngularVelocity());
+        control.setCcdMotionThreshold(getCcdMotionThreshold());
+        control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());
+        control.setCollideWithGroups(getCollideWithGroups());
+        control.setCollisionGroup(getCollisionGroup());
+        control.setDamping(getLinearDamping(), getAngularDamping());
+        control.setFriction(getFriction());
+        control.setGravity(getGravity());
+        control.setKinematic(isKinematic());
+        control.setLinearSleepingThreshold(getLinearSleepingThreshold());
+        control.setLinearVelocity(getLinearVelocity());
+        control.setPhysicsLocation(getPhysicsLocation());
+        control.setPhysicsRotation(getPhysicsRotationMatrix());
+        control.setRestitution(getRestitution());
+
+        control.setFrictionSlip(getFrictionSlip());
+        control.setMaxSuspensionTravelCm(getMaxSuspensionTravelCm());
+        control.setSuspensionStiffness(getSuspensionStiffness());
+        control.setSuspensionCompression(tuning.suspensionCompression);
+        control.setSuspensionDamping(tuning.suspensionDamping);
+        control.setMaxSuspensionForce(getMaxSuspensionForce());
+
+        for (Iterator<VehicleWheel> it = wheels.iterator(); it.hasNext();) {
+            VehicleWheel wheel = it.next();
+            VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel());
+            newWheel.setFrictionSlip(wheel.getFrictionSlip());
+            newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
+            newWheel.setSuspensionStiffness(wheel.getSuspensionStiffness());
+            newWheel.setWheelsDampingCompression(wheel.getWheelsDampingCompression());
+            newWheel.setWheelsDampingRelaxation(wheel.getWheelsDampingRelaxation());
+            newWheel.setMaxSuspensionForce(wheel.getMaxSuspensionForce());
+
+            //TODO: bad way finding children!
+            if (spatial instanceof Node) {
+                Node node = (Node) spatial;
+                Spatial wheelSpat = node.getChild(wheel.getWheelSpatial().getName());
+                if (wheelSpat != null) {
+                    newWheel.setWheelSpatial(wheelSpat);
+                }
+            }
+        }
+        control.setApplyPhysicsLocal(isApplyPhysicsLocal());
+
+        control.setSpatial(spatial);
+        return control;
+    }
+
+    public void setSpatial(Spatial spatial) {
+        if (getUserObject() == null || getUserObject() == this.spatial) {
+            setUserObject(spatial);
+        }
+        this.spatial = spatial;
+        if (spatial == null) {
+            if (getUserObject() == spatial) {
+                setUserObject(null);
+            }
+            this.spatial = null;
+            this.collisionShape = null;
+            return;
+        }
+        setPhysicsLocation(getSpatialTranslation());
+        setPhysicsRotation(getSpatialRotation());
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+        if (space != null) {
+            if (enabled && !added) {
+                if(spatial!=null){
+                    setPhysicsLocation(getSpatialTranslation());
+                    setPhysicsRotation(getSpatialRotation());
+                }
+                space.addCollisionObject(this);
+                added = true;
+            } else if (!enabled && added) {
+                space.removeCollisionObject(this);
+                added = false;
+            }
+        }
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public void update(float tpf) {
+        if (enabled && spatial != null) {
+            if (getMotionState().applyTransform(spatial)) {
+                spatial.getWorldTransform();
+                applyWheelTransforms();
+            }
+        } else if (enabled) {
+            applyWheelTransforms();
+        }
+    }
+
+    @Override
+    protected Spatial getDebugShape() {
+        return super.getDebugShape();
+    }
+
+    public void render(RenderManager rm, ViewPort vp) {
+        if (enabled && space != null && space.getDebugManager() != null) {
+            if (debugShape == null) {
+                attachDebugShape(space.getDebugManager());
+            }
+            Node debugNode = (Node) debugShape;
+            debugShape.setLocalTranslation(spatial.getWorldTranslation());
+            debugShape.setLocalRotation(spatial.getWorldRotation());
+            int i = 0;
+            for (Iterator<VehicleWheel> it = wheels.iterator(); it.hasNext();) {
+                VehicleWheel physicsVehicleWheel = it.next();
+                Vector3f location = physicsVehicleWheel.getLocation().clone();
+                Vector3f direction = physicsVehicleWheel.getDirection().clone();
+                Vector3f axle = physicsVehicleWheel.getAxle().clone();
+                float restLength = physicsVehicleWheel.getRestLength();
+                float radius = physicsVehicleWheel.getRadius();
+
+                Geometry locGeom = (Geometry) debugNode.getChild("WheelLocationDebugShape" + i);
+                Geometry dirGeom = (Geometry) debugNode.getChild("WheelDirectionDebugShape" + i);
+                Geometry axleGeom = (Geometry) debugNode.getChild("WheelAxleDebugShape" + i);
+                Geometry wheelGeom = (Geometry) debugNode.getChild("WheelRadiusDebugShape" + i);
+
+                Arrow locArrow = (Arrow) locGeom.getMesh();
+                locArrow.setArrowExtent(location);
+                Arrow axleArrow = (Arrow) axleGeom.getMesh();
+                axleArrow.setArrowExtent(axle.normalizeLocal().multLocal(0.3f));
+                Arrow wheelArrow = (Arrow) wheelGeom.getMesh();
+                wheelArrow.setArrowExtent(direction.normalizeLocal().multLocal(radius));
+                Arrow dirArrow = (Arrow) dirGeom.getMesh();
+                dirArrow.setArrowExtent(direction.normalizeLocal().multLocal(restLength));
+
+                dirGeom.setLocalTranslation(location);
+                axleGeom.setLocalTranslation(location.addLocal(direction));
+                wheelGeom.setLocalTranslation(location);
+                i++;
+            }
+            debugShape.updateLogicalState(0);
+            debugShape.updateGeometricState();
+            rm.renderScene(debugShape, vp);
+        }
+    }
+
+    public void setPhysicsSpace(PhysicsSpace space) {
+        createVehicle(space);
+        if (space == null) {
+            if (this.space != null) {
+                this.space.removeCollisionObject(this);
+                added = false;
+            }
+        } else {
+            if(this.space==space) return;
+            space.addCollisionObject(this);
+            added = true;
+        }
+        this.space = space;
+    }
+
+    public PhysicsSpace getPhysicsSpace() {
+        return space;
+    }
+
+    @Override
+    public void write(JmeExporter ex) throws IOException {
+        super.write(ex);
+        OutputCapsule oc = ex.getCapsule(this);
+        oc.write(enabled, "enabled", true);
+        oc.write(motionState.isApplyPhysicsLocal(), "applyLocalPhysics", false);
+        oc.write(spatial, "spatial", null);
+    }
+
+    @Override
+    public void read(JmeImporter im) throws IOException {
+        super.read(im);
+        InputCapsule ic = im.getCapsule(this);
+        enabled = ic.readBoolean("enabled", true);
+        spatial = (Spatial) ic.readSavable("spatial", null);
+        motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
+        setUserObject(spatial);
+    }
+}

+ 99 - 0
engine/src/bullet-common/com/jme3/bullet/control/ragdoll/HumanoidRagdollPreset.java

@@ -0,0 +1,99 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control.ragdoll;
+
+import com.jme3.math.FastMath;
+
+/**
+ *
+ * @author Nehon
+ */
+public class HumanoidRagdollPreset extends RagdollPreset {
+
+    @Override
+    protected void initBoneMap() {
+        boneMap.put("head", new JointPreset(FastMath.QUARTER_PI, -FastMath.QUARTER_PI, FastMath.QUARTER_PI, -FastMath.QUARTER_PI, FastMath.QUARTER_PI, -FastMath.QUARTER_PI));
+
+        boneMap.put("torso", new JointPreset(FastMath.QUARTER_PI, -FastMath.QUARTER_PI, 0, 0, FastMath.QUARTER_PI, -FastMath.QUARTER_PI));
+
+        boneMap.put("upperleg", new JointPreset(FastMath.PI, -FastMath.QUARTER_PI, FastMath.QUARTER_PI/2, -FastMath.QUARTER_PI/2, FastMath.QUARTER_PI, -FastMath.QUARTER_PI));
+
+        boneMap.put("lowerleg", new JointPreset(0, -FastMath.PI, 0, 0, 0, 0));
+
+        boneMap.put("foot", new JointPreset(0, -FastMath.QUARTER_PI, FastMath.QUARTER_PI, -FastMath.QUARTER_PI, FastMath.QUARTER_PI, -FastMath.QUARTER_PI));
+
+        boneMap.put("upperarm", new JointPreset(FastMath.HALF_PI, -FastMath.QUARTER_PI, 0, 0, FastMath.HALF_PI, -FastMath.QUARTER_PI));
+
+        boneMap.put("lowerarm", new JointPreset(FastMath.HALF_PI, 0, 0, 0, 0, 0));
+
+        boneMap.put("hand", new JointPreset(FastMath.QUARTER_PI, -FastMath.QUARTER_PI, FastMath.QUARTER_PI, -FastMath.QUARTER_PI, FastMath.QUARTER_PI, -FastMath.QUARTER_PI));
+
+    }
+
+    @Override
+    protected void initLexicon() {
+        LexiconEntry entry = new LexiconEntry();
+        entry.addSynonym("head", 100);        
+        lexicon.put("head", entry);
+
+        entry = new LexiconEntry();
+        entry.addSynonym("torso", 100);
+        entry.addSynonym("chest", 100);
+        entry.addSynonym("spine", 45);
+        entry.addSynonym("high", 25);
+        lexicon.put("torso", entry);
+
+        entry = new LexiconEntry();
+        entry.addSynonym("upperleg", 100);
+        entry.addSynonym("thigh", 100);
+        entry.addSynonym("hip", 75);
+        entry.addSynonym("leg", 40);
+        entry.addSynonym("high", 10);
+        entry.addSynonym("up", 15);
+        entry.addSynonym("upper", 15);
+        lexicon.put("upperleg", entry);
+
+        entry = new LexiconEntry();
+        entry.addSynonym("lowerleg", 100);
+        entry.addSynonym("calf", 100);
+        entry.addSynonym("knee", 75);
+        entry.addSynonym("leg", 50);
+        entry.addSynonym("low", 10);
+        entry.addSynonym("lower", 10);
+        lexicon.put("lowerleg", entry);
+        
+        entry = new LexiconEntry();
+        entry.addSynonym("foot", 100);
+        entry.addSynonym("ankle", 75);   
+        lexicon.put("foot", entry);
+        
+        
+        entry = new LexiconEntry();
+        entry.addSynonym("upperarm", 100);
+        entry.addSynonym("humerus", 100); 
+        entry.addSynonym("shoulder", 50);
+        entry.addSynonym("arm", 40);
+        entry.addSynonym("high", 10);
+        entry.addSynonym("up", 15);
+        entry.addSynonym("upper", 15);
+        lexicon.put("upperarm", entry);
+
+        entry = new LexiconEntry();
+        entry.addSynonym("lowerarm", 100);
+        entry.addSynonym("ulna", 100);
+        entry.addSynonym("elbow", 75);
+        entry.addSynonym("arm", 50);
+        entry.addSynonym("low", 10);
+        entry.addSynonym("lower", 10);
+        lexicon.put("lowerarm", entry);
+        
+        entry = new LexiconEntry();
+        entry.addSynonym("hand", 100);
+        entry.addSynonym("fist", 100);   
+        entry.addSynonym("wrist", 75);           
+        lexicon.put("hand", entry);
+
+    }
+}

+ 106 - 0
engine/src/bullet-common/com/jme3/bullet/control/ragdoll/RagdollPreset.java

@@ -0,0 +1,106 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control.ragdoll;
+
+import com.jme3.bullet.joints.SixDofJoint;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author Nehon
+ */
+public abstract class RagdollPreset {
+
+    protected static final Logger logger = Logger.getLogger(RagdollPreset.class.getName());
+    protected Map<String, JointPreset> boneMap = new HashMap<String, JointPreset>();
+    protected Map<String, LexiconEntry> lexicon = new HashMap<String, LexiconEntry>();
+
+    protected abstract void initBoneMap();
+
+    protected abstract void initLexicon();
+
+    public void setupJointForBone(String boneName, SixDofJoint joint) {
+
+        if (boneMap.isEmpty()) {
+            initBoneMap();
+        }
+        if (lexicon.isEmpty()) {
+            initLexicon();
+        }
+        String resultName = "";
+        int resultScore = 0;
+
+        for (String key : lexicon.keySet()) {
+        
+            int score = lexicon.get(key).getScore(boneName);        
+            if (score > resultScore) {
+                resultScore = score;
+                resultName = key;
+            }
+            
+        }
+        
+        JointPreset preset = boneMap.get(resultName);
+
+        if (preset != null && resultScore >= 50) {
+            logger.log(Level.INFO, "Found matching joint for bone {0} : {1} with score {2}", new Object[]{boneName, resultName, resultScore});
+            preset.setupJoint(joint);
+        } else {
+            logger.log(Level.INFO, "No joint match found for bone {0}", boneName);
+            if (resultScore > 0) {
+                logger.log(Level.INFO, "Best match found is {0} with score {1}", new Object[]{resultName, resultScore});
+            }
+            new JointPreset().setupJoint(joint);
+        }
+
+    }
+
+    protected class JointPreset {
+
+        private float maxX, minX, maxY, minY, maxZ, minZ;
+
+        public JointPreset() {
+        }
+
+        public JointPreset(float maxX, float minX, float maxY, float minY, float maxZ, float minZ) {
+            this.maxX = maxX;
+            this.minX = minX;
+            this.maxY = maxY;
+            this.minY = minY;
+            this.maxZ = maxZ;
+            this.minZ = minZ;
+        }
+
+        public void setupJoint(SixDofJoint joint) {
+            joint.getRotationalLimitMotor(0).setHiLimit(maxX);
+            joint.getRotationalLimitMotor(0).setLoLimit(minX);
+            joint.getRotationalLimitMotor(1).setHiLimit(maxY);
+            joint.getRotationalLimitMotor(1).setLoLimit(minY);
+            joint.getRotationalLimitMotor(2).setHiLimit(maxZ);
+            joint.getRotationalLimitMotor(2).setLoLimit(minZ);
+        }
+    }
+
+    protected class LexiconEntry extends HashMap<String, Integer> {
+
+        public void addSynonym(String word, int score) {
+            put(word.toLowerCase(), score);
+        }
+
+        public int getScore(String word) {
+            int score = 0;
+            String searchWord = word.toLowerCase();
+            for (String key : this.keySet()) {
+                if (searchWord.indexOf(key) >= 0) {
+                    score += get(key);
+                }
+            }
+            return score;
+        }
+    }
+}

+ 273 - 0
engine/src/bullet-common/com/jme3/bullet/control/ragdoll/RagdollUtils.java

@@ -0,0 +1,273 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.bullet.control.ragdoll;
+
+import com.jme3.animation.Bone;
+import com.jme3.animation.Skeleton;
+import com.jme3.bullet.collision.shapes.HullCollisionShape;
+import com.jme3.bullet.joints.SixDofJoint;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Transform;
+import com.jme3.math.Vector3f;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Mesh;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.VertexBuffer.Type;
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * @author Nehon
+ */
+public class RagdollUtils {
+
+    public static void setJointLimit(SixDofJoint joint, float maxX, float minX, float maxY, float minY, float maxZ, float minZ) {
+
+        joint.getRotationalLimitMotor(0).setHiLimit(maxX);
+        joint.getRotationalLimitMotor(0).setLoLimit(minX);
+        joint.getRotationalLimitMotor(1).setHiLimit(maxY);
+        joint.getRotationalLimitMotor(1).setLoLimit(minY);
+        joint.getRotationalLimitMotor(2).setHiLimit(maxZ);
+        joint.getRotationalLimitMotor(2).setLoLimit(minZ);
+    }
+
+    public static Map<Integer, List<Float>> buildPointMap(Spatial model) {
+
+
+        Map<Integer, List<Float>> map = new HashMap<Integer, List<Float>>();
+        if (model instanceof Geometry) {
+            Geometry g = (Geometry) model;
+            buildPointMapForMesh(g.getMesh(), map);
+        } else if (model instanceof Node) {
+            Node node = (Node) model;
+            for (Spatial s : node.getChildren()) {
+                if (s instanceof Geometry) {
+                    Geometry g = (Geometry) s;
+                    buildPointMapForMesh(g.getMesh(), map);
+                }
+            }
+        }
+        return map;
+    }
+
+    private static Map<Integer, List<Float>> buildPointMapForMesh(Mesh mesh, Map<Integer, List<Float>> map) {
+
+        FloatBuffer vertices = mesh.getFloatBuffer(Type.Position);
+        ByteBuffer boneIndices = (ByteBuffer) mesh.getBuffer(Type.BoneIndex).getData();
+        FloatBuffer boneWeight = (FloatBuffer) mesh.getBuffer(Type.BoneWeight).getData();
+
+        vertices.rewind();
+        boneIndices.rewind();
+        boneWeight.rewind();
+
+        int vertexComponents = mesh.getVertexCount() * 3;
+        int k, start, index;
+        float maxWeight = 0;
+
+        for (int i = 0; i < vertexComponents; i += 3) {
+
+
+            start = i / 3 * 4;
+            index = 0;
+            maxWeight = -1;
+            for (k = start; k < start + 4; k++) {
+                float weight = boneWeight.get(k);
+                if (weight > maxWeight) {
+                    maxWeight = weight;
+                    index = boneIndices.get(k);
+                }
+            }
+            List<Float> points = map.get(index);
+            if (points == null) {
+                points = new ArrayList<Float>();
+                map.put(index, points);
+            }
+            points.add(vertices.get(i));
+            points.add(vertices.get(i + 1));
+            points.add(vertices.get(i + 2));
+        }
+        return map;
+    }
+
+    /**
+     * Create a hull collision shape from linked vertices to this bone.
+     * Vertices have to be previoulsly gathered in a map using buildPointMap method
+     * @param link
+     * @param model
+     * @return 
+     */
+    public static HullCollisionShape makeShapeFromPointMap(Map<Integer, List<Float>> pointsMap, List<Integer> boneIndices, Vector3f initialScale, Vector3f initialPosition) {
+
+        ArrayList<Float> points = new ArrayList<Float>();
+        for (Integer index : boneIndices) {
+            List<Float> l = pointsMap.get(index);
+            if (l != null) {
+
+                for (int i = 0; i < l.size(); i += 3) {
+                    Vector3f pos = new Vector3f();
+                    pos.x = l.get(i);
+                    pos.y = l.get(i + 1);
+                    pos.z = l.get(i + 2);
+                    pos.subtractLocal(initialPosition).multLocal(initialScale);
+                    points.add(pos.x);
+                    points.add(pos.y);
+                    points.add(pos.z);
+                }
+            }
+        }
+
+        float[] p = new float[points.size()];
+        for (int i = 0; i < points.size(); i++) {
+            p[i] = points.get(i);
+        }
+
+
+        return new HullCollisionShape(p);
+    }
+
+    //retruns the list of bone indices of the given bone and its child(if they are not in the boneList)
+    public static List<Integer> getBoneIndices(Bone bone, Skeleton skeleton, Set<String> boneList) {
+        List<Integer> list = new LinkedList<Integer>();
+        if (boneList.isEmpty()) {
+            list.add(skeleton.getBoneIndex(bone));
+        } else {
+            list.add(skeleton.getBoneIndex(bone));
+            for (Bone chilBone : bone.getChildren()) {
+                if (!boneList.contains(chilBone.getName())) {
+                    list.addAll(getBoneIndices(chilBone, skeleton, boneList));
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * Create a hull collision shape from linked vertices to this bone.
+     * 
+     * @param link
+     * @param model
+     * @return 
+     */
+    public static HullCollisionShape makeShapeFromVerticeWeights(Spatial model, List<Integer> boneIndices, Vector3f initialScale, Vector3f initialPosition, float weightThreshold) {
+
+        ArrayList<Float> points = new ArrayList<Float>();
+        if (model instanceof Geometry) {
+            Geometry g = (Geometry) model;
+            for (Integer index : boneIndices) {
+                points.addAll(getPoints(g.getMesh(), index, initialScale, initialPosition, weightThreshold));
+            }
+        } else if (model instanceof Node) {
+            Node node = (Node) model;
+            for (Spatial s : node.getChildren()) {
+                if (s instanceof Geometry) {
+                    Geometry g = (Geometry) s;
+                    for (Integer index : boneIndices) {
+                        points.addAll(getPoints(g.getMesh(), index, initialScale, initialPosition, weightThreshold));
+                    }
+
+                }
+            }
+        }
+        float[] p = new float[points.size()];
+        for (int i = 0; i < points.size(); i++) {
+            p[i] = points.get(i);
+        }
+
+
+        return new HullCollisionShape(p);
+    }
+
+    /**
+     * returns a list of points for the given bone
+     * @param mesh
+     * @param boneIndex
+     * @param offset
+     * @param link
+     * @return 
+     */
+    private static List<Float> getPoints(Mesh mesh, int boneIndex, Vector3f initialScale, Vector3f offset, float weightThreshold) {
+
+        FloatBuffer vertices = mesh.getFloatBuffer(Type.Position);
+        ByteBuffer boneIndices = (ByteBuffer) mesh.getBuffer(Type.BoneIndex).getData();
+        FloatBuffer boneWeight = (FloatBuffer) mesh.getBuffer(Type.BoneWeight).getData();
+
+        vertices.rewind();
+        boneIndices.rewind();
+        boneWeight.rewind();
+
+        ArrayList<Float> results = new ArrayList<Float>();
+
+        int vertexComponents = mesh.getVertexCount() * 3;
+
+        for (int i = 0; i < vertexComponents; i += 3) {
+            int k;
+            boolean add = false;
+            int start = i / 3 * 4;
+            for (k = start; k < start + 4; k++) {
+                if (boneIndices.get(k) == boneIndex && boneWeight.get(k) >= weightThreshold) {
+                    add = true;
+                    break;
+                }
+            }
+            if (add) {
+
+                Vector3f pos = new Vector3f();
+                pos.x = vertices.get(i);
+                pos.y = vertices.get(i + 1);
+                pos.z = vertices.get(i + 2);
+                pos.subtractLocal(offset).multLocal(initialScale);
+                results.add(pos.x);
+                results.add(pos.y);
+                results.add(pos.z);
+
+            }
+        }
+
+        return results;
+    }
+
+    /**
+     * Updates a bone position and rotation.
+     * if the child bones are not in the bone list this means, they are not associated with a physic shape.
+     * So they have to be updated
+     * @param bone the bone
+     * @param pos the position
+     * @param rot the rotation
+     */
+    public static void setTransform(Bone bone, Vector3f pos, Quaternion rot, boolean restoreBoneControl, Set<String> boneList) {
+        //we ensure that we have the control
+        if (restoreBoneControl) {
+            bone.setUserControl(true);
+        }
+        //we set te user transforms of the bone
+        bone.setUserTransformsWorld(pos, rot);
+        for (Bone childBone : bone.getChildren()) {
+            //each child bone that is not in the list is updated
+            if (!boneList.contains(childBone.getName())) {
+                Transform t = childBone.getCombinedTransform(pos, rot);
+                setTransform(childBone, t.getTranslation(), t.getRotation(), restoreBoneControl, boneList);
+            }
+        }
+        //we give back the control to the keyframed animation
+        if (restoreBoneControl) {
+            bone.setUserControl(false);
+        }
+    }
+
+    public static void setUserControl(Bone bone, boolean bool) {
+        bone.setUserControl(bool);
+        for (Bone child : bone.getChildren()) {
+            setUserControl(child, bool);
+        }
+    }
+}

+ 0 - 0
engine/src/bullet/com/jme3/bullet/util/CollisionShapeFactory.java → engine/src/bullet-common/com/jme3/bullet/util/CollisionShapeFactory.java


+ 259 - 0
engine/src/bullet-native/android/Android.mk

@@ -0,0 +1,259 @@
+# /*
+# Bullet Continuous Collision Detection and Physics Library for Android NDK
+# Copyright (c) 2006-2009 Noritsuna Imamura  <a href="http://www.siprop.org/" rel="nofollow">http://www.siprop.org/</a>
+#
+# This software is provided 'as-is', without any express or implied warranty.
+# In no event will the authors be held liable for any damages arising from the use of this software.
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it freely,
+# subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+# */
+LOCAL_PATH:= $(call my-dir)
+JME3_PATH:=
+BULLET_PATH:=
+ 
+include $(CLEAR_VARS)
+ 
+LOCAL_MODULE    := bulletjme
+LOCAL_C_INCLUDES := $(BULLET_PATH)/\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver\
+    $(BULLET_PATH)/BulletDynamics/Dynamics\
+    $(BULLET_PATH)/BulletDynamics/Vehicle\
+    $(BULLET_PATH)/LinearMath\
+    $(BULLET_PATH)/BulletCollision\
+    $(BULLET_PATH)/BulletDynamics\
+    $(BULLET_PATH)/BulletMultiThreaded\
+    $(BULLET_PATH)/BulletSoftBody\
+    $(BULLET_PATH)/ibmsdk\
+    $(BULLET_PATH)/LinearMath\
+    $(BULLET_PATH)/MiniCL\
+    $(BULLET_PATH)/vectormath\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes\
+    $(BULLET_PATH)/BulletCollision/Gimpact\
+    $(BULLET_PATH)/BulletCollision/ibmsdk\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision\
+    $(BULLET_PATH)/BulletDynamics/Character\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver\
+    $(BULLET_PATH)/BulletDynamics/Dynamics\
+    $(BULLET_PATH)/BulletDynamics/ibmsdk\
+    $(BULLET_PATH)/BulletDynamics/Vehicle\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers\
+    $(BULLET_PATH)/BulletMultiThreaded/out\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuNarrowPhaseCollisionTask\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuSampleTask\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/CPU\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/DX11\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Apple\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10\
+    $(BULLET_PATH)/LinearMath/ibmsdk\
+    $(BULLET_PATH)/MiniCL/MiniCLTask\
+    $(BULLET_PATH)/vectormath/scalar\
+    $(BULLET_PATH)/vectormath/sse
+ 
+LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)
+LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl -lm -llog
+ 
+LOCAL_SRC_FILES := $(JME3_PATH)/com_jme3_bullet_collision_PhysicsCollisionEvent.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_PhysicsCollisionObject.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_BoxCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_CollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_CompoundCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_ConeCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_CylinderCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_GImpactCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_HullCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_MeshCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_PlaneCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_SimplexCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_collision_shapes_SphereCollisionShape.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_ConeJoint.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_HingeJoint.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_motors_RotationalLimitMotor.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_PhysicsJoint.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_Point2PointJoint.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_SixDofJoint.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_SixDofSpringJoint.cpp\
+    $(JME3_PATH)/com_jme3_bullet_joints_SliderJoint.cpp\
+    $(JME3_PATH)/com_jme3_bullet_objects_infos_RigidBodyMotionState.cpp\
+    $(JME3_PATH)/com_jme3_bullet_objects_PhysicsCharacter.cpp\
+    $(JME3_PATH)/com_jme3_bullet_objects_PhysicsGhostObject.cpp\
+    $(JME3_PATH)/com_jme3_bullet_objects_PhysicsRigidBody.cpp\
+    $(JME3_PATH)/com_jme3_bullet_objects_PhysicsVehicle.cpp\
+    $(JME3_PATH)/com_jme3_bullet_objects_VehicleWheel.cpp\
+    $(JME3_PATH)/com_jme3_bullet_PhysicsSpace.cpp\
+    $(JME3_PATH)/com_jme3_bullet_util_DebugShapeFactory.cpp\
+    $(JME3_PATH)/com_jme3_bullet_util_NativeMeshUtil.cpp\
+    $(JME3_PATH)/jmeBulletUtil.cpp\
+    $(JME3_PATH)/jmeClasses.cpp\
+    $(JME3_PATH)/jmeMotionState.cpp\
+    $(JME3_PATH)/jmePhysicsSpace.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btDbvt.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btDispatcher.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp\
+    $(BULLET_PATH)/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btCollisionObject.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btCollisionWorld.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btGhostObject.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btManifoldResult.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/btUnionFind.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btBox2dShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btBoxShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btCapsuleShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btCollisionShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btCompoundShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConcaveShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConeShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConvex2dShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConvexHullShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConvexInternalShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConvexShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btCylinderShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btEmptyShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btMultiSphereShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btOptimizedBvh.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btShapeHull.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btSphereShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btTetrahedronShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btTriangleBuffer.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btTriangleCallback.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btTriangleMesh.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp\
+    $(BULLET_PATH)/BulletCollision/CollisionShapes/btUniformScalingShape.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/btContactProcessing.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/btGenericPoolAllocator.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/btGImpactBvh.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/btGImpactShape.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/btTriangleShapeEx.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/gim_box_set.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/gim_contact.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/gim_memory.cpp\
+    $(BULLET_PATH)/BulletCollision/Gimpact/gim_tri_collision.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp\
+    $(BULLET_PATH)/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp\
+    $(BULLET_PATH)/BulletDynamics/Character/btKinematicCharacterController.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btContactConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp\
+    $(BULLET_PATH)/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp\
+    $(BULLET_PATH)/BulletDynamics/Dynamics/btRigidBody.cpp\
+    $(BULLET_PATH)/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp\
+    $(BULLET_PATH)/BulletDynamics/Dynamics/Bullet-C-API.cpp\
+    $(BULLET_PATH)/BulletDynamics/Vehicle/btRaycastVehicle.cpp\
+    $(BULLET_PATH)/BulletDynamics/Vehicle/btWheelInfo.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/btGpu3DGridBroadphase.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/btParallelConstraintSolver.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/btThreadSupportInterface.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/PosixThreadSupport.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SequentialThreadSupport.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuCollisionTaskProcess.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuFakeDma.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuLibspe2Support.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuSampleTaskProcess.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/Win32ThreadSupport.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/MiniCLTaskWrap.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp\
+    $(BULLET_PATH)/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btDefaultSoftBodySolver.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btSoftBody.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btSoftBodyHelpers.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btSoftRigidDynamicsWorld.cpp\
+    $(BULLET_PATH)/BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp\
+    $(BULLET_PATH)/LinearMath/btAlignedAllocator.cpp\
+    $(BULLET_PATH)/LinearMath/btConvexHull.cpp\
+    $(BULLET_PATH)/LinearMath/btConvexHullComputer.cpp\
+    $(BULLET_PATH)/LinearMath/btGeometryUtil.cpp\
+    $(BULLET_PATH)/LinearMath/btQuickprof.cpp\
+    $(BULLET_PATH)/LinearMath/btSerializer.cpp\
+    $(BULLET_PATH)/MiniCL/MiniCL.cpp\
+    $(BULLET_PATH)/MiniCL/MiniCLTaskScheduler.cpp\
+    $(BULLET_PATH)/MiniCL/MiniCLTask/MiniCLTask.cpp
+ 
+include $(BUILD_SHARED_LIBRARY)

+ 2 - 0
engine/src/bullet-native/android/Application.mk

@@ -0,0 +1,2 @@
+APP_MODULES      := bulletjme
+APP_ABI          := all

+ 273 - 0
engine/src/bullet-native/android/jmePhysicsSpace.cpp

@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "jmePhysicsSpace.h"
+#include "jmeBulletUtil.h"
+#include <stdio.h>
+
+/**
+ * Author: Normen Hansen
+ */
+jmePhysicsSpace::jmePhysicsSpace(JNIEnv* env, jobject javaSpace) {
+    //TODO: global ref? maybe not -> cleaning, rather callback class?
+    this->javaPhysicsSpace = env->NewWeakGlobalRef(javaSpace);
+    this->env = env;
+    env->GetJavaVM(&vm);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+}
+
+void jmePhysicsSpace::attachThread() {
+#ifdef JNI_VERSION_1_2
+    vm->AttachCurrentThread((JNIEnv**) &env, NULL);
+#else
+    vm->AttachCurrentThread(&env, NULL);
+#endif
+}
+
+JNIEnv* jmePhysicsSpace::getEnv() {
+    attachThread();
+    return this->env;
+}
+
+void jmePhysicsSpace::stepSimulation(jfloat tpf, jint maxSteps, jfloat accuracy) {
+    dynamicsWorld->stepSimulation(tpf, maxSteps, accuracy);
+}
+
+btThreadSupportInterface* jmePhysicsSpace::createSolverThreadSupport(int maxNumThreads) {
+#ifdef _WIN32
+    Win32ThreadSupport::Win32ThreadConstructionInfo threadConstructionInfo("solverThreads", SolverThreadFunc, SolverlsMemoryFunc, maxNumThreads);
+    Win32ThreadSupport* threadSupport = new Win32ThreadSupport(threadConstructionInfo);
+    threadSupport->startSPU();
+#elif defined (USE_PTHREADS)
+    PosixThreadSupport::ThreadConstructionInfo constructionInfo("collision", SolverThreadFunc,
+            SolverlsMemoryFunc, maxNumThreads);
+    PosixThreadSupport* threadSupport = new PosixThreadSupport(constructionInfo);
+    threadSupport->startSPU();
+#else
+    SequentialThreadSupport::SequentialThreadConstructionInfo tci("solverThreads", SolverThreadFunc, SolverlsMemoryFunc);
+    SequentialThreadSupport* threadSupport = new SequentialThreadSupport(tci);
+    threadSupport->startSPU();
+#endif
+    return threadSupport;
+}
+
+btThreadSupportInterface* jmePhysicsSpace::createDispatchThreadSupport(int maxNumThreads) {
+#ifdef _WIN32
+    Win32ThreadSupport::Win32ThreadConstructionInfo threadConstructionInfo("solverThreads", processCollisionTask, createCollisionLocalStoreMemory, maxNumThreads);
+    Win32ThreadSupport* threadSupport = new Win32ThreadSupport(threadConstructionInfo);
+    threadSupport->startSPU();
+#elif defined (USE_PTHREADS)
+    PosixThreadSupport::ThreadConstructionInfo solverConstructionInfo("solver", processCollisionTask,
+            createCollisionLocalStoreMemory, maxNumThreads);
+    PosixThreadSupport* threadSupport = new PosixThreadSupport(solverConstructionInfo);
+    threadSupport->startSPU();
+#else
+    SequentialThreadSupport::SequentialThreadConstructionInfo tci("solverThreads", processCollisionTask, createCollisionLocalStoreMemory);
+    SequentialThreadSupport* threadSupport = new SequentialThreadSupport(tci);
+    threadSupport->startSPU();
+#endif
+    return threadSupport;
+}
+
+void jmePhysicsSpace::createPhysicsSpace(jfloat minX, jfloat minY, jfloat minZ, jfloat maxX, jfloat maxY, jfloat maxZ, jint broadphaseId, jboolean threading) {
+    // collision configuration contains default setup for memory, collision setup
+    btDefaultCollisionConstructionInfo cci;
+    //    if(threading){
+    //        cci.m_defaultMaxPersistentManifoldPoolSize = 32768;
+    //    }
+    btCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration(cci);
+
+    btVector3 min = btVector3(minX, minY, minZ);
+    btVector3 max = btVector3(maxX, maxY, maxZ);
+
+    btBroadphaseInterface* broadphase;
+
+    switch (broadphaseId) {
+        case 0:
+            broadphase = new btSimpleBroadphase();
+            break;
+        case 1:
+            broadphase = new btAxisSweep3(min, max);
+            break;
+        case 2:
+            //TODO: 32bit!
+            broadphase = new btAxisSweep3(min, max);
+            break;
+        case 3:
+            broadphase = new btDbvtBroadphase();
+            break;
+        case 4:
+            //            broadphase = new btGpu3DGridBroadphase(
+            //                    min, max,
+            //                    20, 20, 20,
+            //                    10000, 1000, 25);
+            break;
+    }
+
+    btCollisionDispatcher* dispatcher;
+    btConstraintSolver* solver;
+    // use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
+    if (threading) {
+        btThreadSupportInterface* dispatchThreads = createDispatchThreadSupport(4);
+        dispatcher = new SpuGatheringCollisionDispatcher(dispatchThreads, 4, collisionConfiguration);
+        dispatcher->setDispatcherFlags(btCollisionDispatcher::CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION);
+    } else {
+        dispatcher = new btCollisionDispatcher(collisionConfiguration);
+    }
+
+    // the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
+    if (threading) {
+        btThreadSupportInterface* solverThreads = createSolverThreadSupport(4);
+        solver = new btParallelConstraintSolver(solverThreads);
+    } else {
+        solver = new btSequentialImpulseConstraintSolver;
+    }
+
+    //create dynamics world
+    btDiscreteDynamicsWorld* world = new btDiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
+    dynamicsWorld = world;
+    dynamicsWorld->setWorldUserInfo(this);
+
+    //parallel solver requires the contacts to be in a contiguous pool, so avoid dynamic allocation
+    if (threading) {
+        world->getSimulationIslandManager()->setSplitIslands(false);
+        world->getSolverInfo().m_numIterations = 4;
+        world->getSolverInfo().m_solverMode = SOLVER_SIMD + SOLVER_USE_WARMSTARTING; //+SOLVER_RANDMIZE_ORDER;
+        world->getDispatchInfo().m_enableSPU = true;
+    }
+
+    broadphase->getOverlappingPairCache()->setInternalGhostPairCallback(new btGhostPairCallback());
+
+    dynamicsWorld->setGravity(btVector3(0, -9.81f, 0));
+
+    struct jmeFilterCallback : public btOverlapFilterCallback {
+        // return true when pairs need collision
+
+        virtual bool needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy * proxy1) const {
+            //            bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
+            //            collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+            bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
+            collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+            if (collides) {
+                btCollisionObject* co0 = (btCollisionObject*) proxy0->m_clientObject;
+                btCollisionObject* co1 = (btCollisionObject*) proxy1->m_clientObject;
+                jmeUserPointer *up0 = (jmeUserPointer*) co0 -> getUserPointer();
+                jmeUserPointer *up1 = (jmeUserPointer*) co1 -> getUserPointer();
+                if (up0 != NULL && up1 != NULL) {
+                    collides = (up0->group & up1->groups) != 0;
+                    collides = collides && (up1->group & up0->groups);
+
+                    //add some additional logic here that modified 'collides'
+                    return collides;
+                }
+                return false;
+            }
+            return collides;
+        }
+    };
+    dynamicsWorld->getPairCache()->setOverlapFilterCallback(new jmeFilterCallback());
+    dynamicsWorld->setInternalTickCallback(&jmePhysicsSpace::preTickCallback, static_cast<void *> (this), true);
+    dynamicsWorld->setInternalTickCallback(&jmePhysicsSpace::postTickCallback, static_cast<void *> (this));
+    if (gContactProcessedCallback == NULL) {
+        gContactProcessedCallback = &jmePhysicsSpace::contactProcessedCallback;
+    }
+}
+
+void jmePhysicsSpace::preTickCallback(btDynamicsWorld *world, btScalar timeStep) {
+    jmePhysicsSpace* dynamicsWorld = (jmePhysicsSpace*) world->getWorldUserInfo();
+    JNIEnv* env = dynamicsWorld->getEnv();
+    jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
+    if (javaPhysicsSpace != NULL) {
+        env->CallVoidMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_preTick, timeStep);
+        env->DeleteLocalRef(javaPhysicsSpace);
+        if (env->ExceptionCheck()) {
+            env->Throw(env->ExceptionOccurred());
+            return;
+        }
+    }
+}
+
+void jmePhysicsSpace::postTickCallback(btDynamicsWorld *world, btScalar timeStep) {
+    jmePhysicsSpace* dynamicsWorld = (jmePhysicsSpace*) world->getWorldUserInfo();
+    JNIEnv* env = dynamicsWorld->getEnv();
+    jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
+    if (javaPhysicsSpace != NULL) {
+        env->CallVoidMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_postTick, timeStep);
+        env->DeleteLocalRef(javaPhysicsSpace);
+        if (env->ExceptionCheck()) {
+            env->Throw(env->ExceptionOccurred());
+            return;
+        }
+    }
+}
+
+bool jmePhysicsSpace::contactProcessedCallback(btManifoldPoint &cp, void *body0, void *body1) {
+    //    printf("contactProcessedCallback %d %dn", body0, body1);
+    btCollisionObject* co0 = (btCollisionObject*) body0;
+    jmeUserPointer *up0 = (jmeUserPointer*) co0 -> getUserPointer();
+    btCollisionObject* co1 = (btCollisionObject*) body1;
+    jmeUserPointer *up1 = (jmeUserPointer*) co1 -> getUserPointer();
+    if (up0 != NULL) {
+        jmePhysicsSpace *dynamicsWorld = (jmePhysicsSpace *)up0->space;
+        if (dynamicsWorld != NULL) {
+            JNIEnv* env = dynamicsWorld->getEnv();
+            jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
+            if (javaPhysicsSpace != NULL) {
+                jobject javaCollisionObject0 = env->NewLocalRef(up0->javaCollisionObject);
+                jobject javaCollisionObject1 = env->NewLocalRef(up1->javaCollisionObject);
+                env->CallVoidMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_addCollisionEvent, javaCollisionObject0, javaCollisionObject1, (jlong) & cp);
+                env->DeleteLocalRef(javaPhysicsSpace);
+                env->DeleteLocalRef(javaCollisionObject0);
+                env->DeleteLocalRef(javaCollisionObject1);
+                if (env->ExceptionCheck()) {
+                    env->Throw(env->ExceptionOccurred());
+                    return true;
+                }
+            }
+        }
+    }
+    return true;
+}
+
+btDynamicsWorld* jmePhysicsSpace::getDynamicsWorld() {
+    return dynamicsWorld;
+}
+
+jobject jmePhysicsSpace::getJavaPhysicsSpace() {
+    return javaPhysicsSpace;
+}
+
+jmePhysicsSpace::~jmePhysicsSpace() {
+    delete(dynamicsWorld);
+}

+ 450 - 0
engine/src/bullet-native/com_jme3_bullet_PhysicsSpace.cpp

@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "com_jme3_bullet_PhysicsSpace.h"
+#include "jmePhysicsSpace.h"
+#include "jmeBulletUtil.h"
+
+/**
+ * Author: Normen Hansen
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    createPhysicsSpace
+     * Signature: (FFFFFFI)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_PhysicsSpace_createPhysicsSpace
+    (JNIEnv * env, jobject object, jfloat minX, jfloat minY, jfloat minZ, jfloat maxX, jfloat maxY, jfloat maxZ, jint broadphase, jboolean threading) {
+        jmeClasses::initJavaClasses(env);
+        jmePhysicsSpace* space = new jmePhysicsSpace(env, object);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space has not been created.");
+            return 0;
+        }
+        space->createPhysicsSpace(minX, minY, minZ, maxX, maxY, maxZ, broadphase, threading);
+        return reinterpret_cast<jlong>(space);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    stepSimulation
+     * Signature: (JFIF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_stepSimulation
+    (JNIEnv * env, jobject object, jlong spaceId, jfloat tpf, jint maxSteps, jfloat accuracy) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        space->stepSimulation(tpf, maxSteps, accuracy);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    addCollisionObject
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCollisionObject
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The collision object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        userPointer -> space = space;
+
+        space->getDynamicsWorld()->addCollisionObject(collisionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    removeCollisionObject
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCollisionObject
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The collision object does not exist.");
+            return;
+        }
+        space->getDynamicsWorld()->removeCollisionObject(collisionObject);
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        userPointer -> space = NULL;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    addRigidBody
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addRigidBody
+    (JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btRigidBody* collisionObject = reinterpret_cast<btRigidBody*>(rigidBodyId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The collision object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        userPointer -> space = space;
+        space->getDynamicsWorld()->addRigidBody(collisionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    removeRigidBody
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeRigidBody
+    (JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btRigidBody* collisionObject = reinterpret_cast<btRigidBody*>(rigidBodyId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The collision object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        userPointer -> space = NULL;
+        space->getDynamicsWorld()->removeRigidBody(collisionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    addCharacterObject
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCharacterObject
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The collision object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        userPointer -> space = space;
+        space->getDynamicsWorld()->addCollisionObject(collisionObject,
+                btBroadphaseProxy::CharacterFilter,
+                btBroadphaseProxy::StaticFilter | btBroadphaseProxy::DefaultFilter
+        );
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    removeCharacterObject
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCharacterObject
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The collision object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        userPointer -> space = NULL;
+        space->getDynamicsWorld()->removeCollisionObject(collisionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    addAction
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addAction
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (actionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The action object does not exist.");
+            return;
+        }
+        space->getDynamicsWorld()->addAction(actionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    removeAction
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeAction
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (actionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The action object does not exist.");
+            return;
+        }
+        space->getDynamicsWorld()->removeAction(actionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    addVehicle
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addVehicle
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (actionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The vehicle object does not exist.");
+            return;
+        }
+        space->getDynamicsWorld()->addVehicle(actionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    removeVehicle
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeVehicle
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (actionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The action object does not exist.");
+            return;
+        }
+        space->getDynamicsWorld()->removeVehicle(actionObject);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    addConstraint
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraint
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (constraint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The constraint object does not exist.");
+            return;
+        }
+        space->getDynamicsWorld()->addConstraint(constraint);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    removeConstraint
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeConstraint
+    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*>(objectId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        if (constraint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The constraint object does not exist.");
+            return;
+        }
+        space->getDynamicsWorld()->removeConstraint(constraint);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    setGravity
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setGravity
+    (JNIEnv * env, jobject object, jlong spaceId, jobject vector) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+        btVector3 gravity = btVector3();
+        jmeBulletUtil::convert(env, vector, &gravity);
+        space->getDynamicsWorld()->setGravity(gravity);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    initNativePhysics
+     * Signature: ()V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_initNativePhysics
+    (JNIEnv * env, jclass clazz) {
+        jmeClasses::initJavaClasses(env);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_PhysicsSpace
+     * Method:    finalizeNative
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_finalizeNative
+    (JNIEnv * env, jobject object, jlong spaceId) {
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        if (space == NULL) {
+            return;
+        }
+        delete(space);
+    }
+    
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_rayTest_1native
+    (JNIEnv * env, jobject object, jobject to, jobject from, jlong spaceId, jobject resultlist) {
+
+        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The physics space does not exist.");
+            return;
+        }
+
+        struct AllRayResultCallback : public btCollisionWorld::RayResultCallback {
+
+            AllRayResultCallback(const btVector3& rayFromWorld, const btVector3 & rayToWorld) : m_rayFromWorld(rayFromWorld), m_rayToWorld(rayToWorld) {
+            }
+            jobject resultlist;
+            JNIEnv* env;
+            btVector3 m_rayFromWorld; //used to calculate hitPointWorld from hitFraction
+            btVector3 m_rayToWorld;
+
+            btVector3 m_hitNormalWorld;
+            btVector3 m_hitPointWorld;
+
+            virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) {
+                if (normalInWorldSpace) {
+                    m_hitNormalWorld = rayResult.m_hitNormalLocal;
+                } else {
+                    m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis() * rayResult.m_hitNormalLocal;
+                }
+                m_hitPointWorld.setInterpolate3(m_rayFromWorld, m_rayToWorld, rayResult.m_hitFraction);
+
+                jmeBulletUtil::addResult(env, resultlist, m_hitNormalWorld, m_hitPointWorld, rayResult.m_hitFraction, rayResult.m_collisionObject);
+
+                return 1.f;
+            }
+        };
+
+        btVector3 native_to = btVector3();
+        jmeBulletUtil::convert(env, to, &native_to);
+
+        btVector3 native_from = btVector3();
+        jmeBulletUtil::convert(env, from, &native_from);
+
+        AllRayResultCallback resultCallback(native_from, native_to);
+        resultCallback.env = env;
+        resultCallback.resultlist = resultlist;
+        space->getDynamicsWorld()->rayTest(native_from, native_to, resultCallback);
+        return;
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 165 - 0
engine/src/bullet-native/com_jme3_bullet_PhysicsSpace.h

@@ -0,0 +1,165 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_PhysicsSpace */
+
+#ifndef _Included_com_jme3_bullet_PhysicsSpace
+#define _Included_com_jme3_bullet_PhysicsSpace
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_jme3_bullet_PhysicsSpace_AXIS_X
+#define com_jme3_bullet_PhysicsSpace_AXIS_X 0L
+#undef com_jme3_bullet_PhysicsSpace_AXIS_Y
+#define com_jme3_bullet_PhysicsSpace_AXIS_Y 1L
+#undef com_jme3_bullet_PhysicsSpace_AXIS_Z
+#define com_jme3_bullet_PhysicsSpace_AXIS_Z 2L
+/* Inaccessible static: pQueueTL */
+/* Inaccessible static: physicsSpaceTL */
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    createPhysicsSpace
+ * Signature: (FFFFFFIZ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_PhysicsSpace_createPhysicsSpace
+  (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jint, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    stepSimulation
+ * Signature: (JFIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_stepSimulation
+  (JNIEnv *, jobject, jlong, jfloat, jint, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    addCollisionObject
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCollisionObject
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    removeCollisionObject
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCollisionObject
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    addRigidBody
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addRigidBody
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    removeRigidBody
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeRigidBody
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    addCharacterObject
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCharacterObject
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    removeCharacterObject
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCharacterObject
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    addAction
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addAction
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    removeAction
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeAction
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    addVehicle
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addVehicle
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    removeVehicle
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeVehicle
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    addConstraint
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraint
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    removeConstraint
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeConstraint
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    setGravity
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setGravity
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    rayTest_native
+ * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;JLjava/util/List;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_rayTest_1native
+  (JNIEnv *, jobject, jobject, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    initNativePhysics
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_initNativePhysics
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     com_jme3_bullet_PhysicsSpace
+ * Method:    finalizeNative
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_finalizeNative
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 308 - 0
engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionEvent.cpp

@@ -0,0 +1,308 @@
+#include "jmeBulletUtil.h"
+#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
+#include "com_jme3_bullet_collision_PhysicsCollisionEvent.h"
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getAppliedImpulse
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulse
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_appliedImpulse;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getAppliedImpulseLateral1
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral1
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_appliedImpulseLateral1;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getAppliedImpulseLateral2
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral2
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_appliedImpulseLateral2;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getCombinedFriction
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedFriction
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_combinedFriction;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getCombinedRestitution
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedRestitution
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_combinedRestitution;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getDistance1
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getDistance1
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_distance1;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getIndex0
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex0
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_index0;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getIndex1
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex1
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_index1;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLateralFrictionDir1
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir1
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject lateralFrictionDir1) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return;
+    }
+    jmeBulletUtil::convert(env, &mp -> m_lateralFrictionDir1, lateralFrictionDir1);
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLateralFrictionDir2
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir2
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject lateralFrictionDir2) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return;
+    }
+    jmeBulletUtil::convert(env, &mp -> m_lateralFrictionDir2, lateralFrictionDir2);
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    isLateralFrictionInitialized
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_isLateralFrictionInitialized
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_lateralFrictionInitialized;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLifeTime
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLifeTime
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_lifeTime;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLocalPointA
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointA
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject localPointA) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return;
+    }
+    jmeBulletUtil::convert(env, &mp -> m_localPointA, localPointA);
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLocalPointB
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointB
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject localPointB) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return;
+    }
+    jmeBulletUtil::convert(env, &mp -> m_localPointB, localPointB);
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getNormalWorldOnB
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getNormalWorldOnB
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject normalWorldOnB) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return;
+    }
+    jmeBulletUtil::convert(env, &mp -> m_normalWorldOnB, normalWorldOnB);
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPartId0
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId0
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_partId0;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPartId1
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId1
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return 0;
+    }
+    return mp -> m_partId1;
+}
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPositionWorldOnA
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnA
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject positionWorldOnA) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return;
+    }
+    jmeBulletUtil::convert(env, &mp -> m_positionWorldOnA, positionWorldOnA);
+}
+
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPositionWorldOnB
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnB
+  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject positionWorldOnB) {
+    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
+    if (mp == NULL) {
+        jclass newExc = env->FindClass("java/lang/NullPointerException");
+        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
+        return;
+    }
+    jmeBulletUtil::convert(env, &mp -> m_positionWorldOnB, positionWorldOnB);
+}

+ 173 - 0
engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionEvent.h

@@ -0,0 +1,173 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_PhysicsCollisionEvent */
+
+#ifndef _Included_com_jme3_bullet_collision_PhysicsCollisionEvent
+#define _Included_com_jme3_bullet_collision_PhysicsCollisionEvent
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_jme3_bullet_collision_PhysicsCollisionEvent_serialVersionUID
+#define com_jme3_bullet_collision_PhysicsCollisionEvent_serialVersionUID 5516075349620653480LL
+#undef com_jme3_bullet_collision_PhysicsCollisionEvent_TYPE_ADDED
+#define com_jme3_bullet_collision_PhysicsCollisionEvent_TYPE_ADDED 0L
+#undef com_jme3_bullet_collision_PhysicsCollisionEvent_TYPE_PROCESSED
+#define com_jme3_bullet_collision_PhysicsCollisionEvent_TYPE_PROCESSED 1L
+#undef com_jme3_bullet_collision_PhysicsCollisionEvent_TYPE_DESTROYED
+#define com_jme3_bullet_collision_PhysicsCollisionEvent_TYPE_DESTROYED 2L
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getAppliedImpulse
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulse
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getAppliedImpulseLateral1
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral1
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getAppliedImpulseLateral2
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral2
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getCombinedFriction
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedFriction
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getCombinedRestitution
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedRestitution
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getDistance1
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getDistance1
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getIndex0
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex0
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getIndex1
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex1
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLateralFrictionDir1
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir1
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLateralFrictionDir2
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir2
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    isLateralFrictionInitialized
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_isLateralFrictionInitialized
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLifeTime
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLifeTime
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLocalPointA
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointA
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getLocalPointB
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointB
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getNormalWorldOnB
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getNormalWorldOnB
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPartId0
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId0
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPartId1
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId1
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPositionWorldOnA
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnA
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
+ * Method:    getPositionWorldOnB
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnB
+  (JNIEnv *, jobject, jlong, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 148 - 0
engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionObject.cpp

@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_PhysicsCollisionObject.h"
+#include "jmeBulletUtil.h"
+#include "jmePhysicsSpace.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+     * Method:    attachCollisionShape
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_attachCollisionShape
+    (JNIEnv * env, jobject object, jlong objectId, jlong shapeId) {
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/IllegalStateException");
+            env->ThrowNew(newExc, "The collision object does not exist.");
+            return;
+        }
+        btCollisionShape* collisionShape = reinterpret_cast<btCollisionShape*>(shapeId);
+        if (collisionShape == NULL) {
+            jclass newExc = env->FindClass("java/lang/IllegalStateException");
+            env->ThrowNew(newExc, "The collision shape does not exist.");
+            return;
+        }
+        collisionObject->setCollisionShape(collisionShape);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+     * Method:    finalizeNative
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_finalizeNative
+    (JNIEnv * env, jobject object, jlong objectId) {
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        if (collisionObject -> getUserPointer() != NULL){
+            jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+            delete(userPointer);
+        }
+        delete(collisionObject);
+    }
+    /*
+     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+     * Method:    initUserPointer
+     * Signature: (JII)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_initUserPointer
+      (JNIEnv *env, jobject object, jlong objectId, jint group, jint groups) {
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        if (userPointer != NULL) {
+//            delete(userPointer);
+        }
+        userPointer = new jmeUserPointer();
+        userPointer -> javaCollisionObject = env->NewWeakGlobalRef(object);
+        userPointer -> group = group;
+        userPointer -> groups = groups;
+        userPointer -> space = NULL;
+        collisionObject -> setUserPointer(userPointer);
+    }
+    /*
+     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+     * Method:    setCollisionGroup
+     * Signature: (JI)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_setCollisionGroup
+      (JNIEnv *env, jobject object, jlong objectId, jint group) {
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        if (userPointer != NULL){
+            userPointer -> group = group;
+        }
+    }
+    /*
+     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+     * Method:    setCollideWithGroups
+     * Signature: (JI)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_setCollideWithGroups
+      (JNIEnv *env, jobject object, jlong objectId, jint groups) {
+        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
+        if (collisionObject == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
+        if (userPointer != NULL){
+            userPointer -> groups = groups;
+        }
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 87 - 0
engine/src/bullet-native/com_jme3_bullet_collision_PhysicsCollisionObject.h

@@ -0,0 +1,87 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_PhysicsCollisionObject */
+
+#ifndef _Included_com_jme3_bullet_collision_PhysicsCollisionObject
+#define _Included_com_jme3_bullet_collision_PhysicsCollisionObject
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_NONE
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_NONE 0L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_01
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_01 1L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_02
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_02 2L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_03
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_03 4L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_04
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_04 8L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_05
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_05 16L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_06
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_06 32L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_07
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_07 64L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_08
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_08 128L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_09
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_09 256L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_10
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_10 512L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_11
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_11 1024L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_12
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_12 2048L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_13
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_13 4096L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_14
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_14 8192L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_15
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_15 16384L
+#undef com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_16
+#define com_jme3_bullet_collision_PhysicsCollisionObject_COLLISION_GROUP_16 32768L
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+ * Method:    initUserPointer
+ * Signature: (JII)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_initUserPointer
+  (JNIEnv *, jobject, jlong, jint, jint);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+ * Method:    attachCollisionShape
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_attachCollisionShape
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+ * Method:    setCollisionGroup
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_setCollisionGroup
+  (JNIEnv *, jobject, jlong, jint);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+ * Method:    setCollideWithGroups
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_setCollideWithGroups
+  (JNIEnv *, jobject, jlong, jint);
+
+/*
+ * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
+ * Method:    finalizeNative
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_finalizeNative
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 59 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_BoxCollisionShape.cpp

@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_BoxCollisionShape.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_BoxCollisionShape
+     * Method:    createShape
+     * Signature: (Lcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_BoxCollisionShape_createShape
+    (JNIEnv *env, jobject object, jobject halfExtents) {
+        jmeClasses::initJavaClasses(env);
+        btVector3 extents =  btVector3();
+        jmeBulletUtil::convert(env, halfExtents, &extents);
+        btBoxShape* shape = new btBoxShape(extents);
+        return reinterpret_cast<jlong>(shape);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_BoxCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_BoxCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_BoxCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_BoxCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_BoxCollisionShape
+ * Method:    createShape
+ * Signature: (Lcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_BoxCollisionShape_createShape
+  (JNIEnv *, jobject, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 68 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.cpp

@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_CapsuleCollisionShape.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CapsuleCollisionShape
+     * Method:    createShape
+     * Signature: (IFF)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CapsuleCollisionShape_createShape
+    (JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
+        jmeClasses::initJavaClasses(env);
+        btCollisionShape* shape;
+        switch(axis){
+            case 0:
+                shape = new btCapsuleShapeX(radius, height);
+                break;
+            case 1:
+                shape = new btCapsuleShape(radius, height);
+                break;
+            case 2:
+                shape = new btCapsuleShapeZ(radius, height);
+                break;
+        }
+        return reinterpret_cast<jlong>(shape);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_CapsuleCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_CapsuleCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_CapsuleCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CapsuleCollisionShape
+ * Method:    createShape
+ * Signature: (IFF)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CapsuleCollisionShape_createShape
+  (JNIEnv *, jobject, jint, jfloat, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 110 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CollisionShape.cpp

@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_CollisionShape.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+     * Method:    getMargin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_getMargin
+    (JNIEnv * env, jobject object, jlong shapeId) {
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return shape->getMargin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+     * Method:    setLocalScaling
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setLocalScaling
+    (JNIEnv * env, jobject object, jlong shapeId, jobject scale) {
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 scl = btVector3();
+        jmeBulletUtil::convert(env, scale, &scl);
+        shape->setLocalScaling(scl);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+     * Method:    setMargin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setMargin
+    (JNIEnv * env, jobject object, jlong shapeId, jfloat newMargin) {
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        shape->setMargin(newMargin);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+     * Method:    finalizeNative
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_finalizeNative
+    (JNIEnv * env, jobject object, jlong shapeId) {
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        delete(shape);
+    }
+#ifdef __cplusplus
+}
+#endif

+ 45 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CollisionShape.h

@@ -0,0 +1,45 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_CollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_CollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_CollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+ * Method:    getMargin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_getMargin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+ * Method:    setLocalScaling
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setLocalScaling
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+ * Method:    setMargin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setMargin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CollisionShape
+ * Method:    finalizeNative
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_finalizeNative
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 107 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CompoundCollisionShape.cpp

@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_CompoundCollisionShape.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+     * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
+     * Method:    createShape
+     * Signature: ()J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_createShape
+    (JNIEnv *env, jobject object) {
+        jmeClasses::initJavaClasses(env);
+        btCompoundShape* shape = new btCompoundShape();
+        return reinterpret_cast<jlong>(shape);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
+     * Method:    addChildShape
+     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_addChildShape
+    (JNIEnv *env, jobject object, jlong compoundId, jlong childId, jobject childLocation, jobject childRotation) {
+        btCompoundShape* shape = reinterpret_cast<btCompoundShape*>(compoundId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        btCollisionShape* child = reinterpret_cast<btCollisionShape*>(childId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        btMatrix3x3 mtx = btMatrix3x3();
+        btTransform trans = btTransform(mtx);
+        jmeBulletUtil::convert(env, childLocation, &trans.getOrigin());
+        jmeBulletUtil::convert(env, childRotation, &trans.getBasis());
+        shape->addChildShape(trans, child);
+        return 0;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
+     * Method:    removeChildShape
+     * Signature: (JJ)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_removeChildShape
+    (JNIEnv * env, jobject object, jlong compoundId, jlong childId) {
+        btCompoundShape* shape = reinterpret_cast<btCompoundShape*>(compoundId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        btCollisionShape* child = reinterpret_cast<btCollisionShape*>(childId);
+        if (shape == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        shape->removeChildShape(child);
+        return 0;
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 37 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CompoundCollisionShape.h

@@ -0,0 +1,37 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_CompoundCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_CompoundCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_CompoundCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
+ * Method:    createShape
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_createShape
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
+ * Method:    addChildShape
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_addChildShape
+  (JNIEnv *, jobject, jlong, jlong, jobject, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
+ * Method:    removeChildShape
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_removeChildShape
+  (JNIEnv *, jobject, jlong, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 68 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_ConeCollisionShape.cpp

@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_ConeCollisionShape.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_ConeCollisionShape
+     * Method:    createShape
+     * Signature: (IFF)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_ConeCollisionShape_createShape
+    (JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
+        jmeClasses::initJavaClasses(env);
+        btCollisionShape* shape;
+        switch (axis) {
+            case 0:
+                shape = new btConeShapeX(radius, height);
+                break;
+            case 1:
+                shape = new btConeShape(radius, height);
+                break;
+            case 2:
+                shape = new btConeShapeZ(radius, height);
+                break;
+        }
+        return reinterpret_cast<jlong>(shape);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_ConeCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_ConeCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_ConeCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_ConeCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_ConeCollisionShape
+ * Method:    createShape
+ * Signature: (IFF)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_ConeCollisionShape_createShape
+  (JNIEnv *, jobject, jint, jfloat, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 70 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CylinderCollisionShape.cpp

@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_CylinderCollisionShape.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_CylinderCollisionShape
+     * Method:    createShape
+     * Signature: (ILcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CylinderCollisionShape_createShape
+    (JNIEnv * env, jobject object, jint axis, jobject halfExtents) {
+        jmeClasses::initJavaClasses(env);
+        btVector3 extents = btVector3();
+        jmeBulletUtil::convert(env, halfExtents, &extents);
+        btCollisionShape* shape;
+        switch (axis) {
+            case 0:
+                shape = new btCylinderShapeX(extents);
+                break;
+            case 1:
+                shape = new btCylinderShape(extents);
+                break;
+            case 2:
+                shape = new btCylinderShapeZ(extents);
+                break;
+        }
+        return reinterpret_cast<jlong>(shape);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_CylinderCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_CylinderCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_CylinderCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_CylinderCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_CylinderCollisionShape
+ * Method:    createShape
+ * Signature: (ILcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CylinderCollisionShape_createShape
+  (JNIEnv *, jobject, jint, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 70 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_GImpactCollisionShape.cpp

@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_GImpactCollisionShape.h"
+#include "jmeBulletUtil.h"
+#include <BulletCollision/Gimpact/btGImpactShape.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_GImpactCollisionShape
+     * Method:    createShape
+     * Signature: (J)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_createShape
+    (JNIEnv * env, jobject object, jlong meshId) {
+        jmeClasses::initJavaClasses(env);
+        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*>(meshId);
+        btGImpactMeshShape* shape = new btGImpactMeshShape(array);
+        return reinterpret_cast<jlong>(shape);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_GImpactCollisionShape
+     * Method:    finalizeNative
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_finalizeNative
+    (JNIEnv * env, jobject object, jlong meshId) {
+        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*> (meshId);
+        delete(array);
+    }
+    
+#ifdef __cplusplus
+}
+#endif

+ 29 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_GImpactCollisionShape.h

@@ -0,0 +1,29 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_GImpactCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_GImpactCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_GImpactCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_GImpactCollisionShape
+ * Method:    createShape
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_createShape
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_GImpactCollisionShape
+ * Method:    finalizeNative
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_finalizeNative
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 59 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.cpp

@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.h"
+#include "jmeBulletUtil.h"
+#include "BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_HeightfieldCollisionShape
+     * Method:    createShape
+     * Signature: (II[FFFFIZ)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HeightfieldCollisionShape_createShape
+    (JNIEnv * env, jobject object, jint heightStickWidth, jint heightStickLength, jobject heightfieldData, jfloat heightScale, jfloat minHeight, jfloat maxHeight, jint upAxis, jboolean flipQuadEdges) {
+        jmeClasses::initJavaClasses(env);
+        void* data = env->GetDirectBufferAddress(heightfieldData);
+        btHeightfieldTerrainShape* shape=new btHeightfieldTerrainShape(heightStickWidth, heightStickLength, data, heightScale, minHeight, maxHeight, upAxis, PHY_FLOAT, flipQuadEdges);
+        return reinterpret_cast<jlong>(shape);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_HeightfieldCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_HeightfieldCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_HeightfieldCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_HeightfieldCollisionShape
+ * Method:    createShape
+ * Signature: (IILjava/nio/ByteBuffer;FFFIZ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HeightfieldCollisionShape_createShape
+  (JNIEnv *, jobject, jint, jint, jobject, jfloat, jfloat, jfloat, jint, jboolean);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 69 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_HullCollisionShape.cpp

@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_HullCollisionShape.h"
+#include "jmeBulletUtil.h"
+#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_HullCollisionShape
+     * Method:    createShape
+     * Signature: ([F)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HullCollisionShape_createShape
+    (JNIEnv *env, jobject object, jobject array) {
+        jmeClasses::initJavaClasses(env);
+        float* data = (float*) env->GetDirectBufferAddress(array);
+        //TODO: capacity will not always be length!
+        int length = env->GetDirectBufferCapacity(array)/4;
+        btConvexHullShape* shape = new btConvexHullShape();
+        for (int i = 0; i < length; i+=3) {
+            btVector3 vect = btVector3(data[i],
+                    data[i + 1],
+                    data[i + 2]);
+            
+            shape->addPoint(vect);
+        }
+
+        return reinterpret_cast<jlong>(shape);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_HullCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_HullCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_HullCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_HullCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_HullCollisionShape
+ * Method:    createShape
+ * Signature: (Ljava/nio/ByteBuffer;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HullCollisionShape_createShape
+  (JNIEnv *, jobject, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 70 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_MeshCollisionShape.cpp

@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_MeshCollisionShape.h"
+#include "jmeBulletUtil.h"
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
+     * Method:    createShape
+     * Signature: (J)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_createShape
+    (JNIEnv * env, jobject object, jlong arrayId) {
+        jmeClasses::initJavaClasses(env);
+        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*>(arrayId);
+        btBvhTriangleMeshShape* shape = new btBvhTriangleMeshShape(array, true, true);
+        return reinterpret_cast<jlong>(shape);
+    }
+    
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
+     * Method:    finalizeNative
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_finalizeNative
+    (JNIEnv * env, jobject object, jlong arrayId){
+        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*>(arrayId);
+        delete(array);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 29 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_MeshCollisionShape.h

@@ -0,0 +1,29 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_MeshCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_MeshCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_MeshCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
+ * Method:    createShape
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_createShape
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
+ * Method:    finalizeNative
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_finalizeNative
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 60 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_PlaneCollisionShape.cpp

@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_PlaneCollisionShape.h"
+#include "jmeBulletUtil.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_PlaneCollisionShape
+     * Method:    createShape
+     * Signature: (Lcom/jme3/math/Vector3f;F)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_PlaneCollisionShape_createShape
+    (JNIEnv * env, jobject object, jobject normal, jfloat constant) {
+        jmeClasses::initJavaClasses(env);
+        btVector3 norm = btVector3();
+        jmeBulletUtil::convert(env, normal, &norm);
+        btStaticPlaneShape* shape = new btStaticPlaneShape(norm, constant);
+        return reinterpret_cast<jlong>(shape);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_PlaneCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_PlaneCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_PlaneCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_PlaneCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_PlaneCollisionShape
+ * Method:    createShape
+ * Signature: (Lcom/jme3/math/Vector3f;F)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_PlaneCollisionShape_createShape
+  (JNIEnv *, jobject, jobject, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 110 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_SimplexCollisionShape.cpp

@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_collision_shapes_SimplexCollisionShape.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+     * Method:    createShape
+     * Signature: (Lcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2
+    (JNIEnv *env, jobject object, jobject vector1) {
+        jmeClasses::initJavaClasses(env);
+        btVector3 vec1 = btVector3();
+        jmeBulletUtil::convert(env, vector1, &vec1);
+        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1);
+        return reinterpret_cast<jlong>(simplexShape);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+     * Method:    createShape
+     * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
+    (JNIEnv *env, jobject object, jobject vector1, jobject vector2) {
+        jmeClasses::initJavaClasses(env);
+        btVector3 vec1 = btVector3();
+        jmeBulletUtil::convert(env, vector1, &vec1);
+        btVector3 vec2 = btVector3();
+        jmeBulletUtil::convert(env, vector2, &vec2);
+        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2);
+        return reinterpret_cast<jlong>(simplexShape);
+    }
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+     * Method:    createShape
+     * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
+    (JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3) {
+        jmeClasses::initJavaClasses(env);
+        btVector3 vec1 = btVector3();
+        jmeBulletUtil::convert(env, vector1, &vec1);
+        btVector3 vec2 = btVector3();
+        jmeBulletUtil::convert(env, vector2, &vec2);
+        btVector3 vec3 = btVector3();
+        jmeBulletUtil::convert(env, vector3, &vec3);
+        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3);
+        return reinterpret_cast<jlong>(simplexShape);
+    }
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+     * Method:    createShape
+     * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
+    (JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3, jobject vector4) {
+        jmeClasses::initJavaClasses(env);
+        btVector3 vec1 = btVector3();
+        jmeBulletUtil::convert(env, vector1, &vec1);
+        btVector3 vec2 = btVector3();
+        jmeBulletUtil::convert(env, vector2, &vec2);
+        btVector3 vec3 = btVector3();
+        jmeBulletUtil::convert(env, vector3, &vec3);
+        btVector3 vec4 = btVector3();
+        jmeBulletUtil::convert(env, vector4, &vec4);
+        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3, vec4);
+        return reinterpret_cast<jlong>(simplexShape);
+    }
+#ifdef __cplusplus
+}
+#endif

+ 45 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_SimplexCollisionShape.h

@@ -0,0 +1,45 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_SimplexCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_SimplexCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_SimplexCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+ * Method:    createShape
+ * Signature: (Lcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2
+  (JNIEnv *, jobject, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+ * Method:    createShape
+ * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
+  (JNIEnv *, jobject, jobject, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+ * Method:    createShape
+ * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
+  (JNIEnv *, jobject, jobject, jobject, jobject);
+
+/*
+ * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
+ * Method:    createShape
+ * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
+  (JNIEnv *, jobject, jobject, jobject, jobject, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 18 - 15
engine/src/jbullet/com/jme3/bullet/PhysicsTickListener.java → engine/src/bullet-native/com_jme3_bullet_collision_shapes_SphereCollisionShape.cpp

@@ -29,26 +29,29 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-package com.jme3.bullet;
 
 /**
- * Implement this interface to be called from the physics thread on a physics update.
- * @author normenhansen
+ * Author: Normen Hansen
  */
-public interface PhysicsTickListener {
+#include "com_jme3_bullet_collision_shapes_SphereCollisionShape.h"
+#include "jmeBulletUtil.h"
 
-    /**
-     * Called before the physics is actually stepped, use to apply forces etc.
-     * @param space
-     * @param f
-     */
-    public void prePhysicsTick(PhysicsSpace space, float f);
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-    /**
-     * Called after the physics has been stepped, use to check for forces etc.
-     * @param space
-     * @param f
+    /*
+     * Class:     com_jme3_bullet_collision_shapes_SphereCollisionShape
+     * Method:    createShape
+     * Signature: (F)J
      */
-    public void physicsTick(PhysicsSpace space, float f);
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SphereCollisionShape_createShape
+    (JNIEnv *env, jobject object, jfloat radius) {
+        jmeClasses::initJavaClasses(env);
+        btSphereShape* shape=new btSphereShape(radius);
+        return reinterpret_cast<jlong>(shape);
+    }
 
+#ifdef __cplusplus
 }
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_collision_shapes_SphereCollisionShape.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_collision_shapes_SphereCollisionShape */
+
+#ifndef _Included_com_jme3_bullet_collision_shapes_SphereCollisionShape
+#define _Included_com_jme3_bullet_collision_shapes_SphereCollisionShape
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_collision_shapes_SphereCollisionShape
+ * Method:    createShape
+ * Signature: (F)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SphereCollisionShape_createShape
+  (JNIEnv *, jobject, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 100 - 0
engine/src/bullet-native/com_jme3_bullet_joints_ConeJoint.cpp

@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_ConeJoint.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_ConeJoint
+     * Method:    setLimit
+     * Signature: (JFFF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setLimit
+    (JNIEnv * env, jobject object, jlong jointId, jfloat swingSpan1, jfloat swingSpan2, jfloat twistSpan) {
+        btConeTwistConstraint* joint = reinterpret_cast<btConeTwistConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        //TODO: extended setLimit!
+        joint->setLimit(swingSpan1, swingSpan2, twistSpan);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_ConeJoint
+     * Method:    setAngularOnly
+     * Signature: (JZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setAngularOnly
+    (JNIEnv * env, jobject object, jlong jointId, jboolean angularOnly) {
+        btConeTwistConstraint* joint = reinterpret_cast<btConeTwistConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setAngularOnly(angularOnly);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_ConeJoint
+     * Method:    createJoint
+     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_ConeJoint_createJoint
+    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB) {
+        jmeClasses::initJavaClasses(env);
+        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
+        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
+        btMatrix3x3 mtx1 = btMatrix3x3();
+        btMatrix3x3 mtx2 = btMatrix3x3();
+        btTransform transA = btTransform(mtx1);
+        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
+        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
+        btTransform transB = btTransform(mtx2);
+        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
+        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
+        btConeTwistConstraint* joint = new btConeTwistConstraint(*bodyA, *bodyB, transA, transB);
+        return reinterpret_cast<jlong>(joint);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 37 - 0
engine/src/bullet-native/com_jme3_bullet_joints_ConeJoint.h

@@ -0,0 +1,37 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_ConeJoint */
+
+#ifndef _Included_com_jme3_bullet_joints_ConeJoint
+#define _Included_com_jme3_bullet_joints_ConeJoint
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_ConeJoint
+ * Method:    setLimit
+ * Signature: (JFFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setLimit
+  (JNIEnv *, jobject, jlong, jfloat, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_ConeJoint
+ * Method:    setAngularOnly
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setAngularOnly
+  (JNIEnv *, jobject, jlong, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_joints_ConeJoint
+ * Method:    createJoint
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_ConeJoint_createJoint
+  (JNIEnv *, jobject, jlong, jlong, jobject, jobject, jobject, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 226 - 0
engine/src/bullet-native/com_jme3_bullet_joints_HingeJoint.cpp

@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_HingeJoint.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    enableMotor
+     * Signature: (JZFF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_enableMotor
+    (JNIEnv * env, jobject object, jlong jointId, jboolean enable, jfloat targetVelocity, jfloat maxMotorImpulse) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->enableAngularMotor(enable, targetVelocity, maxMotorImpulse);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    getEnableAngularMotor
+     * Signature: (J)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_HingeJoint_getEnableAngularMotor
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return joint->getEnableAngularMotor();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    getMotorTargetVelocity
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMotorTargetVelocity
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getMotorTargetVelosity();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    getMaxMotorImpulse
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMaxMotorImpulse
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getMaxMotorImpulse();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    setLimit
+     * Signature: (JFF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFF
+    (JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        return joint->setLimit(low, high);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    setLimit
+     * Signature: (JFFFFF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFFFFF
+    (JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high, jfloat softness, jfloat biasFactor, jfloat relaxationFactor) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        return joint->setLimit(low, high, softness, biasFactor, relaxationFactor);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    getUpperLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getUpperLimit
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getUpperLimit();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    getLowerLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getLowerLimit
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getLowerLimit();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    setAngularOnly
+     * Signature: (JZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setAngularOnly
+    (JNIEnv * env, jobject object, jlong jointId, jboolean angular) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setAngularOnly(angular);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    getHingeAngle
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getHingeAngle
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btHingeConstraint* joint = reinterpret_cast<btHingeConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getHingeAngle();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_HingeJoint
+     * Method:    createJoint
+     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_HingeJoint_createJoint
+    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject axisA, jobject pivotB, jobject axisB) {
+        jmeClasses::initJavaClasses(env);
+        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
+        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
+        btVector3 vec1 = btVector3();
+        btVector3 vec2 = btVector3();
+        btVector3 vec3 = btVector3();
+        btVector3 vec4 = btVector3();
+        jmeBulletUtil::convert(env, pivotA, &vec1);
+        jmeBulletUtil::convert(env, pivotB, &vec2);
+        jmeBulletUtil::convert(env, axisA, &vec3);
+        jmeBulletUtil::convert(env, axisB, &vec4);
+        btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, vec1, vec2, vec3, vec4);
+        return reinterpret_cast<jlong>(joint);
+    }
+#ifdef __cplusplus
+}
+#endif

+ 101 - 0
engine/src/bullet-native/com_jme3_bullet_joints_HingeJoint.h

@@ -0,0 +1,101 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_HingeJoint */
+
+#ifndef _Included_com_jme3_bullet_joints_HingeJoint
+#define _Included_com_jme3_bullet_joints_HingeJoint
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    enableMotor
+ * Signature: (JZFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_enableMotor
+  (JNIEnv *, jobject, jlong, jboolean, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    getEnableAngularMotor
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_HingeJoint_getEnableAngularMotor
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    getMotorTargetVelocity
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMotorTargetVelocity
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    getMaxMotorImpulse
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMaxMotorImpulse
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    setLimit
+ * Signature: (JFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFF
+  (JNIEnv *, jobject, jlong, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    setLimit
+ * Signature: (JFFFFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFFFFF
+  (JNIEnv *, jobject, jlong, jfloat, jfloat, jfloat, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    getUpperLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getUpperLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    getLowerLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getLowerLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    setAngularOnly
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setAngularOnly
+  (JNIEnv *, jobject, jlong, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    getHingeAngle
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getHingeAngle
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_HingeJoint
+ * Method:    createJoint
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_HingeJoint_createJoint
+  (JNIEnv *, jobject, jlong, jlong, jobject, jobject, jobject, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 61 - 0
engine/src/bullet-native/com_jme3_bullet_joints_PhysicsJoint.cpp

@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_PhysicsJoint.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_PhysicsJoint
+     * Method:    getAppliedImpulse
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_getAppliedImpulse
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btTypedConstraint* joint = reinterpret_cast<btTypedConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getAppliedImpulse();
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 29 - 0
engine/src/bullet-native/com_jme3_bullet_joints_PhysicsJoint.h

@@ -0,0 +1,29 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_PhysicsJoint */
+
+#ifndef _Included_com_jme3_bullet_joints_PhysicsJoint
+#define _Included_com_jme3_bullet_joints_PhysicsJoint
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_PhysicsJoint
+ * Method:    getAppliedImpulse
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_getAppliedImpulse
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_PhysicsJoint
+ * Method:    finalizeNative
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_finalizeNative
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 162 - 0
engine/src/bullet-native/com_jme3_bullet_joints_Point2PointJoint.cpp

@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_Point2PointJoint.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_Point2PointJoint
+     * Method:    setDamping
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setDamping
+    (JNIEnv * env, jobject object, jlong jointId, jfloat damping) {
+        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->m_setting.m_damping = damping;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_Point2PointJoint
+     * Method:    setImpulseClamp
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setImpulseClamp
+    (JNIEnv * env, jobject object, jlong jointId, jfloat clamp) {
+        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->m_setting.m_impulseClamp = clamp;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_Point2PointJoint
+     * Method:    setTau
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setTau
+    (JNIEnv * env, jobject object, jlong jointId, jfloat tau) {
+        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->m_setting.m_tau = tau;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_Point2PointJoint
+     * Method:    getDamping
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getDamping
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->m_setting.m_damping;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_Point2PointJoint
+     * Method:    getImpulseClamp
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getImpulseClamp
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->m_setting.m_damping;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_Point2PointJoint
+     * Method:    getTau
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getTau
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->m_setting.m_damping;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_Point2PointJoint
+     * Method:    createJoint
+     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_createJoint
+    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject pivotB) {
+        jmeClasses::initJavaClasses(env);
+        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
+        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
+        //TODO: matrix not needed?
+        btMatrix3x3 mtx1 = btMatrix3x3();
+        btMatrix3x3 mtx2 = btMatrix3x3();
+        btTransform transA = btTransform(mtx1);
+        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
+        btTransform transB = btTransform(mtx2);
+        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
+        btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, transA, transB);
+        return reinterpret_cast<jlong>(joint);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 69 - 0
engine/src/bullet-native/com_jme3_bullet_joints_Point2PointJoint.h

@@ -0,0 +1,69 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_Point2PointJoint */
+
+#ifndef _Included_com_jme3_bullet_joints_Point2PointJoint
+#define _Included_com_jme3_bullet_joints_Point2PointJoint
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_Point2PointJoint
+ * Method:    setDamping
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setDamping
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_Point2PointJoint
+ * Method:    setImpulseClamp
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setImpulseClamp
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_Point2PointJoint
+ * Method:    setTau
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setTau
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_Point2PointJoint
+ * Method:    getDamping
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getDamping
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_Point2PointJoint
+ * Method:    getImpulseClamp
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getImpulseClamp
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_Point2PointJoint
+ * Method:    getTau
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getTau
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_Point2PointJoint
+ * Method:    createJoint
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_createJoint
+  (JNIEnv *, jobject, jlong, jlong, jobject, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 170 - 0
engine/src/bullet-native/com_jme3_bullet_joints_SixDofJoint.cpp

@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_SixDofJoint.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_SixDofJoint
+     * Method:    getRotationalLimitMotor
+     * Signature: (JI)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getRotationalLimitMotor
+    (JNIEnv * env, jobject object, jlong jointId, jint index) {
+        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return reinterpret_cast<jlong>(joint->getRotationalLimitMotor(index));
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SixDofJoint
+     * Method:    getTranslationalLimitMotor
+     * Signature: (J)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getTranslationalLimitMotor
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return reinterpret_cast<jlong>(joint->getTranslationalLimitMotor());
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SixDofJoint
+     * Method:    setLinearUpperLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearUpperLimit
+    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
+        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, vector, &vec);
+        joint->setLinearUpperLimit(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SixDofJoint
+     * Method:    setLinearLowerLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearLowerLimit
+    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
+        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, vector, &vec);
+        joint->setLinearLowerLimit(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SixDofJoint
+     * Method:    setAngularUpperLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularUpperLimit
+    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
+        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, vector, &vec);
+        joint->setAngularUpperLimit(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SixDofJoint
+     * Method:    setAngularLowerLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularLowerLimit
+    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
+        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, vector, &vec);
+        joint->setAngularLowerLimit(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SixDofJoint
+     * Method:    createJoint
+     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_createJoint
+    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
+        jmeClasses::initJavaClasses(env);
+        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
+        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
+        btMatrix3x3 mtx1 = btMatrix3x3();
+        btMatrix3x3 mtx2 = btMatrix3x3();
+        btTransform transA = btTransform(mtx1);
+        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
+        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
+        btTransform transB = btTransform(mtx2);
+        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
+        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
+        btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
+        return reinterpret_cast<jlong>(joint);
+    }
+#ifdef __cplusplus
+}
+#endif

+ 69 - 0
engine/src/bullet-native/com_jme3_bullet_joints_SixDofJoint.h

@@ -0,0 +1,69 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_SixDofJoint */
+
+#ifndef _Included_com_jme3_bullet_joints_SixDofJoint
+#define _Included_com_jme3_bullet_joints_SixDofJoint
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_SixDofJoint
+ * Method:    getRotationalLimitMotor
+ * Signature: (JI)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getRotationalLimitMotor
+  (JNIEnv *, jobject, jlong, jint);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofJoint
+ * Method:    getTranslationalLimitMotor
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getTranslationalLimitMotor
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofJoint
+ * Method:    setLinearUpperLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearUpperLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofJoint
+ * Method:    setLinearLowerLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearLowerLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofJoint
+ * Method:    setAngularUpperLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularUpperLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofJoint
+ * Method:    setAngularLowerLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularLowerLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofJoint
+ * Method:    createJoint
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_createJoint
+  (JNIEnv *, jobject, jlong, jlong, jobject, jobject, jobject, jobject, jboolean);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 94 - 0
engine/src/bullet-native/com_jme3_bullet_joints_SixDofSpringJoint.cpp

@@ -0,0 +1,94 @@
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_SixDofSpringJoint.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    enableString
+ * Signature: (JIZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_enableSpring
+  (JNIEnv *env, jobject object, jlong jointId, jint index, jboolean onOff) {
+    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
+    joint -> enableSpring(index, onOff);
+}
+
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setStiffness
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setStiffness
+  (JNIEnv *env, jobject object, jlong jointId, jint index, jfloat stiffness) {
+    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
+    joint -> setStiffness(index, stiffness);
+}
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setDamping
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setDamping
+  (JNIEnv *env, jobject object, jlong jointId, jint index, jfloat damping) {
+    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
+    joint -> setDamping(index, damping);
+}
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setEquilibriumPoint
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setEquilibriumPoint__J
+  (JNIEnv *env, jobject object, jlong jointId) {
+    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
+    joint -> setEquilibriumPoint();
+}
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setEquilibriumPoint
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setEquilibriumPoint__JI
+  (JNIEnv *env, jobject object, jlong jointId, jint index) {
+    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
+    joint -> setEquilibriumPoint(index);
+}
+
+
+
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    createJoint
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_createJoint
+    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
+        jmeClasses::initJavaClasses(env);
+        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
+        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
+        btTransform transA;
+        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
+        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
+        btTransform transB;
+        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
+        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
+
+        btGeneric6DofSpringConstraint* joint = new btGeneric6DofSpringConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
+        return reinterpret_cast<jlong>(joint);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 61 - 0
engine/src/bullet-native/com_jme3_bullet_joints_SixDofSpringJoint.h

@@ -0,0 +1,61 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_SixDofSpringJoint */
+
+#ifndef _Included_com_jme3_bullet_joints_SixDofSpringJoint
+#define _Included_com_jme3_bullet_joints_SixDofSpringJoint
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    enableSpring
+ * Signature: (JIZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_enableSpring
+  (JNIEnv *, jobject, jlong, jint, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setStiffness
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setStiffness
+  (JNIEnv *, jobject, jlong, jint, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setDamping
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setDamping
+  (JNIEnv *, jobject, jlong, jint, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setEquilibriumPoint
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setEquilibriumPoint__J
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    setEquilibriumPoint
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setEquilibriumPoint__JI
+  (JNIEnv *, jobject, jlong, jint);
+
+/*
+ * Class:     com_jme3_bullet_joints_SixDofSpringJoint
+ * Method:    createJoint
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_createJoint
+  (JNIEnv *, jobject, jlong, jlong, jobject, jobject, jobject, jobject, jboolean);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 963 - 0
engine/src/bullet-native/com_jme3_bullet_joints_SliderJoint.cpp

@@ -0,0 +1,963 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_SliderJoint.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getLowerLinLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerLinLimit
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getLowerLinLimit();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setLowerLinLimit
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerLinLimit
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setLowerLinLimit(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getUpperLinLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperLinLimit
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getUpperLinLimit();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setUpperLinLimit
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperLinLimit
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setUpperLinLimit(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getLowerAngLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerAngLimit
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getLowerAngLimit();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setLowerAngLimit
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerAngLimit
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setLowerAngLimit(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getUpperAngLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperAngLimit
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getUpperAngLimit();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setUpperAngLimit
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperAngLimit
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setUpperAngLimit(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getSoftnessDirLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getSoftnessDirLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setSoftnessDirLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setSoftnessDirLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getRestitutionDirLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getRestitutionDirLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setRestitutionDirLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setRestitutionDirLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getDampingDirLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getDampingDirLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setDampingDirLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setDampingDirLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getSoftnessDirAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getSoftnessDirAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setSoftnessDirAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setSoftnessDirAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getRestitutionDirAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getRestitutionDirAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setRestitutionDirAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setRestitutionDirAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getDampingDirAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getDampingDirAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setDampingDirAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setDampingDirAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getSoftnessLimLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getSoftnessLimLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setSoftnessLimLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setSoftnessLimLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getRestitutionLimLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getRestitutionLimLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setRestitutionLimLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setRestitutionLimLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getDampingLimLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getDampingLimLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setDampingLimLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setDampingLimLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getSoftnessLimAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getSoftnessLimAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setSoftnessLimAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setSoftnessLimAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getRestitutionLimAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getRestitutionLimAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setRestitutionLimAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setRestitutionLimAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getDampingLimAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getDampingLimAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setDampingLimAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setDampingLimAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getSoftnessOrthoLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getSoftnessOrthoLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setSoftnessOrthoLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setSoftnessOrthoLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getRestitutionOrthoLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getRestitutionOrthoLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setRestitutionOrthoLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setRestitutionOrthoLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getDampingOrthoLin
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoLin
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getDampingOrthoLin();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setDampingOrthoLin
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoLin
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setDampingOrthoLin(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getSoftnessOrthoAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getSoftnessOrthoAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setSoftnessOrthoAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setSoftnessOrthoAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getRestitutionOrthoAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getRestitutionOrthoAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setRestitutionOrthoAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setRestitutionOrthoAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getDampingOrthoAng
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoAng
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getDampingOrthoAng();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setDampingOrthoAng
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoAng
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setDampingOrthoAng(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    isPoweredLinMotor
+     * Signature: (J)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredLinMotor
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return joint->getPoweredLinMotor();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setPoweredLinMotor
+     * Signature: (JZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredLinMotor
+    (JNIEnv * env, jobject object, jlong jointId, jboolean value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setPoweredLinMotor(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getTargetLinMotorVelocity
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetLinMotorVelocity
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getTargetLinMotorVelocity();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setTargetLinMotorVelocity
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetLinMotorVelocity
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setTargetLinMotorVelocity(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getMaxLinMotorForce
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxLinMotorForce
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getMaxLinMotorForce();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setMaxLinMotorForce
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxLinMotorForce
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setMaxLinMotorForce(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    isPoweredAngMotor
+     * Signature: (J)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredAngMotor
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return joint->getPoweredAngMotor();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setPoweredAngMotor
+     * Signature: (JZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredAngMotor
+    (JNIEnv * env, jobject object, jlong jointId, jboolean value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setPoweredAngMotor(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getTargetAngMotorVelocity
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetAngMotorVelocity
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getTargetAngMotorVelocity();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setTargetAngMotorVelocity
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetAngMotorVelocity
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setTargetAngMotorVelocity(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    getMaxAngMotorForce
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxAngMotorForce
+    (JNIEnv * env, jobject object, jlong jointId) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return joint->getMaxAngMotorForce();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    setMaxAngMotorForce
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxAngMotorForce
+    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
+        btSliderConstraint* joint = reinterpret_cast<btSliderConstraint*>(jointId);
+        if (joint == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        joint->setMaxAngMotorForce(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_SliderJoint
+     * Method:    createJoint
+     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SliderJoint_createJoint
+    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
+        jmeClasses::initJavaClasses(env);
+        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
+        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
+        btMatrix3x3 mtx1 = btMatrix3x3();
+        btMatrix3x3 mtx2 = btMatrix3x3();
+        btTransform transA = btTransform(mtx1);
+        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
+        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
+        btTransform transB = btTransform(mtx2);
+        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
+        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
+        btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
+        return reinterpret_cast<jlong>(joint);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 469 - 0
engine/src/bullet-native/com_jme3_bullet_joints_SliderJoint.h

@@ -0,0 +1,469 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_SliderJoint */
+
+#ifndef _Included_com_jme3_bullet_joints_SliderJoint
+#define _Included_com_jme3_bullet_joints_SliderJoint
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getLowerLinLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerLinLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setLowerLinLimit
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerLinLimit
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getUpperLinLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperLinLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setUpperLinLimit
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperLinLimit
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getLowerAngLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerAngLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setLowerAngLimit
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerAngLimit
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getUpperAngLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperAngLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setUpperAngLimit
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperAngLimit
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getSoftnessDirLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setSoftnessDirLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getRestitutionDirLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setRestitutionDirLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getDampingDirLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setDampingDirLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getSoftnessDirAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setSoftnessDirAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getRestitutionDirAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setRestitutionDirAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getDampingDirAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setDampingDirAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getSoftnessLimLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setSoftnessLimLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getRestitutionLimLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setRestitutionLimLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getDampingLimLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setDampingLimLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getSoftnessLimAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setSoftnessLimAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getRestitutionLimAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setRestitutionLimAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getDampingLimAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setDampingLimAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getSoftnessOrthoLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setSoftnessOrthoLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getRestitutionOrthoLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setRestitutionOrthoLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getDampingOrthoLin
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoLin
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setDampingOrthoLin
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoLin
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getSoftnessOrthoAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setSoftnessOrthoAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getRestitutionOrthoAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setRestitutionOrthoAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getDampingOrthoAng
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoAng
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setDampingOrthoAng
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoAng
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    isPoweredLinMotor
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredLinMotor
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setPoweredLinMotor
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredLinMotor
+  (JNIEnv *, jobject, jlong, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getTargetLinMotorVelocity
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetLinMotorVelocity
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setTargetLinMotorVelocity
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetLinMotorVelocity
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getMaxLinMotorForce
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxLinMotorForce
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setMaxLinMotorForce
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxLinMotorForce
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    isPoweredAngMotor
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredAngMotor
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setPoweredAngMotor
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredAngMotor
+  (JNIEnv *, jobject, jlong, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getTargetAngMotorVelocity
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetAngMotorVelocity
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setTargetAngMotorVelocity
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetAngMotorVelocity
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    getMaxAngMotorForce
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxAngMotorForce
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    setMaxAngMotorForce
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxAngMotorForce
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_SliderJoint
+ * Method:    createJoint
+ * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SliderJoint_createJoint
+  (JNIEnv *, jobject, jlong, jlong, jobject, jobject, jobject, jobject, jboolean);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 365 - 0
engine/src/bullet-native/com_jme3_bullet_joints_motors_RotationalLimitMotor.cpp

@@ -0,0 +1,365 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_motors_RotationalLimitMotor.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getLoLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLoLimit
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_loLimit;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setLoLimit
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLoLimit
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_loLimit = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getHiLimit
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getHiLimit
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_hiLimit;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setHiLimit
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setHiLimit
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_hiLimit = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getTargetVelocity
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getTargetVelocity
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_targetVelocity;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setTargetVelocity
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setTargetVelocity
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_targetVelocity = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getMaxMotorForce
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxMotorForce
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_maxMotorForce;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setMaxMotorForce
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxMotorForce
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_maxMotorForce = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getMaxLimitForce
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxLimitForce
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_maxLimitForce;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setMaxLimitForce
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxLimitForce
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_maxLimitForce = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getDamping
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getDamping
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_damping;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setDamping
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setDamping
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_damping = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getLimitSoftness
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLimitSoftness
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_limitSoftness;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setLimitSoftness
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLimitSoftness
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_limitSoftness = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getERP
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getERP
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_stopERP;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setERP
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setERP
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_stopERP = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    getBounce
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getBounce
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_bounce;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setBounce
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setBounce
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_bounce = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    isEnableMotor
+     * Signature: (J)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_isEnableMotor
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return motor->m_enableMotor;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+     * Method:    setEnableMotor
+     * Signature: (JZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setEnableMotor
+    (JNIEnv *env, jobject object, jlong motorId, jboolean value) {
+        btRotationalLimitMotor* motor = reinterpret_cast<btRotationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_enableMotor = value;
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 173 - 0
engine/src/bullet-native/com_jme3_bullet_joints_motors_RotationalLimitMotor.h

@@ -0,0 +1,173 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_motors_RotationalLimitMotor */
+
+#ifndef _Included_com_jme3_bullet_joints_motors_RotationalLimitMotor
+#define _Included_com_jme3_bullet_joints_motors_RotationalLimitMotor
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getLoLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLoLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setLoLimit
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLoLimit
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getHiLimit
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getHiLimit
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setHiLimit
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setHiLimit
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getTargetVelocity
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getTargetVelocity
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setTargetVelocity
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setTargetVelocity
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getMaxMotorForce
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxMotorForce
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setMaxMotorForce
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxMotorForce
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getMaxLimitForce
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxLimitForce
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setMaxLimitForce
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxLimitForce
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getDamping
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getDamping
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setDamping
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setDamping
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getLimitSoftness
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLimitSoftness
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setLimitSoftness
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLimitSoftness
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getERP
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getERP
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setERP
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setERP
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    getBounce
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getBounce
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setBounce
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setBounce
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    isEnableMotor
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_isEnableMotor
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
+ * Method:    setEnableMotor
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setEnableMotor
+  (JNIEnv *, jobject, jlong, jboolean);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 237 - 0
engine/src/bullet-native/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp

@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_joints_motors_TranslationalLimitMotor.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    getLowerLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLowerLimit
+    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &motor->m_lowerLimit, vector);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    setLowerLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLowerLimit
+    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, vector, &motor->m_lowerLimit);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    getUpperLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getUpperLimit
+    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &motor->m_upperLimit, vector);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    setUpperLimit
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setUpperLimit
+    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, vector, &motor->m_upperLimit);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    getAccumulatedImpulse
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getAccumulatedImpulse
+    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &motor->m_accumulatedImpulse, vector);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    setAccumulatedImpulse
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setAccumulatedImpulse
+    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, vector, &motor->m_accumulatedImpulse);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    getLimitSoftness
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLetLimitSoftness
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_limitSoftness;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    setLimitSoftness
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLimitSoftness
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_limitSoftness = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    getDamping
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getDamping
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_damping;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    setDamping
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setDamping
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_damping = value;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    getRestitution
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getRestitution
+    (JNIEnv *env, jobject object, jlong motorId) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return motor->m_restitution;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+     * Method:    setRestitution
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setRestitution
+    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
+        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(motorId);
+        if (motor == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        motor->m_restitution = value;
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 109 - 0
engine/src/bullet-native/com_jme3_bullet_joints_motors_TranslationalLimitMotor.h

@@ -0,0 +1,109 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_joints_motors_TranslationalLimitMotor */
+
+#ifndef _Included_com_jme3_bullet_joints_motors_TranslationalLimitMotor
+#define _Included_com_jme3_bullet_joints_motors_TranslationalLimitMotor
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    getLowerLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLowerLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    setLowerLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLowerLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    getUpperLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getUpperLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    setUpperLimit
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setUpperLimit
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    getAccumulatedImpulse
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getAccumulatedImpulse
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    setAccumulatedImpulse
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setAccumulatedImpulse
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    getLimitSoftness
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLimitSoftness
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    setLimitSoftness
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLimitSoftness
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    getDamping
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getDamping
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    setDamping
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setDamping
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    getRestitution
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getRestitution
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
+ * Method:    setRestitution
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setRestitution
+  (JNIEnv *, jobject, jlong, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 388 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsCharacter.cpp

@@ -0,0 +1,388 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+
+#include "com_jme3_bullet_objects_PhysicsCharacter.h"
+#include "jmeBulletUtil.h"
+#include "BulletCollision/CollisionDispatch/btGhostObject.h"
+#include "BulletDynamics/Character/btKinematicCharacterController.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    createGhostObject
+     * Signature: ()J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createGhostObject
+    (JNIEnv * env, jobject object) {
+        jmeClasses::initJavaClasses(env);
+        btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
+        return reinterpret_cast<jlong>(ghost);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setCharacterFlags
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCharacterFlags
+    (JNIEnv *env, jobject object, jlong ghostId) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(ghostId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        ghost->setCollisionFlags(/*ghost->getCollisionFlags() |*/ btCollisionObject::CF_CHARACTER_OBJECT);
+        ghost->setCollisionFlags(ghost->getCollisionFlags() & ~btCollisionObject::CF_NO_CONTACT_RESPONSE);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    createCharacterObject
+     * Signature: (JJF)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createCharacterObject
+    (JNIEnv *env, jobject object, jlong objectId, jlong shapeId, jfloat stepHeight) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        //TODO: check convexshape!
+        btConvexShape* shape = reinterpret_cast<btConvexShape*>(shapeId);
+        btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight);
+        return reinterpret_cast<jlong>(character);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    warp
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_warp
+    (JNIEnv *env, jobject object, jlong objectId, jobject vector) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, vector, &vec);
+        character->warp(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setWalkDirection
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setWalkDirection
+    (JNIEnv *env, jobject object, jlong objectId, jobject vector) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, vector, &vec);
+        character->setWalkDirection(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setUpAxis
+     * Signature: (JI)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setUpAxis
+    (JNIEnv *env, jobject object, jlong objectId, jint value) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        character->setUpAxis(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setFallSpeed
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setFallSpeed
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        character->setFallSpeed(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setJumpSpeed
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setJumpSpeed
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        character->setJumpSpeed(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setGravity
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setGravity
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        character->setGravity(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    getGravity
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getGravity
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return character->getGravity();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setMaxSlope
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxSlope
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        character->setMaxSlope(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    getMaxSlope
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxSlope
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return character->getMaxSlope();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    onGround
+     * Signature: (J)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_onGround
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return character->onGround();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    jump
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_jump
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        character->jump();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    getPhysicsLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getPhysicsLocation
+    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &ghost->getWorldTransform().getOrigin(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setCcdSweptSphereRadius
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdSweptSphereRadius
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        ghost->setCcdSweptSphereRadius(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    setCcdMotionThreshold
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdMotionThreshold
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        ghost->setCcdMotionThreshold(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    getCcdSweptSphereRadius
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSweptSphereRadius
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return ghost->getCcdSweptSphereRadius();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    getCcdMotionThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdMotionThreshold
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return ghost->getCcdMotionThreshold();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    getCcdSquareMotionThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSquareMotionThreshold
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return ghost->getCcdSquareMotionThreshold();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsCharacter
+     * Method:    finalizeNativeCharacter
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_finalizeNativeCharacter
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
+        if (character == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        delete(character);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 215 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsCharacter.h

@@ -0,0 +1,215 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_objects_PhysicsCharacter */
+
+#ifndef _Included_com_jme3_bullet_objects_PhysicsCharacter
+#define _Included_com_jme3_bullet_objects_PhysicsCharacter
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_NONE
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_NONE 0L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_01
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_01 1L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_02
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_02 2L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_03
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_03 4L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_04
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_04 8L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_05
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_05 16L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_06
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_06 32L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_07
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_07 64L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_08
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_08 128L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_09
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_09 256L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_10
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_10 512L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_11
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_11 1024L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_12
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_12 2048L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_13
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_13 4096L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_14
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_14 8192L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_15
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_15 16384L
+#undef com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_16
+#define com_jme3_bullet_objects_PhysicsCharacter_COLLISION_GROUP_16 32768L
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    createGhostObject
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createGhostObject
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setCharacterFlags
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCharacterFlags
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    createCharacterObject
+ * Signature: (JJF)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createCharacterObject
+  (JNIEnv *, jobject, jlong, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    warp
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_warp
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setWalkDirection
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setWalkDirection
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setUpAxis
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setUpAxis
+  (JNIEnv *, jobject, jlong, jint);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setFallSpeed
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setFallSpeed
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setJumpSpeed
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setJumpSpeed
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setGravity
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setGravity
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    getGravity
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getGravity
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setMaxSlope
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxSlope
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    getMaxSlope
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxSlope
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    onGround
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_onGround
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    jump
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_jump
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    getPhysicsLocation
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getPhysicsLocation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setCcdSweptSphereRadius
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdSweptSphereRadius
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    setCcdMotionThreshold
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdMotionThreshold
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    getCcdSweptSphereRadius
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSweptSphereRadius
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    getCcdMotionThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdMotionThreshold
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    getCcdSquareMotionThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSquareMotionThreshold
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsCharacter
+ * Method:    finalizeNativeCharacter
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_finalizeNativeCharacter
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 313 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsGhostObject.cpp

@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+
+#include <BulletCollision/CollisionDispatch/btGhostObject.h>
+
+#include "com_jme3_bullet_objects_PhysicsGhostObject.h"
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
+#include "jmeBulletUtil.h"
+#include "jmePhysicsSpace.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    createGhostObject
+     * Signature: ()J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_createGhostObject
+    (JNIEnv * env, jobject object) {
+        jmeClasses::initJavaClasses(env);
+        btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
+        return reinterpret_cast<jlong>(ghost);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    setGhostFlags
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setGhostFlags
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        ghost->setCollisionFlags(ghost->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    setPhysicsLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsLocation
+    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getOrigin());
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    setPhysicsRotation
+     * Signature: (JLcom/jme3/math/Matrix3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
+    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getBasis());
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    setPhysicsRotation
+     * Signature: (JLcom/jme3/math/Quaternion;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
+    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convertQuat(env, value, &ghost->getWorldTransform().getBasis());
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getPhysicsLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsLocation
+    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &ghost->getWorldTransform().getOrigin(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getPhysicsRotation
+     * Signature: (JLcom/jme3/math/Quaternion;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotation
+    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convertQuat(env, &ghost->getWorldTransform().getBasis(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getPhysicsRotationMatrix
+     * Signature: (JLcom/jme3/math/Matrix3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotationMatrix
+    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &ghost->getWorldTransform().getBasis(), value);
+    }
+
+    class jmeGhostOverlapCallback : public btOverlapCallback {
+        JNIEnv* m_env;
+        jobject m_object;
+    public:
+        jmeGhostOverlapCallback(JNIEnv *env, jobject object)
+                :m_env(env),
+                 m_object(object)
+        {
+        }
+        virtual ~jmeGhostOverlapCallback() {}
+        virtual bool    processOverlap(btBroadphasePair& pair)
+        {
+            btCollisionObject *co1 = (btCollisionObject *)pair.m_pProxy0->m_clientObject;
+            jmeUserPointer *up1 = (jmeUserPointer*)co1 -> getUserPointer();
+            jobject javaCollisionObject1 = m_env->NewLocalRef(up1->javaCollisionObject);
+            m_env->CallVoidMethod(m_object, jmeClasses::PhysicsGhostObject_addOverlappingObject, javaCollisionObject1);
+            m_env->DeleteLocalRef(javaCollisionObject1);
+            if (m_env->ExceptionCheck()) {
+                m_env->Throw(m_env->ExceptionOccurred());
+                return false;
+            }
+
+            return false;
+        }
+    };
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getOverlappingObjects
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingObjects
+      (JNIEnv *env, jobject object, jlong objectId) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btHashedOverlappingPairCache * pc = ghost->getOverlappingPairCache();
+        jmeGhostOverlapCallback cb(env, object);
+        pc -> processAllOverlappingPairs(&cb, NULL);
+    }
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getOverlappingCount
+     * Signature: (J)I
+     */
+    JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingCount
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return ghost->getNumOverlappingObjects();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    setCcdSweptSphereRadius
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdSweptSphereRadius
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        ghost->setCcdSweptSphereRadius(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    setCcdMotionThreshold
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdMotionThreshold
+    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        ghost->setCcdMotionThreshold(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getCcdSweptSphereRadius
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSweptSphereRadius
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return ghost->getCcdSweptSphereRadius();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getCcdMotionThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdMotionThreshold
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return ghost->getCcdMotionThreshold();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+     * Method:    getCcdSquareMotionThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSquareMotionThreshold
+    (JNIEnv *env, jobject object, jlong objectId) {
+        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
+        if (ghost == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return ghost->getCcdSquareMotionThreshold();
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 167 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsGhostObject.h

@@ -0,0 +1,167 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_objects_PhysicsGhostObject */
+
+#ifndef _Included_com_jme3_bullet_objects_PhysicsGhostObject
+#define _Included_com_jme3_bullet_objects_PhysicsGhostObject
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_NONE
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_NONE 0L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_01
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_01 1L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_02
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_02 2L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_03
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_03 4L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_04
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_04 8L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_05
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_05 16L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_06
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_06 32L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_07
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_07 64L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_08
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_08 128L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_09
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_09 256L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_10
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_10 512L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_11
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_11 1024L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_12
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_12 2048L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_13
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_13 4096L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_14
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_14 8192L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_15
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_15 16384L
+#undef com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_16
+#define com_jme3_bullet_objects_PhysicsGhostObject_COLLISION_GROUP_16 32768L
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    createGhostObject
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_createGhostObject
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    setGhostFlags
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setGhostFlags
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    setPhysicsLocation
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsLocation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    setPhysicsRotation
+ * Signature: (JLcom/jme3/math/Matrix3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    setPhysicsRotation
+ * Signature: (JLcom/jme3/math/Quaternion;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getPhysicsLocation
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsLocation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getPhysicsRotation
+ * Signature: (JLcom/jme3/math/Quaternion;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getPhysicsRotationMatrix
+ * Signature: (JLcom/jme3/math/Matrix3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotationMatrix
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getOverlappingObjects
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingObjects
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getOverlappingCount
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingCount
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    setCcdSweptSphereRadius
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdSweptSphereRadius
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    setCcdMotionThreshold
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdMotionThreshold
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getCcdSweptSphereRadius
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSweptSphereRadius
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getCcdMotionThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdMotionThreshold
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsGhostObject
+ * Method:    getCcdSquareMotionThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSquareMotionThreshold
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 849 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsRigidBody.cpp

@@ -0,0 +1,849 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_objects_PhysicsRigidBody.h"
+#include "jmeBulletUtil.h"
+#include "jmeMotionState.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    createRigidBody
+     * Signature: (FJJ)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_createRigidBody
+    (JNIEnv *env, jobject object, jfloat mass, jlong motionstatId, jlong shapeId) {
+        jmeClasses::initJavaClasses(env);
+        btMotionState* motionState = reinterpret_cast<btMotionState*>(motionstatId);
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        btVector3 localInertia = btVector3();
+        shape->calculateLocalInertia(mass, localInertia);
+        btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia);
+        body->setUserPointer(NULL);
+        return reinterpret_cast<jlong>(body);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    isInWorld
+     * Signature: (J)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isInWorld
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return body->isInWorld();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setPhysicsLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsLocation
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        //        if (body->isStaticOrKinematicObject() || !body->isInWorld())
+        ((jmeMotionState*) body->getMotionState())->setKinematicLocation(env, value);
+        body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
+        //        else{
+        //            btMatrix3x3* mtx = &btMatrix3x3();
+        //            btTransform* trans = &btTransform(*mtx);
+        //            trans->setBasis(body->getCenterOfMassTransform().getBasis());
+        //            jmeBulletUtil::convert(env, value, &trans->getOrigin());
+        //            body->setCenterOfMassTransform(*trans);
+        //        }
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setPhysicsRotation
+     * Signature: (JLcom/jme3/math/Matrix3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        //        if (body->isStaticOrKinematicObject() || !body->isInWorld())
+        ((jmeMotionState*) body->getMotionState())->setKinematicRotation(env, value);
+        body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
+        //        else{
+        //            btMatrix3x3* mtx = &btMatrix3x3();
+        //            btTransform* trans = &btTransform(*mtx);
+        //            trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
+        //            jmeBulletUtil::convert(env, value, &trans->getBasis());
+        //            body->setCenterOfMassTransform(*trans);
+        //        }
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setPhysicsRotation
+     * Signature: (JLcom/jme3/math/Quaternion;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        //        if (body->isStaticOrKinematicObject() || !body->isInWorld())
+        ((jmeMotionState*) body->getMotionState())->setKinematicRotationQuat(env, value);
+        body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
+        //        else{
+        //            btMatrix3x3* mtx = &btMatrix3x3();
+        //            btTransform* trans = &btTransform(*mtx);
+        //            trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
+        //            jmeBulletUtil::convertQuat(env, value, &trans->getBasis());
+        //            body->setCenterOfMassTransform(*trans);
+        //        }
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getPhysicsLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsLocation
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &body->getWorldTransform().getOrigin(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getPhysicsRotation
+     * Signature: (JLcom/jme3/math/Quaternion;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotation
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convertQuat(env, &body->getWorldTransform().getBasis(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getPhysicsRotationMatrix
+     * Signature: (JLcom/jme3/math/Matrix3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotationMatrix
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &body->getWorldTransform().getBasis(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setKinematic
+     * Signature: (JZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setKinematic
+    (JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        if (value) {
+            body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
+            body->setActivationState(DISABLE_DEACTIVATION);
+        } else {
+            body->setCollisionFlags(body->getCollisionFlags() & ~btCollisionObject::CF_KINEMATIC_OBJECT);
+            body->setActivationState(ACTIVE_TAG);
+        }
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setCcdSweptSphereRadius
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdSweptSphereRadius
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setCcdSweptSphereRadius(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setCcdMotionThreshold
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdMotionThreshold
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setCcdMotionThreshold(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getCcdSweptSphereRadius
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSweptSphereRadius
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getCcdSweptSphereRadius();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getCcdMotionThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdMotionThreshold
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getCcdMotionThreshold();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getCcdSquareMotionThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSquareMotionThreshold
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getCcdSquareMotionThreshold();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setStatic
+     * Signature: (JZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setStatic
+    (JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        if (value) {
+            body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_STATIC_OBJECT);
+        } else {
+            body->setCollisionFlags(body->getCollisionFlags() & ~btCollisionObject::CF_STATIC_OBJECT);
+        }
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    updateMassProps
+     * Signature: (JJF)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_updateMassProps
+    (JNIEnv *env, jobject object, jlong bodyId, jlong shapeId, jfloat mass) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        btVector3 localInertia = btVector3();
+        shape->calculateLocalInertia(mass, localInertia);
+        body->setMassProps(mass, localInertia);
+        return reinterpret_cast<jlong>(body);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getGravity
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getGravity
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &body->getGravity(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setGravity
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setGravity
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, value, &vec);
+        body->setGravity(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getFriction
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getFriction
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getFriction();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setFriction
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setFriction
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setFriction(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setDamping
+     * Signature: (JFF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setDamping
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value1, jfloat value2) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setDamping(value1, value2);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setAngularDamping
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularDamping
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setDamping(body->getAngularDamping(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getLinearDamping
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearDamping
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getLinearDamping();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getAngularDamping
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularDamping
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getAngularDamping();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getRestitution
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getRestitution
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getRestitution();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setRestitution
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setRestitution
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setRestitution(value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getAngularVelocity
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularVelocity
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &body->getAngularVelocity(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setAngularVelocity
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularVelocity
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, value, &vec);
+        body->setAngularVelocity(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getLinearVelocity
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearVelocity
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &body->getLinearVelocity(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setLinearVelocity
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearVelocity
+    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec = btVector3();
+        jmeBulletUtil::convert(env, value, &vec);
+        body->setLinearVelocity(vec);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    applyForce
+     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyForce
+    (JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec1 = btVector3();
+        btVector3 vec2 = btVector3();
+        jmeBulletUtil::convert(env, force, &vec1);
+        jmeBulletUtil::convert(env, location, &vec2);
+        body->applyForce(vec1, vec2);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    applyCentralForce
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyCentralForce
+    (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec1 = btVector3();
+        jmeBulletUtil::convert(env, force, &vec1);
+        body->applyCentralForce(vec1);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    applyTorque
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorque
+    (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec1 = btVector3();
+        jmeBulletUtil::convert(env, force, &vec1);
+        body->applyTorque(vec1);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    applyImpulse
+     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyImpulse
+    (JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec1 = btVector3();
+        btVector3 vec2 = btVector3();
+        jmeBulletUtil::convert(env, force, &vec1);
+        jmeBulletUtil::convert(env, location, &vec2);
+        body->applyImpulse(vec1, vec2);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    applyTorqueImpulse
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorqueImpulse
+    (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec1 = btVector3();
+        jmeBulletUtil::convert(env, force, &vec1);
+        body->applyTorqueImpulse(vec1);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    clearForces
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_clearForces
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->clearForces();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setCollisionShape
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCollisionShape
+    (JNIEnv *env, jobject object, jlong bodyId, jlong shapeId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        body->setCollisionShape(shape);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    activate
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_activate
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->activate(false);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    isActive
+     * Signature: (J)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isActive
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return body->isActive();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setSleepingThresholds
+     * Signature: (JFF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setSleepingThresholds
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat linear, jfloat angular) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setSleepingThresholds(linear, angular);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setLinearSleepingThreshold
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearSleepingThreshold
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setSleepingThresholds(value, body->getLinearSleepingThreshold());
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setAngularSleepingThreshold
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularSleepingThreshold
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        body->setSleepingThresholds(body->getAngularSleepingThreshold(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getLinearSleepingThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearSleepingThreshold
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getLinearSleepingThreshold();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getAngularSleepingThreshold
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularSleepingThreshold
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getAngularSleepingThreshold();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    getAngularFactor
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
+    (JNIEnv *env, jobject object, jlong bodyId) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return body->getAngularFactor().getX();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+     * Method:    setAngularFactor
+     * Signature: (JF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
+    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 vec1 = btVector3();
+        vec1.setX(value);
+        vec1.setY(value);
+        vec1.setZ(value);
+        body->setAngularFactor(vec1);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 415 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsRigidBody.h

@@ -0,0 +1,415 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_objects_PhysicsRigidBody */
+
+#ifndef _Included_com_jme3_bullet_objects_PhysicsRigidBody
+#define _Included_com_jme3_bullet_objects_PhysicsRigidBody
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_NONE
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_NONE 0L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_01
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_01 1L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_02
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_02 2L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_03
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_03 4L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_04
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_04 8L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_05
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_05 16L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_06
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_06 32L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_07
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_07 64L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_08
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_08 128L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_09
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_09 256L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_10
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_10 512L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_11
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_11 1024L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_12
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_12 2048L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_13
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_13 4096L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_14
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_14 8192L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_15
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_15 16384L
+#undef com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_16
+#define com_jme3_bullet_objects_PhysicsRigidBody_COLLISION_GROUP_16 32768L
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    createRigidBody
+ * Signature: (FJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_createRigidBody
+  (JNIEnv *, jobject, jfloat, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    isInWorld
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isInWorld
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setPhysicsLocation
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsLocation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setPhysicsRotation
+ * Signature: (JLcom/jme3/math/Matrix3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setPhysicsRotation
+ * Signature: (JLcom/jme3/math/Quaternion;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getPhysicsLocation
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsLocation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getPhysicsRotation
+ * Signature: (JLcom/jme3/math/Quaternion;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getPhysicsRotationMatrix
+ * Signature: (JLcom/jme3/math/Matrix3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotationMatrix
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setKinematic
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setKinematic
+  (JNIEnv *, jobject, jlong, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setCcdSweptSphereRadius
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdSweptSphereRadius
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setCcdMotionThreshold
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdMotionThreshold
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getCcdSweptSphereRadius
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSweptSphereRadius
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getCcdMotionThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdMotionThreshold
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getCcdSquareMotionThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSquareMotionThreshold
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setStatic
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setStatic
+  (JNIEnv *, jobject, jlong, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    updateMassProps
+ * Signature: (JJF)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_updateMassProps
+  (JNIEnv *, jobject, jlong, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getGravity
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getGravity
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setGravity
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setGravity
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getFriction
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getFriction
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setFriction
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setFriction
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setDamping
+ * Signature: (JFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setDamping
+  (JNIEnv *, jobject, jlong, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setAngularDamping
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularDamping
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getLinearDamping
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearDamping
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getAngularDamping
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularDamping
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getRestitution
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getRestitution
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setRestitution
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setRestitution
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getAngularVelocity
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularVelocity
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setAngularVelocity
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularVelocity
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getLinearVelocity
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearVelocity
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setLinearVelocity
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearVelocity
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    applyForce
+ * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyForce
+  (JNIEnv *, jobject, jlong, jobject, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    applyCentralForce
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyCentralForce
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    applyTorque
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorque
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    applyImpulse
+ * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyImpulse
+  (JNIEnv *, jobject, jlong, jobject, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    applyTorqueImpulse
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorqueImpulse
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    clearForces
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_clearForces
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setCollisionShape
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCollisionShape
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    activate
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_activate
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    isActive
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isActive
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setSleepingThresholds
+ * Signature: (JFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setSleepingThresholds
+  (JNIEnv *, jobject, jlong, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setLinearSleepingThreshold
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearSleepingThreshold
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setAngularSleepingThreshold
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularSleepingThreshold
+  (JNIEnv *, jobject, jlong, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getLinearSleepingThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearSleepingThreshold
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getAngularSleepingThreshold
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularSleepingThreshold
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    getAngularFactor
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsRigidBody
+ * Method:    setAngularFactor
+ * Signature: (JF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
+  (JNIEnv *, jobject, jlong, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 272 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsVehicle.cpp

@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+
+#include "com_jme3_bullet_objects_PhysicsVehicle.h"
+#include "jmeBulletUtil.h"
+#include "jmePhysicsSpace.h"
+#include "BulletDynamics/Vehicle/btRaycastVehicle.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    updateWheelTransform
+     * Signature: (JIZ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_updateWheelTransform
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jboolean interpolated) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        vehicle->updateWheelTransform(wheel, interpolated);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    createVehicleRaycaster
+     * Signature: (JJ)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createVehicleRaycaster
+    (JNIEnv *env, jobject object, jlong bodyId, jlong spaceId) {
+        //btRigidBody* body = reinterpret_cast<btRigidBody*> bodyId;
+        jmeClasses::initJavaClasses(env);
+        jmePhysicsSpace *space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
+        if (space == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(space->getDynamicsWorld());
+        return reinterpret_cast<jlong>(caster);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    createRaycastVehicle
+     * Signature: (JJ)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createRaycastVehicle
+    (JNIEnv *env, jobject object, jlong objectId, jlong casterId) {
+        jmeClasses::initJavaClasses(env);
+        btRigidBody* body = reinterpret_cast<btRigidBody*>(objectId);
+        if (body == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        body->setActivationState(DISABLE_DEACTIVATION);
+        btVehicleRaycaster* caster = reinterpret_cast<btDefaultVehicleRaycaster*>(casterId);
+        if (caster == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        btRaycastVehicle::btVehicleTuning tuning;
+        btRaycastVehicle* vehicle = new btRaycastVehicle(tuning, body, caster);
+        return reinterpret_cast<jlong>(vehicle);
+
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    setCoordinateSystem
+     * Signature: (JIII)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_setCoordinateSystem
+    (JNIEnv *env, jobject object, jlong vehicleId, jint right, jint up, jint forward) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        vehicle->setCoordinateSystem(right, up, forward);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    addWheel
+     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;FFLcom/jme3/bullet/objects/infos/VehicleTuning;Z)J
+     */
+    JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_addWheel
+    (JNIEnv *env, jobject object, jlong vehicleId, jobject location, jobject direction, jobject axle, jfloat restLength, jfloat radius, jobject tuning, jboolean frontWheel) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        btVector3 vec1 = btVector3();
+        btVector3 vec2 = btVector3();
+        btVector3 vec3 = btVector3();
+        jmeBulletUtil::convert(env, location, &vec1);
+        jmeBulletUtil::convert(env, direction, &vec2);
+        jmeBulletUtil::convert(env, axle, &vec3);
+        btRaycastVehicle::btVehicleTuning tune;
+        btWheelInfo* info = &vehicle->addWheel(vec1, vec2, vec3, restLength, radius, tune, frontWheel);
+        int idx = vehicle->getNumWheels();
+        return idx-1;
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    resetSuspension
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_resetSuspension
+    (JNIEnv *env, jobject object, jlong vehicleId) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        vehicle->resetSuspension();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    applyEngineForce
+     * Signature: (JIF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_applyEngineForce
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat force) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        vehicle->applyEngineForce(force, wheel);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    steer
+     * Signature: (JIF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_steer
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        vehicle->setSteeringValue(value, wheel);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    brake
+     * Signature: (JIF)F
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_brake
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        vehicle->setBrake(value, wheel);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    getCurrentVehicleSpeedKmHour
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getCurrentVehicleSpeedKmHour
+    (JNIEnv *env, jobject object, jlong vehicleId) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return vehicle->getCurrentSpeedKmHour();
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    getForwardVector
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getForwardVector
+    (JNIEnv *env, jobject object, jlong vehicleId, jobject out) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        btVector3 forwardVector = vehicle->getForwardVector();
+        jmeBulletUtil::convert(env, &forwardVector, out);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_PhysicsVehicle
+     * Method:    finalizeNative
+     * Signature: (JJ)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_finalizeNative
+    (JNIEnv *env, jobject object, jlong casterId, jlong vehicleId) {
+        btVehicleRaycaster* rayCaster = reinterpret_cast<btVehicleRaycaster*>(casterId);
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        delete(vehicle);
+        if (rayCaster == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        delete(rayCaster);
+    }
+
+#ifdef __cplusplus
+}
+#endif
+

+ 143 - 0
engine/src/bullet-native/com_jme3_bullet_objects_PhysicsVehicle.h

@@ -0,0 +1,143 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_objects_PhysicsVehicle */
+
+#ifndef _Included_com_jme3_bullet_objects_PhysicsVehicle
+#define _Included_com_jme3_bullet_objects_PhysicsVehicle
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_NONE
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_NONE 0L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_01
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_01 1L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_02
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_02 2L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_03
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_03 4L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_04
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_04 8L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_05
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_05 16L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_06
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_06 32L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_07
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_07 64L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_08
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_08 128L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_09
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_09 256L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_10
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_10 512L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_11
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_11 1024L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_12
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_12 2048L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_13
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_13 4096L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_14
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_14 8192L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_15
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_15 16384L
+#undef com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_16
+#define com_jme3_bullet_objects_PhysicsVehicle_COLLISION_GROUP_16 32768L
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    updateWheelTransform
+ * Signature: (JIZ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_updateWheelTransform
+  (JNIEnv *, jobject, jlong, jint, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    createVehicleRaycaster
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createVehicleRaycaster
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    createRaycastVehicle
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createRaycastVehicle
+  (JNIEnv *, jobject, jlong, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    setCoordinateSystem
+ * Signature: (JIII)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_setCoordinateSystem
+  (JNIEnv *, jobject, jlong, jint, jint, jint);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    addWheel
+ * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;FFLcom/jme3/bullet/objects/infos/VehicleTuning;Z)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_addWheel
+  (JNIEnv *, jobject, jlong, jobject, jobject, jobject, jfloat, jfloat, jobject, jboolean);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    resetSuspension
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_resetSuspension
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    applyEngineForce
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_applyEngineForce
+  (JNIEnv *, jobject, jlong, jint, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    steer
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_steer
+  (JNIEnv *, jobject, jlong, jint, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    brake
+ * Signature: (JIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_brake
+  (JNIEnv *, jobject, jlong, jint, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    getCurrentVehicleSpeedKmHour
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getCurrentVehicleSpeedKmHour
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    getForwardVector
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getForwardVector
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_PhysicsVehicle
+ * Method:    finalizeNative
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_finalizeNative
+  (JNIEnv *, jobject, jlong, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 147 - 0
engine/src/bullet-native/com_jme3_bullet_objects_VehicleWheel.cpp

@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+
+#include "com_jme3_bullet_objects_VehicleWheel.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_objects_VehicleWheel
+     * Method:    getWheelLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelLocation
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &vehicle->getWheelInfo(wheelIndex).m_worldTransform.getOrigin(), out);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_VehicleWheel
+     * Method:    getWheelRotation
+     * Signature: (JLcom/jme3/math/Matrix3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelRotation
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &vehicle->getWheelInfo(wheelIndex).m_worldTransform.getBasis(), out);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_VehicleWheel
+     * Method:    applyInfo
+     * Signature: (JFFFFFFFFZF)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_applyInfo
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jfloat suspensionStiffness, jfloat wheelsDampingRelaxation, jfloat wheelsDampingCompression, jfloat frictionSlip, jfloat rollInfluence, jfloat maxSuspensionTravelCm, jfloat maxSuspensionForce, jfloat radius, jboolean frontWheel, jfloat restLength) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        vehicle->getWheelInfo(wheelIndex).m_suspensionStiffness = suspensionStiffness;
+        vehicle->getWheelInfo(wheelIndex).m_wheelsDampingRelaxation = wheelsDampingRelaxation;
+        vehicle->getWheelInfo(wheelIndex).m_wheelsDampingCompression = wheelsDampingCompression;
+        vehicle->getWheelInfo(wheelIndex).m_frictionSlip = frictionSlip;
+        vehicle->getWheelInfo(wheelIndex).m_rollInfluence = rollInfluence;
+        vehicle->getWheelInfo(wheelIndex).m_maxSuspensionTravelCm = maxSuspensionTravelCm;
+        vehicle->getWheelInfo(wheelIndex).m_maxSuspensionForce = maxSuspensionForce;
+        vehicle->getWheelInfo(wheelIndex).m_wheelsRadius = radius;
+        vehicle->getWheelInfo(wheelIndex).m_bIsFrontWheel = frontWheel;
+        vehicle->getWheelInfo(wheelIndex).m_suspensionRestLength1 = restLength;
+
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_VehicleWheel
+     * Method:    getCollisionLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionLocation
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &vehicle->getWheelInfo(wheelIndex).m_raycastInfo.m_contactPointWS, out);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_VehicleWheel
+     * Method:    getCollisionNormal
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionNormal
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &vehicle->getWheelInfo(wheelIndex).m_raycastInfo.m_contactNormalWS, out);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_VehicleWheel
+     * Method:    getSkidInfo
+     * Signature: (J)F
+     */
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getSkidInfo
+    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex) {
+        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
+        if (vehicle == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return 0;
+        }
+        return vehicle->getWheelInfo(wheelIndex).m_skidInfo;
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 61 - 0
engine/src/bullet-native/com_jme3_bullet_objects_VehicleWheel.h

@@ -0,0 +1,61 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_objects_VehicleWheel */
+
+#ifndef _Included_com_jme3_bullet_objects_VehicleWheel
+#define _Included_com_jme3_bullet_objects_VehicleWheel
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_objects_VehicleWheel
+ * Method:    getWheelLocation
+ * Signature: (JILcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelLocation
+  (JNIEnv *, jobject, jlong, jint, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_VehicleWheel
+ * Method:    getWheelRotation
+ * Signature: (JILcom/jme3/math/Matrix3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelRotation
+  (JNIEnv *, jobject, jlong, jint, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_VehicleWheel
+ * Method:    applyInfo
+ * Signature: (JIFFFFFFFFZF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_applyInfo
+  (JNIEnv *, jobject, jlong, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jboolean, jfloat);
+
+/*
+ * Class:     com_jme3_bullet_objects_VehicleWheel
+ * Method:    getCollisionLocation
+ * Signature: (JILcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionLocation
+  (JNIEnv *, jobject, jlong, jint, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_VehicleWheel
+ * Method:    getCollisionNormal
+ * Signature: (JILcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionNormal
+  (JNIEnv *, jobject, jlong, jint, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_VehicleWheel
+ * Method:    getSkidInfo
+ * Signature: (JI)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getSkidInfo
+  (JNIEnv *, jobject, jlong, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 138 - 0
engine/src/bullet-native/com_jme3_bullet_objects_infos_RigidBodyMotionState.cpp

@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_objects_infos_RigidBodyMotionState.h"
+#include "jmeBulletUtil.h"
+#include "jmeMotionState.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+     * Method:    createMotionState
+     * Signature: ()J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_createMotionState
+    (JNIEnv *env, jobject object) {
+        jmeClasses::initJavaClasses(env);
+        jmeMotionState* motionState = new jmeMotionState();
+        return reinterpret_cast<jlong>(motionState);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+     * Method:    applyTransform
+     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Quaternion;)Z
+     */
+    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_applyTransform
+    (JNIEnv *env, jobject object, jlong stateId, jobject location, jobject rotation) {
+        jmeMotionState* motionState = reinterpret_cast<jmeMotionState*>(stateId);
+        if (motionState == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return false;
+        }
+        return motionState->applyTransform(env, location, rotation);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+     * Method:    getWorldLocation
+     * Signature: (JLcom/jme3/math/Vector3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldLocation
+    (JNIEnv *env, jobject object, jlong stateId, jobject value) {
+        jmeMotionState* motionState = reinterpret_cast<jmeMotionState*>(stateId);
+        if (motionState == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &motionState->worldTransform.getOrigin(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+     * Method:    getWorldRotation
+     * Signature: (JLcom/jme3/math/Matrix3f;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotation
+    (JNIEnv *env, jobject object, jlong stateId, jobject value) {
+        jmeMotionState* motionState = reinterpret_cast<jmeMotionState*>(stateId);
+        if (motionState == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convert(env, &motionState->worldTransform.getBasis(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+     * Method:    getWorldRotationQuat
+     * Signature: (JLcom/jme3/math/Quaternion;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotationQuat
+    (JNIEnv *env, jobject object, jlong stateId, jobject value) {
+        jmeMotionState* motionState = reinterpret_cast<jmeMotionState*>(stateId);
+        if (motionState == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        jmeBulletUtil::convertQuat(env, &motionState->worldTransform.getBasis(), value);
+    }
+
+    /*
+     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+     * Method:    finalizeNative
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_finalizeNative
+    (JNIEnv *env, jobject object, jlong stateId) {
+        jmeMotionState* motionState = reinterpret_cast<jmeMotionState*>(stateId);
+        if (motionState == NULL) {
+            jclass newExc = env->FindClass("java/lang/NullPointerException");
+            env->ThrowNew(newExc, "The native object does not exist.");
+            return;
+        }
+        delete(motionState);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 61 - 0
engine/src/bullet-native/com_jme3_bullet_objects_infos_RigidBodyMotionState.h

@@ -0,0 +1,61 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_objects_infos_RigidBodyMotionState */
+
+#ifndef _Included_com_jme3_bullet_objects_infos_RigidBodyMotionState
+#define _Included_com_jme3_bullet_objects_infos_RigidBodyMotionState
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+ * Method:    createMotionState
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_createMotionState
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+ * Method:    applyTransform
+ * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Quaternion;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_applyTransform
+  (JNIEnv *, jobject, jlong, jobject, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+ * Method:    getWorldLocation
+ * Signature: (JLcom/jme3/math/Vector3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldLocation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+ * Method:    getWorldRotation
+ * Signature: (JLcom/jme3/math/Matrix3f;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotation
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+ * Method:    getWorldRotationQuat
+ * Signature: (JLcom/jme3/math/Quaternion;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotationQuat
+  (JNIEnv *, jobject, jlong, jobject);
+
+/*
+ * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
+ * Method:    finalizeNative
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_finalizeNative
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 152 - 0
engine/src/bullet-native/com_jme3_bullet_util_DebugShapeFactory.cpp

@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen, CJ Hare
+ */
+#include "com_jme3_bullet_util_DebugShapeFactory.h"
+#include "jmeBulletUtil.h"
+#include "BulletCollision/CollisionShapes/btShapeHull.h"
+
+class DebugCallback : public btTriangleCallback, public btInternalTriangleIndexCallback {
+public:
+    JNIEnv* env;
+    jobject callback;
+
+    DebugCallback(JNIEnv* env, jobject object) {
+        this->env = env;
+        this->callback = object;
+    }
+
+    virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex) {
+        processTriangle(triangle, partId, triangleIndex);
+    }
+
+    virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) {
+        btVector3 vertexA, vertexB, vertexC;
+        vertexA = triangle[0];
+        vertexB = triangle[1];
+        vertexC = triangle[2];
+        env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexA.getX(), vertexA.getY(), vertexA.getZ(), partId, triangleIndex);
+        if (env->ExceptionCheck()) {
+            env->Throw(env->ExceptionOccurred());
+            return;
+        }
+//        triangle = 
+        env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexB.getX(), vertexB.getY(), vertexB.getZ(), partId, triangleIndex);
+        if (env->ExceptionCheck()) {
+            env->Throw(env->ExceptionOccurred());
+            return;
+        }
+        env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexC.getX(), vertexC.getY(), vertexC.getZ(), partId, triangleIndex);
+        if (env->ExceptionCheck()) {
+            env->Throw(env->ExceptionOccurred());
+            return;
+        }
+    }
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /* Inaccessible static: _00024assertionsDisabled */
+
+    /*
+     * Class:     com_jme3_bullet_util_DebugShapeFactory
+     * Method:    getVertices
+     * Signature: (JLcom/jme3/bullet/util/DebugMeshCallback;)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_util_DebugShapeFactory_getVertices
+    (JNIEnv *env, jclass clazz, jlong shapeId, jobject callback) {
+        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
+        if (shape->isConcave()) {
+            btConcaveShape* concave = reinterpret_cast<btConcaveShape*>(shape);
+            DebugCallback* clb = new DebugCallback(env, callback);
+            btVector3 min = btVector3(-1e30, -1e30, -1e30);
+            btVector3 max = btVector3(1e30, 1e30, 1e30);
+            concave->processAllTriangles(clb, min, max);
+            delete(clb);
+        } else if (shape->isConvex()) {
+            btConvexShape* convexShape = reinterpret_cast<btConvexShape*>(shape);
+            // Check there is a hull shape to render
+            if (convexShape->getUserPointer() == NULL) {
+                // create a hull approximation
+                btShapeHull* hull = new btShapeHull(convexShape);
+                float margin = convexShape->getMargin();
+                hull->buildHull(margin);
+                convexShape->setUserPointer(hull);
+            }
+
+            btShapeHull* hull = (btShapeHull*) convexShape->getUserPointer();
+
+            int numberOfTriangles = hull->numTriangles();
+            int numberOfFloats = 3 * 3 * numberOfTriangles;
+            int byteBufferSize = numberOfFloats * 4;
+            
+            // Loop variables
+            const unsigned int* hullIndices = hull->getIndexPointer();
+            const btVector3* hullVertices = hull->getVertexPointer();
+            btVector3 vertexA, vertexB, vertexC;
+            int index = 0;
+
+            for (int i = 0; i < numberOfTriangles; i++) {
+                // Grab the data for this triangle from the hull
+                vertexA = hullVertices[hullIndices[index++]];
+                vertexB = hullVertices[hullIndices[index++]];
+                vertexC = hullVertices[hullIndices[index++]];
+
+                // Put the verticies into the vertex buffer
+                env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexA.getX(), vertexA.getY(), vertexA.getZ());
+                if (env->ExceptionCheck()) {
+                    env->Throw(env->ExceptionOccurred());
+                    return;
+                }
+                env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexB.getX(), vertexB.getY(), vertexB.getZ());
+                if (env->ExceptionCheck()) {
+                    env->Throw(env->ExceptionOccurred());
+                    return;
+                }
+                env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexC.getX(), vertexC.getY(), vertexC.getZ());
+                if (env->ExceptionCheck()) {
+                    env->Throw(env->ExceptionOccurred());
+                    return;
+                }
+            }
+            delete hull;
+            convexShape->setUserPointer(NULL);
+        }
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_util_DebugShapeFactory.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_util_DebugShapeFactory */
+
+#ifndef _Included_com_jme3_bullet_util_DebugShapeFactory
+#define _Included_com_jme3_bullet_util_DebugShapeFactory
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_util_DebugShapeFactory
+ * Method:    getVertices
+ * Signature: (JLcom/jme3/bullet/util/DebugMeshCallback;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_bullet_util_DebugShapeFactory_getVertices
+  (JNIEnv *, jclass, jlong, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 59 - 0
engine/src/bullet-native/com_jme3_bullet_util_NativeMeshUtil.cpp

@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Author: Normen Hansen
+ */
+#include "com_jme3_bullet_util_NativeMeshUtil.h"
+#include "jmeBulletUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*
+     * Class:     com_jme3_bullet_util_NativeMeshUtil
+     * Method:    createTriangleIndexVertexArray
+     * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIII)J
+     */
+    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_util_NativeMeshUtil_createTriangleIndexVertexArray
+    (JNIEnv * env, jclass cls, jobject triangleIndexBase, jobject vertexIndexBase, jint numTriangles, jint numVertices, jint vertexStride, jint triangleIndexStride) {
+        jmeClasses::initJavaClasses(env);
+        int* triangles = (int*) env->GetDirectBufferAddress(triangleIndexBase);
+        float* vertices = (float*) env->GetDirectBufferAddress(vertexIndexBase);
+        btTriangleIndexVertexArray* array = new btTriangleIndexVertexArray(numTriangles, triangles, triangleIndexStride, numVertices, vertices, vertexStride);
+        return reinterpret_cast<jlong>(array);
+    }
+
+#ifdef __cplusplus
+}
+#endif

+ 21 - 0
engine/src/bullet-native/com_jme3_bullet_util_NativeMeshUtil.h

@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_bullet_util_NativeMeshUtil */
+
+#ifndef _Included_com_jme3_bullet_util_NativeMeshUtil
+#define _Included_com_jme3_bullet_util_NativeMeshUtil
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_bullet_util_NativeMeshUtil
+ * Method:    createTriangleIndexVertexArray
+ * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIII)J
+ */
+JNIEXPORT jlong JNICALL Java_com_jme3_bullet_util_NativeMeshUtil_createTriangleIndexVertexArray
+  (JNIEnv *, jclass, jobject, jobject, jint, jint, jint, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 327 - 0
engine/src/bullet-native/jmeBulletUtil.cpp

@@ -0,0 +1,327 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <math.h>
+#include "jmeBulletUtil.h"
+
+/**
+ * Author: Normen Hansen,Empire Phoenix, Lutherion
+ */
+void jmeBulletUtil::convert(JNIEnv* env, jobject in, btVector3* out) {
+    if (in == NULL || out == NULL) {
+        jmeClasses::throwNPE(env);
+    }
+    float x = env->GetFloatField(in, jmeClasses::Vector3f_x); //env->CallFloatMethod(in, jmeClasses::Vector3f_getX);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float y = env->GetFloatField(in, jmeClasses::Vector3f_y); //env->CallFloatMethod(in, jmeClasses::Vector3f_getY);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float z = env->GetFloatField(in, jmeClasses::Vector3f_z); //env->CallFloatMethod(in, jmeClasses::Vector3f_getZ);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    out->setX(x);
+    out->setY(y);
+    out->setZ(z);
+}
+
+void jmeBulletUtil::convert(JNIEnv* env, const btVector3* in, jobject out) {
+    if (in == NULL || out == NULL) {
+        jmeClasses::throwNPE(env);
+    }
+    float x = in->getX();
+    float y = in->getY();
+    float z = in->getZ();
+    env->SetFloatField(out, jmeClasses::Vector3f_x, x);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Vector3f_y, y);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Vector3f_z, z);
+    //    env->CallObjectMethod(out, jmeClasses::Vector3f_set, x, y, z);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+}
+
+void jmeBulletUtil::convert(JNIEnv* env, jobject in, btMatrix3x3* out) {
+    if (in == NULL || out == NULL) {
+        jmeClasses::throwNPE(env);
+    }
+    float m00 = env->GetFloatField(in, jmeClasses::Matrix3f_m00);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m01 = env->GetFloatField(in, jmeClasses::Matrix3f_m01);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m02 = env->GetFloatField(in, jmeClasses::Matrix3f_m02);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m10 = env->GetFloatField(in, jmeClasses::Matrix3f_m10);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m11 = env->GetFloatField(in, jmeClasses::Matrix3f_m11);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m12 = env->GetFloatField(in, jmeClasses::Matrix3f_m12);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m20 = env->GetFloatField(in, jmeClasses::Matrix3f_m20);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m21 = env->GetFloatField(in, jmeClasses::Matrix3f_m21);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float m22 = env->GetFloatField(in, jmeClasses::Matrix3f_m22);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    out->setValue(m00, m01, m02, m10, m11, m12, m20, m21, m22);
+}
+
+void jmeBulletUtil::convert(JNIEnv* env, const btMatrix3x3* in, jobject out) {
+    if (in == NULL || out == NULL) {
+        jmeClasses::throwNPE(env);
+    }
+    float m00 = in->getRow(0).m_floats[0];
+    float m01 = in->getRow(0).m_floats[1];
+    float m02 = in->getRow(0).m_floats[2];
+    float m10 = in->getRow(1).m_floats[0];
+    float m11 = in->getRow(1).m_floats[1];
+    float m12 = in->getRow(1).m_floats[2];
+    float m20 = in->getRow(2).m_floats[0];
+    float m21 = in->getRow(2).m_floats[1];
+    float m22 = in->getRow(2).m_floats[2];
+    env->SetFloatField(out, jmeClasses::Matrix3f_m00, m00);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m01, m01);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m02, m02);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m10, m10);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m11, m11);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m12, m12);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m20, m20);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m21, m21);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Matrix3f_m22, m22);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+}
+
+void jmeBulletUtil::convertQuat(JNIEnv* env, jobject in, btMatrix3x3* out) {
+    if (in == NULL || out == NULL) {
+        jmeClasses::throwNPE(env);
+    }
+    float x = env->GetFloatField(in, jmeClasses::Quaternion_x);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float y = env->GetFloatField(in, jmeClasses::Quaternion_y);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float z = env->GetFloatField(in, jmeClasses::Quaternion_z);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    float w = env->GetFloatField(in, jmeClasses::Quaternion_w);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    float norm = w * w + x * x + y * y + z * z;
+    float s = (norm == 1.0) ? 2.0 : (norm > 0.1) ? 2.0 / norm : 0.0;
+
+    // compute xs/ys/zs first to save 6 multiplications, since xs/ys/zs
+    // will be used 2-4 times each.
+    float xs = x * s;
+    float ys = y * s;
+    float zs = z * s;
+    float xx = x * xs;
+    float xy = x * ys;
+    float xz = x * zs;
+    float xw = w * xs;
+    float yy = y * ys;
+    float yz = y * zs;
+    float yw = w * ys;
+    float zz = z * zs;
+    float zw = w * zs;
+
+    // using s=2/norm (instead of 1/norm) saves 9 multiplications by 2 here
+    out->setValue(1.0 - (yy + zz), (xy - zw), (xz + yw),
+            (xy + zw), 1 - (xx + zz), (yz - xw),
+            (xz - yw), (yz + xw), 1.0 - (xx + yy));
+}
+
+void jmeBulletUtil::convertQuat(JNIEnv* env, const btMatrix3x3* in, jobject out) {
+    if (in == NULL || out == NULL) {
+        jmeClasses::throwNPE(env);
+    }
+    // the trace is the sum of the diagonal elements; see
+    // http://mathworld.wolfram.com/MatrixTrace.html
+    float t = in->getRow(0).m_floats[0] + in->getRow(1).m_floats[1] + in->getRow(2).m_floats[2];
+    float w, x, y, z;
+    // we protect the division by s by ensuring that s>=1
+    if (t >= 0) { // |w| >= .5
+        float s = sqrt(t + 1); // |s|>=1 ...
+        w = 0.5f * s;
+        s = 0.5f / s; // so this division isn't bad
+        x = (in->getRow(2).m_floats[1] - in->getRow(1).m_floats[2]) * s;
+        y = (in->getRow(0).m_floats[2] - in->getRow(2).m_floats[0]) * s;
+        z = (in->getRow(1).m_floats[0] - in->getRow(0).m_floats[1]) * s;
+    } else if ((in->getRow(0).m_floats[0] > in->getRow(1).m_floats[1]) && (in->getRow(0).m_floats[0] > in->getRow(2).m_floats[2])) {
+        float s = sqrt(1.0f + in->getRow(0).m_floats[0] - in->getRow(1).m_floats[1] - in->getRow(2).m_floats[2]); // |s|>=1
+        x = s * 0.5f; // |x| >= .5
+        s = 0.5f / s;
+        y = (in->getRow(1).m_floats[0] + in->getRow(0).m_floats[1]) * s;
+        z = (in->getRow(0).m_floats[2] + in->getRow(2).m_floats[0]) * s;
+        w = (in->getRow(2).m_floats[1] - in->getRow(1).m_floats[2]) * s;
+    } else if (in->getRow(1).m_floats[1] > in->getRow(2).m_floats[2]) {
+        float s = sqrt(1.0f + in->getRow(1).m_floats[1] - in->getRow(0).m_floats[0] - in->getRow(2).m_floats[2]); // |s|>=1
+        y = s * 0.5f; // |y| >= .5
+        s = 0.5f / s;
+        x = (in->getRow(1).m_floats[0] + in->getRow(0).m_floats[1]) * s;
+        z = (in->getRow(2).m_floats[1] + in->getRow(1).m_floats[2]) * s;
+        w = (in->getRow(0).m_floats[2] - in->getRow(2).m_floats[0]) * s;
+    } else {
+        float s = sqrt(1.0f + in->getRow(2).m_floats[2] - in->getRow(0).m_floats[0] - in->getRow(1).m_floats[1]); // |s|>=1
+        z = s * 0.5f; // |z| >= .5
+        s = 0.5f / s;
+        x = (in->getRow(0).m_floats[2] + in->getRow(2).m_floats[0]) * s;
+        y = (in->getRow(2).m_floats[1] + in->getRow(1).m_floats[2]) * s;
+        w = (in->getRow(1).m_floats[0] - in->getRow(0).m_floats[1]) * s;
+    }
+
+    env->SetFloatField(out, jmeClasses::Quaternion_x, x);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Quaternion_y, y);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Quaternion_z, z);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    env->SetFloatField(out, jmeClasses::Quaternion_w, w);
+    //    env->CallObjectMethod(out, jmeClasses::Quaternion_set, x, y, z, w);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+}
+
+void jmeBulletUtil::addResult(JNIEnv* env, jobject resultlist, btVector3 hitnormal, btVector3 m_hitPointWorld, btScalar m_hitFraction, btCollisionObject* hitobject) {
+
+    jobject singleresult = env->AllocObject(jmeClasses::PhysicsRay_Class);
+    jobject hitnormalvec = env->AllocObject(jmeClasses::Vector3f);
+
+    convert(env, const_cast<btVector3*> (&hitnormal), hitnormalvec);
+    jmeUserPointer *up1 = (jmeUserPointer*) hitobject -> getUserPointer();
+
+    env->SetObjectField(singleresult, jmeClasses::PhysicsRay_normalInWorldSpace, hitnormalvec);
+    env->SetFloatField(singleresult, jmeClasses::PhysicsRay_hitfraction, m_hitFraction);
+
+    env->SetObjectField(singleresult, jmeClasses::PhysicsRay_collisionObject, up1->javaCollisionObject);
+    env->CallVoidMethod(resultlist, jmeClasses::PhysicsRay_addmethod, singleresult);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+}

+ 61 - 0
engine/src/bullet-native/jmeBulletUtil.h

@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "jmeClasses.h"
+#include "btBulletDynamicsCommon.h"
+#include "btBulletCollisionCommon.h"
+#include "LinearMath/btVector3.h"
+
+/**
+ * Author: Normen Hansen
+ */
+class jmeBulletUtil{
+public:
+    static void convert(JNIEnv* env, jobject in, btVector3* out);
+    static void convert(JNIEnv* env, const btVector3* in, jobject out);
+    static void convert(JNIEnv* env, jobject in, btMatrix3x3* out);
+    static void convert(JNIEnv* env, const btMatrix3x3* in, jobject out);
+    static void convertQuat(JNIEnv* env, jobject in, btMatrix3x3* out);
+    static void convertQuat(JNIEnv* env, const btMatrix3x3* in, jobject out);
+    static void addResult(JNIEnv* env, jobject resultlist, const btVector3 hitnormal,const btVector3 m_hitPointWorld,const btScalar  m_hitFraction,btCollisionObject* hitobject);
+private:
+    jmeBulletUtil(){};
+    ~jmeBulletUtil(){};
+    
+};
+
+class jmeUserPointer {
+public:
+    jobject javaCollisionObject;
+    jint group;
+    jint groups;
+    void *space;
+};

+ 250 - 0
engine/src/bullet-native/jmeClasses.cpp

@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "jmeClasses.h"
+#include <stdio.h>
+
+/**
+ * Author: Normen Hansen,Empire Phoenix, Lutherion
+ */
+//public fields
+jclass jmeClasses::PhysicsSpace;
+jmethodID jmeClasses::PhysicsSpace_preTick;
+jmethodID jmeClasses::PhysicsSpace_postTick;
+jmethodID jmeClasses::PhysicsSpace_addCollisionEvent;
+
+jclass jmeClasses::PhysicsGhostObject;
+jmethodID jmeClasses::PhysicsGhostObject_addOverlappingObject;
+
+jclass jmeClasses::Vector3f;
+jmethodID jmeClasses::Vector3f_set;
+jmethodID jmeClasses::Vector3f_toArray;
+jmethodID jmeClasses::Vector3f_getX;
+jmethodID jmeClasses::Vector3f_getY;
+jmethodID jmeClasses::Vector3f_getZ;
+jfieldID jmeClasses::Vector3f_x;
+jfieldID jmeClasses::Vector3f_y;
+jfieldID jmeClasses::Vector3f_z;
+
+jclass jmeClasses::Quaternion;
+jmethodID jmeClasses::Quaternion_set;
+jmethodID jmeClasses::Quaternion_getX;
+jmethodID jmeClasses::Quaternion_getY;
+jmethodID jmeClasses::Quaternion_getZ;
+jmethodID jmeClasses::Quaternion_getW;
+jfieldID jmeClasses::Quaternion_x;
+jfieldID jmeClasses::Quaternion_y;
+jfieldID jmeClasses::Quaternion_z;
+jfieldID jmeClasses::Quaternion_w;
+
+jclass jmeClasses::Matrix3f;
+jmethodID jmeClasses::Matrix3f_set;
+jmethodID jmeClasses::Matrix3f_get;
+jfieldID jmeClasses::Matrix3f_m00;
+jfieldID jmeClasses::Matrix3f_m01;
+jfieldID jmeClasses::Matrix3f_m02;
+jfieldID jmeClasses::Matrix3f_m10;
+jfieldID jmeClasses::Matrix3f_m11;
+jfieldID jmeClasses::Matrix3f_m12;
+jfieldID jmeClasses::Matrix3f_m20;
+jfieldID jmeClasses::Matrix3f_m21;
+jfieldID jmeClasses::Matrix3f_m22;
+
+jclass jmeClasses::DebugMeshCallback;
+jmethodID jmeClasses::DebugMeshCallback_addVector;
+
+jclass jmeClasses::PhysicsRay_Class;
+jmethodID jmeClasses::PhysicsRay_newSingleResult;
+
+jfieldID jmeClasses::PhysicsRay_normalInWorldSpace;
+jfieldID jmeClasses::PhysicsRay_hitfraction;
+jfieldID jmeClasses::PhysicsRay_collisionObject;
+
+jclass jmeClasses::PhysicsRay_listresult;
+jmethodID jmeClasses::PhysicsRay_addmethod;
+
+//private fields
+//JNIEnv* jmeClasses::env;
+JavaVM* jmeClasses::vm;
+
+void jmeClasses::initJavaClasses(JNIEnv* env) {
+//    if (env != NULL) {
+//        fprintf(stdout, "Check Java VM state\n");
+//        fflush(stdout);
+//        int res = vm->AttachCurrentThread((void**) &jmeClasses::env, NULL);
+//        if (res < 0) {
+//            fprintf(stdout, "** ERROR: getting Java env!\n");
+//            if (res == JNI_EVERSION) fprintf(stdout, "GetEnv Error because of different JNI Version!\n");
+//            fflush(stdout);
+//        }
+//        return;
+//    }
+    if(PhysicsSpace!=NULL) return;
+    fprintf(stdout, "Bullet-Native: Initializing java classes\n");
+    fflush(stdout);
+//    jmeClasses::env = env;
+    env->GetJavaVM(&vm);
+
+    PhysicsSpace = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/PhysicsSpace"));
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    PhysicsSpace_preTick = env->GetMethodID(PhysicsSpace, "preTick_native", "(F)V");
+    PhysicsSpace_postTick = env->GetMethodID(PhysicsSpace, "postTick_native", "(F)V");
+    PhysicsSpace_addCollisionEvent = env->GetMethodID(PhysicsSpace, "addCollisionEvent_native","(Lcom/jme3/bullet/collision/PhysicsCollisionObject;Lcom/jme3/bullet/collision/PhysicsCollisionObject;J)V");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    PhysicsGhostObject = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/objects/PhysicsGhostObject"));
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    PhysicsGhostObject_addOverlappingObject = env->GetMethodID(PhysicsGhostObject, "addOverlappingObject_native","(Lcom/jme3/bullet/collision/PhysicsCollisionObject;)V");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    Vector3f = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/math/Vector3f"));
+    Vector3f_set = env->GetMethodID(Vector3f, "set", "(FFF)Lcom/jme3/math/Vector3f;");
+    Vector3f_toArray = env->GetMethodID(Vector3f, "toArray", "([F)[F");
+    Vector3f_getX = env->GetMethodID(Vector3f, "getX", "()F");
+    Vector3f_getY = env->GetMethodID(Vector3f, "getY", "()F");
+    Vector3f_getZ = env->GetMethodID(Vector3f, "getZ", "()F");
+    Vector3f_x = env->GetFieldID(Vector3f, "x", "F");
+    Vector3f_y = env->GetFieldID(Vector3f, "y", "F");
+    Vector3f_z = env->GetFieldID(Vector3f, "z", "F");
+
+    Quaternion = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/math/Quaternion"));
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    Quaternion_set = env->GetMethodID(Quaternion, "set", "(FFFF)Lcom/jme3/math/Quaternion;");
+    Quaternion_getW = env->GetMethodID(Quaternion, "getW", "()F");
+    Quaternion_getX = env->GetMethodID(Quaternion, "getX", "()F");
+    Quaternion_getY = env->GetMethodID(Quaternion, "getY", "()F");
+    Quaternion_getZ = env->GetMethodID(Quaternion, "getZ", "()F");
+    Quaternion_x = env->GetFieldID(Quaternion, "x", "F");
+    Quaternion_y = env->GetFieldID(Quaternion, "y", "F");
+    Quaternion_z = env->GetFieldID(Quaternion, "z", "F");
+    Quaternion_w = env->GetFieldID(Quaternion, "w", "F");
+
+    Matrix3f = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/math/Matrix3f"));
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    Matrix3f_set = env->GetMethodID(Matrix3f, "set", "(IIF)Lcom/jme3/math/Matrix3f;");
+    Matrix3f_get = env->GetMethodID(Matrix3f, "get", "(II)F");
+    Matrix3f_m00 = env->GetFieldID(Matrix3f, "m00", "F");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+    Matrix3f_m01 = env->GetFieldID(Matrix3f, "m01", "F");
+    Matrix3f_m02 = env->GetFieldID(Matrix3f, "m02", "F");
+    Matrix3f_m10 = env->GetFieldID(Matrix3f, "m10", "F");
+    Matrix3f_m11 = env->GetFieldID(Matrix3f, "m11", "F");
+    Matrix3f_m12 = env->GetFieldID(Matrix3f, "m12", "F");
+    Matrix3f_m20 = env->GetFieldID(Matrix3f, "m20", "F");
+    Matrix3f_m21 = env->GetFieldID(Matrix3f, "m21", "F");
+    Matrix3f_m22 = env->GetFieldID(Matrix3f, "m22", "F");
+
+    DebugMeshCallback = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/util/DebugMeshCallback"));
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    DebugMeshCallback_addVector = env->GetMethodID(DebugMeshCallback, "addVector", "(FFFII)V");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    PhysicsRay_Class = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/collision/PhysicsRayTestResult"));
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    PhysicsRay_newSingleResult = env->GetMethodID(PhysicsRay_Class,"<init>","()V");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    PhysicsRay_normalInWorldSpace = env->GetFieldID(PhysicsRay_Class,"hitNormalLocal","Lcom/jme3/math/Vector3f;");
+        if (env->ExceptionCheck()) {
+            env->Throw(env->ExceptionOccurred());
+            return;
+        }
+
+
+    PhysicsRay_hitfraction = env->GetFieldID(PhysicsRay_Class,"hitFraction","F");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+
+    PhysicsRay_collisionObject = env->GetFieldID(PhysicsRay_Class,"collisionObject","Lcom/jme3/bullet/collision/PhysicsCollisionObject;");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    PhysicsRay_listresult = env->FindClass("java/util/List");
+    PhysicsRay_listresult = (jclass)env->NewGlobalRef(PhysicsRay_listresult);
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+
+    PhysicsRay_addmethod = env->GetMethodID(PhysicsRay_listresult,"add","(Ljava/lang/Object;)Z");
+    if (env->ExceptionCheck()) {
+        env->Throw(env->ExceptionOccurred());
+        return;
+    }
+}
+
+void jmeClasses::throwNPE(JNIEnv* env) {
+    if (env == NULL) return;
+    jclass newExc = env->FindClass("java/lang/NullPointerException");
+    env->ThrowNew(newExc, "");
+    return;
+}

Някои файлове не бяха показани, защото твърде много файлове са промени