Просмотр исходного кода

Merge pull request #3 from jMonkeyEngine/master

Resync fork
joliver82 7 лет назад
Родитель
Сommit
4f8a2ccdd6
100 измененных файлов с 4071 добавлено и 4027 удалено
  1. 2 3
      .gitignore
  2. 3 2
      .travis.yml
  3. 2 0
      appveyor.yml
  4. 3 6
      build.gradle
  5. BIN
      gradle/wrapper/gradle-wrapper.jar
  6. 5 6
      gradle/wrapper/gradle-wrapper.properties
  7. 3 3
      gradlew
  8. 16 2
      jme3-bullet-native/build.gradle
  9. BIN
      jme3-bullet-native/libs/native/linux/x86/libbulletjme.so
  10. BIN
      jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so
  11. BIN
      jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib
  12. BIN
      jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib
  13. BIN
      jme3-bullet-native/libs/native/windows/x86/bulletjme.dll
  14. BIN
      jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll
  15. 0 187
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_PhysicsSpace.h
  16. 0 13
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_PhysicsSpace_BroadphaseType.h
  17. 0 173
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionEvent.h
  18. 0 87
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionObject.h
  19. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_BoxCollisionShape.h
  20. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.h
  21. 0 45
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CollisionShape.h
  22. 0 37
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CompoundCollisionShape.h
  23. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_ConeCollisionShape.h
  24. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CylinderCollisionShape.h
  25. 0 29
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_GImpactCollisionShape.h
  26. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.h
  27. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HullCollisionShape.h
  28. 0 45
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_MeshCollisionShape.h
  29. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_PlaneCollisionShape.h
  30. 0 45
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SimplexCollisionShape.h
  31. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SphereCollisionShape.h
  32. 0 37
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_ConeJoint.h
  33. 0 101
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_HingeJoint.h
  34. 17 1
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_PhysicsJoint.cpp
  35. 0 29
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_PhysicsJoint.h
  36. 4 4
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp
  37. 0 69
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.h
  38. 0 69
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofJoint.h
  39. 0 61
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofSpringJoint.h
  40. 0 469
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SliderJoint.h
  41. 0 173
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_RotationalLimitMotor.h
  42. 2 2
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp
  43. 0 109
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_TranslationalLimitMotor.h
  44. 0 331
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsCharacter.h
  45. 0 167
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsGhostObject.h
  46. 2 2
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp
  47. 0 447
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.h
  48. 0 143
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsVehicle.h
  49. 0 69
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_VehicleWheel.h
  50. 0 61
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_infos_RigidBodyMotionState.h
  51. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_DebugShapeFactory.h
  52. 0 21
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_NativeMeshUtil.h
  53. 236 35
      jme3-bullet/src/common/java/com/jme3/bullet/BulletAppState.java
  54. 15 8
      jme3-bullet/src/common/java/com/jme3/bullet/PhysicsTickListener.java
  55. 13 6
      jme3-bullet/src/common/java/com/jme3/bullet/collision/PhysicsCollisionGroupListener.java
  56. 14 6
      jme3-bullet/src/common/java/com/jme3/bullet/collision/PhysicsCollisionListener.java
  57. 12 1
      jme3-bullet/src/common/java/com/jme3/bullet/collision/RagdollCollisionListener.java
  58. 39 1
      jme3-bullet/src/common/java/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java
  59. 136 40
      jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java
  60. 173 119
      jme3-bullet/src/common/java/com/jme3/bullet/control/BetterCharacterControl.java
  61. 24 14
      jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java
  62. 151 17
      jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java
  63. 366 97
      jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java
  64. 26 10
      jme3-bullet/src/common/java/com/jme3/bullet/control/PhysicsControl.java
  65. 170 29
      jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java
  66. 136 23
      jme3-bullet/src/common/java/com/jme3/bullet/control/VehicleControl.java
  67. 10 1
      jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/HumanoidRagdollPreset.java
  68. 58 1
      jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/RagdollPreset.java
  69. 132 59
      jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/RagdollUtils.java
  70. 31 1
      jme3-bullet/src/common/java/com/jme3/bullet/debug/AbstractPhysicsDebugControl.java
  71. 44 1
      jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletCharacterDebugControl.java
  72. 95 5
      jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletDebugAppState.java
  73. 47 1
      jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletGhostObjectDebugControl.java
  74. 32 1
      jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletJointDebugControl.java
  75. 47 1
      jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletRigidBodyDebugControl.java
  76. 32 1
      jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletVehicleDebugControl.java
  77. 129 1
      jme3-bullet/src/common/java/com/jme3/bullet/debug/DebugTools.java
  78. 71 26
      jme3-bullet/src/common/java/com/jme3/bullet/util/CollisionShapeFactory.java
  79. 417 104
      jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java
  80. 202 9
      jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionEvent.java
  81. 10 0
      jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionEventFactory.java
  82. 158 28
      jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java
  83. 29 9
      jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsRayTestResult.java
  84. 40 6
      jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsSweepTestResult.java
  85. 36 5
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java
  86. 64 12
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java
  87. 74 6
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java
  88. 44 11
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java
  89. 55 2
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java
  90. 54 8
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java
  91. 34 3
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java
  92. 65 9
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java
  93. 44 1
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java
  94. 51 24
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java
  95. 32 3
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java
  96. 52 2
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java
  97. 39 5
      jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java
  98. 62 6
      jme3-bullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java
  99. 117 22
      jme3-bullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java
  100. 94 10
      jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java

+ 2 - 3
.gitignore

@@ -22,10 +22,9 @@
 .DS_Store
 /jme3-core/src/main/resources/com/jme3/system/version.properties
 /jme3-*/build/
-/jme3-bullet-native/bullet.zip
 /jme3-bullet-native/bullet3.zip
-/jme3-bullet-native/bullet-2.82-r2704/
-/jme3-bullet-native/bullet3-2.83.7/
+/jme3-bullet-native/bullet3-2.86.1/
+/jme3-bullet-native/src/native/cpp/com_jme3_bullet_*.h
 /jme3-android-native/openal-soft/
 /jme3-android-native/OpenALSoft.zip
 /jme3-android-native/src/native/jme_decode/STBI/

+ 3 - 2
.travis.yml

@@ -1,6 +1,5 @@
 language: java
-sudo: false
-dist: precise
+sudo: true
 
 branches:
   only:
@@ -15,7 +14,9 @@ matrix:
     env: UPLOAD=true UPLOAD_NATIVE=true
   - os: linux
     jdk: openjdk7
+    dist: precise
   - os: osx
+    osx_image: xcode9.3
     env: UPLOAD_NATIVE=true
 
 addons:

+ 2 - 0
appveyor.yml

@@ -41,6 +41,8 @@ deploy: off
 
 on_success:
 - cmd: >-
+    if not defined encrypted_f0a0b284e2e8_key appveyor exit
+
     openssl aes-256-cbc -K %encrypted_f0a0b284e2e8_key% -iv %encrypted_f0a0b284e2e8_iv% -in private\key.enc -out c:\users\appveyor\.ssh\id_rsa -d
 
     git config --global user.email "appveyor"

+ 3 - 6
build.gradle

@@ -1,10 +1,11 @@
 buildscript {
     repositories {
+        google()
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.1.0'
-        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.5'
+        classpath 'com.android.tools.build:gradle:3.1.4'
+        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
     }
 }
 
@@ -115,10 +116,6 @@ task mergedSource(type: Copy){
 
 }
 
-task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper to the current directory.') {
-    gradleVersion = '4.1'
-}
-
 ext {
     ndkCommandPath  = ""
     ndkExists       = false

BIN
gradle/wrapper/gradle-wrapper.jar


+ 5 - 6
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,5 @@
-#Sun Sep 17 22:55:30 EDT 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip

+ 3 - 3
gradlew

@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD="maximum"
 
-warn ( ) {
+warn () {
     echo "$*"
 }
 
-die ( ) {
+die () {
     echo
     echo "$*"
     echo
@@ -155,7 +155,7 @@ if $cygwin ; then
 fi
 
 # Escape application args
-save ( ) {
+save () {
     for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
     echo " "
 }

+ 16 - 2
jme3-bullet-native/build.gradle

@@ -11,6 +11,16 @@ if (!hasProperty('mainClass')) {
 dependencies {
     compile project(':jme3-bullet')
 }
+clean { dependsOn 'cleanHeaders', 'cleanUnzipped' }
+
+// clean up auto-generated C++ headers
+task cleanHeaders(type: Delete) {
+    delete fileTree(dir: 'src/native/cpp', include: 'com_jme3_bullet_*.h')
+}
+// clean up unzipped files
+task cleanUnzipped(type: Delete) {
+    delete bulletFolder
+}
 
 model {
     components {
@@ -77,6 +87,7 @@ model {
                 return
             }
 
+            cppCompiler.define('BT_NO_PROFILE')
             if (toolChain in VisualCpp) {
                 cppCompiler.args "/I$javaHome\\include"
             } else{
@@ -115,7 +126,10 @@ model {
                 cppCompiler.define('WIN32')
             }
 
-            tasks.all { dependsOn unzipBulletIfNeeded }
+            tasks.all { 
+                dependsOn unzipBulletIfNeeded
+                dependsOn ':jme3-bullet:generateNativeHeaders'
+            }
 
             // Add output to jar file
             jar.into("native/${os}/${arch}") {
@@ -199,7 +213,7 @@ unzipBulletIfNeeded.dependsOn {
     }
 }
 
-// Helper class to wrap ant dowload task
+// Helper class to wrap ant download task
 class MyDownload extends DefaultTask {
     @Input
     String sourceUrl

BIN
jme3-bullet-native/libs/native/linux/x86/libbulletjme.so


BIN
jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so


BIN
jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib


BIN
jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib


BIN
jme3-bullet-native/libs/native/windows/x86/bulletjme.dll


BIN
jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll


+ 0 - 187
jme3-bullet-native/src/native/cpp/com_jme3_bullet_PhysicsSpace.h

@@ -1,187 +0,0 @@
-/* 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
-/*
- * 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:    addConstraintC
- * Signature: (JJZ)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraintC
-  (JNIEnv *, jobject, jlong, jlong, jboolean);
-
-/*
- * 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;I)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_rayTest_1native
-  (JNIEnv *, jobject, jobject, jobject, jlong, jobject, jint);
-
-/*
- * Class:     com_jme3_bullet_PhysicsSpace
- * Method:    sweepTest_native
- * Signature: (JLcom/jme3/math/Transform;Lcom/jme3/math/Transform;JLjava/util/List;F)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_sweepTest_1native
-  (JNIEnv *, jobject, jlong, jobject, jobject, jlong, jobject, jfloat);
-
-/*
- * Class:     com_jme3_bullet_PhysicsSpace
- * Method:    setSolverNumIterations
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setSolverNumIterations
-  (JNIEnv *, jobject, jlong, jint);
-
-/*
- * 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

+ 0 - 13
jme3-bullet-native/src/native/cpp/com_jme3_bullet_PhysicsSpace_BroadphaseType.h

@@ -1,13 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_jme3_bullet_PhysicsSpace_BroadphaseType */
-
-#ifndef _Included_com_jme3_bullet_PhysicsSpace_BroadphaseType
-#define _Included_com_jme3_bullet_PhysicsSpace_BroadphaseType
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 173
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionEvent.h

@@ -1,173 +0,0 @@
-/* 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

+ 0 - 87
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionObject.h

@@ -1,87 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_BoxCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 45
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CollisionShape.h

@@ -1,45 +0,0 @@
-/* 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

+ 0 - 37
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CompoundCollisionShape.h

@@ -1,37 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_ConeCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CylinderCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 29
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_GImpactCollisionShape.h

@@ -1,29 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HullCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 45
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_MeshCollisionShape.h

@@ -1,45 +0,0 @@
-/* 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:    setBVH
- * Signature: ([BJ)J
- */
-JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_setBVH
-  (JNIEnv *, jobject, jbyteArray, jlong);
-
-/*
- * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
- * Method:    saveBVH
- * Signature: (J)[B
- */
-JNIEXPORT jbyteArray JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_saveBVH
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
- * Method:    createShape
- * Signature: (ZZJ)J
- */
-JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_createShape
-  (JNIEnv *, jobject, jboolean, jboolean, jlong);
-
-/*
- * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
- * Method:    finalizeNative
- * Signature: (JJ)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_finalizeNative
-  (JNIEnv *, jobject, jlong, jlong);
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_PlaneCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 45
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SimplexCollisionShape.h

@@ -1,45 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SphereCollisionShape.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 37
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_ConeJoint.h

@@ -1,37 +0,0 @@
-/* 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

+ 0 - 101
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_HingeJoint.h

@@ -1,101 +0,0 @@
-/* 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

+ 17 - 1
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_PhysicsJoint.cpp

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -56,6 +56,22 @@ extern "C" {
         return joint->getAppliedImpulse();
     }
 
+    /*
+     * Class:     com_jme3_bullet_joints_PhysicsJoint
+     * Method:    finalizeNative
+     * Signature: (J)V
+     */
+    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_finalizeNative
+    (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;
+        }
+        delete(joint);
+    }
+
 #ifdef __cplusplus
 }
 #endif

+ 0 - 29
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_PhysicsJoint.h

@@ -1,29 +0,0 @@
-/* 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

+ 4 - 4
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp

@@ -111,13 +111,13 @@ extern "C" {
      */
     JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getImpulseClamp
     (JNIEnv * env, jobject object, jlong jointId) {
-        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(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;
+        return joint->m_setting.m_impulseClamp;
     }
 
     /*
@@ -127,13 +127,13 @@ extern "C" {
      */
     JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getTau
     (JNIEnv * env, jobject object, jlong jointId) {
-        btPoint2PointConstraint* joint = reinterpret_cast<btPoint2PointConstraint*>(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;
+        return joint->m_setting.m_tau;
     }
 
     /*

+ 0 - 69
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.h

@@ -1,69 +0,0 @@
-/* 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

+ 0 - 69
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofJoint.h

@@ -1,69 +0,0 @@
-/* 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

+ 0 - 61
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofSpringJoint.h

@@ -1,61 +0,0 @@
-/* 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

+ 0 - 469
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SliderJoint.h

@@ -1,469 +0,0 @@
-/* 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

+ 0 - 173
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_RotationalLimitMotor.h

@@ -1,173 +0,0 @@
-/* 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

+ 2 - 2
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp

@@ -141,9 +141,9 @@ extern "C" {
      * Method:    getLimitSoftness
      * Signature: (J)F
      */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLetLimitSoftness
+    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLimitSoftness
     (JNIEnv *env, jobject object, jlong motorId) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<btTranslationalLimitMotor*>(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.");

+ 0 - 109
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_TranslationalLimitMotor.h

@@ -1,109 +0,0 @@
-/* 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

+ 0 - 331
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsCharacter.h

@@ -1,331 +0,0 @@
-/* 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:    setUp
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setUp
-    (JNIEnv *, jobject , jlong , jobject );
-
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    setAngularVelocity
-  * Signature: (JLcom/jme3/math/Vector3f;)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setAngularVelocity
-    (JNIEnv *, jobject , jlong , jobject ) ;
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    getAngularVelocity
-  * Signature: (JLcom/jme3/math/Vector3f;)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getAngularVelocity
-   (JNIEnv *, jobject , jlong , jobject );
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    setLinearVelocity
-  * Signature: (JLcom/jme3/math/Vector3f;)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setLinearVelocity
-    (JNIEnv *, jobject , jlong , jobject );
-
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    getLinearVelocity
-  * Signature: (JLcom/jme3/math/Vector3f;)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getLinearVelocity
-   (JNIEnv *, jobject , jlong , jobject );
-
-
-
-/*
- * 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:  (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setGravity
-  (JNIEnv *, jobject, jlong, jobject);
-
-/*
- * Class:     com_jme3_bullet_objects_PhysicsCharacter
- * Method:    getGravity
- * Signature:  (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getGravity
-  (JNIEnv *, jobject, jlong, jobject);
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    setLinearDamping
-  * Signature: (JF)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setLinearDamping
-   (JNIEnv *, jobject , jlong ,jfloat );
-
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    getLinearDamping
-  * Signature: (J)F
-  */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getLinearDamping
-    (JNIEnv *, jobject , jlong );
-
-
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    setAngularDamping
-  * Signature: (JF)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setAngularDamping
-    (JNIEnv *, jobject , jlong ,jfloat );
-
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    getAngularDamping
-  * Signature: (J)F
-  */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getAngularDamping
-    (JNIEnv *, jobject , jlong );
-
-  
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    setStepHeight
-  * Signature: (JF)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setStepHeight
-    (JNIEnv *, jobject , jlong ,jfloat );
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    getStepHeight
-  * Signature: (J)F
-  */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getStepHeight
-    (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:    setMaxPenetrationDepth
-  * Signature: (JF)V
-  */
-  JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxPenetrationDepth
-    (JNIEnv *, jobject , jlong , jfloat );
-
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    getMaxPenetrationDepth
-  * Signature: (J)F
-  */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxPenetrationDepth
-    (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: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_jump
-  (JNIEnv *, jobject, jlong, jobject);
-
-/*
-  * Class:     com_jme3_bullet_objects_PhysicsCharacter
-  * Method:    applyImpulse
-  * Signature: (JLcom/jme3/math/Vector3f;)V
-  */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_applyImpulse
-    (JNIEnv *, jobject , jlong ,jobject );
-
-/*
- * 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

+ 0 - 167
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsGhostObject.h

@@ -1,167 +0,0 @@
-/* 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

+ 2 - 2
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp

@@ -795,7 +795,7 @@ extern "C" {
             env->ThrowNew(newExc, "The native object does not exist.");
             return;
         }
-        body->setSleepingThresholds(value, body->getLinearSleepingThreshold());
+        body->setSleepingThresholds(value, body->getAngularSleepingThreshold());
     }
 
     /*
@@ -811,7 +811,7 @@ extern "C" {
             env->ThrowNew(newExc, "The native object does not exist.");
             return;
         }
-        body->setSleepingThresholds(body->getAngularSleepingThreshold(), value);
+        body->setSleepingThresholds(body->getLinearSleepingThreshold(), value);
     }
 
     /*

+ 0 - 447
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.h

@@ -1,447 +0,0 @@
-/* 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:    setInverseInertiaLocal
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setInverseInertiaLocal
-  (JNIEnv *, jobject, jlong, jobject);
-
-/*
- * Class:     com_jme3_bullet_objects_PhysicsRigidBody
- * Method:    getInverseInertiaLocal
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getInverseInertiaLocal
-  (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: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
-  (JNIEnv *, jobject, jlong, jobject);
-
-/*
- * Class:     com_jme3_bullet_objects_PhysicsRigidBody
- * Method:    setAngularFactor
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
-  (JNIEnv *, jobject, jlong, jobject);
-
-/*
- * Class:     com_jme3_bullet_objects_PhysicsRigidBody
- * Method:    getLinearFactor
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearFactor
-  (JNIEnv *, jobject, jlong, jobject);
-
-/*
- * Class:     com_jme3_bullet_objects_PhysicsRigidBody
- * Method:    setLinearFactor
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearFactor
-  (JNIEnv *, jobject, jlong, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 143
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsVehicle.h

@@ -1,143 +0,0 @@
-/* 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

+ 0 - 69
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_VehicleWheel.h

@@ -1,69 +0,0 @@
-/* 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);
-
-/*
- * Class:     com_jme3_bullet_objects_VehicleWheel
- * Method:    getDeltaRotation
- * Signature: (JI)F
- */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getDeltaRotation
-  (JNIEnv *, jobject, jlong, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 61
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_infos_RigidBodyMotionState.h

@@ -1,61 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_DebugShapeFactory.h

@@ -1,21 +0,0 @@
-/* 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

+ 0 - 21
jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_NativeMeshUtil.h

@@ -1,21 +0,0 @@
-/* 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

+ 236 - 35
jme3-bullet/src/common/java/com/jme3/bullet/BulletAppState.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,66 +43,136 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * <code>BulletAppState</code> allows using bullet physics in an Application.
+ * An app state to manage a single Bullet physics space.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class BulletAppState implements AppState, PhysicsTickListener {
 
+    /**
+     * true if-and-only-if the physics simulation is running (started but not
+     * yet stopped)
+     */
     protected boolean initialized = false;
     protected Application app;
+    /**
+     * manager that manages this state, set during attach
+     */
     protected AppStateManager stateManager;
+    /**
+     * executor service for physics tasks, or null if parallel simulation is not
+     * running
+     */
     protected ScheduledThreadPoolExecutor executor;
+    /**
+     * physics space managed by this state, or null if no simulation running
+     */
     protected PhysicsSpace pSpace;
+    /**
+     * threading mode to use (not null)
+     */
     protected ThreadingType threadingType = ThreadingType.SEQUENTIAL;
+    /**
+     * broadphase collision-detection algorithm for the physics space to use
+     * (not null)
+     */
     protected BroadphaseType broadphaseType = BroadphaseType.DBVT;
+    /**
+     * minimum coordinate values for the physics space when using AXIS_SWEEP
+     * broadphase algorithms (not null)
+     */
     protected Vector3f worldMin = new Vector3f(-10000f, -10000f, -10000f);
+    /**
+     * maximum coordinate values for the physics space when using AXIS_SWEEP
+     * broadphase algorithms (not null)
+     */
     protected Vector3f worldMax = new Vector3f(10000f, 10000f, 10000f);
+    /**
+     * simulation speed multiplier (default=1, paused=0)
+     */
     protected float speed = 1;
+    /**
+     * true if-and-only-if this state is enabled
+     */
     protected boolean active = true;
+    /**
+     * true if-and-only-if debug visualization is enabled
+     */
     protected boolean debugEnabled = false;
+    /**
+     * app state to manage the debug visualization, or null if none
+     */
     protected BulletDebugAppState debugAppState;
+    /**
+     * time interval between frames (in seconds) from the most recent update
+     */
     protected float tpf;
+    /**
+     * current physics task, or null if none
+     */
     protected Future physicsFuture;
 
     /**
-     * Creates a new BulletAppState running a PhysicsSpace for physics
-     * simulation, use getStateManager().attach(bulletAppState) to enable
-     * physics for an Application.
+     * Instantiate an app state to manage a new PhysicsSpace with DBVT collision
+     * detection.
+     * <p>
+     * Use getStateManager().addState(bulletAppState) to start physics.
      */
     public BulletAppState() {
     }
 
     /**
-     * Creates a new BulletAppState running a PhysicsSpace for physics
-     * simulation, use getStateManager().attach(bulletAppState) to enable
-     * physics for an Application.
+     * Instantiate an app state to manage a new PhysicsSpace.
+     * <p>
+     * Use getStateManager().addState(bulletAppState) to start physics.
      *
-     * @param broadphaseType The type of broadphase collision detection,
-     * BroadphaseType.DVBT is the default
+     * @param broadphaseType which broadphase collision-detection algorithm to
+     * use (not null)
      */
     public BulletAppState(BroadphaseType broadphaseType) {
         this(new Vector3f(-10000f, -10000f, -10000f), new Vector3f(10000f, 10000f, 10000f), broadphaseType);
     }
 
     /**
-     * Creates a new BulletAppState running a PhysicsSpace for physics
-     * simulation, use getStateManager().attach(bulletAppState) to enable
-     * physics for an Application. An AxisSweep broadphase is used.
+     * Instantiate an app state to manage a new PhysicsSpace with AXIS_SWEEP_3
+     * collision detection.
+     * <p>
+     * Use getStateManager().addState(bulletAppState) to start physics.
      *
-     * @param worldMin The minimum world extent
-     * @param worldMax The maximum world extent
+     * @param worldMin the desired minimum coordinate values (not null,
+     * unaffected, default=-10k,-10k,-10k)
+     * @param worldMax the desired maximum coordinate values (not null,
+     * unaffected, default=10k,10k,10k)
      */
     public BulletAppState(Vector3f worldMin, Vector3f worldMax) {
         this(worldMin, worldMax, BroadphaseType.AXIS_SWEEP_3);
     }
 
+    /**
+     * Instantiate an app state to manage a new PhysicsSpace.
+     * <p>
+     * Use getStateManager().addState(bulletAppState) to enable physics.
+     *
+     * @param worldMin the desired minimum coordinate values (not null,
+     * unaffected, default=-10k,-10k,-10k)
+     * @param worldMax the desired maximum coordinate values (not null,
+     * unaffected, default=10k,10k,10k)
+     * @param broadphaseType which broadphase collision-detection algorithm to
+     * use (not null)
+     */
     public BulletAppState(Vector3f worldMin, Vector3f worldMax, BroadphaseType broadphaseType) {
         this.worldMin.set(worldMin);
         this.worldMax.set(worldMax);
         this.broadphaseType = broadphaseType;
     }
 
+    /**
+     * Allocate the physics space and start physics for ThreadingType.PARALLEL.
+     *
+     * @return true if successful, otherwise false
+     */
     private boolean startPhysicsOnExecutor() {
         if (executor != null) {
             executor.shutdown();
@@ -145,28 +215,49 @@ public class BulletAppState implements AppState, PhysicsTickListener {
         }
     };
 
+    /**
+     * Access the PhysicsSpace managed by this state. Normally there is none
+     * until the state is attached.
+     *
+     * @return the pre-existing instance, or null if no simulation running
+     */
     public PhysicsSpace getPhysicsSpace() {
         return pSpace;
     }
 
     /**
-     * The physics system is started automatically on attaching, if you want to
-     * start it before for some reason, you can use this method.
+     * Allocate a physics space and start physics.
+     * <p>
+     * Physics starts automatically after the state is attached. To start it
+     * sooner, invoke this method.
      */
     public void startPhysics() {
         if (initialized) {
             return;
         }
-        //start physics thread(pool)
-        if (threadingType == ThreadingType.PARALLEL) {
-            startPhysicsOnExecutor();
-        } else {
-            pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType);
+
+        switch (threadingType) {
+            case PARALLEL:
+                boolean success = startPhysicsOnExecutor();
+                assert success;
+                assert pSpace != null;
+                break;
+
+            case SEQUENTIAL:
+                pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType);
+                pSpace.addTickListener(this);
+                break;
+
+            default:
+                throw new IllegalStateException(threadingType.toString());
         }
-        pSpace.addTickListener(this);
+
         initialized = true;
     }
 
+    /**
+     * Stop physics after this state is detached.
+     */
     public void stopPhysics() {
         if(!initialized){
             return;
@@ -180,32 +271,72 @@ public class BulletAppState implements AppState, PhysicsTickListener {
         initialized = false;
     }
 
+    /**
+     * Initialize this state prior to its 1st update. Should be invoked only by
+     * a subclass or by the AppStateManager.
+     *
+     * @param stateManager the manager for this state (not null)
+     * @param app the application which owns this state (not null)
+     */
     public void initialize(AppStateManager stateManager, Application app) {
         this.app = app;
         this.stateManager = stateManager;
         startPhysics();
     }
 
+    /**
+     * Test whether the physics simulation is running (started but not yet
+     * stopped).
+     *
+     * @return true if running, otherwise false
+     */
     public boolean isInitialized() {
         return initialized;
     }
 
+    /**
+     * Enable or disable this state.
+     *
+     * @param enabled true &rarr; enable, false &rarr; disable
+     */
     public void setEnabled(boolean enabled) {
         this.active = enabled;
     }
 
+    /**
+     * Test whether this state is enabled.
+     *
+     * @return true if enabled, otherwise false
+     */
     public boolean isEnabled() {
         return active;
     }
 
+    /**
+     * Alter whether debug visualization is enabled.
+     *
+     * @param debugEnabled true &rarr; enable, false &rarr; disable
+     */
     public void setDebugEnabled(boolean debugEnabled) {
         this.debugEnabled = debugEnabled;
     }
 
+
+    /**
+     * Test whether debug visualization is enabled.
+     *
+     * @return true if enabled, otherwise false
+     */
     public boolean isDebugEnabled() {
         return debugEnabled;
     }
 
+    /**
+     * Transition this state from detached to initializing. Should be invoked
+     * only by a subclass or by the AppStateManager.
+     *
+     * @param stateManager (not null)
+     */
     public void stateAttached(AppStateManager stateManager) {
         if (!initialized) {
             startPhysics();
@@ -219,9 +350,22 @@ public class BulletAppState implements AppState, PhysicsTickListener {
         }
     }
 
+    /**
+     * Transition this state from running to terminating. Should be invoked only
+     * by a subclass or by the AppStateManager.
+     *
+     * @param stateManager (not null)
+     */
     public void stateDetached(AppStateManager stateManager) {
     }
 
+    /**
+     * Update this state prior to rendering. Should be invoked only by a
+     * subclass or by the AppStateManager. Invoked once per frame, provided the
+     * state is attached and enabled.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     public void update(float tpf) {
         if (debugEnabled && debugAppState == null && pSpace != null) {
             debugAppState = new BulletDebugAppState(pSpace);
@@ -237,6 +381,13 @@ public class BulletAppState implements AppState, PhysicsTickListener {
         this.tpf = tpf;
     }
 
+    /**
+     * Render this state. Should be invoked only by a subclass or by the
+     * AppStateManager. Invoked once per frame, provided the state is attached
+     * and enabled.
+     *
+     * @param rm the render manager (not null)
+     */
     public void render(RenderManager rm) {
         if (!active) {
             return;
@@ -249,6 +400,11 @@ public class BulletAppState implements AppState, PhysicsTickListener {
         }
     }
 
+    /**
+     * Update this state after all rendering commands are flushed. Should be
+     * invoked only by a subclass or by the AppStateManager. Invoked once per
+     * frame, provided the state is attached and enabled.
+     */
     public void postRender() {
         if (physicsFuture != null) {
             try {
@@ -262,6 +418,12 @@ public class BulletAppState implements AppState, PhysicsTickListener {
         }
     }
 
+    /**
+     * Transition this state from terminating to detached. Should be invoked
+     * only by a subclass or by the AppStateManager. Invoked once for each time
+     * {@link #initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)}
+     * is invoked.
+     */
     public void cleanup() {
         if (debugAppState != null) {
             stateManager.detach(debugAppState);
@@ -271,67 +433,106 @@ public class BulletAppState implements AppState, PhysicsTickListener {
     }
 
     /**
-     * @return the threadingType
+     * Read which type of threading this app state uses.
+     *
+     * @return the threadingType (not null)
      */
     public ThreadingType getThreadingType() {
         return threadingType;
     }
 
     /**
-     * Use before attaching state
+     * Alter which type of threading this app state uses. Not allowed after
+     * attaching the app state.
      *
-     * @param threadingType the threadingType to set
+     * @param threadingType the desired type (not null, default=SEQUENTIAL)
      */
     public void setThreadingType(ThreadingType threadingType) {
         this.threadingType = threadingType;
     }
 
     /**
-     * Use before attaching state
+     * Alter the broadphase type the physics space will use. Not allowed after
+     * attaching the app state.
+     *
+     * @param broadphaseType an enum value (not null, default=DBVT)
      */
     public void setBroadphaseType(BroadphaseType broadphaseType) {
         this.broadphaseType = broadphaseType;
     }
 
     /**
-     * Use before attaching state
+     * Alter the coordinate range. Not allowed after attaching the app state.
+     *
+     * @param worldMin the desired minimum coordinate values when using
+     * AXIS_SWEEP broadphase algorithms (not null, alias created,
+     * default=-10k,-10k,-10k)
      */
     public void setWorldMin(Vector3f worldMin) {
         this.worldMin = worldMin;
     }
 
     /**
-     * Use before attaching state
+     * Alter the coordinate range. Not allowed after attaching the app state.
+     *
+     * @param worldMax the desired maximum coordinate values when using
+     * AXIS_SWEEP broadphase algorithms (not null, alias created,
+     * default=10k,10k,10k)
      */
     public void setWorldMax(Vector3f worldMax) {
         this.worldMax = worldMax;
     }
 
+    /**
+     * Read the simulation speed.
+     *
+     * @return speed (&ge;0, default=1)
+     */
     public float getSpeed() {
         return speed;
     }
 
+    /**
+     * Alter the simulation speed.
+     *
+     * @param speed the desired speed (&ge;0, default=1)
+     */
     public void setSpeed(float speed) {
         this.speed = speed;
     }
-
+    /**
+     * Callback from Bullet, invoked just before the physics is stepped. A good
+     * time to clear/apply forces.
+     *
+     * @param space the space that is about to be stepped (not null)
+     * @param f the time per physics step (in seconds, &ge;0)
+     */
     public void prePhysicsTick(PhysicsSpace space, float f) {
     }
 
+    /**
+     * Callback from Bullet, invoked just after the physics is stepped. A good
+     * time to clear/apply forces.
+     *
+     * @param space the space that is about to be stepped (not null)
+     * @param f the time per physics step (in seconds, &ge;0)
+     */
     public void physicsTick(PhysicsSpace space, float f) {
     }
 
+    /**
+     * Enumerate threading modes.
+     */
     public enum ThreadingType {
 
         /**
-         * Default mode; user update, physics update and rendering happen
-         * sequentially (single threaded)
+         * Default mode: user update, physics update, and rendering happen
+         * sequentially. (single threaded)
          */
         SEQUENTIAL,
         /**
-         * Parallel threaded mode; physics update and rendering are executed in
-         * parallel, update order is kept.<br/> Multiple BulletAppStates will
-         * execute in parallel in this mode.
+         * Parallel threaded mode: physics update and rendering are executed in
+         * parallel, update order is maintained.
          */
         PARALLEL,
     }

+ 15 - 8
jme3-bullet/src/common/java/com/jme3/bullet/PhysicsTickListener.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,22 +32,29 @@
 package com.jme3.bullet;
 
 /**
- * Implement this interface to be called from the physics thread on a physics update.
+ * Callback interface from the physics thread, used to clear/apply forces.
+ * <p>
+ * This interface is shared between JBullet and Native Bullet.
+ *
  * @author normenhansen
  */
 public interface PhysicsTickListener {
 
     /**
-     * Called before the physics is actually stepped, use to apply forces etc.
-     * @param space the physics space
-     * @param tpf the time per frame in seconds 
+     * Callback from Bullet, invoked just before the physics is stepped. A good
+     * time to clear/apply forces.
+     *
+     * @param space the space that is about to be stepped (not null)
+     * @param tpf the time per physics step (in seconds, &ge;0)
      */
     public void prePhysicsTick(PhysicsSpace space, float tpf);
 
     /**
-     * Called after the physics has been stepped, use to check for forces etc.
-     * @param space the physics space
-     * @param tpf the time per frame in seconds
+     * Callback from Bullet, invoked just after the physics has been stepped,
+     * use to check for forces etc.
+     *
+     * @param space the space that was just stepped (not null)
+     * @param tpf the time per physics step (in seconds, &ge;0)
      */
     public void physicsTick(PhysicsSpace space, float tpf);
 

+ 13 - 6
jme3-bullet/src/common/java/com/jme3/bullet/collision/PhysicsCollisionGroupListener.java

@@ -32,18 +32,25 @@
 package com.jme3.bullet.collision;
 
 /**
+ * Interface to receive notifications whenever an object in a particular
+ * collision group is about to collide.
+ * <p>
+ * This interface is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public interface PhysicsCollisionGroupListener {
 
     /**
-     * Called when two physics objects of the registered group are about to collide, <i>called from physics thread</i>.<br>
-     * This is only called when the collision will happen based on the collisionGroup and collideWithGroups
-     * settings in the PhysicsCollisionObject. That is the case when <b>one</b> of the parties has the
-     * collisionGroup of the other in its collideWithGroups set.<br>
-     * @param nodeA CollisionObject #1
-     * @param nodeB CollisionObject #2
+     * Invoked when two physics objects of the registered group are about to
+     * collide. <i>invoked on the physics thread</i>.<br>
+     * This is only invoked when the collision will happen based on the
+     * collisionGroup and collideWithGroups settings in the
+     * PhysicsCollisionObject. That is the case when <b>one</b> of the parties
+     * has the collisionGroup of the other in its collideWithGroups set.
+     *
+     * @param nodeA collision object #1
+     * @param nodeB collision object #2
      * @return true if the collision should happen, false otherwise
      */
     public boolean collide(PhysicsCollisionObject nodeA, PhysicsCollisionObject nodeB);

+ 14 - 6
jme3-bullet/src/common/java/com/jme3/bullet/collision/PhysicsCollisionListener.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,16 +32,24 @@
 package com.jme3.bullet.collision;
 
 /**
- * Interface for Objects that want to be informed about collision events in the physics space
+ * Interface to receive notifications whenever an object in a particular physics
+ * space collides.
+ * <p>
+ * This interface is shared between JBullet and Native Bullet.
+ *
  * @author normenhansen
  */
 public interface PhysicsCollisionListener {
 
     /**
-     * Called when a collision happened in the PhysicsSpace, <i>called from render thread</i>.
-     * 
-     * Do not store the event object as it will be cleared after the method has finished.
-     * @param event the CollisionEvent
+     * Invoked when a collision happened in the PhysicsSpace. <i>Invoked on the
+     * render thread.</i>
+     * <p>
+     * Do not retain the event object, as it will be reused after the
+     * collision() method returns. Copy any data you need during the collide()
+     * method.
+     *
+     * @param event the event that occurred (not null, reusable)
      */
     public void collision(PhysicsCollisionEvent event);
 

+ 12 - 1
jme3-bullet/src/common/java/com/jme3/bullet/collision/RagdollCollisionListener.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,11 +34,22 @@ package com.jme3.bullet.collision;
 import com.jme3.animation.Bone;
 
 /**
+ * Interface to receive notifications whenever a KinematicRagdollControl
+ * collides with another physics object.
+ * <p>
+ * This interface is shared between JBullet and Native Bullet.
  *
  * @author Nehon
  */
 public interface RagdollCollisionListener {
     
+    /**
+     * Invoked when a collision involving a KinematicRagdollControl occurs.
+     *
+     * @param bone the ragdoll bone that collided (not null)
+     * @param object the collision object that collided with the bone (not null)
+     * @param event other event details (not null)
+     */    
     public void collide(Bone bone, PhysicsCollisionObject object, PhysicsCollisionEvent event);
     
 }

+ 39 - 1
jme3-bullet/src/common/java/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,24 +39,56 @@ import com.jme3.math.Vector3f;
 import java.io.IOException;
 
 /**
+ * An element of a CompoundCollisionShape, consisting of a (non-compound) child
+ * shape, offset and rotated with respect to its parent.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class ChildCollisionShape implements Savable {
 
+    /**
+     * translation relative to parent shape (not null)
+     */
     public Vector3f location;
+    /**
+     * rotation relative to parent shape (not null)
+     */
     public Matrix3f rotation;
+    /**
+     * base shape (not null, not a compound shape)
+     */
     public CollisionShape shape;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public ChildCollisionShape() {
     }
 
+    /**
+     * Instantiate a child shape for use in a compound shape.
+     *
+     * @param location translation relative to the parent (not null, alias
+     * created)
+     * @param rotation rotation relative to the parent (not null, alias created)
+     * @param shape the base shape (not null, not a compound shape, alias
+     * created)
+     */
     public ChildCollisionShape(Vector3f location, Matrix3f rotation, CollisionShape shape) {
         this.location = location;
         this.rotation = rotation;
         this.shape = shape;
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.write(location, "location", new Vector3f());
@@ -64,6 +96,12 @@ public class ChildCollisionShape implements Savable {
         capsule.write(shape, "shape", new BoxCollisionShape(new Vector3f(1, 1, 1)));
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         InputCapsule capsule = im.getCapsule(this);
         location = (Vector3f) capsule.readSavable("location", new Vector3f());

+ 136 - 40
jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java

@@ -47,82 +47,113 @@ import com.jme3.util.clone.JmeCloneable;
 import java.io.IOException;
 
 /**
- * AbstractPhysicsControl manages the lifecycle of a physics object that is
- * attached to a spatial in the SceneGraph.
+ * Manage the life cycle of a physics object linked to a spatial in a scene
+ * graph.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public abstract class AbstractPhysicsControl implements PhysicsControl, JmeCloneable {
 
+    /**
+     * temporary storage during calculations
+     */
     private final Quaternion tmp_inverseWorldRotation = new Quaternion();
+    /**
+     * spatial to which this control is added, or null if none
+     */
     protected Spatial spatial;
+    /**
+     * true&rarr;control is enabled, false&rarr;control is disabled
+     */
     protected boolean enabled = true;
+    /**
+     * true&rarr;body is added to the physics space, false&rarr;not added
+     */
     protected boolean added = false;
+    /**
+     * space to which the physics object is (or would be) added
+     */
     protected PhysicsSpace space = null;
+    /**
+     * true &rarr; physics coordinates match local transform, false &rarr;
+     * physics coordinates match world transform
+     */
     protected boolean applyLocal = false;
 
     /**
-     * Called when the control is added to a new spatial, create any
-     * spatial-dependent data here.
+     * Create spatial-dependent data. Invoked when this control is added to a
+     * spatial.
      *
-     * @param spat The new spatial, guaranteed not to be null
+     * @param spat the controlled spatial (not null)
      */
     protected abstract void createSpatialData(Spatial spat);
 
     /**
-     * Called when the control is removed from a spatial, remove any
-     * spatial-dependent data here.
+     * Destroy spatial-dependent data. Invoked when this control is removed from
+     * a spatial.
      *
-     * @param spat The old spatial, guaranteed not to be null
+     * @param spat the previously controlled spatial (not null)
      */
     protected abstract void removeSpatialData(Spatial spat);
 
     /**
-     * Called when the physics object is supposed to move to the spatial
-     * position.
+     * Translate the physics object to the specified location.
      *
-     * @param vec
+     * @param vec desired location (not null, unaffected)
      */
     protected abstract void setPhysicsLocation(Vector3f vec);
 
     /**
-     * Called when the physics object is supposed to move to the spatial
-     * rotation.
+     * Rotate the physics object to the specified orientation.
      *
-     * @param quat
+     * @param quat desired orientation (not null, unaffected)
      */
     protected abstract void setPhysicsRotation(Quaternion quat);
 
     /**
-     * Called when the physics object is supposed to add all objects it needs to
-     * manage to the physics space.
+     * Add all managed physics objects to the specified space.
      *
-     * @param space
+     * @param space which physics space to add to (not null)
      */
     protected abstract void addPhysics(PhysicsSpace space);
 
     /**
-     * Called when the physics object is supposed to remove all objects added to
-     * the physics space.
+     * Remove all managed physics objects from the specified space.
      *
-     * @param space
+     * @param space which physics space to remove from (not null)
      */
     protected abstract void removePhysics(PhysicsSpace space);
 
+    /**
+     * Test whether physics-space coordinates should match the spatial's local
+     * coordinates.
+     *
+     * @return true if matching local coordinates, false if matching world
+     * coordinates
+     */
     public boolean isApplyPhysicsLocal() {
         return applyLocal;
     }
 
     /**
-     * When set to true, the physics coordinates will be applied to the local
-     * translation of the Spatial
+     * Alter whether physics-space coordinates should match the spatial's local
+     * coordinates.
      *
-     * @param applyPhysicsLocal
+     * @param applyPhysicsLocal true&rarr;match local coordinates,
+     * false&rarr;match world coordinates (default=false)
      */
     public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
         applyLocal = applyPhysicsLocal;
     }
 
+    /**
+     * Access whichever spatial translation corresponds to the physics location.
+     *
+     * @return the pre-existing location vector (in physics-space coordinates,
+     * not null)
+     */
     protected Vector3f getSpatialTranslation() {
         if (applyLocal) {
             return spatial.getLocalTranslation();
@@ -130,6 +161,12 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
         return spatial.getWorldTranslation();
     }
 
+    /**
+     * Access whichever spatial rotation corresponds to the physics rotation.
+     *
+     * @return the pre-existing quaternion (in physics-space coordinates, not
+     * null)
+     */
     protected Quaternion getSpatialRotation() {
         if (applyLocal) {
             return spatial.getLocalRotation();
@@ -138,10 +175,12 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
     }
 
     /**
-     * Applies a physics transform to the spatial
+     * Apply a physics transform to the spatial.
      *
-     * @param worldLocation
-     * @param worldRotation
+     * @param worldLocation location vector (in physics-space coordinates, not
+     * null, unaffected)
+     * @param worldRotation orientation (in physics-space coordinates, not null,
+     * unaffected)
      */
     protected void applyPhysicsTransform(Vector3f worldLocation, Quaternion worldRotation) {
         if (enabled && spatial != null) {
@@ -170,12 +209,28 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
         throw new UnsupportedOperationException();
     }
 
+    /**
+     * Callback from {@link com.jme3.util.clone.Cloner} to convert this
+     * shallow-cloned control into a deep-cloned one, using the specified cloner
+     * and original to resolve copied fields.
+     *
+     * @param cloner the cloner that's cloning this control (not null)
+     * @param original the control from which this control was shallow-cloned
+     * (unused)
+     */
     @Override  
     public void cloneFields( Cloner cloner, Object original ) { 
         this.spatial = cloner.clone(spatial);
         createSpatialData(this.spatial);
     }
          
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     public void setSpatial(Spatial spatial) {
         if (this.spatial != null && this.spatial != spatial) {
             removeSpatialData(this.spatial);
@@ -191,6 +246,15 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
         setPhysicsRotation(getSpatialRotation());
     }
 
+    /**
+     * Enable or disable this control.
+     * <p>
+     * When the control is disabled, the physics object is removed from physics
+     * space. When the control is enabled again, the physics object is moved to
+     * the spatial's location and then added to the physics space.
+     *
+     * @param enabled true&rarr;enable the control, false&rarr;disable it
+     */
     public void setEnabled(boolean enabled) {
         this.enabled = enabled;
         if (space != null) {
@@ -208,6 +272,11 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
         }
     }
 
+    /**
+     * Test whether this control is enabled.
+     *
+     * @return true if enabled, otherwise false
+     */
     public boolean isEnabled() {
         return enabled;
     }
@@ -218,28 +287,48 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
     public void render(RenderManager rm, ViewPort vp) {
     }
 
-    public void setPhysicsSpace(PhysicsSpace space) {
-        if (space == null) {
-            if (this.space != null) {
-                removePhysics(this.space);
-                added = false;
-            }
-        } else {
-            if (this.space == space) {
-                return;
-            } else if (this.space != null) {
-                removePhysics(this.space);
-            }
-            addPhysics(space);
+    /**
+     * If enabled, add this control's physics object to the specified physics
+     * space. If not enabled, alter where the object would be added. The object
+     * is removed from any other space it's in.
+     *
+     * @param newSpace where to add, or null to simply remove
+     */
+    @Override
+    public void setPhysicsSpace(PhysicsSpace newSpace) {
+        if (space == newSpace) {
+            return;
+        }
+        if (added) {
+            removePhysics(space);
+            added = false;
+        }
+        if (newSpace != null && isEnabled()) {
+            addPhysics(newSpace);
             added = true;
         }
-        this.space = space;
+        /*
+         * If this control isn't enabled, its physics object will be
+         * added to the new space when the control becomes enabled.
+         */
+        space = newSpace;
     }
 
+    /**
+     * Access the physics space to which the object is (or would be) added.
+     *
+     * @return the pre-existing space, or null for none
+     */
     public PhysicsSpace getPhysicsSpace() {
         return space;
     }
 
+    /**
+     * Serialize this object, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule oc = ex.getCapsule(this);
@@ -248,6 +337,13 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
         oc.write(spatial, "spatial", null);
     }
 
+    /**
+     * De-serialize this control from the specified importer, for example when
+     * loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter im) throws IOException {
         InputCapsule ic = im.getCapsule(this);

+ 173 - 119
jme3-bullet/src/common/java/com/jme3/bullet/control/BetterCharacterControl.java

@@ -56,15 +56,18 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * This is intended to be a replacement for the internal bullet character class.
- * A RigidBody with cylinder collision shape is used and its velocity is set
- * continuously, a ray test is used to check if the character is on the ground.
- *
- * The character keeps his own local coordinate system which adapts based on the
- * gravity working on the character so the character will always stand upright.
- *
- * Forces in the local x/z plane are dampened while those in the local y
- * direction are applied fully (e.g. jumping, falling).
+ * This class is intended to replace the CharacterControl class.
+ * <p>
+ * A rigid body with cylinder collision shape is used and its velocity is set
+ * continuously. A ray test is used to test whether the character is on the
+ * ground.
+ * <p>
+ * The character keeps their own local coordinate system which adapts based on
+ * the gravity working on the character so they will always stand upright.
+ * <p>
+ * Motion in the local X-Z plane is damped.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
@@ -74,10 +77,16 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     protected PhysicsRigidBody rigidBody;
     protected float radius;
     protected float height;
+    /**
+     * mass of this character (&gt;0)
+     */
     protected float mass;
+    /**
+     * relative height when ducked (1=full height)
+     */
     protected float duckedFactor = 0.6f;
     /**
-     * Local up direction, derived from gravity.
+     * local up direction, derived from gravity
      */
     protected final Vector3f localUp = new Vector3f(0, 1, 0);
     /**
@@ -94,22 +103,27 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
      */
     protected final Quaternion localForwardRotation = new Quaternion(Quaternion.DIRECTION_Z);
     /**
-     * Is a z-forward vector based on the view direction and the current local
-     * x/z plane.
+     * a Z-forward vector based on the view direction and the local X-Z plane.
      */
     protected final Vector3f viewDirection = new Vector3f(0, 0, 1);
     /**
-     * Stores final spatial location, corresponds to RigidBody location.
+     * spatial location, corresponds to RigidBody location.
      */
     protected final Vector3f location = new Vector3f();
     /**
-     * Stores final spatial rotation, is a z-forward rotation based on the view
-     * direction and the current local x/z plane. See also rotatedViewDirection.
+     * spatial rotation, a Z-forward rotation based on the view direction and
+     * local X-Z plane.
+     *
+     * @see #rotatedViewDirection
      */
     protected final Quaternion rotation = new Quaternion(Quaternion.DIRECTION_Z);
     protected final Vector3f rotatedViewDirection = new Vector3f(0, 0, 1);
     protected final Vector3f walkDirection = new Vector3f();
     protected final Vector3f jumpForce;
+    /**
+     * X-Z motion damping factor (0&rarr;no damping, 1=no external forces,
+     * default=0.9)
+     */
     protected float physicsDamping = 0.9f;
     protected final Vector3f scale = new Vector3f(1, 1, 1);
     protected final Vector3f velocity = new Vector3f();
@@ -119,20 +133,23 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     protected boolean wantToUnDuck = false;
 
     /**
-     * Only used for serialization, do not use this constructor.
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
      */
     public BetterCharacterControl() {
         jumpForce = new Vector3f();
     }
 
     /**
-     * Creates a new character with the given properties. Note that to avoid
-     * issues the final height when ducking should be larger than 2x radius. The
-     * jumpForce will be set to an upwards force of 5x mass.
+     * Instantiate an enabled control with the specified properties.
+     * <p>
+     * The final height when ducking must be larger than 2x radius. The
+     * jumpForce will be set to an upward force of 5x mass.
      *
-     * @param radius
-     * @param height
-     * @param mass
+     * @param radius the radius of the character's collision shape (&gt;0)
+     * @param height the height of the character's collision shape
+     * (&gt;2*radius)
+     * @param mass the character's mass (&ge;0)
      */
     public BetterCharacterControl(float radius, float height, float mass) {
         this.radius = radius;
@@ -143,6 +160,13 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
         rigidBody.setAngularFactor(0);
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is added to a scene graph. Do not invoke
+     * directly from user code.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     @Override
     public void update(float tpf) {
         super.update(tpf);
@@ -151,16 +175,24 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
         applyPhysicsTransform(location, rotation);
     }
 
+    /**
+     * Render this control. Invoked once per view port per frame, provided the
+     * control is added to a scene. Should be invoked only by a subclass or by
+     * the RenderManager.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     @Override
     public void render(RenderManager rm, ViewPort vp) {
         super.render(rm, vp);
     }
 
     /**
-     * Used internally, don't call manually
+     * Callback from Bullet, invoked just before the physics is stepped.
      *
-     * @param space
-     * @param tpf
+     * @param space the space that is about to be stepped (not null)
+     * @param tpf the time per physics step (in seconds, &ge;0)
      */
     public void prePhysicsTick(PhysicsSpace space, float tpf) {
         checkOnGround();
@@ -172,8 +204,8 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
         TempVars vars = TempVars.get();
 
         Vector3f currentVelocity = vars.vect2.set(velocity);
-        
-        // dampen existing x/z forces
+
+        // Attenuate any existing X-Z motion.
         float existingLeftVelocity = velocity.dot(localLeft);
         float existingForwardVelocity = velocity.dot(localForward);
         Vector3f counter = vars.vect1;
@@ -208,20 +240,20 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Used internally, don't call manually
+     * Callback from Bullet, invoked just after the physics has been stepped.
      *
-     * @param space
-     * @param tpf
+     * @param space the space that was just stepped (not null)
+     * @param tpf the time per physics step (in seconds, &ge;0)
      */
     public void physicsTick(PhysicsSpace space, float tpf) {
         rigidBody.getLinearVelocity(velocity);
     }
 
     /**
-     * Move the character somewhere. Note the character also takes the location
-     * of any spatial its being attached to in the moment it is attached.
+     * Move the character somewhere. Note the character also warps to the
+     * location of the spatial when the control is added.
      *
-     * @param vec The new character location.
+     * @param vec the desired character location (not null)
      */
     public void warp(Vector3f vec) {
         setPhysicsLocation(vec);
@@ -239,32 +271,32 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Set the jump force as a Vector3f. The jump force is local to the
-     * characters coordinate system, which normally is always z-forward (in
-     * world coordinates, parent coordinates when set to applyLocalPhysics)
+     * Alter the jump force. The jump force is local to the character's
+     * coordinate system, which normally is always z-forward (in world
+     * coordinates, parent coordinates when set to applyLocalPhysics)
      *
-     * @param jumpForce The new jump force
+     * @param jumpForce the desired jump force (not null, unaffected,
+     * default=5*mass in +Y direction)
      */
     public void setJumpForce(Vector3f jumpForce) {
         this.jumpForce.set(jumpForce);
     }
 
     /**
-     * Gets the current jump force. The default is 5 * character mass in y
-     * direction.
+     * Access the jump force.
      *
-     * @return
+     * @return the pre-existing vector (not null)
      */
     public Vector3f getJumpForce() {
         return jumpForce;
     }
 
     /**
-     * Check if the character is on the ground. This is determined by a ray test
-     * in the center of the character and might return false even if the
-     * character is not falling yet.
+     * Test whether the character is supported. Uses a ray test from the center
+     * of the character and might return false even if the character is not
+     * falling yet.
      *
-     * @return
+     * @return true if on the ground, otherwise false
      */
     public boolean isOnGround() {
         return onGround;
@@ -274,10 +306,10 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
      * Toggle character ducking. When ducked the characters capsule collision
      * shape height will be multiplied by duckedFactor to make the capsule
      * smaller. When unducking, the character will check with a ray test if it
-     * can in fact unduck and only do so when its possible. You can check the
-     * state of the unducking by checking isDucked().
+     * can in fact unduck and only do so when its possible. You can test the
+     * state using isDucked().
      *
-     * @param enabled
+     * @param enabled true&rarr;duck, false&rarr;unduck
      */
     public void setDucked(boolean enabled) {
         if (enabled) {
@@ -298,33 +330,33 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
      * Check if the character is ducking, either due to user input or due to
      * unducking being impossible at the moment (obstacle above).
      *
-     * @return
+     * @return true if ducking, otherwise false
      */
     public boolean isDucked() {
         return ducked;
     }
 
     /**
-     * Sets the height multiplication factor for ducking.
+     * Alter the height multiplier for ducking.
      *
-     * @param factor The factor by which the height should be multiplied when
-     * ducking
+     * @param factor the factor by which the height should be multiplied when
+     * ducking (&ge;0, &le;1)
      */
     public void setDuckedFactor(float factor) {
         duckedFactor = factor;
     }
 
     /**
-     * Gets the height multiplication factor for ducking.
+     * Read the height multiplier for ducking.
      *
-     * @return
+     * @return the factor (&ge;0, &le;1)
      */
     public float getDuckedFactor() {
         return duckedFactor;
     }
 
     /**
-     * Sets the walk direction of the character. This parameter is framerate
+     * Alter the character's the walk direction. This parameter is framerate
      * independent and the character will move continuously in the direction
      * given by the vector with the speed given by the vector length in m/s.
      *
@@ -335,20 +367,19 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Gets the current walk direction and speed of the character. The length of
-     * the vector defines the speed.
+     * Read the walk velocity. The length of the vector defines the speed.
      *
-     * @return
+     * @return the pre-existing vector (not null)
      */
     public Vector3f getWalkDirection() {
         return walkDirection;
     }
 
     /**
-     * Sets the view direction for the character. Note this only defines the
-     * rotation of the spatial in the local x/z plane of the character.
+     * Alter the character's view direction. Note this only defines the
+     * orientation in the local X-Z plane.
      *
-     * @param vec
+     * @param vec a direction vector (not null, unaffected)
      */
     public void setViewDirection(Vector3f vec) {
         viewDirection.set(vec);
@@ -356,10 +387,10 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Gets the current view direction, note this doesn't need to correspond
-     * with the spatials forward direction.
+     * Access the view direction. This need not agree with the spatial's forward
+     * direction.
      *
-     * @return
+     * @return the pre-existing vector (not null)
      */
     public Vector3f getViewDirection() {
         return viewDirection;
@@ -367,15 +398,15 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
 
     /**
      * Realign the local forward vector to given direction vector, if null is
-     * supplied Vector3f.UNIT_Z is used. Input vector has to be perpendicular to
-     * current gravity vector. This normally only needs to be called when the
+     * supplied Vector3f.UNIT_Z is used. The input vector must be perpendicular
+     * to gravity vector. This normally only needs to be invoked when the
      * gravity direction changed continuously and the local forward vector is
      * off due to drift. E.g. after walking around on a sphere "planet" for a
-     * while and then going back to a y-up coordinate system the local z-forward
-     * might not be 100% alinged with Z axis.
+     * while and then going back to a Y-up coordinate system the local Z-forward
+     * might not be 100% aligned with the Z axis.
      *
-     * @param vec The new forward vector, has to be perpendicular to the current
-     * gravity vector!
+     * @param vec the desired forward vector (perpendicular to the gravity
+     * vector, may be null, default=0,0,1)
      */
     public void resetForward(Vector3f vec) {
         if (vec == null) {
@@ -386,23 +417,21 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Get the current linear velocity along the three axes of the character.
-     * This is prepresented in world coordinates, parent coordinates when the
-     * control is set to applyLocalPhysics.
+     * Access the character's linear velocity in physics-space coordinates.
      *
-     * @return The current linear velocity of the character
+     * @return the pre-existing vector (not null)
      */
     public Vector3f getVelocity() {
         return velocity;
     }
 
     /**
-     * Set the gravity for this character. Note that this also realigns the
-     * local coordinate system of the character so that continuous changes in
-     * gravity direction are possible while maintaining a sensible control over
-     * the character.
+     * Alter the gravity acting on this character. Note that this also realigns
+     * the local coordinate system of the character so that continuous changes
+     * in gravity direction are possible while maintaining a sensible control
+     * over the character.
      *
-     * @param gravity
+     * @param gravity an acceleration vector (not null, unaffected)
      */
     public void setGravity(Vector3f gravity) {
         rigidBody.setGravity(gravity);
@@ -411,46 +440,48 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Get the current gravity of the character.
+     * Copy the character's gravity vector.
      *
-     * @return
+     * @return a new acceleration vector (not null)
      */
     public Vector3f getGravity() {
         return rigidBody.getGravity();
     }
 
     /**
-     * Get the current gravity of the character.
+     * Copy the character's gravity vector.
      *
-     * @param store The vector to store the result in
-     * @return
+     * @param store storage for the result (modified if not null)
+     * @return an acceleration vector (either the provided storage or a new
+     * vector, not null)
      */
     public Vector3f getGravity(Vector3f store) {
         return rigidBody.getGravity(store);
     }
 
     /**
-     * Sets how much the physics forces in the local x/z plane should be
-     * dampened.
-     * @param physicsDamping The dampening value, 0 = no dampening, 1 = no external force, default = 0.9
+     * Alter how much motion in the local X-Z plane is damped.
+     *
+     * @param physicsDamping the desired damping factor (0&rarr;no damping, 1=no
+     * external forces, default=0.9)
      */
     public void setPhysicsDamping(float physicsDamping) {
         this.physicsDamping = physicsDamping;
     }
 
     /**
-     * Gets how much the physics forces in the local x/z plane should be
-     * dampened.
+     * Read how much motion in the local X-Z plane is damped.
+     *
+     * @return the damping factor (0&rarr;no damping, 1=no external forces)
      */
     public float getPhysicsDamping() {
         return physicsDamping;
     }
 
     /**
-     * This actually sets a new collision shape to the character to change the
-     * height of the capsule.
+     * Alter the height of collision shape.
      *
-     * @param percent
+     * @param percent the desired height, as a percentage of the full height
      */
     protected void setHeightPercent(float percent) {
         scale.setY(percent);
@@ -458,7 +489,7 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * This checks if the character is on the ground by doing a ray test.
+     * Test whether the character is on the ground, by means of a ray test.
      */
     protected void checkOnGround() {
         TempVars vars = TempVars.get();
@@ -499,12 +530,10 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Gets a new collision shape based on the current scale parameter. The
-     * created collisionshape is a capsule collision shape that is attached to a
-     * compound collision shape with an offset to set the object center at the
-     * bottom of the capsule.
+     * Create a collision shape based on the scale parameter. The new shape is a
+     * compound shape containing an offset capsule.
      *
-     * @return
+     * @return a new compound shape (not null)
      */
     protected CollisionShape getShape() {
         //TODO: cleanup size mess..
@@ -516,18 +545,18 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Gets the scaled height.
+     * Calculate the character's scaled height.
      *
-     * @return
+     * @return the height
      */
     protected float getFinalHeight() {
         return height * scale.getY();
     }
 
     /**
-     * Gets the scaled radius.
+     * Calculate the character's scaled radius.
      *
-     * @return
+     * @return the radius
      */
     protected float getFinalRadius() {
         return radius * scale.getZ();
@@ -536,7 +565,7 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     /**
      * Updates the local coordinate system from the localForward and localUp
      * vectors, adapts localForward, sets localForwardRotation quaternion to
-     * local z-forward rotation.
+     * local Z-forward rotation.
      */
     protected void updateLocalCoordinateSystem() {
         //gravity vector has possibly changed, calculate new world forward (UNIT_Z)
@@ -547,8 +576,8 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * Updates the local x/z-flattened view direction and the corresponding
-     * rotation quaternion for the spatial.
+     * Updates the local X-Z view direction and the corresponding rotation
+     * quaternion for the spatial.
      */
     protected void updateLocalViewDirection() {
         //update local rotation quaternion to use for view rotation
@@ -568,7 +597,6 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
      * set to the new direction
      * @param worldUpVector The up vector to use, the result direction will be
      * perpendicular to this
-     * @return
      */
     protected final void calculateNewForward(Quaternion rotation, Vector3f direction, Vector3f worldUpVector) {
         if (direction == null) {
@@ -600,10 +628,9 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * This is implemented from AbstractPhysicsControl and called when the
-     * spatial is attached for example.
+     * Translate the character to the specified location.
      *
-     * @param vec
+     * @param vec desired location (not null, unaffected)
      */
     @Override
     protected void setPhysicsLocation(Vector3f vec) {
@@ -612,12 +639,12 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * This is implemented from AbstractPhysicsControl and called when the
-     * spatial is attached for example. We don't set the actual physics rotation
-     * but the view rotation here. It might actually be altered by the
-     * calculateNewForward method.
+     * Rotate the physics object to the specified orientation.
+     * <p>
+     * We don't set the actual physics rotation but the view rotation here. It
+     * might actually be altered by the calculateNewForward method.
      *
-     * @param quat
+     * @param quat desired orientation (not null, unaffected)
      */
     @Override
     protected void setPhysicsRotation(Quaternion quat) {
@@ -627,10 +654,9 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * This is implemented from AbstractPhysicsControl and called when the
-     * control is supposed to add all objects to the physics space.
+     * Add all managed physics objects to the specified space.
      *
-     * @param space
+     * @param space which physics space to add to (not null)
      */
     @Override
     protected void addPhysics(PhysicsSpace space) {
@@ -642,10 +668,9 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
     }
 
     /**
-     * This is implemented from AbstractPhysicsControl and called when the
-     * control is supposed to remove all objects from the physics space.
+     * Remove all managed physics objects from the specified space.
      *
-     * @param space
+     * @param space which physics space to remove from (not null)
      */
     @Override
     protected void removePhysics(PhysicsSpace space) {
@@ -653,16 +678,33 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
         space.removeTickListener(this);
     }
 
+    /**
+     * Create spatial-dependent data. Invoked when this control is added to a
+     * spatial.
+     *
+     * @param spat the controlled spatial (not null, alias created)
+     */
     @Override
     protected void createSpatialData(Spatial spat) {
         rigidBody.setUserObject(spatial);
     }
 
+    /**
+     * Destroy spatial-dependent data. Invoked when this control is removed from
+     * a spatial.
+     *
+     * @param spat the previously controlled spatial (not null)
+     */
     @Override
     protected void removeSpatialData(Spatial spat) {
         rigidBody.setUserObject(null);
     }
 
+    /**
+     * Create a shallow clone for the JME cloner.
+     *
+     * @return a new control (not null)
+     */
     @Override
     public Object jmeClone() {
         BetterCharacterControl control = new BetterCharacterControl(radius, height, mass);
@@ -671,6 +713,12 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
         return control;
     }     
 
+    /**
+     * Serialize this control, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
@@ -682,6 +730,12 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
         oc.write(physicsDamping, "physicsDamping", 0.9f);
     }
 
+    /**
+     * De-serialize this control, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter im) throws IOException {
         super.read(im);

+ 24 - 14
jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java

@@ -190,21 +190,31 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
     public void render(RenderManager rm, ViewPort 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;
-            // if this object isn't enabled, it will be added when it will be enabled.
-            if (isEnabled()) {
-                space.addCollisionObject(this);
-                added = true;
-            }
+    /**
+     * If enabled, add this control's physics object to the specified physics
+     * space. If not enabled, alter where the object would be added. The object
+     * is removed from any other space it's currently in.
+     *
+     * @param newSpace where to add, or null to simply remove
+     */
+    @Override
+    public void setPhysicsSpace(PhysicsSpace newSpace) {
+        if (space == newSpace) {
+            return;
+        }
+        if (added) {
+            space.removeCollisionObject(this);
+            added = false;
+        }
+        if (newSpace != null && isEnabled()) {
+            newSpace.addCollisionObject(this);
+            added = true;
         }
-        this.space = space;
+        /*
+         * If this control isn't enabled, its physics object will be
+         * added to the new space when the control becomes enabled.
+         */
+        space = newSpace;
     }
 
     public PhysicsSpace getPhysicsSpace() {

+ 151 - 17
jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java

@@ -49,38 +49,82 @@ import com.jme3.util.clone.JmeCloneable;
 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).
+ * A physics control to link a PhysicsGhostObject to a spatial.
+ * <p>
+ * The ghost object moves with the spatial it is attached to and can be used to
+ * detect overlaps with other physics objects (e.g. aggro radius).
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
+ *
  * @author normenhansen
  */
 public class GhostControl extends PhysicsGhostObject implements PhysicsControl, JmeCloneable {
 
+    /**
+     * spatial to which this control is added, or null if none
+     */
     protected Spatial spatial;
+    /**
+     * true&rarr;control is enabled, false&rarr;control is disabled
+     */
     protected boolean enabled = true;
+    /**
+     * true&rarr;body is added to the physics space, false&rarr;not added
+     */
     protected boolean added = false;
+    /**
+     * space to which the ghost object is (or would be) added
+     */
     protected PhysicsSpace space = null;
+    /**
+     * true &rarr; physics coordinates match local transform, false &rarr;
+     * physics coordinates match world transform
+     */
     protected boolean applyLocal = false;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public GhostControl() {
     }
 
+    /**
+     * Instantiate an enabled control with the specified shape.
+     *
+     * @param shape (not null)
+     */
     public GhostControl(CollisionShape shape) {
         super(shape);
     }
 
+    /**
+     * Test whether physics-space coordinates should match the spatial's local
+     * coordinates.
+     *
+     * @return true if matching local coordinates, false if matching world
+     * coordinates
+     */
     public boolean isApplyPhysicsLocal() {
         return applyLocal;
     }
 
     /**
-     * When set to true, the physics coordinates will be applied to the local
-     * translation of the Spatial
-     * @param applyPhysicsLocal
+     * Alter whether physics-space coordinates should match the spatial's local
+     * coordinates.
+     *
+     * @param applyPhysicsLocal true&rarr;match local coordinates,
+     * false&rarr;match world coordinates (default=false)
      */
     public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
         applyLocal = applyPhysicsLocal;
     }
 
+    /**
+     * Access whichever spatial translation corresponds to the physics location.
+     *
+     * @return the pre-existing vector (not null)
+     */
     private Vector3f getSpatialTranslation() {
         if (applyLocal) {
             return spatial.getLocalTranslation();
@@ -88,6 +132,11 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
         return spatial.getWorldTranslation();
     }
 
+    /**
+     * Access whichever spatial rotation corresponds to the physics rotation.
+     *
+     * @return the pre-existing quaternion (not null)
+     */
     private Quaternion getSpatialRotation() {
         if (applyLocal) {
             return spatial.getLocalRotation();
@@ -95,12 +144,23 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
         return spatial.getWorldRotation();
     }
 
+    /**
+     * Clone this control for a different spatial. No longer used as of JME 3.1.
+     *
+     * @param spatial the spatial for the clone to control (or null)
+     * @return a new control (not null)
+     */
     @Deprecated
     @Override
     public Control cloneForSpatial(Spatial spatial) {
         throw new UnsupportedOperationException();
     }
 
+    /**
+     * Create a shallow clone for the JME cloner.
+     *
+     * @return a new control (not null)
+     */
     @Override
     public Object jmeClone() {
         GhostControl control = new GhostControl(collisionShape);
@@ -115,11 +175,27 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
         return control;
     }     
 
+    /**
+     * Callback from {@link com.jme3.util.clone.Cloner} to convert this
+     * shallow-cloned control into a deep-cloned one, using the specified cloner
+     * and original to resolve copied fields.
+     *
+     * @param cloner the cloner that's cloning this control (not null)
+     * @param original the control from which this control was shallow-cloned
+     * (unused)
+     */
     @Override   
     public void cloneFields( Cloner cloner, Object original ) { 
         this.spatial = cloner.clone(spatial);
     }
          
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     public void setSpatial(Spatial spatial) {
         this.spatial = spatial;
         setUserObject(spatial);
@@ -130,6 +206,15 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
         setPhysicsRotation(getSpatialRotation());
     }
 
+    /**
+     * Enable or disable this control.
+     * <p>
+     * When the control is disabled, the ghost object is removed from physics
+     * space. When the control is enabled again, the object is moved to the
+     * current location of the spatial and then added to the physics space.
+     *
+     * @param enabled true&rarr;enable the control, false&rarr;disable it
+     */
     public void setEnabled(boolean enabled) {
         this.enabled = enabled;
         if (space != null) {
@@ -147,10 +232,22 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
         }
     }
 
+    /**
+     * Test whether this control is enabled.
+     *
+     * @return true if enabled, otherwise false
+     */
     public boolean isEnabled() {
         return enabled;
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is added to a scene. Do not invoke directly
+     * from user code.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     public void update(float tpf) {
         if (!enabled) {
             return;
@@ -159,29 +256,60 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
         setPhysicsRotation(getSpatialRotation());
     }
 
+    /**
+     * Render this control. Invoked once per view port per frame, provided the
+     * control is added to a scene. Should be invoked only by a subclass or by
+     * the RenderManager.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     public void render(RenderManager rm, ViewPort 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);
+    /**
+     * If enabled, add this control's physics object to the specified physics
+     * space. If not enabled, alter where the object would be added. The object
+     * is removed from any other space it's currently in.
+     *
+     * @param newSpace where to add, or null to simply remove
+     */
+    @Override
+    public void setPhysicsSpace(PhysicsSpace newSpace) {
+        if (space == newSpace) {
+            return;
+        }
+        if (added) {
+            space.removeCollisionObject(this);
+            added = false;
+        }
+        if (newSpace != null && isEnabled()) {
+            newSpace.addCollisionObject(this);
             added = true;
         }
-        this.space = space;
+        /*
+         * If this control isn't enabled, its physics object will be
+         * added to the new space when the control becomes enabled.
+         */
+        space = newSpace;
     }
 
+    /**
+     * Access the physics space to which the ghost object is (or would be)
+     * added.
+     *
+     * @return the pre-existing space, or null for none
+     */
     public PhysicsSpace getPhysicsSpace() {
         return space;
     }
 
+    /**
+     * Serialize this control, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
@@ -191,6 +319,12 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
         oc.write(spatial, "spatial", null);
     }
 
+    /**
+     * De-serialize this control, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter im) throws IOException {
         super.read(im);

+ 366 - 97
jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java

@@ -43,11 +43,11 @@ import com.jme3.export.*;
 import com.jme3.math.*;
 import com.jme3.renderer.RenderManager;
 import com.jme3.renderer.ViewPort;
+import com.jme3.scene.Mesh;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 import com.jme3.util.TempVars;
 import com.jme3.util.clone.JmeCloneable;
-
 import java.io.IOException;
 import java.util.*;
 import java.util.logging.Level;
@@ -58,32 +58,39 @@ import java.util.logging.Logger;
  * 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 physics 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 physics shapes follow the motion 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 character is entirely controlled 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)
+ * add/removes it from the physics space<br>
+ * <p>
+ * This control creates collision shapes for each bones of the skeleton when you
+ * invoke 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>
+ * 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 physics shapes follow the motion 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 invoke the setRagdollMode() method. In this
+ * mode the character is entirely controlled by physics, so it will fall under
+ * the gravity and move if any force is applied to it.</li>
+ * </ul>
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
- * TODO this needs to be redone with the new animation system
+ * @author Normen Hansen and Rémy Bouquet (Nehon)
  */
 @Deprecated
 public class KinematicRagdollControl extends AbstractPhysicsControl implements PhysicsCollisionListener, JmeCloneable {
 
+    /**
+     * list of registered collision listeners
+     */
     protected static final Logger logger = Logger.getLogger(KinematicRagdollControl.class.getName());
     protected List<RagdollCollisionListener> listeners;
     protected final Set<String> boneList = new TreeSet<String>();
@@ -91,7 +98,13 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     protected final Vector3f modelPosition = new Vector3f();
     protected final Quaternion modelRotation = new Quaternion();
     protected final PhysicsRigidBody baseRigidBody;
+    /**
+     * model being controlled
+     */
     protected Spatial targetModel;
+    /**
+     * skeleton being controlled
+     */
     protected Skeleton skeleton;
     protected RagdollPreset preset = new HumanoidRagdollPreset();
     protected Vector3f initScale;
@@ -100,23 +113,52 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     protected boolean blendedControl = false;
     protected float weightThreshold = -1.0f;
     protected float blendStart = 0.0f;
+    /**
+     * blending interval for animations (in seconds, &ge;0)
+     */
     protected float blendTime = 1.0f;
     protected float eventDispatchImpulseThreshold = 10;
     protected float rootMass = 15;
+    /**
+     * accumulate total mass of ragdoll when control is added to a scene
+     */
     protected float totalMass = 0;
     private Map<String, Vector3f> ikTargets = new HashMap<String, Vector3f>();
     private Map<String, Integer> ikChainDepth = new HashMap<String, Integer>();
+    /**
+     * rotational speed for inverse kinematics (radians per second, default=7)
+     */
     private float ikRotSpeed = 7f;
+    /**
+     * viscous limb-damping ratio (0&rarr;no damping, 1&rarr;critically damped,
+     * default=0.6)
+     */
     private float limbDampening = 0.6f;
-
+    /**
+     * distance threshold for inverse kinematics (default=0.1)
+     */
     private float IKThreshold = 0.1f;
+    /**
+     * Enumerate joint-control modes for this control.
+     */
     public static enum Mode {
-
+        /**
+         * collision shapes follow the movements of bones in the skeleton
+         */
         Kinematic,
+        /**
+         * skeleton is controlled by Bullet physics (gravity and collisions)
+         */
         Ragdoll,
+        /**
+         * skeleton is controlled by inverse-kinematic targets
+         */
         IK
     }
 
+    /**
+     * Link a bone to a jointed rigid body.
+     */
     public class PhysicsBoneLink implements Savable {
 
         protected PhysicsRigidBody rigidBody;
@@ -126,17 +168,37 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         protected Quaternion startBlendingRot = new Quaternion();
         protected Vector3f startBlendingPos = new Vector3f();
 
+        /**
+         * Instantiate an uninitialized link.
+         */
         public PhysicsBoneLink() {
         }
 
+        /**
+         * Access the linked bone.
+         *
+         * @return the pre-existing instance or null
+         */
         public Bone getBone() {
             return bone;
         }
 
+        /**
+         * Access the linked body.
+         *
+         * @return the pre-existing instance or null
+         */
         public PhysicsRigidBody getRigidBody() {
             return rigidBody;
         }
 
+        /**
+         * Serialize this bone link, for example when saving to a J3O file.
+         *
+         * @param ex exporter (not null)
+         * @throws IOException from exporter
+         */
+        @Override
         public void write(JmeExporter ex) throws IOException {
             OutputCapsule oc = ex.getCapsule(this);
             oc.write(rigidBody, "rigidBody", null);
@@ -147,6 +209,14 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
             oc.write(startBlendingPos, "startBlendingPos", new Vector3f());
         }
 
+        /**
+         * De-serialize this bone link, for example when loading from a J3O
+         * file.
+         *
+         * @param im importer (not null)
+         * @throws IOException from importer
+         */
+        @Override
         public void read(JmeImporter im) throws IOException {
             InputCapsule ic = im.getCapsule(this);
             rigidBody = (PhysicsRigidBody) ic.readSavable("rigidBody", null);
@@ -159,29 +229,54 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * construct a KinematicRagdollControl
+     * Instantiate an enabled control.
      */
     public KinematicRagdollControl() {
         baseRigidBody = new PhysicsRigidBody(new BoxCollisionShape(Vector3f.UNIT_XYZ.mult(0.1f)), 1);
         baseRigidBody.setKinematic(mode == Mode.Kinematic);
     }
 
+    /**
+     * Instantiate an enabled control with the specified weight threshold.
+     *
+     * @param weightThreshold (&gt;0, &lt;1)
+     */
     public KinematicRagdollControl(float weightThreshold) {
         this();
         this.weightThreshold = weightThreshold;
     }
 
+    /**
+     * Instantiate an enabled control with the specified preset and weight
+     * threshold.
+     *
+     * @param preset (not null)
+     * @param weightThreshold (&gt;0, &lt;1)
+     */
     public KinematicRagdollControl(RagdollPreset preset, float weightThreshold) {
         this();
         this.preset = preset;
         this.weightThreshold = weightThreshold;
     }
 
+    /**
+     * Instantiate an enabled control with the specified preset.
+     *
+     * @param preset (not null)
+     */
     public KinematicRagdollControl(RagdollPreset preset) {
         this();
         this.preset = preset;
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is added to a scene. Do not invoke directly
+     * from user code.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
+    @Override
     public void update(float tpf) {
         if (!enabled) {
             return;
@@ -196,6 +291,11 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         }
     }
 
+    /**
+     * Update this control in Ragdoll mode, based on Bullet physics.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     protected void ragDollUpdate(float tpf) {
         TempVars vars = TempVars.get();
         Quaternion tmpRot1 = vars.quat1;
@@ -213,7 +313,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
             //retrieving bone rotation in physics world space
             Quaternion q = link.rigidBody.getMotionState().getWorldRotationQuat();
 
-            //multiplying this rotation by the initialWorld rotation of the bone, 
+            //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);
@@ -237,20 +337,19 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
                 link.bone.setUserTransformsInModelSpace(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.setUserTransformsInModelSpace(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 recursively
-                    RagdollUtils.setTransform(link.bone, position, tmpRot1, false, boneList);
-                }
+                //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);
             }
         }
         vars.release();
     }
 
+    /**
+     * Update this control in Kinematic mode, based on bone animation tracks.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     protected void kinematicUpdate(float tpf) {
         //the ragdoll does not have control, so the keyframed animation updates the physics position of the physics bonces
         TempVars vars = TempVars.get();
@@ -261,7 +360,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
 //            if(link.usedbyIK){
 //                continue;
 //            }
-            //if blended control this means, keyframed animation is updating the skeleton, 
+            //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;
@@ -275,17 +374,8 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
                 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.setUserTransformsInModelSpace(position, tmpRot1);
-                    //we give control back to the key framed animation.
-                    link.bone.setUserControl(false);
-                } else {
-                    RagdollUtils.setTransform(link.bone, position, tmpRot1, true, boneList);
-                }
-
+                //update bone transforms
+                RagdollUtils.setTransform(link.bone, position, tmpRot1, true, boneList);
             }
             //setting skeleton transforms to the ragdoll
             matchPhysicObjectToBone(link, position, tmpRot1);
@@ -301,6 +391,11 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         }
         vars.release();
     }
+    /**
+     * Update this control in IK mode, based on IK targets.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     private void ikUpdate(float tpf){
         TempVars vars = TempVars.get();
 
@@ -337,6 +432,19 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         vars.release();
     }
     
+    /**
+     * Update a bone and its ancestors in IK mode. Note: recursive!
+     *
+     * @param link the bone link for the affected bone (may be null)
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     * @param vars unused
+     * @param tmpRot1 temporary storage used in calculations (not null)
+     * @param tmpRot2 temporary storage used in calculations (not null)
+     * @param tipBone (not null)
+     * @param target the location target in model space (not null, unaffected)
+     * @param depth depth of the recursion (&ge;0)
+     * @param maxDepth recursion limit (&ge;0)
+     */
     public void updateBone(PhysicsBoneLink link, float tpf, TempVars vars, Quaternion tmpRot1, Quaternion[] tmpRot2, Bone tipBone, Vector3f target, int depth, int maxDepth) {
         if (link == null || link.bone.getParent() == null) {
             return;
@@ -391,13 +499,12 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * 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
+     * Alter the transforms of a rigidBody to match the transforms of a bone.
+     * This is used to make the ragdoll follow animated motion 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
+     * @param link the bone link connecting the bone and the rigidBody
+     * @param position temporary storage used in calculations (not null)
+     * @param tmpRot1 temporary storage used in calculations (not null)
      */
     protected void matchPhysicObjectToBone(PhysicsBoneLink link, Vector3f position, Quaternion tmpRot1) {
         //computing position from rotation and scale
@@ -415,8 +522,8 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * rebuild the ragdoll this is useful if you applied scale on the ragdoll
-     * after it's been initialized, same as reattaching.
+     * Rebuild the ragdoll. This is useful if you applied scale on the ragdoll
+     * after it was initialized. Same as re-attaching.
      */
     public void reBuild() {
         if (spatial == null) {
@@ -426,6 +533,12 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         createSpatialData(spatial);
     }
 
+    /**
+     * Create spatial-dependent data. Invoked when this control is added to a
+     * scene.
+     *
+     * @param model the controlled spatial (not null)
+     */
     @Override
     protected void createSpatialData(Spatial model) {
         targetModel = model;
@@ -450,8 +563,24 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         model.removeControl(sc);
         model.addControl(sc);
 
+        if (boneList.isEmpty()) {
+            // add all bones to the list
+            skeleton = sc.getSkeleton();
+            for (int boneI = 0; boneI < skeleton.getBoneCount(); boneI++) {
+                String boneName = skeleton.getBone(boneI).getName();
+                boneList.add(boneName);
+            }
+        }
+        // filter out bones without vertices
+        filterBoneList(sc);
+
+        if (boneList.isEmpty()) {
+            throw new IllegalArgumentException(
+                    "No suitable bones were found in the model's skeleton.");
+        }
+
         // put into bind pose and compute bone transforms in model space
-        // maybe dont reset to ragdoll out of animations?
+        // maybe don't reset to ragdoll out of animations?
         scanSpatial(model);
 
 
@@ -469,6 +598,31 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         logger.log(Level.FINE, "Created physics ragdoll for skeleton {0}", skeleton);
     }
 
+    /**
+     * Remove any bones without vertices from the boneList, so that every hull
+     * shape will contain at least 1 vertex.
+     */
+    private void filterBoneList(SkeletonControl skeletonControl) {
+        Mesh[] targets = skeletonControl.getTargets();
+        Skeleton skel = skeletonControl.getSkeleton();
+        for (int boneI = 0; boneI < skel.getBoneCount(); boneI++) {
+            String boneName = skel.getBone(boneI).getName();
+            if (boneList.contains(boneName)) {
+                boolean hasVertices = RagdollUtils.hasVertices(boneI, targets,
+                        weightThreshold);
+                if (!hasVertices) {
+                    boneList.remove(boneName);
+                }
+            }
+        }
+    }
+
+    /**
+     * Destroy spatial-dependent data. Invoked when this control is removed from
+     * a spatial.
+     *
+     * @param spat the previously controlled spatial (not null)
+     */
     @Override
     protected void removeSpatialData(Spatial spat) {
         if (added) {
@@ -478,15 +632,22 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * 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.
+     * Add a bone name to this control. Repeated invocations of this method can
+     * be used to specify which bones to use when generating collision shapes.
+     * <p>
+     * Not allowed after attaching the control.
      *
-     * @param name
+     * @param name the name of the bone to add
      */
     public void addBoneName(String name) {
         boneList.add(name);
     }
 
+    /**
+     * Generate physics shapes and bone links for the skeleton.
+     *
+     * @param model the spatial with the model's SkeletonControl (not null)
+     */
     protected void scanSpatial(Spatial model) {
         AnimControl animControl = model.getControl(AnimControl.class);
         Map<Integer, List<Float>> pointsMap = null;
@@ -505,14 +666,24 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         }
     }
 
+    /**
+     * Generate a physics shape and bone links for the specified bone. Note:
+     * recursive!
+     *
+     * @param model the spatial with the model's SkeletonControl (not null)
+     * @param bone the bone to be linked (not null)
+     * @param parent the body linked to the parent bone (not null)
+     * @param reccount depth of the recursion (&ge;1)
+     * @param pointsMap (not null)
+     */
     protected 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())) {
+        if (boneList.contains(bone.getName())) {
 
             PhysicsBoneLink link = new PhysicsBoneLink();
             link.bone = bone;
 
-            //creating the collision shape 
+            //create 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
@@ -555,16 +726,16 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * 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
+     * Alter the limits of the joint connecting the specified bone to its
+     * parent. Can only be invoked after adding 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)
+     * @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 Y 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);
@@ -576,8 +747,8 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * Return the joint between the given bone and its parent. This return null
-     * if it's called before attaching the control to a spatial
+     * Return the joint between the specified bone and its parent. This return
+     * null if it's invoked before adding the control to a spatial
      *
      * @param boneName the name of the bone
      * @return the joint between the given bone and its parent
@@ -642,9 +813,9 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * For internal use only callback for collisionevent
+     * For internal use only: callback for collision event
      *
-     * @param event
+     * @param event (not null)
      */
     public void collision(PhysicsCollisionEvent event) {
         PhysicsCollisionObject objA = event.getObjectA();
@@ -699,7 +870,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
      * be animated by the keyframe animation, but will be able to physically
      * interact with its physics environment
      *
-     * @param ragdollEnabled
+     * @param mode an enum value (not null)
      */
     protected void setMode(Mode mode) {
         this.mode = mode;
@@ -777,9 +948,9 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * Set the control into Kinematic mode In this mode, the collision shapes
-     * follow the movements of the skeleton, and can interact with physical
-     * environment
+     * Put the control into Kinematic mode. In this mode, the collision shapes
+     * follow the movements of the skeleton while interacting with the physics
+     * environment.
      */
     public void setKinematicMode() {
         if (mode != Mode.Kinematic) {
@@ -798,8 +969,8 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * Sets the control into Inverse Kinematics mode. The affected bones are affected by IK.
-     * physics.
+     * Sets the control into Inverse Kinematics mode. The affected bones are
+     * affected by IK. physics.
      */
     public void setIKMode() {
         if (mode != Mode.IK) {
@@ -810,16 +981,16 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     /**
      * returns the mode of this control
      *
-     * @return
+     * @return an enum value
      */
     public Mode getMode() {
         return mode;
     }
 
     /**
-     * add a
+     * Add a collision listener to this control.
      *
-     * @param listener
+     * @param listener (not null, alias created)
      */
     public void addCollisionListener(RagdollCollisionListener listener) {
         if (listeners == null) {
@@ -828,35 +999,66 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         listeners.add(listener);
     }
 
+    /**
+     * Alter the ragdoll's root mass.
+     *
+     * @param rootMass the desired mass (&ge;0)
+     */
     public void setRootMass(float rootMass) {
         this.rootMass = rootMass;
     }
 
+    /**
+     * Read the ragdoll's total mass.
+     *
+     * @return mass (&ge;0)
+     */
     public float getTotalMass() {
         return totalMass;
     }
 
+    /**
+     * Read the ragdoll's weight threshold.
+     *
+     * @return threshold
+     */
     public float getWeightThreshold() {
         return weightThreshold;
     }
 
+    /**
+     * Alter the ragdoll's weight threshold.
+     *
+     * @param weightThreshold the desired threshold
+     */
     public void setWeightThreshold(float weightThreshold) {
         this.weightThreshold = weightThreshold;
     }
 
+    /**
+     * Read the ragdoll's event-dispatch impulse threshold.
+     *
+     * @return threshold
+     */
     public float getEventDispatchImpulseThreshold() {
         return eventDispatchImpulseThreshold;
     }
 
+    /**
+     * Alter the ragdoll's event-dispatch impulse threshold.
+     *
+     * @param eventDispatchImpulseThreshold desired threshold
+     */
     public void setEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold) {
         this.eventDispatchImpulseThreshold = eventDispatchImpulseThreshold;
     }
 
     /**
-     * Set the CcdMotionThreshold of all the bone's rigidBodies of the ragdoll
+     * Alter the CcdMotionThreshold of all rigid bodies in the ragdoll.
      *
      * @see PhysicsRigidBody#setCcdMotionThreshold(float)
-     * @param value
+     * @param value the desired threshold value (velocity, &gt;0) or zero to
+     * disable CCD (default=0)
      */
     public void setCcdMotionThreshold(float value) {
         for (PhysicsBoneLink link : boneLinks.values()) {
@@ -865,10 +1067,11 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * Set the CcdSweptSphereRadius of all the bone's rigidBodies of the ragdoll
+     * Alter the CcdSweptSphereRadius of all rigid bodies in the ragdoll.
      *
      * @see PhysicsRigidBody#setCcdSweptSphereRadius(float)
-     * @param value
+     * @param value the desired radius of the sphere used for continuous
+     * collision detection (&ge;0)
      */
     public void setCcdSweptSphereRadius(float value) {
         for (PhysicsBoneLink link : boneLinks.values()) {
@@ -877,7 +1080,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * return the rigidBody associated to the given bone
+     * Access the rigidBody associated with the named bone.
      *
      * @param boneName the name of the bone
      * @return the associated rigidBody.
@@ -891,15 +1094,22 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * For internal use only specific render for the ragdoll (if debugging)
+     * Render this control. Invoked once per view port per frame, provided the
+     * control is added to a scene. Should be invoked only by a subclass or by
+     * the RenderManager.
      *
-     * @param rm
-     * @param vp
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
      */
     @Override
     public void render(RenderManager rm, ViewPort vp) {
     }
 
+    /**
+     * Create a shallow clone for the JME cloner.
+     *
+     * @return a new control (not null)
+     */
     @Override   
     public Object jmeClone() {
         KinematicRagdollControl control = new KinematicRagdollControl(preset, weightThreshold);        
@@ -911,6 +1121,14 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         return control;
     }     
 
+    /**
+     * Add a target for inverse kinematics.
+     *
+     * @param bone which bone the IK applies to (not null)
+     * @param worldPos the world coordinates of the goal (not null)
+     * @param chainLength number of bones in the chain
+     * @return a new instance (not null, already added to ikTargets)
+     */
     public Vector3f setIKTarget(Bone bone, Vector3f worldPos, int chainLength) {
         Vector3f target = worldPos.subtract(targetModel.getWorldTranslation());
         ikTargets.put(bone.getName(), target);
@@ -929,6 +1147,11 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         return target;
     }
 
+    /**
+     * Remove the inverse-kinematics target for the specified bone.
+     *
+     * @param bone which bone has the target (not null, modified)
+     */
     public void removeIKTarget(Bone bone) {
         int depth = ikChainDepth.remove(bone.getName());
         int i = 0;
@@ -942,11 +1165,19 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
         }
     }
     
+    /**
+     * Remove all inverse-kinematics targets.
+     */
     public void removeAllIKTargets(){
         ikTargets.clear();
         ikChainDepth.clear();
         applyUserControl();
     }
+
+    /**
+     * Ensure that user control is enabled for any bones used by inverse
+     * kinematics and disabled for any other bones.
+     */
     public void applyUserControl() {
         for (Bone bone : skeleton.getRoots()) {
             RagdollUtils.setUserControl(bone, false);
@@ -973,39 +1204,77 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
             vars.release();
         }
     }
+
+    /**
+     * Read the rotation speed for inverse kinematics.
+     *
+     * @return speed (&ge;0)
+     */
     public float getIkRotSpeed() {
         return ikRotSpeed;
     }
 
+    /**
+     * Alter the rotation speed for inverse kinematics.
+     *
+     * @param ikRotSpeed the desired speed (&ge;0, default=7)
+     */
     public void setIkRotSpeed(float ikRotSpeed) {
         this.ikRotSpeed = ikRotSpeed;
     }
 
+    /**
+     * Read the distance threshold for inverse kinematics.
+     *
+     * @return distance threshold
+     */
     public float getIKThreshold() {
         return IKThreshold;
     }
 
+    /**
+     * Alter the distance threshold for inverse kinematics.
+     *
+     * @param IKThreshold the desired distance threshold (default=0.1)
+     */
     public void setIKThreshold(float IKThreshold) {
         this.IKThreshold = IKThreshold;
     }
 
-    
+    /**
+     * Read the limb damping.
+     *
+     * @return the viscous damping ratio (0&rarr;no damping, 1&rarr;critically
+     * damped)
+     */
     public float getLimbDampening() {
         return limbDampening;
     }
 
+    /**
+     * Alter the limb damping.
+     *
+     * @param limbDampening the desired viscous damping ratio (0&rarr;no
+     * damping, 1&rarr;critically damped, default=0.6)
+     */
     public void setLimbDampening(float limbDampening) {
         this.limbDampening = limbDampening;
     }
     
+    /**
+     * Access the named bone.
+     *
+     * @param name which bone to access
+     * @return the pre-existing instance, or null if not found
+     */
     public Bone getBone(String name){
         return skeleton.getBone(name);
     }
     /**
-     * serialize this control
+     * Serialize this control, for example when saving to a J3O file.
      *
-     * @param ex
-     * @throws IOException
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
      */
     @Override
     public void write(JmeExporter ex) throws IOException {
@@ -1032,10 +1301,10 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
     }
 
     /**
-     * de-serialize this control
+     * De-serialize this control, for example when loading from a J3O file.
      *
-     * @param im
-     * @throws IOException
+     * @param im importer (not null)
+     * @throws IOException from importer
      */
     @Override
     public void read(JmeImporter im) throws IOException {

+ 26 - 10
jme3-bullet/src/common/java/com/jme3/bullet/control/PhysicsControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,31 +35,47 @@ import com.jme3.bullet.PhysicsSpace;
 import com.jme3.scene.control.Control;
 
 /**
+ * An interface for a scene-graph control that links a physics object to a
+ * Spatial.
+ * <p>
+ * This interface is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public interface PhysicsControl extends Control {
 
     /**
-     * Only used internally, do not call.
-     * @param space
+     * If enabled, add this control's physics object to the specified physics
+     * space. In not enabled, alter where the object would be added. The object
+     * is removed from any other space it's currently in.
+     *
+     * @param space where to add, or null to simply remove
      */
     public void setPhysicsSpace(PhysicsSpace space);
 
+    /**
+     * Access the physics space to which the object is (or would be) added.
+     *
+     * @return the pre-existing space, or null for none
+     */
     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
+     * Enable or disable this control.
+     * <p>
+     * The physics object is removed from its 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.
+     *
+     * @param state true&rarr;enable the control, false&rarr;disable it
      */
     public void setEnabled(boolean state);
 
     /**
-     * Returns the current enabled state of the physics control
-     * @return current enabled state
+     * Test whether this control is enabled.
+     *
+     * @return true if enabled, otherwise false
      */
     public boolean isEnabled();
 }

+ 170 - 29
jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java

@@ -56,47 +56,91 @@ import com.jme3.util.clone.JmeCloneable;
 import java.io.IOException;
 
 /**
+ * A physics control to link a PhysicsRigidBody to a spatial.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl, JmeCloneable {
 
+    /**
+     * spatial to which this control is added, or null if none
+     */
     protected Spatial spatial;
+    /**
+     * true&rarr;control is enabled, false&rarr;control is disabled
+     */
     protected boolean enabled = true;
+    /**
+     * true&rarr;body is added to the physics space, false&rarr;not added
+     */
     protected boolean added = false;
+    /**
+     * space to which the body is (or would be) added
+     */
     protected PhysicsSpace space = null;
+    /**
+     * true&rarr;body is kinematic, false&rarr;body is static or dynamic
+     */
     protected boolean kinematicSpatial = true;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     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.
+     * 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 shape
+     * Instantiate an enabled control with mass=1 and the specified collision
+     * shape.
+     *
+     * @param shape the desired shape (not null, alias created)
      */
     public RigidBodyControl(CollisionShape shape) {
         super(shape);
     }
 
+    /**
+     * Instantiate an enabled control with the specified collision shape and
+     * mass.
+     *
+     * @param shape the desired shape (not null, alias created)
+     * @param mass the desired mass (&ge;0)
+     */
     public RigidBodyControl(CollisionShape shape, float mass) {
         super(shape, mass);
     }
 
-    @Deprecated
+    /**
+     * Clone this control for a different spatial. No longer used as of JME 3.1.
+     *
+     * @param spatial the spatial for the clone to control (or null)
+     * @return a new control (not null)
+     */
     @Override
     public Control cloneForSpatial(Spatial spatial) {
         throw new UnsupportedOperationException();
     }
 
+    /**
+     * Create a shallow clone for the JME cloner.
+     *
+     * @return a new control (not null)
+     */
     @Override   
     public Object jmeClone() {
         RigidBodyControl control = new RigidBodyControl(collisionShape, mass);
@@ -127,11 +171,27 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         return control;
     }     
 
+    /**
+     * Callback from {@link com.jme3.util.clone.Cloner} to convert this
+     * shallow-cloned control into a deep-cloned one, using the specified cloner
+     * and original to resolve copied fields.
+     *
+     * @param cloner the cloner that's cloning this control (not null)
+     * @param original the control from which this control was shallow-cloned
+     * (unused)
+     */
     @Override   
     public void cloneFields( Cloner cloner, Object original ) { 
         this.spatial = cloner.clone(spatial);
     }
          
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     public void setSpatial(Spatial spatial) {
         this.spatial = spatial;
         setUserObject(spatial);
@@ -146,6 +206,10 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         setPhysicsRotation(getSpatialRotation());
     }
 
+    /**
+     * Set the collision shape based on the controlled spatial and its
+     * descendents.
+     */
     protected void createCollisionShape() {
         if (spatial == null) {
             return;
@@ -168,6 +232,15 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         }
     }
 
+    /**
+     * Enable or disable this control.
+     * <p>
+     * When the control is disabled, the body is removed from physics space.
+     * When the control is enabled again, the body is moved to the current
+     * location of the spatial and then added to the physics space.
+     *
+     * @param enabled true&rarr;enable the control, false&rarr;disable it
+     */
     public void setEnabled(boolean enabled) {
         this.enabled = enabled;
         if (space != null) {
@@ -185,40 +258,62 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         }
     }
 
+    /**
+     * Test whether this control is enabled.
+     *
+     * @return true if enabled, otherwise 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
+     * Test whether this control is in kinematic mode.
+     *
+     * @return true if the spatial location and rotation are applied to the
+     * rigid body, otherwise false
      */
     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
+     * Enable or disable kinematic mode. In kinematic mode, the spatial's
+     * location and rotation will be applied to the rigid body.
+     *
+     * @param kinematicSpatial true&rarr;kinematic, false&rarr;dynamic or static
      */
     public void setKinematicSpatial(boolean kinematicSpatial) {
         this.kinematicSpatial = kinematicSpatial;
     }
 
+    /**
+     * Test whether physics-space coordinates should match the spatial's local
+     * coordinates.
+     *
+     * @return true if matching local coordinates, false if matching world
+     * coordinates
+     */
     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 translation.
-     * @param applyPhysicsLocal
+     * Alter whether physics-space coordinates should match the spatial's local
+     * coordinates.
+     *
+     * @param applyPhysicsLocal true&rarr;match local coordinates,
+     * false&rarr;match world coordinates (default=false)
      */
     public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
         motionState.setApplyPhysicsLocal(applyPhysicsLocal);
     }
 
+    /**
+     * Access whichever spatial translation corresponds to the physics location.
+     *
+     * @return the pre-existing vector (not null)
+     */
     private Vector3f getSpatialTranslation(){
         if(motionState.isApplyPhysicsLocal()){
             return spatial.getLocalTranslation();
@@ -226,6 +321,11 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         return spatial.getWorldTranslation();
     }
 
+    /**
+     * Access whichever spatial rotation corresponds to the physics rotation.
+     *
+     * @return the pre-existing quaternion (not null)
+     */
     private Quaternion getSpatialRotation(){
         if(motionState.isApplyPhysicsLocal()){
             return spatial.getLocalRotation();
@@ -233,6 +333,12 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         return spatial.getWorldRotation();
     }
 
+    /**
+     * Update this control. Invoked once per frame, during the logical-state
+     * update, provided the control is added to a scene.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     public void update(float tpf) {
         if (enabled && spatial != null) {
             if (isKinematic() && kinematicSpatial) {
@@ -244,30 +350,59 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         }
     }
 
+    /**
+     * Render this control. Invoked once per view port per frame, provided the
+     * control is added to a scene. Should be invoked only by a subclass or by
+     * the RenderManager.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     public void render(RenderManager rm, ViewPort 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;
-            // if this object isn't enabled, it will be added when it will be enabled.
-            if (isEnabled()) {
-                space.addCollisionObject(this);
-                added = true;
-            }
+    /**
+     * If enabled, add this control's body to the specified physics space. In
+     * not enabled, alter where the body would be added. The body is removed
+     * from any other space it's currently in.
+     *
+     * @param newSpace where to add, or null to simply remove
+     */
+    @Override
+    public void setPhysicsSpace(PhysicsSpace newSpace) {
+        if (space == newSpace) {
+            return;
+        }
+        if (added) {
+            space.removeCollisionObject(this);
+            added = false;
         }
-        this.space = space;
+        if (newSpace != null && isEnabled()) {
+            newSpace.addCollisionObject(this);
+            added = true;
+        }
+        /*
+         * If this control isn't enabled, its body will be
+         * added to the new space when the control becomes enabled.
+         */
+        space = newSpace;
     }
 
+    /**
+     * Access the physics space to which the body is (or would be) added.
+     *
+     * @return the pre-existing space, or null for none
+     */
     public PhysicsSpace getPhysicsSpace() {
         return space;
     }
 
+    /**
+     * Serialize this control, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
@@ -278,6 +413,12 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         oc.write(spatial, "spatial", null);
     }
 
+    /**
+     * De-serialize this control, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter im) throws IOException {
         super.read(im);
@@ -288,4 +429,4 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
         motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
         setUserObject(spatial);
     }
-}
+}

+ 136 - 23
jme3-bullet/src/common/java/com/jme3/bullet/control/VehicleControl.java

@@ -51,39 +51,75 @@ import java.io.IOException;
 import java.util.Iterator;
 
 /**
+ * A physics control to link a PhysicsVehicle to a spatial.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class VehicleControl extends PhysicsVehicle implements PhysicsControl, JmeCloneable {
 
+    /**
+     * spatial to which this control is added, or null if none
+     */
     protected Spatial spatial;
+    /**
+     * true&rarr;control is enabled, false&rarr;control is disabled
+     */
     protected boolean enabled = true;
+    /**
+     * space to which the vehicle is (or would be) added
+     */
     protected PhysicsSpace space = null;
+    /**
+     * true&rarr;vehicle is added to the physics space, false&rarr;not added
+     */
     protected boolean added = false;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public VehicleControl() {
     }
 
     /**
-     * Creates a new PhysicsNode with the supplied collision shape
-     * @param shape
+     * Instantiate an enabled control with mass=1 and the specified collision
+     * shape.
+     *
+     * @param shape the desired shape (not null, alias created)
      */
     public VehicleControl(CollisionShape shape) {
         super(shape);
     }
 
+    /**
+     * Instantiate an enabled with the specified collision shape and mass.
+     *
+     * @param shape the desired shape (not null, alias created)
+     * @param mass (&gt;0)
+     */
     public VehicleControl(CollisionShape shape, float mass) {
         super(shape, mass);
     }
 
+    /**
+     * Test whether physics-space coordinates should match the spatial's local
+     * coordinates.
+     *
+     * @return true if matching local coordinates, false if matching world
+     * coordinates
+     */
     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
+     * Alter whether physics-space coordinates should match the spatial's local
+     * coordinates.
+     *
+     * @param applyPhysicsLocal true&rarr;match local coordinates,
+     * false&rarr;match world coordinates (default=false)
      */
     public void setApplyPhysicsLocal(boolean applyPhysicsLocal) {
         motionState.setApplyPhysicsLocal(applyPhysicsLocal);
@@ -107,13 +143,22 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         return spatial.getWorldRotation();
     }
 
-    @Deprecated
+    /**
+     * Clone this control for a different spatial. No longer used as of JME 3.1.
+     *
+     * @param spatial the spatial for the clone to control (or null)
+     * @return a new control (not null)
+     */
     @Override
     public Control cloneForSpatial(Spatial spatial) {
         throw new UnsupportedOperationException();
     }
 
-    @Override   
+    /**
+     * Create a shallow clone for the JME cloner.
+     *
+     * @return a new control (not null)
+     */
     public Object jmeClone() {
         VehicleControl control = new VehicleControl(collisionShape, mass);
         control.setAngularFactor(getAngularFactor());
@@ -161,6 +206,15 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         return control;
     }     
 
+    /**
+     * Callback from {@link com.jme3.util.clone.Cloner} to convert this
+     * shallow-cloned control into a deep-cloned one, using the specified cloner
+     * and original to resolve copied fields.
+     *
+     * @param cloner the cloner that's cloning this control (not null)
+     * @param original the control from which this control was shallow-cloned
+     * (unused)
+     */
     @Override   
     public void cloneFields( Cloner cloner, Object original ) {
         this.spatial = cloner.clone(spatial);
@@ -171,6 +225,11 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         }        
     }
          
+    /**
+     * Alter which spatial is controlled.
+     *
+     * @param spatial spatial to control (or null)
+     */
     public void setSpatial(Spatial spatial) {
         this.spatial = spatial;
         setUserObject(spatial);
@@ -181,6 +240,15 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         setPhysicsRotation(getSpatialRotation());
     }
 
+    /**
+     * Enable or disable this control.
+     * <p>
+     * When the control is disabled, the vehicle is removed from physics space.
+     * When the control is enabled again, the physics object is moved to the
+     * spatial's location and then added to the physics space.
+     *
+     * @param enabled true&rarr;enable the control, false&rarr;disable it
+     */
     public void setEnabled(boolean enabled) {
         this.enabled = enabled;
         if (space != null) {
@@ -198,10 +266,21 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         }
     }
 
+    /**
+     * Test whether this control is enabled.
+     *
+     * @return true if enabled, otherwise false
+     */
     public boolean isEnabled() {
         return enabled;
     }
 
+    /**
+     * Update this control. Invoked once per frame, during the logical-state
+     * update, provided the control is added to a scene.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     public void update(float tpf) {
         if (enabled && spatial != null) {
             if (getMotionState().applyTransform(spatial)) {
@@ -213,31 +292,59 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         }
     }
 
+    /**
+     * Render this control. Invoked once per view port per frame, provided the
+     * control is added to a scene. Should be invoked only by a subclass or by
+     * the RenderManager.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     public void render(RenderManager rm, ViewPort 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;
-            // if this object isn't enabled, it will be added when it will be enabled.
-            if (isEnabled()) {
-                space.addCollisionObject(this);
-                added = true;
-            }
+    /**
+     * If enabled, add this control's physics object to the specified physics
+     * space. In not enabled, alter where the object would be added. The object
+     * is removed from any other space it's currently in.
+     *
+     * @param newSpace where to add, or null to simply remove
+     */
+    @Override
+    public void setPhysicsSpace(PhysicsSpace newSpace) {
+        if (space == newSpace) {
+            return;
+        }
+        if (added) {
+            space.removeCollisionObject(this);
+            added = false;
+        }
+        if (newSpace != null && isEnabled()) {
+            newSpace.addCollisionObject(this);
+            added = true;
         }
-        this.space = space;
+        /*
+         * If this control isn't enabled, its physics object will be
+         * added to the new space when the control becomes enabled.
+         */
+        space = newSpace;
     }
 
+    /**
+     * Access the physics space to which the vehicle is (or would be) added.
+     *
+     * @return the pre-existing space, or null for none
+     */
     public PhysicsSpace getPhysicsSpace() {
         return space;
     }
 
+    /**
+     * Serialize this control, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
@@ -247,6 +354,12 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         oc.write(spatial, "spatial", null);
     }
 
+    /**
+     * De-serialize this control, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter im) throws IOException {
         super.read(im);
@@ -256,4 +369,4 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
         motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
         setUserObject(spatial);
     }
-}
+}

+ 10 - 1
jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/HumanoidRagdollPreset.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,11 +34,17 @@ package com.jme3.bullet.control.ragdoll;
 import com.jme3.math.FastMath;
 
 /**
+ * Example ragdoll presets for a typical humanoid skeleton.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author Nehon
  */
 public class HumanoidRagdollPreset extends RagdollPreset {
 
+    /**
+     * Initialize the map from bone names to joint presets.
+     */
     @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));
@@ -59,6 +65,9 @@ public class HumanoidRagdollPreset extends RagdollPreset {
 
     }
 
+    /**
+     * Initialize the lexicon.
+     */
     @Override
     protected void initLexicon() {
         LexiconEntry entry = new LexiconEntry();

+ 58 - 1
jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/RagdollPreset.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,14 +43,35 @@ import java.util.logging.Logger;
  */
 public abstract class RagdollPreset {
 
+    /**
+     * message logger for this class
+     */
     protected static final Logger logger = Logger.getLogger(RagdollPreset.class.getName());
+    /**
+     * map bone names to joint presets
+     */
     protected Map<String, JointPreset> boneMap = new HashMap<String, JointPreset>();
+    /**
+     * lexicon to map bone names to entries
+     */
     protected Map<String, LexiconEntry> lexicon = new HashMap<String, LexiconEntry>();
 
+    /**
+     * Initialize the map from bone names to joint presets.
+     */
     protected abstract void initBoneMap();
 
+    /**
+     * Initialize the lexicon.
+     */
     protected abstract void initLexicon();
 
+    /**
+     * Apply the preset for the named bone to the specified joint.
+     *
+     * @param boneName name
+     * @param joint where to apply the preset (not null, modified)
+     */
     public void setupJointForBone(String boneName, SixDofJoint joint) {
 
         if (boneMap.isEmpty()) {
@@ -87,14 +108,30 @@ public abstract class RagdollPreset {
 
     }
 
+    /**
+     * Range of motion for a joint.
+     */
     protected class JointPreset {
 
         private float maxX, minX, maxY, minY, maxZ, minZ;
 
+        /**
+         * Instantiate a preset with no motion allowed.
+         */
         public JointPreset() {
         }
 
         public JointPreset(float maxX, float minX, float maxY, float minY, float maxZ, float minZ) {
+        /**
+         * Instantiate a preset with the specified range of motion.
+         *
+         * @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 Y 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)
+         */
             this.maxX = maxX;
             this.minX = minX;
             this.maxY = maxY;
@@ -103,6 +140,11 @@ public abstract class RagdollPreset {
             this.minZ = minZ;
         }
 
+        /**
+         * Apply this preset to the specified joint.
+         *
+         * @param joint where to apply (not null, modified)
+         */
         public void setupJoint(SixDofJoint joint) {
             joint.getRotationalLimitMotor(0).setHiLimit(maxX);
             joint.getRotationalLimitMotor(0).setLoLimit(minX);
@@ -113,13 +155,28 @@ public abstract class RagdollPreset {
         }
     }
 
+    /**
+     * One entry in a bone lexicon.
+     */
     protected class LexiconEntry extends HashMap<String, Integer> {
 
+        /**
+         * Add a synonym with the specified score.
+         *
+         * @param word a substring that might occur in a bone name (not null)
+         * @param score larger value means more likely to correspond
+         */
         public void addSynonym(String word, int score) {
             put(word.toLowerCase(), score);
         }
 
         public int getScore(String word) {
+        /**
+         * Calculate a total score for the specified bone name.
+         *
+         * @param name the name of a bone (not null)
+         * @return total score: larger value means more likely to correspond
+         */
             int score = 0;
             String searchWord = word.toLowerCase();
             for (String key : this.keySet()) {

+ 132 - 59
jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/RagdollUtils.java

@@ -33,14 +33,13 @@ package com.jme3.bullet.control.ragdoll;
 
 import com.jme3.animation.Bone;
 import com.jme3.animation.Skeleton;
+import com.jme3.animation.SkeletonControl;
 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;
@@ -48,11 +47,31 @@ import java.nio.FloatBuffer;
 import java.util.*;
 
 /**
+ * Utility methods used by KinematicRagdollControl.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author Nehon
  */
 public class RagdollUtils {
 
+    /**
+     * A private constructor to inhibit instantiation of this class.
+     */
+    private RagdollUtils() {
+    }
+
+    /**
+     * Alter the limits of the specified 6-DOF joint.
+     *
+     * @param joint which joint to alter (not null)
+     * @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 Y 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 static void setJointLimit(SixDofJoint joint, float maxX, float minX, float maxY, float minY, float maxZ, float minZ) {
 
         joint.getRotationalLimitMotor(0).setHiLimit(maxX);
@@ -63,22 +82,21 @@ public class RagdollUtils {
         joint.getRotationalLimitMotor(2).setLoLimit(minZ);
     }
 
+    /**
+     * Build a map of mesh vertices in a subtree of the scene graph.
+     *
+     * @param model the root of the subtree (may be null)
+     * @return a new map (not null)
+     */
     public static Map<Integer, List<Float>> buildPointMap(Spatial model) {
+        Map<Integer, List<Float>> map = new HashMap<>();
 
-
-        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);
-                }
-            }
+        SkeletonControl skeletonCtrl = model.getControl(SkeletonControl.class);
+        Mesh[] targetMeshes = skeletonCtrl.getTargets();
+        for (Mesh mesh : targetMeshes) {
+            buildPointMapForMesh(mesh, map);
         }
+
         return map;
     }
 
@@ -122,14 +140,15 @@ public class RagdollUtils {
     }
 
     /**
-     * Create a hull collision shape from linked vertices to this bone.
-     * Vertices have to be previously gathered in a map using buildPointMap method
-     * 
-     * @param pointsMap
-     * @param boneIndices
-     * @param initialScale
-     * @param initialPosition
-     * @return 
+     * Create a hull collision shape from linked vertices to this bone. Vertices
+     * must have previously been gathered using buildPointMap().
+     *
+     * @param pointsMap map from bone indices to coordinates (not null,
+     * unaffected)
+     * @param boneIndices (not null, unaffected)
+     * @param initialScale scale factors (not null, unaffected)
+     * @param initialPosition location (not null, unaffected)
+     * @return a new shape (not null)
      */
     public static HullCollisionShape makeShapeFromPointMap(Map<Integer, List<Float>> pointsMap, List<Integer> boneIndices, Vector3f initialScale, Vector3f initialPosition) {
 
@@ -151,16 +170,24 @@ public class RagdollUtils {
             }
         }
 
+        assert !points.isEmpty();
         float[] p = new float[points.size()];
         for (int i = 0; i < points.size(); i++) {
             p[i] = points.get(i);
         }
 
-
         return new HullCollisionShape(p);
     }
 
-    //returns the list of bone indices of the given bone and its child (if they are not in the boneList)
+    /**
+     * Enumerate the bone indices of the specified bone and all its descendents.
+     *
+     * @param bone the input bone (not null)
+     * @param skeleton the skeleton containing the bone (not null)
+     * @param boneList a set of bone names (not null, unaffected)
+     *
+     * @return a new list (not null)
+     */
     public static List<Integer> getBoneIndices(Bone bone, Skeleton skeleton, Set<String> boneList) {
         List<Integer> list = new LinkedList<Integer>();
         if (boneList.isEmpty()) {
@@ -178,50 +205,51 @@ public class RagdollUtils {
 
     /**
      * Create a hull collision shape from linked vertices to this bone.
-     * 
-     * @param model
-     * @param boneIndices
-     * @param initialScale
-     * @param initialPosition
-     * @param weightThreshold
-     * @return 
+     *
+     * @param model the model on which to base the shape
+     * @param boneIndices indices of relevant bones (not null, unaffected)
+     * @param initialScale scale factors
+     * @param initialPosition location
+     * @param weightThreshold minimum weight for inclusion
+     * @return a new shape
      */
-    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;
+    public static HullCollisionShape makeShapeFromVerticeWeights(Spatial model,
+            List<Integer> boneIndices, Vector3f initialScale,
+            Vector3f initialPosition, float weightThreshold) {
+        List<Float> points = new ArrayList<>(100);
+
+        SkeletonControl skeletonCtrl = model.getControl(SkeletonControl.class);
+        Mesh[] targetMeshes = skeletonCtrl.getTargets();
+        for (Mesh mesh : targetMeshes) {
             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));
-                    }
-
-                }
+                List<Float> bonePoints = getPoints(mesh, index, initialScale,
+                        initialPosition, weightThreshold);
+                points.addAll(bonePoints);
             }
         }
+
+        assert !points.isEmpty();
         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 
+     * Enumerate vertices that meet the weight threshold for the indexed bone.
+     *
+     * @param mesh the mesh to analyze (not null)
+     * @param boneIndex the index of the bone (&ge;0)
+     * @param initialScale a scale applied to vertex positions (not null,
+     * unaffected)
+     * @param offset an offset subtracted from vertex positions (not null,
+     * unaffected)
+     * @param weightThreshold the minimum bone weight for inclusion in the
+     * result (&ge;0, &le;1)
+     * @return a new list of vertex coordinates (not null, length a multiple of
+     * 3)
      */
     private static List<Float> getPoints(Mesh mesh, int boneIndex, Vector3f initialScale, Vector3f offset, float weightThreshold) {
 
@@ -265,12 +293,16 @@ public class RagdollUtils {
     }
 
     /**
-     * Updates a bone position and rotation.
-     * if the child bones are not in the bone list this means, they are not associated with a physics shape.
-     * So they have to be updated
+     * Updates a bone position and rotation. if the child bones are not in the
+     * bone list this means, they are not associated with a physics shape. So
+     * they have to be updated
+     *
      * @param bone the bone
      * @param pos the position
      * @param rot the rotation
+     * @param restoreBoneControl true &rarr; user-control flag should be set
+     * @param boneList the names of all bones without collision shapes (not
+     * null, unaffected)
      */
     public static void setTransform(Bone bone, Vector3f pos, Quaternion rot, boolean restoreBoneControl, Set<String> boneList) {
         //we ensure that we have the control
@@ -292,10 +324,51 @@ public class RagdollUtils {
         }
     }
 
+    /**
+     * Alter the user-control flags of a bone and all its descendents.
+     *
+     * @param bone the ancestor bone (not null, modified)
+     * @param bool true to enable user control, false to disable
+     */
     public static void setUserControl(Bone bone, boolean bool) {
         bone.setUserControl(bool);
         for (Bone child : bone.getChildren()) {
             setUserControl(child, bool);
         }
     }
+
+    /**
+     * Test whether the indexed bone has at least one vertex in the specified
+     * meshes with a weight greater than the specified threshold.
+     *
+     * @param boneIndex the index of the bone (&ge;0)
+     * @param targets the meshes to search (not null, no null elements)
+     * @param weightThreshold the threshold (&ge;0, &le;1)
+     * @return true if at least 1 vertex found, otherwise false
+     */
+    public static boolean hasVertices(int boneIndex, Mesh[] targets,
+            float weightThreshold) {
+        for (Mesh mesh : targets) {
+            ByteBuffer boneIndices
+                    = (ByteBuffer) mesh.getBuffer(Type.BoneIndex).getData();
+            FloatBuffer boneWeight
+                    = (FloatBuffer) mesh.getBuffer(Type.BoneWeight).getData();
+
+            boneIndices.rewind();
+            boneWeight.rewind();
+
+            int vertexComponents = mesh.getVertexCount() * 3;
+            for (int i = 0; i < vertexComponents; i += 3) {
+                int start = i / 3 * 4;
+                for (int k = start; k < start + 4; k++) {
+                    if (boneIndices.get(k) == boneIndex
+                            && boneWeight.get(k) >= weightThreshold) {
+                        return true;
+                    }
+                }
+            }
+        }
+
+        return false;
+    }
 }

+ 31 - 1
jme3-bullet/src/common/java/com/jme3/bullet/debug/AbstractPhysicsDebugControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,14 +37,27 @@ import com.jme3.scene.Spatial;
 import com.jme3.scene.control.AbstractControl;
 
 /**
+ * The abstract base class for physics-debug controls (such as
+ * BulletRigidBodyDebugControl) used to visualize individual collision objects
+ * and joints.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public abstract class AbstractPhysicsDebugControl extends AbstractControl {
 
     private final Quaternion tmp_inverseWorldRotation = new Quaternion();
+    /**
+     * the app state that this control serves
+     */
     protected final BulletDebugAppState debugAppState;
 
+    /**
+     * Instantiate an enabled control to serve the specified debug app state.
+     *
+     * @param debugAppState which app state (not null, alias created)
+     */
     public AbstractPhysicsDebugControl(BulletDebugAppState debugAppState) {
         this.debugAppState = debugAppState;
     }
@@ -55,10 +68,27 @@ public abstract class AbstractPhysicsDebugControl extends AbstractControl {
     @Override
     protected abstract void controlUpdate(float tpf);
 
+    /**
+     * Apply the specified location and orientation to the controlled spatial.
+     *
+     * @param worldLocation location vector (in physics-space coordinates, not
+     * null, unaffected)
+     * @param worldRotation orientation (in physics-space coordinates, not null,
+     * unaffected)
+     */
     protected void applyPhysicsTransform(Vector3f worldLocation, Quaternion worldRotation) {
         applyPhysicsTransform(worldLocation, worldRotation, this.spatial);
     }
 
+    /**
+     * Apply the specified location and orientation to the specified spatial.
+     *
+     * @param worldLocation location vector (in physics-space coordinates, not
+     * null, unaffected)
+     * @param worldRotation orientation (in physics-space coordinates, not null,
+     * unaffected)
+     * @param spatial where to apply (may be null)
+     */
     protected void applyPhysicsTransform(Vector3f worldLocation, Quaternion worldRotation, Spatial spatial) {
         if (spatial != null) {
             Vector3f localLocation = spatial.getLocalTranslation();

+ 44 - 1
jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletCharacterDebugControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,16 +42,37 @@ import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 
 /**
+ * A physics-debug control used to visualize a PhysicsCharacter.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class BulletCharacterDebugControl extends AbstractPhysicsDebugControl {
 
+    /**
+     * character to visualize (not null)
+     */
     protected final PhysicsCharacter body;
+    /**
+     * temporary storage for physics location
+     */
     protected final Vector3f location = new Vector3f();
     protected final Quaternion rotation = new Quaternion();
+    /**
+     * shape for which geom was generated
+     */
     protected CollisionShape myShape;
+    /**
+     * geometry to visualize myShape (not null)
+     */
     protected Spatial geom;
+    /**
+     * Instantiate an enabled control to visualize the specified character.
+     *
+     * @param debugAppState which app state (not null, alias created)
+     * @param body the character to visualize (not null, alias created)
+     */
 
     public BulletCharacterDebugControl(BulletDebugAppState debugAppState, PhysicsCharacter body) {
         super(debugAppState);
@@ -61,6 +82,13 @@ public class BulletCharacterDebugControl extends AbstractPhysicsDebugControl {
         geom.setMaterial(debugAppState.DEBUG_PINK);
     }
 
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     @Override
     public void setSpatial(Spatial spatial) {
         if (spatial != null && spatial instanceof Node) {
@@ -73,6 +101,13 @@ public class BulletCharacterDebugControl extends AbstractPhysicsDebugControl {
         super.setSpatial(spatial);
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is enabled and added to a scene. Should be
+     * invoked only by a subclass or by AbstractControl.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     @Override
     protected void controlUpdate(float tpf) {
         if(myShape != body.getCollisionShape()){
@@ -86,6 +121,14 @@ public class BulletCharacterDebugControl extends AbstractPhysicsDebugControl {
         geom.setLocalScale(body.getCollisionShape().getScale());
     }
 
+    /**
+     * Render this control. Invoked once per frame, provided the
+     * control is enabled and added to a scene. Should be invoked only by a
+     * subclass or by AbstractControl.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     @Override
     protected void controlRender(RenderManager rm, ViewPort vp) {
     }

+ 95 - 5
jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletDebugAppState.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,31 +55,84 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
+ * An app state to manage a debug visualization of a physics space.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class BulletDebugAppState extends AbstractAppState {
 
+    /**
+     * message logger for this class
+     */
     protected static final Logger logger = Logger.getLogger(BulletDebugAppState.class.getName());
+    /**
+     * limit which objects are visualized, or null to visualize all objects
+     */
     protected DebugAppStateFilter filter;
     protected Application app;
     protected AssetManager assetManager;
+    /**
+     * physics space to visualize (not null)
+     */
     protected final PhysicsSpace space;
+    /**
+     * scene-graph node to parent the geometries
+     */
     protected final Node physicsDebugRootNode = new Node("Physics Debug Root Node");
+    /**
+     * view port in which to render (not null)
+     */
     protected ViewPort viewPort;
     protected RenderManager rm;
+    /**
+     * material for inactive rigid bodies
+     */
     public Material DEBUG_BLUE;
     public Material DEBUG_RED;
+    /**
+     * material for joints
+     */
     public Material DEBUG_GREEN;
+    /**
+     * material for ghosts
+     */
     public Material DEBUG_YELLOW;
+    /**
+     * material for vehicles and active rigid bodies
+     */
     public Material DEBUG_MAGENTA;
+    /**
+     * material for physics characters
+     */
     public Material DEBUG_PINK;
+    /**
+     * map rigid bodies to visualizations
+     */
     protected HashMap<PhysicsRigidBody, Spatial> bodies = new HashMap<PhysicsRigidBody, Spatial>();
+    /**
+     * map joints to visualizations
+     */
     protected HashMap<PhysicsJoint, Spatial> joints = new HashMap<PhysicsJoint, Spatial>();
+    /**
+     * map ghosts to visualizations
+     */
     protected HashMap<PhysicsGhostObject, Spatial> ghosts = new HashMap<PhysicsGhostObject, Spatial>();
+    /**
+     * map physics characters to visualizations
+     */
     protected HashMap<PhysicsCharacter, Spatial> characters = new HashMap<PhysicsCharacter, Spatial>();
+    /**
+     * map vehicles to visualizations
+     */
     protected HashMap<PhysicsVehicle, Spatial> vehicles = new HashMap<PhysicsVehicle, Spatial>();
-
+    /**
+     * Instantiate an app state to visualize the specified space. This constructor should be invoked only by
+     * BulletAppState.
+     *
+     * @param space physics space to visualize (not null, alias created)
+     */
     public BulletDebugAppState(PhysicsSpace space) {
         this.space = space;
     }
@@ -88,10 +141,22 @@ public class BulletDebugAppState extends AbstractAppState {
         return new DebugTools(assetManager);
     }
 
+    /**
+     * Alter which objects are visualized.
+     *
+     * @param filter the desired filter, or or null to visualize all objects
+     */
     public void setFilter(DebugAppStateFilter filter) {
         this.filter = filter;
     }
     
+    /**
+     * Initialize this state prior to its 1st update. Should be invoked only by
+     * a subclass or by the AppStateManager.
+     *
+     * @param stateManager the manager for this state (not null)
+     * @param app the application which owns this state (not null)
+     */
     @Override
     public void initialize(AppStateManager stateManager, Application app) {
         super.initialize(stateManager, app);
@@ -105,12 +170,25 @@ public class BulletDebugAppState extends AbstractAppState {
         viewPort.attachScene(physicsDebugRootNode);
     }
 
+    /**
+     * Transition this state from terminating to detached. Should be invoked
+     * only by a subclass or by the AppStateManager. Invoked once for each time
+     * {@link #initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)}
+     * is invoked.
+     */
     @Override
     public void cleanup() {
         rm.removeMainView(viewPort);
         super.cleanup();
     }
 
+    /**
+     * Update this state prior to rendering. Should be invoked only by a
+     * subclass or by the AppStateManager. Invoked once per frame, provided the
+     * state is attached and enabled.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     @Override
     public void update(float tpf) {
         super.update(tpf);
@@ -125,6 +203,13 @@ public class BulletDebugAppState extends AbstractAppState {
         physicsDebugRootNode.updateGeometricState();
     }
 
+    /**
+     * Render this state. Should be invoked only by a subclass or by the
+     * AppStateManager. Invoked once per frame, provided the state is attached
+     * and enabled.
+     *
+     * @param rm the render manager (not null)
+     */
     @Override
     public void render(RenderManager rm) {
         super.render(rm);
@@ -133,6 +218,11 @@ public class BulletDebugAppState extends AbstractAppState {
         }
     }
 
+    /**
+     * Initialize the materials.
+     *
+     * @param app the application which owns this state (not null)
+     */
     private void setupMaterials(Application app) {
         AssetManager manager = app.getAssetManager();
         DEBUG_BLUE = new Material(manager, "Common/MatDefs/Misc/Unshaded.j3md");
@@ -311,14 +401,14 @@ public class BulletDebugAppState extends AbstractAppState {
     }
 
     /**
-     * Interface that allows filtering out objects from the debug display
+     * Interface to restrict which physics objects are visualized.
      */
     public static interface DebugAppStateFilter {
 
         /**
-         * Queries an object to be displayed
+         * Test whether the specified physics object should be displayed.
          *
-         * @param obj The object to be displayed
+         * @param obj the joint or collision object to test (unaffected)
          * @return return true if the object should be displayed, false if not
          */
         public boolean displayObject(Object obj);

+ 47 - 1
jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletGhostObjectDebugControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,17 +42,41 @@ import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 
 /**
+ * A physics-debug control used to visualize a PhysicsGhostObject.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class BulletGhostObjectDebugControl extends AbstractPhysicsDebugControl {
 
+    /**
+     * ghost object to visualize (not null)
+     */
     protected final PhysicsGhostObject body;
+    /**
+     * temporary storage for physics location
+     */
     protected final Vector3f location = new Vector3f();
+    /**
+     * temporary storage for physics rotation
+     */
     protected final Quaternion rotation = new Quaternion();
+    /**
+     * shape for which geom was generated (not null)
+     */
     protected CollisionShape myShape;
+    /**
+     * geometry to visualize myShape (not null)
+     */
     protected Spatial geom;
 
+    /**
+     * Instantiate an enabled control to visualize the specified ghost object.
+     *
+     * @param debugAppState which app state (not null, alias created)
+     * @param body which object to visualize (not null, alias created)
+     */
     public BulletGhostObjectDebugControl(BulletDebugAppState debugAppState, PhysicsGhostObject body) {
         super(debugAppState);
         this.body = body;
@@ -63,6 +87,13 @@ public class BulletGhostObjectDebugControl extends AbstractPhysicsDebugControl {
         geom.setMaterial(debugAppState.DEBUG_YELLOW);
     }
 
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     @Override
     public void setSpatial(Spatial spatial) {
         if (spatial != null && spatial instanceof Node) {
@@ -75,6 +106,13 @@ public class BulletGhostObjectDebugControl extends AbstractPhysicsDebugControl {
         super.setSpatial(spatial);
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is enabled and added to a scene. Should be
+     * invoked only by a subclass or by AbstractControl.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     @Override
     protected void controlUpdate(float tpf) {
         if (myShape != body.getCollisionShape()) {
@@ -88,6 +126,14 @@ public class BulletGhostObjectDebugControl extends AbstractPhysicsDebugControl {
         geom.setLocalScale(body.getCollisionShape().getScale());
     }
 
+    /**
+     * Render this control. Invoked once per frame, provided the
+     * control is enabled and added to a scene. Should be invoked only by a
+     * subclass or by AbstractControl.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     @Override
     protected void controlRender(RenderManager rm, ViewPort vp) {
     }

+ 32 - 1
jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletJointDebugControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,9 @@ import com.jme3.scene.Spatial;
 import com.jme3.scene.debug.Arrow;
 
 /**
+ * A physics-debug control used to visualize a PhysicsJoint.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
@@ -58,6 +61,12 @@ public class BulletJointDebugControl extends AbstractPhysicsDebugControl {
     protected final Vector3f offA = new Vector3f();
     protected final Vector3f offB = new Vector3f();
 
+    /**
+     * Instantiate an enabled control to visualize the specified joint.
+     *
+     * @param debugAppState which app state (not null, alias created)
+     * @param body the joint to visualize (not null, alias created)
+     */
     public BulletJointDebugControl(BulletDebugAppState debugAppState, PhysicsJoint body) {
         super(debugAppState);
         this.body = body;
@@ -71,6 +80,13 @@ public class BulletJointDebugControl extends AbstractPhysicsDebugControl {
         geomB.setMaterial(debugAppState.DEBUG_GREEN);
     }
 
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     @Override
     public void setSpatial(Spatial spatial) {
         if (spatial != null && spatial instanceof Node) {
@@ -85,6 +101,13 @@ public class BulletJointDebugControl extends AbstractPhysicsDebugControl {
         super.setSpatial(spatial);
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is enabled and added to a scene. Should be
+     * invoked only by a subclass or by AbstractControl.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     @Override
     protected void controlUpdate(float tpf) {
         body.getBodyA().getPhysicsLocation(a.getTranslation());
@@ -100,6 +123,14 @@ public class BulletJointDebugControl extends AbstractPhysicsDebugControl {
         arrowB.setArrowExtent(body.getPivotB());
     }
 
+    /**
+     * Render this control. Invoked once per frame, provided the
+     * control is enabled and added to a scene. Should be invoked only by a
+     * subclass or by AbstractControl.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     @Override
     protected void controlRender(RenderManager rm, ViewPort vp) {
     }

+ 47 - 1
jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletRigidBodyDebugControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,17 +42,41 @@ import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 
 /**
+ * A physics-debug control used to visualize a PhysicsRigidBody.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class BulletRigidBodyDebugControl extends AbstractPhysicsDebugControl {
 
+    /**
+     * rigid body to visualize (not null)
+     */
     protected final PhysicsRigidBody body;
+    /**
+     * temporary storage for physics location
+     */
     protected final Vector3f location = new Vector3f();
+    /**
+     * temporary storage for physics rotation
+     */
     protected final Quaternion rotation = new Quaternion();
+    /**
+     * shape for which geom was generated (not null)
+     */
     protected CollisionShape myShape;
+    /**
+     * geometry to visualize myShape (not null)
+     */
     protected Spatial geom;
 
+    /**
+     * Instantiate an enabled control to visualize the specified body.
+     *
+     * @param debugAppState which app state (not null, alias created)
+     * @param body which body to visualize (not null, alias created)
+     */
     public BulletRigidBodyDebugControl(BulletDebugAppState debugAppState, PhysicsRigidBody body) {
         super(debugAppState);
         this.body = body;
@@ -62,6 +86,13 @@ public class BulletRigidBodyDebugControl extends AbstractPhysicsDebugControl {
         geom.setMaterial(debugAppState.DEBUG_BLUE);
     }
 
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     @Override
     public void setSpatial(Spatial spatial) {
         if (spatial != null && spatial instanceof Node) {
@@ -74,6 +105,13 @@ public class BulletRigidBodyDebugControl extends AbstractPhysicsDebugControl {
         super.setSpatial(spatial);
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is enabled and added to a scene. Should be
+     * invoked only by a subclass or by AbstractControl.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     @Override
     protected void controlUpdate(float tpf) {
         if(myShape != body.getCollisionShape()){
@@ -91,6 +129,14 @@ public class BulletRigidBodyDebugControl extends AbstractPhysicsDebugControl {
         geom.setLocalScale(body.getCollisionShape().getScale());
     }
 
+    /**
+     * Render this control. Invoked once per frame, provided the
+     * control is enabled and added to a scene. Should be invoked only by a
+     * subclass or by AbstractControl.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     @Override
     protected void controlRender(RenderManager rm, ViewPort vp) {
     }

+ 32 - 1
jme3-bullet/src/common/java/com/jme3/bullet/debug/BulletVehicleDebugControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,9 @@ import com.jme3.scene.Spatial;
 import com.jme3.scene.debug.Arrow;
 
 /**
+ * A physics-debug control used to visualize a PhysicsVehicle.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
@@ -53,6 +56,12 @@ public class BulletVehicleDebugControl extends AbstractPhysicsDebugControl {
     protected final Vector3f location = new Vector3f();
     protected final Quaternion rotation = new Quaternion();
 
+    /**
+     * Instantiate an enabled control to visualize the specified vehicle.
+     *
+     * @param debugAppState which app state (not null, alias created)
+     * @param body which vehicle to visualize (not null, alias created)
+     */
     public BulletVehicleDebugControl(BulletDebugAppState debugAppState, PhysicsVehicle body) {
         super(debugAppState);
         this.body = body;
@@ -60,6 +69,13 @@ public class BulletVehicleDebugControl extends AbstractPhysicsDebugControl {
         createVehicle();
     }
 
+    /**
+     * Alter which spatial is controlled. Invoked when the control is added to
+     * or removed from a spatial. Should be invoked only by a subclass or from
+     * Spatial. Do not invoke directly from user code.
+     *
+     * @param spatial the spatial to control (or null)
+     */
     @Override
     public void setSpatial(Spatial spatial) {
         if (spatial != null && spatial instanceof Node) {
@@ -104,6 +120,13 @@ public class BulletVehicleDebugControl extends AbstractPhysicsDebugControl {
         }
     }
 
+    /**
+     * Update this control. Invoked once per frame during the logical-state
+     * update, provided the control is enabled and added to a scene. Should be
+     * invoked only by a subclass or by AbstractControl.
+     *
+     * @param tpf the time interval between frames (in seconds, &ge;0)
+     */
     @Override
     protected void controlUpdate(float tpf) {
         for (int i = 0; i < body.getNumWheels(); i++) {
@@ -136,6 +159,14 @@ public class BulletVehicleDebugControl extends AbstractPhysicsDebugControl {
         applyPhysicsTransform(body.getPhysicsLocation(location), body.getPhysicsRotation(rotation));
     }
 
+    /**
+     * Render this control. Invoked once per frame, provided the
+     * control is enabled and added to a scene. Should be invoked only by a
+     * subclass or by AbstractControl.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port to render (not null)
+     */
     @Override
     protected void controlRender(RenderManager rm, ViewPort vp) {
     }

+ 129 - 1
jme3-bullet/src/common/java/com/jme3/bullet/debug/DebugTools.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,43 +42,129 @@ import com.jme3.scene.Node;
 import com.jme3.scene.debug.Arrow;
 
 /**
+ * Debugging aids.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen
  */
 public class DebugTools {
 
     protected final AssetManager manager;
+    /**
+     * unshaded blue material
+     */
     public Material DEBUG_BLUE;
+    /**
+     * unshaded red material
+     */
     public Material DEBUG_RED;
+    /**
+     * unshaded green material
+     */
     public Material DEBUG_GREEN;
+    /**
+     * unshaded yellow material
+     */
     public Material DEBUG_YELLOW;
+    /**
+     * unshaded magenta material
+     */
     public Material DEBUG_MAGENTA;
+    /**
+     * unshaded pink material
+     */
     public Material DEBUG_PINK;
+    /**
+     * node for attaching debug geometries
+     */
     public Node debugNode = new Node("Debug Node");
+    /**
+     * mesh for the blue arrow
+     */
     public Arrow arrowBlue = new Arrow(Vector3f.ZERO);
+    /**
+     * geometry for the blue arrow
+     */
     public Geometry arrowBlueGeom = new Geometry("Blue Arrow", arrowBlue);
+    /**
+     * mesh for the green arrow
+     */
     public Arrow arrowGreen = new Arrow(Vector3f.ZERO);
+    /**
+     * geometry for the green arrow
+     */
     public Geometry arrowGreenGeom = new Geometry("Green Arrow", arrowGreen);
+    /**
+     * mesh for the red arrow
+     */
     public Arrow arrowRed = new Arrow(Vector3f.ZERO);
+    /**
+     * geometry for the red arrow
+     */
     public Geometry arrowRedGeom = new Geometry("Red Arrow", arrowRed);
+    /**
+     * mesh for the magenta arrow
+     */
     public Arrow arrowMagenta = new Arrow(Vector3f.ZERO);
+    /**
+     * geometry for the magenta arrow
+     */
     public Geometry arrowMagentaGeom = new Geometry("Magenta Arrow", arrowMagenta);
+    /**
+     * mesh for the yellow arrow
+     */
     public Arrow arrowYellow = new Arrow(Vector3f.ZERO);
+    /**
+     * geometry for the yellow arrow
+     */
     public Geometry arrowYellowGeom = new Geometry("Yellow Arrow", arrowYellow);
+    /**
+     * mesh for the pink arrow
+     */
     public Arrow arrowPink = new Arrow(Vector3f.ZERO);
+    /**
+     * geometry for the pink arrow
+     */
     public Geometry arrowPinkGeom = new Geometry("Pink Arrow", arrowPink);
+    /**
+     * local copy of {@link com.jme3.math.Vector3f#UNIT_X}
+     */
     protected static final Vector3f UNIT_X_CHECK = new Vector3f(1, 0, 0);
+    /**
+     * local copy of {@link com.jme3.math.Vector3f#UNIT_Y}
+     */
     protected static final Vector3f UNIT_Y_CHECK = new Vector3f(0, 1, 0);
+    /**
+     * local copy of {@link com.jme3.math.Vector3f#UNIT_Z}
+     */
     protected static final Vector3f UNIT_Z_CHECK = new Vector3f(0, 0, 1);
+    /**
+     * local copy of {@link com.jme3.math.Vector3f#UNIT_XYZ}
+     */
     protected static final Vector3f UNIT_XYZ_CHECK = new Vector3f(1, 1, 1);
+    /**
+     * local copy of {@link com.jme3.math.Vector3f#ZERO}
+     */
     protected static final Vector3f ZERO_CHECK = new Vector3f(0, 0, 0);
 
+    /**
+     * Instantiate a set of debug tools.
+     *
+     * @param manager for loading assets (not null, alias created)
+     */
     public DebugTools(AssetManager manager) {
         this.manager = manager;
         setupMaterials();
         setupDebugNode();
     }
 
+    /**
+     * Render all the debug geometries to the specified view port.
+     *
+     * @param rm the render manager (not null)
+     * @param vp the view port (not null)
+     */
     public void show(RenderManager rm, ViewPort vp) {
         if (!Vector3f.UNIT_X.equals(UNIT_X_CHECK) || !Vector3f.UNIT_Y.equals(UNIT_Y_CHECK) || !Vector3f.UNIT_Z.equals(UNIT_Z_CHECK)
                 || !Vector3f.UNIT_XYZ.equals(UNIT_XYZ_CHECK) || !Vector3f.ZERO.equals(ZERO_CHECK)) {
@@ -94,36 +180,75 @@ public class DebugTools {
         rm.renderScene(debugNode, vp);
     }
 
+    /**
+     * Alter the location and extent of the blue arrow.
+     *
+     * @param location the coordinates of the tail (not null, unaffected)
+     * @param extent the offset of the tip from the tail (not null, unaffected)
+     */
     public void setBlueArrow(Vector3f location, Vector3f extent) {
         arrowBlueGeom.setLocalTranslation(location);
         arrowBlue.setArrowExtent(extent);
     }
 
+    /**
+     * Alter the location and extent of the green arrow.
+     *
+     * @param location the coordinates of the tail (not null, unaffected)
+     * @param extent the offset of the tip from the tail (not null, unaffected)
+     */
     public void setGreenArrow(Vector3f location, Vector3f extent) {
         arrowGreenGeom.setLocalTranslation(location);
         arrowGreen.setArrowExtent(extent);
     }
 
+    /**
+     * Alter the location and extent of the red arrow.
+     *
+     * @param location the coordinates of the tail (not null, unaffected)
+     * @param extent the offset of the tip from the tail (not null, unaffected)
+     */
     public void setRedArrow(Vector3f location, Vector3f extent) {
         arrowRedGeom.setLocalTranslation(location);
         arrowRed.setArrowExtent(extent);
     }
 
+    /**
+     * Alter the location and extent of the magenta arrow.
+     *
+     * @param location the coordinates of the tail (not null, unaffected)
+     * @param extent the offset of the tip from the tail (not null, unaffected)
+     */
     public void setMagentaArrow(Vector3f location, Vector3f extent) {
         arrowMagentaGeom.setLocalTranslation(location);
         arrowMagenta.setArrowExtent(extent);
     }
 
+    /**
+     * Alter the location and extent of the yellow arrow.
+     *
+     * @param location the coordinates of the tail (not null, unaffected)
+     * @param extent the offset of the tip from the tail (not null, unaffected)
+     */
     public void setYellowArrow(Vector3f location, Vector3f extent) {
         arrowYellowGeom.setLocalTranslation(location);
         arrowYellow.setArrowExtent(extent);
     }
 
+    /**
+     * Alter the location and extent of the pink arrow.
+     *
+     * @param location the coordinates of the tail (not null, unaffected)
+     * @param extent the offset of the tip from the tail (not null, unaffected)
+     */
     public void setPinkArrow(Vector3f location, Vector3f extent) {
         arrowPinkGeom.setLocalTranslation(location);
         arrowPink.setArrowExtent(extent);
     }
 
+    /**
+     * Attach all the debug geometries to the debug node.
+     */
     protected void setupDebugNode() {
         arrowBlueGeom.setMaterial(DEBUG_BLUE);
         arrowGreenGeom.setMaterial(DEBUG_GREEN);
@@ -139,6 +264,9 @@ public class DebugTools {
         debugNode.attachChild(arrowPinkGeom);
     }
 
+    /**
+     * Initialize all the DebugTools materials.
+     */
     protected void setupMaterials() {
         DEBUG_BLUE = new Material(manager, "Common/MatDefs/Misc/Unshaded.j3md");
         DEBUG_BLUE.getAdditionalRenderState().setWireframe(true);

+ 71 - 26
jme3-bullet/src/common/java/com/jme3/bullet/util/CollisionShapeFactory.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,17 +44,21 @@ import java.util.Iterator;
 import java.util.LinkedList;
 
 /**
+ * A utility class for generating collision shapes from Spatials.
+ * <p>
+ * This class is shared between JBullet and Native Bullet.
  *
  * @author normenhansen, tim8dev
  */
 public class CollisionShapeFactory {
 
     /**
-     * returns the correct transform for a collisionshape in relation
-     * to the ancestor for which the collisionshape is generated
+     * Calculate the correct transform for a collision shape relative to the
+     * ancestor for which the shape was generated.
+     *
      * @param spat
      * @param parent
-     * @return
+     * @return a new instance (not null)
      */
     private static Transform getTransform(Spatial spat, Spatial parent) {
         Transform shapeTransform = new Transform();
@@ -135,30 +139,48 @@ public class CollisionShapeFactory {
     }
 
     /**
-     * This type of collision shape is mesh-accurate and meant for immovable "world objects".
-     * Examples include terrain, houses or whole shooter levels.<br>
-     * Objects with "mesh" type collision shape will not collide with each other.
+     * This type of collision shape is mesh-accurate and meant for immovable
+     * "world objects". Examples include terrain, houses or whole shooter
+     * levels.
+     * <p>
+     * Objects with "mesh" type collision shape will not collide with each
+     * other.
+     *
+     * @param rootNode the node on which to base the shape (not null)
+     * @return a new shape (not null)
      */
     private static CompoundCollisionShape createMeshCompoundShape(Node rootNode) {
         return createCompoundShape(rootNode, new CompoundCollisionShape(), true);
     }
 
     /**
-     * This type of collision shape creates a CompoundShape made out of boxes that
-     * are based on the bounds of the Geometries  in the tree.
-     * @param rootNode
-     * @return
+     * This type of collision shape creates a CompoundShape made out of boxes
+     * that are based on the bounds of the Geometries in the tree.
+     *
+     * @param rootNode the node on which to base the shape (not null)
+     * @return a new shape (not null)
      */
     private static CompoundCollisionShape createBoxCompoundShape(Node rootNode) {
         return createCompoundShape(rootNode, new CompoundCollisionShape(), false);
     }
 
     /**
-     * This type of collision shape is mesh-accurate and meant for immovable "world objects".
-     * Examples include terrain, houses or whole shooter levels.<br/>
-     * Objects with "mesh" type collision shape will not collide with each other.<br/>
-     * Creates a HeightfieldCollisionShape if the supplied spatial is a TerrainQuad.
-     * @return A MeshCollisionShape or a CompoundCollisionShape with MeshCollisionShapes as children if the supplied spatial is a Node. A HeightieldCollisionShape if a TerrainQuad was supplied.
+     * Create a mesh shape for the given Spatial.
+     * <p>
+     * This type of collision shape is mesh-accurate and meant for immovable
+     * "world objects". Examples include terrain, houses or whole shooter
+     * levels.
+     * <p>
+     * Objects with "mesh" type collision shape will not collide with each
+     * other.
+     * <p>
+     * Creates a HeightfieldCollisionShape if the supplied spatial is a
+     * TerrainQuad.
+     *
+     * @param spatial the spatial on which to base the shape (not null)
+     * @return A MeshCollisionShape or a CompoundCollisionShape with
+     * MeshCollisionShapes as children if the supplied spatial is a Node. A
+     * HeightieldCollisionShape if a TerrainQuad was supplied.
      */
     public static CollisionShape createMeshShape(Spatial spatial) {
         if (spatial instanceof TerrainQuad) {
@@ -177,9 +199,14 @@ public class CollisionShapeFactory {
     }
 
     /**
-     * This method creates a hull shape for the given Spatial.<br>
-     * If you want to have mesh-accurate dynamic shapes (CPU intense!!!) use GImpact shapes, its probably best to do so with a low-poly version of your model.
-     * @return A HullCollisionShape or a CompoundCollisionShape with HullCollisionShapes as children if the supplied spatial is a Node.
+     * Create a hull shape for the given Spatial.
+     * <p>
+     * For mesh-accurate animated meshes (CPU intense!) use GImpact shapes.
+     *
+     * @param spatial the spatial on which to base the shape (not null)
+     * @return a HullCollisionShape (if spatial is a Geometry) or a
+     * CompoundCollisionShape with HullCollisionShapes as children (if spatial
+     * is a Node)
      */
     public static CollisionShape createDynamicMeshShape(Spatial spatial) {
         if (spatial instanceof Geometry) {
@@ -192,6 +219,14 @@ public class CollisionShapeFactory {
 
     }
 
+    /**
+     * Create a box shape for the given Spatial.
+     *
+     * @param spatial the spatial on which to base the shape (not null)
+     * @return a BoxCollisionShape (if spatial is a Geometry) or a
+     * CompoundCollisionShape with BoxCollisionShapes as children (if spatial is
+     * a Node)
+     */
     public static CollisionShape createBoxShape(Spatial spatial) {
         if (spatial instanceof Geometry) {
             return createSingleBoxShape((Geometry) spatial, spatial);
@@ -203,9 +238,12 @@ public class CollisionShapeFactory {
     }
 
     /**
-     * This type of collision shape is mesh-accurate and meant for immovable "world objects".
-     * Examples include terrain, houses or whole shooter levels.<br>
-     * Objects with "mesh" type collision shape will not collide with each other.
+     * This type of collision shape is mesh-accurate and meant for immovable
+     * "world objects". Examples include terrain, houses or whole shooter
+     * levels.
+     * <p>
+     * Objects with "mesh" type collision shape will not collide with each
+     * other.
      */
     private static MeshCollisionShape createSingleMeshShape(Geometry geom, Spatial parent) {
         Mesh mesh = geom.getMesh();
@@ -220,9 +258,13 @@ public class CollisionShapeFactory {
     }
 
     /**
-     * Uses the bounding box of the supplied spatial to create a BoxCollisionShape
-     * @param spatial
-     * @return BoxCollisionShape with the size of the spatials BoundingBox
+     * Use the bounding box of the supplied spatial to create a
+     * BoxCollisionShape.
+     *
+     * @param spatial the spatial on which to base the shape (not null)
+     * @param parent unused
+     * @return a new shape with the dimensions of the spatial's bounding box
+     * (not null)
      */
     private static BoxCollisionShape createSingleBoxShape(Spatial spatial, Spatial parent) {
         //TODO: using world bound here instead of "local world" bound...
@@ -232,7 +274,10 @@ public class CollisionShapeFactory {
     }
 
     /**
-     * This method creates a hull collision shape for the given mesh.<br>
+     * Create a hull collision shape for the specified geometry.
+     *
+     * @param geom the geometry on which to base the shape (not null)
+     * @param parent
      */
     private static HullCollisionShape createSingleDynamicMeshShape(Geometry geom, Spatial parent) {
         Mesh mesh = geom.getMesh();

+ 417 - 104
jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java

@@ -32,7 +32,6 @@
 package com.jme3.bullet;
 
 import com.jme3.app.AppTask;
-import com.jme3.asset.AssetManager;
 import com.jme3.bullet.collision.*;
 import com.jme3.bullet.collision.shapes.CollisionShape;
 import com.jme3.bullet.control.PhysicsControl;
@@ -46,6 +45,7 @@ import com.jme3.math.Transform;
 import com.jme3.math.Vector3f;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
+import com.jme3.util.SafeArrayList;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -55,6 +55,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Comparator;
+import java.util.Deque;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
@@ -63,17 +64,36 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * <p>PhysicsSpace - The central jbullet-jme physics space</p>
+ * A jbullet-jme physics space with its own btDynamicsWorld.
  *
  * @author normenhansen
  */
 public class PhysicsSpace {
 
+    /**
+     * message logger for this class
+     */
     private static final Logger logger = Logger.getLogger(PhysicsSpace.class.getName());
+    /**
+     * index of the X axis
+     */
     public static final int AXIS_X = 0;
+    /**
+     * index of the Y axis
+     */
     public static final int AXIS_Y = 1;
+    /**
+     * index of the Z axis
+     */
     public static final int AXIS_Z = 2;
+    /**
+     * Bullet identifier of the physics space. The constructor sets this to a
+     * non-zero value.
+     */
     private long physicsSpaceId = 0;
+    /**
+     * first-in/first-out (FIFO) queue of physics tasks for each thread
+     */
     private static ThreadLocal<ConcurrentLinkedQueue<AppTask<?>>> pQueueTL =
             new ThreadLocal<ConcurrentLinkedQueue<AppTask<?>>>() {
                 @Override
@@ -81,8 +101,17 @@ public class PhysicsSpace {
                     return new ConcurrentLinkedQueue<AppTask<?>>();
                 }
             };
+    /**
+     * first-in/first-out (FIFO) queue of physics tasks
+     */
     private ConcurrentLinkedQueue<AppTask<?>> pQueue = new ConcurrentLinkedQueue<AppTask<?>>();
+    /**
+     * physics space for each thread
+     */
     private static ThreadLocal<PhysicsSpace> physicsSpaceTL = new ThreadLocal<PhysicsSpace>();
+    /**
+     * copy of type of acceleration structure used
+     */
     private BroadphaseType broadphaseType = BroadphaseType.DBVT;
 //    private DiscreteDynamicsWorld dynamicsWorld = null;
 //    private BroadphaseInterface broadphase;
@@ -95,15 +124,50 @@ public class PhysicsSpace {
     private Map<Long, PhysicsRigidBody> physicsBodies = new ConcurrentHashMap<Long, PhysicsRigidBody>();
     private Map<Long, PhysicsJoint> physicsJoints = new ConcurrentHashMap<Long, PhysicsJoint>();
     private Map<Long, PhysicsVehicle> physicsVehicles = new ConcurrentHashMap<Long, PhysicsVehicle>();
-    private ArrayList<PhysicsCollisionListener> collisionListeners = new ArrayList<PhysicsCollisionListener>();
+    /**
+     * list of registered collision listeners
+     */
+    final private List<PhysicsCollisionListener> collisionListeners
+            = new SafeArrayList<>(PhysicsCollisionListener.class);
+    /**
+     * queue of collision events not yet distributed to listeners
+     */
     private ArrayDeque<PhysicsCollisionEvent> collisionEvents = new ArrayDeque<PhysicsCollisionEvent>();
+    /**
+     * map from collision groups to registered group listeners
+     */
     private Map<Integer, PhysicsCollisionGroupListener> collisionGroupListeners = new ConcurrentHashMap<Integer, PhysicsCollisionGroupListener>();
+    /**
+     * queue of registered tick listeners
+     */
     private ConcurrentLinkedQueue<PhysicsTickListener> tickListeners = new ConcurrentLinkedQueue<PhysicsTickListener>();
     private PhysicsCollisionEventFactory eventFactory = new PhysicsCollisionEventFactory();
+    /**
+     * copy of minimum coordinate values when using AXIS_SWEEP broadphase
+     * algorithms
+     */
     private Vector3f worldMin = new Vector3f(-10000f, -10000f, -10000f);
+    /**
+     * copy of maximum coordinate values when using AXIS_SWEEP broadphase
+     * algorithms
+     */
     private Vector3f worldMax = new Vector3f(10000f, 10000f, 10000f);
+    /**
+     * physics time step (in seconds, &gt;0)
+     */
     private float accuracy = 1f / 60f;
-    private int maxSubSteps = 4, rayTestFlags = 1 << 2;
+    /**
+     * maximum number of physics steps per frame (&ge;0, default=4)
+     */
+    private int maxSubSteps = 4;
+    /**
+     * flags used in ray tests
+     */
+    private int rayTestFlags = 1 << 2;
+    /**
+     * copy of number of iterations used by the contact-and-constraint solver
+     * (default=10)
+     */
     private int solverNumIterations = 10;
 
     static {
@@ -112,9 +176,8 @@ public class PhysicsSpace {
     }
 
     /**
-     * Get the current PhysicsSpace <b>running on this thread</b><br/> For
-     * parallel physics, this can also be called from the OpenGL thread to
-     * receive the PhysicsSpace
+     * Access the PhysicsSpace <b>running on this thread</b>. For parallel
+     * physics, this can be invoked from the OpenGL thread.
      *
      * @return the PhysicsSpace running on this thread
      */
@@ -125,24 +188,47 @@ public class PhysicsSpace {
     /**
      * Used internally
      *
-     * @param space
+     * @param space which physics space to simulate on this thread
      */
     public static void setLocalThreadPhysicsSpace(PhysicsSpace space) {
         physicsSpaceTL.set(space);
     }
 
+    /**
+     * Instantiate a PhysicsSpace. Must be invoked on the designated physics
+     * thread.
+     */
     public PhysicsSpace() {
         this(new Vector3f(-10000f, -10000f, -10000f), new Vector3f(10000f, 10000f, 10000f), BroadphaseType.DBVT);
     }
 
+    /**
+     * Instantiate a PhysicsSpace. Must be invoked on the designated physics
+     * thread.
+     */
     public PhysicsSpace(BroadphaseType broadphaseType) {
         this(new Vector3f(-10000f, -10000f, -10000f), new Vector3f(10000f, 10000f, 10000f), broadphaseType);
     }
 
+    /**
+     * Instantiate a PhysicsSpace. Must be invoked on the designated physics
+     * thread.
+     */
     public PhysicsSpace(Vector3f worldMin, Vector3f worldMax) {
         this(worldMin, worldMax, BroadphaseType.AXIS_SWEEP_3);
     }
 
+    /**
+     * Instantiate a PhysicsSpace. Must be invoked on the designated physics
+     * thread.
+     *
+     * @param worldMin the desired minimum coordinates values (not null,
+     * unaffected, default=-10k,-10k,-10k)
+     * @param worldMax the desired minimum coordinates values (not null,
+     * unaffected, default=10k,10k,10k)
+     * @param broadphaseType which broadphase collision-detection algorithm to
+     * use (not null)
+     */
     public PhysicsSpace(Vector3f worldMin, Vector3f worldMax, BroadphaseType broadphaseType) {
         this.worldMin.set(worldMin);
         this.worldMax.set(worldMax);
@@ -151,7 +237,7 @@ public class PhysicsSpace {
     }
 
     /**
-     * Has to be called from the (designated) physics thread
+     * Must be invoked on the designated physics thread.
      */
     public void create() {
         physicsSpaceId = createPhysicsSpace(worldMin.x, worldMin.y, worldMin.z, worldMax.x, worldMax.y, worldMax.z, broadphaseType.ordinal(), false);
@@ -192,26 +278,37 @@ public class PhysicsSpace {
 
     private native long createPhysicsSpace(float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int broadphaseType, boolean threading);
 
+    /**
+     * Callback invoked just before the physics is stepped.
+     * <p>
+     * This method is invoked from native code.
+     *
+     * @param timeStep the time per physics step (in seconds, &ge;0)
+     */
     private void preTick_native(float f) {
-        AppTask task = pQueue.poll();
-        task = pQueue.poll();
-        while (task != null) {
-            while (task.isCancelled()) {
-                task = pQueue.poll();
-            }
-            try {
+        AppTask task;
+        while((task=pQueue.poll())!=null){
+            if(task.isCancelled())continue;
+            try{
                 task.invoke();
             } catch (Exception ex) {
                 logger.log(Level.SEVERE, null, ex);
             }
-            task = pQueue.poll();
         }
+
         for (Iterator<PhysicsTickListener> it = tickListeners.iterator(); it.hasNext();) {
             PhysicsTickListener physicsTickCallback = it.next();
             physicsTickCallback.prePhysicsTick(this, f);
         }
     }
 
+    /**
+     * Callback invoked just after the physics is stepped.
+     * <p>
+     * This method is invoked from native code.
+     *
+     * @param timeStep the time per physics step (in seconds, &ge;0)
+     */
     private void postTick_native(float f) {
         for (Iterator<PhysicsTickListener> it = tickListeners.iterator(); it.hasNext();) {
             PhysicsTickListener physicsTickCallback = it.next();
@@ -219,6 +316,9 @@ public class PhysicsSpace {
         }
     }
 
+    /**
+     * This method is invoked from native code.
+     */
     private void addCollision_native() {
     }
 
@@ -338,6 +438,9 @@ public class PhysicsSpace {
         collisionEvents.add(eventFactory.getEvent(PhysicsCollisionEvent.TYPE_PROCESSED, node, node1, manifoldPointObjectId));
     }
     
+    /**
+     * This method is invoked from native code.
+     */    
     private boolean notifyCollisionGroupListeners_native(PhysicsCollisionObject node, PhysicsCollisionObject node1){
         PhysicsCollisionGroupListener listener = collisionGroupListeners.get(node.getCollisionGroup());
         PhysicsCollisionGroupListener listener1 = collisionGroupListeners.get(node1.getCollisionGroup());
@@ -354,19 +457,21 @@ public class PhysicsSpace {
     }
 
     /**
-     * updates the physics space
+     * Update this space. Invoked (by the Bullet app state) once per frame while
+     * the app state is attached and enabled.
      *
-     * @param time the current time value
+     * @param time time-per-frame multiplied by speed (in seconds, &ge;0)
      */
     public void update(float time) {
         update(time, maxSubSteps);
     }
 
     /**
-     * updates the physics space, uses maxSteps<br>
+     * Simulate for the specified time interval, using no more than the
+     * specified number of steps.
      *
-     * @param time the current time value
-     * @param maxSteps
+     * @param time the time interval (in seconds, &ge;0)
+     * @param maxSteps the maximum number of steps (&ge;1)
      */
     public void update(float time, int maxSteps) {
 //        if (getDynamicsWorld() == null) {
@@ -378,6 +483,9 @@ public class PhysicsSpace {
 
     private native void stepSimulation(long space, float time, int maxSteps, float accuracy);
 
+    /**
+     * Distribute each collision event to all listeners.
+     */
     public void distributeEvents() {
         //add collision callbacks
         int clistsize = collisionListeners.size();
@@ -391,6 +499,13 @@ public class PhysicsSpace {
         }
     }
 
+    /**
+     * Enqueue a callable on the currently executing thread.
+     *
+     * @param <V> the task's result type
+     * @param callable the task to be executed
+     * @return a new task (not null)
+     */
     public static <V> Future<V> enqueueOnThisThread(Callable<V> callable) {
         AppTask<V> task = new AppTask<V>(callable);
         System.out.println("created apptask");
@@ -399,11 +514,11 @@ public class PhysicsSpace {
     }
 
     /**
-     * calls the callable on the next physics tick (ensuring e.g. force
-     * applying)
+     * Invoke the specified callable during the next physics tick. This is
+     * useful for applying forces.
      *
-     * @param <V>
-     * @param callable
+     * @param <V> the return type of the callable
+     * @param callable which callable to invoke
      * @return Future object
      */
     public <V> Future<V> enqueue(Callable<V> callable) {
@@ -413,9 +528,10 @@ public class PhysicsSpace {
     }
 
     /**
-     * adds an object to the physics space
+     * Add the specified object to this space.
      *
-     * @param obj the PhysicsControl or Spatial with PhysicsControl to add
+     * @param obj the PhysicsControl, Spatial-with-PhysicsControl,
+     * PhysicsCollisionObject, or PhysicsJoint to add (not null, modified)
      */
     public void add(Object obj) {
         if (obj instanceof PhysicsControl) {
@@ -436,6 +552,11 @@ public class PhysicsSpace {
         }
     }
 
+    /**
+     * Add the specified collision object to this space.
+     *
+     * @param obj the PhysicsCollisionObject to add (not null, modified)
+     */
     public void addCollisionObject(PhysicsCollisionObject obj) {
         if (obj instanceof PhysicsGhostObject) {
             addGhostObject((PhysicsGhostObject) obj);
@@ -449,9 +570,9 @@ public class PhysicsSpace {
     }
 
     /**
-     * removes an object from the physics space
+     * Remove the specified object from this space.
      *
-     * @param obj the PhysicsControl or Spatial with PhysicsControl to remove
+     * @param obj the PhysicsCollisionObject to add, or null (modified)
      */
     public void remove(Object obj) {
         if (obj == null) return;
@@ -473,6 +594,11 @@ public class PhysicsSpace {
         }
     }
 
+    /**
+     * Remove the specified collision object from this space.
+     *
+     * @param obj the PhysicsControl or Spatial with PhysicsControl to remove
+     */
     public void removeCollisionObject(PhysicsCollisionObject obj) {
         if (obj instanceof PhysicsGhostObject) {
             removeGhostObject((PhysicsGhostObject) obj);
@@ -484,9 +610,11 @@ public class PhysicsSpace {
     }
 
     /**
-     * adds all physics controls and joints in the given spatial node to the physics space
-     * (e.g. after loading from disk) - recursive if node
-     * @param spatial the rootnode containing the physics objects
+     * Add all collision objects and joints in the specified subtree of the
+     * scene graph to this space (e.g. after loading from disk). Note:
+     * recursive!
+     *
+     * @param spatial the root of the subtree (not null)
      */
     public void addAll(Spatial spatial) {
         add(spatial);
@@ -514,9 +642,11 @@ public class PhysicsSpace {
     }
 
     /**
-     * Removes all physics controls and joints in the given spatial from the physics space
-     * (e.g. before saving to disk) - recursive if node
-     * @param spatial the rootnode containing the physics objects
+     * Remove all physics controls and joints in the specified subtree of the
+     * scene graph from the physics space (e.g. before saving to disk) Note:
+     * recursive!
+     *
+     * @param spatial the root of the subtree (not null)
      */
     public void removeAll(Spatial spatial) {
         if (spatial.getControl(RigidBodyControl.class) != null) {
@@ -615,6 +745,12 @@ public class PhysicsSpace {
 //        dynamicsWorld.removeCollisionObject(node.getObjectId());
     }
 
+    /**
+     * NOTE: When a rigid body is added, its gravity gets set to that of the
+     * physics space.
+     *
+     * @param node the body to add (not null, not already in the space)
+     */
     private void addRigidBody(PhysicsRigidBody node) {
         if (physicsBodies.containsKey(node.getObjectId())) {
             logger.log(Level.WARNING, "RigidBody {0} already exists in PhysicsSpace, cannot add.", node);
@@ -623,7 +759,7 @@ public class PhysicsSpace {
         physicsBodies.put(node.getObjectId(), node);
 
         //Workaround
-        //It seems that adding a Kinematic RigidBody to the dynamicWorld prevent it from being non kinematic again afterward.
+        //It seems that adding a Kinematic RigidBody to the dynamicWorld prevents it from being non-kinematic again afterward.
         //so we add it non kinematic, then set it kinematic again.
         boolean kinematic = false;
         if (node.isKinematic()) {
@@ -637,9 +773,15 @@ public class PhysicsSpace {
 
         logger.log(Level.FINE, "Adding RigidBody {0} to physics space.", node.getObjectId());
         if (node instanceof PhysicsVehicle) {
-            logger.log(Level.FINE, "Adding vehicle constraint {0} to physics space.", Long.toHexString(((PhysicsVehicle) node).getVehicleId()));
-            physicsVehicles.put(((PhysicsVehicle) node).getVehicleId(), (PhysicsVehicle) node);
-            addVehicle(physicsSpaceId, ((PhysicsVehicle) node).getVehicleId());
+            PhysicsVehicle vehicle = (PhysicsVehicle) node;
+            vehicle.createVehicle(this);
+            long vehicleId = vehicle.getVehicleId();
+            assert vehicleId != 0L;
+            logger.log(Level.FINE,
+                    "Adding vehicle constraint {0} to physics space.",
+                    Long.toHexString(vehicleId));
+            physicsVehicles.put(vehicleId, vehicle);
+            addVehicle(physicsSpaceId, vehicleId);
         }
     }
 
@@ -680,30 +822,64 @@ public class PhysicsSpace {
 //        dynamicsWorld.removeConstraint(joint.getObjectId());
     }
 
+    /**
+     * Copy the list of rigid bodies that have been added to this space and not
+     * yet removed.
+     *
+     * @return a new list (not null)
+     */
     public Collection<PhysicsRigidBody> getRigidBodyList() {
         return new LinkedList<PhysicsRigidBody>(physicsBodies.values());
     }
 
+    /**
+     * Copy the list of ghost objects that have been added to this space and not
+     * yet removed.
+     *
+     * @return a new list (not null)
+     */
     public Collection<PhysicsGhostObject> getGhostObjectList() {
         return new LinkedList<PhysicsGhostObject>(physicsGhostObjects.values());
     }
 
+    /**
+     * Copy the list of physics characters that have been added to this space
+     * and not yet removed.
+     *
+     * @return a new list (not null)
+     */
     public Collection<PhysicsCharacter> getCharacterList() {
         return new LinkedList<PhysicsCharacter>(physicsCharacters.values());
     }
 
+    /**
+     * Copy the list of physics joints that have been added to this space and
+     * not yet removed.
+     *
+     * @return a new list (not null)
+     */
     public Collection<PhysicsJoint> getJointList() {
         return new LinkedList<PhysicsJoint>(physicsJoints.values());
     }
 
+    /**
+     * Copy the list of physics vehicles that have been added to this space and
+     * not yet removed.
+     *
+     * @return a new list (not null)
+     */
     public Collection<PhysicsVehicle> getVehicleList() {
         return new LinkedList<PhysicsVehicle>(physicsVehicles.values());
     }
 
     /**
-     * Sets the gravity of the PhysicsSpace, set before adding physics objects!
+     * Alter the gravitational acceleration acting on newly-added bodies.
+     * <p>
+     * Whenever a rigid body is added to a space, the body's gravity gets set to
+     * that of the space. Thus it makes sense to set the space's vector before
+     * adding any bodies to the space.
      *
-     * @param gravity
+     * @param gravity the desired acceleration vector (not null, unaffected)
      */
     public void setGravity(Vector3f gravity) {
         this.gravity.set(gravity);
@@ -712,8 +888,17 @@ public class PhysicsSpace {
 
     private native void setGravity(long spaceId, Vector3f gravity);
 
-    //TODO: getGravity
+    /**
+     * copy of gravity-acceleration vector (default is 9.81 in the -Y direction,
+     * corresponding to Earth-normal in MKS units)
+     */
     private final Vector3f gravity = new Vector3f(0,-9.81f,0);
+    /**
+     * Copy the gravitational acceleration acting on newly-added bodies.
+     *
+     * @param gravity storage for the result (not null, modified)
+     * @return acceleration (in the vector provided)
+     */
     public Vector3f getGravity(Vector3f gravity) {
         return gravity.set(this.gravity);
     }
@@ -733,57 +918,89 @@ public class PhysicsSpace {
 //    }
 //
     /**
-     * Adds the specified listener to the physics tick listeners. The listeners
-     * are called on each physics step, which is not necessarily each frame but
-     * is determined by the accuracy of the physics space.
+     * Register the specified tick listener with this space.
+     * <p>
+     * Tick listeners are notified before and after each physics step. A physics
+     * step is not necessarily the same as a frame; it is more influenced by the
+     * accuracy of the physics space.
+     *
+     * @see #setAccuracy(float)
      *
-     * @param listener
+     * @param listener the listener to register (not null)
      */
     public void addTickListener(PhysicsTickListener listener) {
         tickListeners.add(listener);
     }
 
+    /**
+     * De-register the specified tick listener.
+     *
+     * @see #addTickListener(com.jme3.bullet.PhysicsTickListener)
+     * @param listener the listener to de-register (not null)
+     */
     public void removeTickListener(PhysicsTickListener listener) {
         tickListeners.remove(listener);
     }
 
     /**
-     * Adds a CollisionListener that will be informed about collision events
+     * Register the specified collision listener with this space.
+     * <p>
+     * Collision listeners are notified when collisions occur in the space.
      *
-     * @param listener the CollisionListener to add
+     * @param listener the listener to register (not null, alias created)
      */
     public void addCollisionListener(PhysicsCollisionListener listener) {
         collisionListeners.add(listener);
     }
 
     /**
-     * Removes a CollisionListener from the list
+     * De-register the specified collision listener.
      *
-     * @param listener the CollisionListener to remove
+     * @see
+     * #addCollisionListener(com.jme3.bullet.collision.PhysicsCollisionListener)
+     * @param listener the listener to de-register (not null)
      */
     public void removeCollisionListener(PhysicsCollisionListener listener) {
         collisionListeners.remove(listener);
     }
 
     /**
-     * Adds a listener for a specific collision group, such a listener can
-     * disable collisions when they happen.<br> There can be only one listener
-     * per collision group.
+     * Register the specified collision-group listener with the specified
+     * collision group of this space.
+     * <p>
+     * Such a listener can disable collisions when they occur. There can be only
+     * one listener per collision group per space.
      *
-     * @param listener
-     * @param collisionGroup
+     * @param listener the listener to register (not null)
+     * @param collisionGroup which group it should listen for (bit mask with
+     * exactly one bit set)
      */
     public void addCollisionGroupListener(PhysicsCollisionGroupListener listener, int collisionGroup) {
         collisionGroupListeners.put(collisionGroup, listener);
     }
 
+    /**
+     * De-register the specified collision-group listener.
+     *
+     * @see
+     * #addCollisionGroupListener(com.jme3.bullet.collision.PhysicsCollisionGroupListener,
+     * int)
+     * @param collisionGroup the group of the listener to de-register (bit mask
+     * with exactly one bit set)
+     */
     public void removeCollisionGroupListener(int collisionGroup) {
         collisionGroupListeners.remove(collisionGroup);
     }
     
     /**
-     * Performs a ray collision test and returns the results as a list of
-     * PhysicsRayTestResults ordered by it hitFraction (lower to higher)
+     * Perform a ray-collision test and return the results as a list of
+     * PhysicsRayTestResults sorted by ascending hitFraction.
+     *
+     * @param from the starting location (physics-space coordinates, not null,
+     * unaffected)
+     * @param to the ending location (in physics-space coordinates, not null,
+     * unaffected)
+     * @return a new list of results (not null)
      */
     public List rayTest(Vector3f from, Vector3f to) {
         List<PhysicsRayTestResult> results = new ArrayList<PhysicsRayTestResult>();
@@ -793,8 +1010,14 @@ public class PhysicsSpace {
     }
     
     /**
-     * Performs a ray collision test and returns the results as a list of
-     * PhysicsRayTestResults without performing any sort operation
+     * Perform a ray-collision test and return the results as a list of
+     * PhysicsRayTestResults in arbitrary order.
+     *
+     * @param from the starting location (in physics-space coordinates, not
+     * null, unaffected)
+     * @param to the ending location (in physics-space coordinates, not null,
+     * unaffected)
+     * @return a new list of results (not null)
      */
     public List rayTestRaw(Vector3f from, Vector3f to) {
         List<PhysicsRayTestResult> results = new ArrayList<PhysicsRayTestResult>();
@@ -804,17 +1027,22 @@ public class PhysicsSpace {
     }
 
     /**
-     * Sets m_flags for raytest, see https://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
+     * Alters the m_flags used in ray tests. see
+     * https://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
      * for possible options. Defaults to using the faster, approximate raytest.
+     *
+     * @param flags the desired flags, ORed together (default=0x4)
      */
     public void SetRayTestFlags(int flags) {
         rayTestFlags = flags;
     }
 
     /**
-     * Gets m_flags for raytest, see https://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
+     * Reads m_flags used in ray tests. see
+     * https://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
      * for possible options.
-     * @return rayTestFlags
+     *
+     * @return which flags are used
      */
     public int GetRayTestFlags() {
         return rayTestFlags;
@@ -829,8 +1057,15 @@ public class PhysicsSpace {
     };
     
     /**
-     * Performs a ray collision test and returns the results as a list of
-     * PhysicsRayTestResults ordered by it hitFraction (lower to higher)
+     * Perform a ray-collision test and return the results as a list of
+     * PhysicsRayTestResults sorted by ascending hitFraction.
+     *
+     * @param from coordinates of the starting location (in physics space, not
+     * null, unaffected)
+     * @param to coordinates of the ending location (in physics space, not null,
+     * unaffected)
+     * @param results the list to hold results (not null, modified)
+     * @return results
      */
     public List<PhysicsRayTestResult> rayTest(Vector3f from, Vector3f to, List<PhysicsRayTestResult> results) {
         results.clear();
@@ -841,8 +1076,15 @@ public class PhysicsSpace {
     }
     
     /**
-     * Performs a ray collision test and returns the results as a list of
-     * PhysicsRayTestResults without performing any sort operation
+     * Perform a ray-collision test and return the results as a list of
+     * PhysicsRayTestResults in arbitrary order.
+     *
+     * @param from coordinates of the starting location (in physics space, not
+     * null, unaffected)
+     * @param to coordinates of the ending location (in physics space, not null,
+     * unaffected)
+     * @param results the list to hold results (not null, modified)
+     * @return results
      */
     public List<PhysicsRayTestResult> rayTestRaw(Vector3f from, Vector3f to, List<PhysicsRayTestResult> results) {
         results.clear();
@@ -872,11 +1114,18 @@ public class PhysicsSpace {
 
 
     /**
-     * Performs a sweep collision test and returns the results as a list of
-     * PhysicsSweepTestResults<br/> You have to use different Transforms for
-     * start and end (at least distance > 0.4f). SweepTest will not see a
-     * collision if it starts INSIDE an object and is moving AWAY from its
-     * center.
+     * Perform a sweep-collision test and return the results as a new list.
+     * <p>
+     * The starting and ending locations must be at least 0.4f physics-space
+     * units apart.
+     * <p>
+     * A sweep test will miss a collision if it starts inside an object and
+     * sweeps away from the object's center.
+     *
+     * @param shape the shape to sweep (not null)
+     * @param start the starting physics-space transform (not null)
+     * @param end the ending physics-space transform (not null)
+     * @return a new list of results
      */
     public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end) {
         List results = new LinkedList();
@@ -884,17 +1133,41 @@ public class PhysicsSpace {
         return (List<PhysicsSweepTestResult>) results;
     }
 
+    /**
+     * Perform a sweep-collision test and store the results in an existing list.
+     * <p>
+     * The starting and ending locations must be at least 0.4f physics-space
+     * units apart.
+     * <p>
+     * A sweep test will miss a collision if it starts inside an object and
+     * sweeps away from the object's center.
+     *
+     * @param shape the shape to sweep (not null)
+     * @param start the starting physics-space transform (not null)
+     * @param end the ending physics-space transform (not null)
+     * @param results the list to hold results (not null, modified)
+     * @return results
+     */    
     public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, List<PhysicsSweepTestResult> results) {
         return sweepTest(shape, start, end, results, 0.0f);
     }
 
     public native void sweepTest_native(long shape, Transform from, Transform to, long physicsSpaceId, List<PhysicsSweepTestResult> results, float allowedCcdPenetration);
     /**
-     * Performs a sweep collision test and returns the results as a list of
-     * PhysicsSweepTestResults<br/> You have to use different Transforms for
-     * start and end (at least distance > allowedCcdPenetration). SweepTest will not see a
-     * collision if it starts INSIDE an object and is moving AWAY from its
-     * center.
+     * Perform a sweep-collision test and store the results in an existing list.
+     * <p>
+     * The starting and ending locations must be at least 0.4f physics-space
+     * units apart.
+     * <p>
+     * A sweep test will miss a collision if it starts inside an object and
+     * sweeps away from the object's center.
+     *
+     * @param shape the shape to sweep (not null)
+     * @param start the starting physics-space transform (not null)
+     * @param end the ending physics-space transform (not null)
+     * @param results the list to hold results (not null, modified)
+     * @param allowedCcdPenetration true&rarr;allow, false&rarr;disallow
+     * @return results
      */
     public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, List<PhysicsSweepTestResult> results, float allowedCcdPenetration ) {
         results.clear();
@@ -921,7 +1194,7 @@ public class PhysicsSpace {
     */
     
     /**
-     * destroys the current PhysicsSpace so that a new one can be created
+     * Destroy this space so that a new one can be instantiated.
      */
     public void destroy() {
         physicsBodies.clear();
@@ -940,59 +1213,87 @@ public class PhysicsSpace {
         return physicsSpaceId;
     }
 
+    /**
+     * Read the type of acceleration structure used.
+     *
+     * @return an enum value (not null)
+     */
     public BroadphaseType getBroadphaseType() {
         return broadphaseType;
     }
 
+    /**
+     * Alter the type of acceleration structure used.
+     * 
+     * @param broadphaseType the desired algorithm (not null)
+     */
     public void setBroadphaseType(BroadphaseType broadphaseType) {
         this.broadphaseType = broadphaseType;
     }
 
     /**
-     * Sets the maximum amount of extra steps that will be used to step the
-     * physics when the fps is below the physics fps. Doing this maintains
-     * determinism in physics. For example a maximum number of 2 can compensate
-     * for framerates as low as 30fps when the physics has the default accuracy
-     * of 60 fps. Note that setting this value too high can make the physics
-     * drive down its own fps in case it's overloaded.
+     * Alter the maximum number of physics steps per frame.
+     * <p>
+     * Extra physics steps help maintain determinism when the render fps drops
+     * below 1/accuracy. For example a value of 2 can compensate for frame rates
+     * as low as 30fps, assuming the physics has an accuracy of 1/60 sec.
+     * <p>
+     * Setting this value too high can depress the frame rate.
      *
-     * @param steps The maximum number of extra steps, default is 4.
+     * @param steps the desired maximum number of steps per frame (&ge;1,
+     * default=4)
      */
     public void setMaxSubSteps(int steps) {
         maxSubSteps = steps;
     }
 
     /**
-     * get the current accuracy of the physics computation
+     * Read the accuracy (time step) of the physics simulation.
      *
-     * @return the current accuracy
+     * @return the timestep (in seconds, &gt;0)
      */
     public float getAccuracy() {
         return accuracy;
     }
 
     /**
-     * sets the accuracy of the physics computation, default=1/60s<br>
+     * Alter the accuracy (time step) of the physics simulation.
+     * <p>
+     * In general, the smaller the time step, the more accurate (and
+     * compute-intensive) the simulation will be. Bullet works best with a
+     * time step of no more than 1/60 second.
      *
-     * @param accuracy
+     * @param accuracy the desired time step (in seconds, &gt;0, default=1/60)
      */
     public void setAccuracy(float accuracy) {
         this.accuracy = accuracy;
     }
 
+    /**
+     * Access the minimum coordinate values for this space.
+     *
+     * @return the pre-existing vector
+     */
     public Vector3f getWorldMin() {
         return worldMin;
     }
 
     /**
-     * only applies for AXIS_SWEEP broadphase
+     * Alter the minimum coordinate values for this space. (only affects
+     * AXIS_SWEEP broadphase algorithms)
      *
-     * @param worldMin
+     * @param worldMin the desired minimum coordinate values (not null,
+     * unaffected)
      */
     public void setWorldMin(Vector3f worldMin) {
         this.worldMin.set(worldMin);
     }
 
+    /**
+     * Access the maximum coordinate values for this space.
+     *
+     * @return the pre-existing vector (not null)
+     */
     public Vector3f getWorldMax() {
         return worldMax;
     }
@@ -1007,11 +1308,11 @@ public class PhysicsSpace {
     }
 
     /**
-     * Set the number of iterations used by the contact solver.
-     * 
-     * The default is 10. Use 4 for low quality, 20 for high quality.
-     * 
-     * @param numIterations The number of iterations used by the contact & constraint solver.
+     * Alter the number of iterations used by the contact-and-constraint solver.
+     * <p>
+     * Use 4 for low quality, 20 for high quality.
+     *
+     * @param numIterations the desired number of iterations (&ge;1, default=10)
      */
     public void setSolverNumIterations(int numIterations) {
         this.solverNumIterations = numIterations;
@@ -1019,9 +1320,9 @@ public class PhysicsSpace {
     }
     
     /**
-     * Get the number of iterations used by the contact solver.
-     * 
-     * @return The number of iterations used by the contact & constraint solver.
+     * Read the number of iterations used by the contact-and-constraint solver.
+     *
+     * @return the number of iterations used
      */
     public int getSolverNumIterations() {
         return solverNumIterations;
@@ -1032,28 +1333,40 @@ public class PhysicsSpace {
     public static native void initNativePhysics();
 
     /**
-     * interface with Broadphase types
+     * Enumerate the available acceleration structures for broadphase collision
+     * detection.
      */
     public enum BroadphaseType {
 
         /**
-         * basic Broadphase
+         * btSimpleBroadphase: a brute-force reference implementation for
+         * debugging purposes
          */
         SIMPLE,
         /**
-         * better Broadphase, needs worldBounds , max Object number = 16384
+         * btAxisSweep3: uses incremental 3-D sweep and prune, requires world
+         * bounds, limited to 16_384 objects
          */
         AXIS_SWEEP_3,
         /**
-         * better Broadphase, needs worldBounds , max Object number = 65536
+         * bt32BitAxisSweep3: uses incremental 3-D sweep and prune, requires
+         * world bounds, limited to 65_536 objects
          */
         AXIS_SWEEP_3_32,
         /**
-         * Broadphase allowing quicker adding/removing of physics objects
+         * btDbvtBroadphase: uses a fast, dynamic bounding-volume hierarchy
+         * based on AABB tree to allow quicker addition/removal of physics
+         * objects
          */
         DBVT;
     }
 
+    /**
+     * Finalize this physics space just before it is destroyed. Should be
+     * invoked only by a subclass or by the garbage collector.
+     *
+     * @throws Throwable ignored by the garbage collector
+     */
     @Override
     protected void finalize() throws Throwable {
         super.finalize();

+ 202 - 9
jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionEvent.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,21 +36,53 @@ import com.jme3.scene.Spatial;
 import java.util.EventObject;
 
 /**
- * A CollisionEvent stores all information about a collision in the PhysicsWorld.
- * Do not store this Object, as it will be reused after the collision() method has been called.
- * Get/reference all data you need in the collide method.
+ * Describe a collision in the physics world.
+ * <p>
+ * Do not retain this object, as it will be reused after the collision() method
+ * returns. Copy any data you need during the collide() method.
+ *
  * @author normenhansen
  */
 public class PhysicsCollisionEvent extends EventObject {
 
+    /**
+     * type value to indicate a new event
+     */
     public static final int TYPE_ADDED = 0;
+    /**
+     * type value to indicate an event that has been added to a PhysicsSpace
+     * queue
+     */
     public static final int TYPE_PROCESSED = 1;
+    /**
+     * type value to indicate a cleaned/destroyed event
+     */
     public static final int TYPE_DESTROYED = 2;
+    /**
+     * type value that indicates the event's status
+     */
     private int type;
+    /**
+     * 1st involved object
+     */
     private PhysicsCollisionObject nodeA;
+    /**
+     * 2nd involved object
+     */
     private PhysicsCollisionObject nodeB;
+    /**
+     * Bullet identifier of the btManifoldPoint
+     */
     private long manifoldPointObjectId = 0;
 
+    /**
+     * Instantiate a collision event.
+     *
+     * @param type event type (0=added/1=processed/2=destroyed)
+     * @param nodeA 1st involved object (alias created)
+     * @param nodeB 2nd involved object (alias created)
+     * @param manifoldPointObjectId Bullet identifier of the btManifoldPoint
+     */
     public PhysicsCollisionEvent(int type, PhysicsCollisionObject nodeA, PhysicsCollisionObject nodeB, long manifoldPointObjectId) {
         super(nodeA);
         this.type = type;
@@ -58,9 +90,9 @@ public class PhysicsCollisionEvent extends EventObject {
         this.nodeB = nodeB;
         this.manifoldPointObjectId = manifoldPointObjectId;
     }
-    
+
     /**
-     * used by event factory, called when event is destroyed
+     * Destroy this event.
      */
     public void clean() {
         source = null;
@@ -71,7 +103,12 @@ public class PhysicsCollisionEvent extends EventObject {
     }
 
     /**
-     * used by event factory, called when event reused
+     * Reuse this event.
+     *
+     * @param type event type (added/processed/destroyed)
+     * @param source 1st involved object (alias created)
+     * @param nodeB 2nd involved object (alias created)
+     * @param manifoldPointObjectId Bullet identifier
      */
     public void refactor(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, long manifoldPointObjectId) {
         this.source = source;
@@ -81,12 +118,19 @@ public class PhysicsCollisionEvent extends EventObject {
         this.manifoldPointObjectId = manifoldPointObjectId;
     }
 
+    /**
+     * Read the type of event.
+     *
+     * @return added/processed/destroyed
+     */
     public int getType() {
         return type;
     }
 
     /**
-     * @return A Spatial if the UserObject of the PhysicsCollisionObject is a Spatial
+     * Access the user object of collision object A, provided it's a Spatial.
+     *
+     * @return the pre-existing Spatial, or null if none
      */
     public Spatial getNodeA() {
         if (nodeA.getUserObject() instanceof Spatial) {
@@ -96,7 +140,9 @@ public class PhysicsCollisionEvent extends EventObject {
     }
 
     /**
-     * @return A Spatial if the UserObject of the PhysicsCollisionObject is a Spatial
+     * Access the user object of collision object B, provided it's a Spatial.
+     *
+     * @return the pre-existing Spatial, or null if none
      */
     public Spatial getNodeB() {
         if (nodeB.getUserObject() instanceof Spatial) {
@@ -105,139 +151,286 @@ public class PhysicsCollisionEvent extends EventObject {
         return null;
     }
 
+    /**
+     * Access collision object A.
+     *
+     * @return the pre-existing object (not null)
+     */
     public PhysicsCollisionObject getObjectA() {
         return nodeA;
     }
 
+    /**
+     * Access collision object B.
+     *
+     * @return the pre-existing object (not null)
+     */
     public PhysicsCollisionObject getObjectB() {
         return nodeB;
     }
 
+    /**
+     * Read the collision's applied impulse.
+     *
+     * @return impulse
+     */
     public float getAppliedImpulse() {
         return getAppliedImpulse(manifoldPointObjectId);
     }
     private native float getAppliedImpulse(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's applied lateral impulse #1.
+     *
+     * @return impulse
+     */
     public float getAppliedImpulseLateral1() {
         return getAppliedImpulseLateral1(manifoldPointObjectId);
     }
     private native float getAppliedImpulseLateral1(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's applied lateral impulse #2.
+     *
+     * @return impulse
+     */
     public float getAppliedImpulseLateral2() {
         return getAppliedImpulseLateral2(manifoldPointObjectId);
     }
     private native float getAppliedImpulseLateral2(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's combined friction.
+     *
+     * @return friction
+     */
     public float getCombinedFriction() {
         return getCombinedFriction(manifoldPointObjectId);
     }
     private native float getCombinedFriction(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's combined restitution.
+     *
+     * @return restitution
+     */
     public float getCombinedRestitution() {
         return getCombinedRestitution(manifoldPointObjectId);
     }
     private native float getCombinedRestitution(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's distance #1.
+     *
+     * @return distance
+     */
     public float getDistance1() {
         return getDistance1(manifoldPointObjectId);
     }
     private native float getDistance1(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's index 0.
+     *
+     * @return index
+     */
     public int getIndex0() {
         return getIndex0(manifoldPointObjectId);
     }
     private native int getIndex0(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's index 1.
+     *
+     * @return index
+     */
     public int getIndex1() {
         return getIndex1(manifoldPointObjectId);
     }
     private native int getIndex1(long manifoldPointObjectId);
 
+    /**
+     * Copy the collision's lateral friction direction #1.
+     *
+     * @return a new vector (not null)
+     */
     public Vector3f getLateralFrictionDir1() {
         return getLateralFrictionDir1(new Vector3f());
     }
 
+    /**
+     * Copy the collision's lateral friction direction #1.
+     *
+     * @param lateralFrictionDir1 storage for the result (not null, modified)
+     * @return direction vector (not null)
+     */
     public Vector3f getLateralFrictionDir1(Vector3f lateralFrictionDir1) {
         getLateralFrictionDir1(manifoldPointObjectId, lateralFrictionDir1);
         return lateralFrictionDir1;
     }
     private native void getLateralFrictionDir1(long manifoldPointObjectId, Vector3f lateralFrictionDir1);
 
+    /**
+     * Copy the collision's lateral friction direction #2.
+     *
+     * @return a new vector
+     */
     public Vector3f getLateralFrictionDir2() {
         return getLateralFrictionDir2(new Vector3f());
     }
 
+    /**
+     * Copy the collision's lateral friction direction #2.
+     *
+     * @param lateralFrictionDir2 storage for the result (not null, modified)
+     * @return direction vector (not null)
+     */
     public Vector3f getLateralFrictionDir2(Vector3f lateralFrictionDir2) {
         getLateralFrictionDir2(manifoldPointObjectId, lateralFrictionDir2);
         return lateralFrictionDir2;
     }
     private native void getLateralFrictionDir2(long manifoldPointObjectId, Vector3f lateralFrictionDir2);
 
+    /**
+     * Test whether the collision's lateral friction is initialized.
+     *
+     * @return true if initialized, otherwise false
+     */
     public boolean isLateralFrictionInitialized() {
         return isLateralFrictionInitialized(manifoldPointObjectId);
     }
     private native boolean isLateralFrictionInitialized(long manifoldPointObjectId);
 
+    /**
+     * Read the collision's lifetime.
+     *
+     * @return lifetime
+     */
     public int getLifeTime() {
         return getLifeTime(manifoldPointObjectId);
     }
     private native int getLifeTime(long manifoldPointObjectId);
 
+    /**
+     * Copy the collision's location in the local coordinates of object A.
+     *
+     * @return a new location vector (in local coordinates, not null)
+     */
     public Vector3f getLocalPointA() {
         return getLocalPointA(new Vector3f());
     }
     
+    /**
+     * Copy the collision's location in the local coordinates of object A.
+     *
+     * @param localPointA storage for the result (not null, modified)
+     * @return a location vector (in local coordinates, not null)
+     */
     public Vector3f getLocalPointA(Vector3f localPointA) {
         getLocalPointA(manifoldPointObjectId, localPointA);
         return localPointA;
     }
     private native void getLocalPointA(long manifoldPointObjectId, Vector3f localPointA);
 
+    /**
+     * Copy the collision's location in the local coordinates of object B.
+     *
+     * @return a new location vector (in local coordinates, not null)
+     */
     public Vector3f getLocalPointB() {
         return getLocalPointB(new Vector3f());
     }
     
+    /**
+     * Copy the collision's location in the local coordinates of object B.
+     *
+     * @param localPointB storage for the result (not null, modified)
+     * @return a location vector (in local coordinates, not null)
+     */
     public Vector3f getLocalPointB(Vector3f localPointB) {
         getLocalPointB(manifoldPointObjectId, localPointB);
         return localPointB;
     }
     private native void getLocalPointB(long manifoldPointObjectId, Vector3f localPointB);
 
+    /**
+     * Copy the collision's normal on object B.
+     *
+     * @return a new normal vector (in physics-space coordinates, not null)
+     */
     public Vector3f getNormalWorldOnB() {
         return getNormalWorldOnB(new Vector3f());
     }
 
+    /**
+     * Copy the collision's normal on object B.
+     *
+     * @param normalWorldOnB storage for the result (not null, modified)
+     * @return a normal vector (in physics-space coordinates, not null)
+     */
     public Vector3f getNormalWorldOnB(Vector3f normalWorldOnB) {
         getNormalWorldOnB(manifoldPointObjectId, normalWorldOnB);
         return normalWorldOnB;
     }
     private native void getNormalWorldOnB(long manifoldPointObjectId, Vector3f normalWorldOnB);
 
+    /**
+     * Read part identifier 0.
+     *
+     * @return identifier
+     */
     public int getPartId0() {
         return getPartId0(manifoldPointObjectId);
     }
     private native int getPartId0(long manifoldPointObjectId);
 
+    /**
+     * Read part identifier 1.
+     *
+     * @return identifier
+     */
     public int getPartId1() {
         return getPartId1(manifoldPointObjectId);
     }
 
     private native int getPartId1(long manifoldPointObjectId);
 
+    /**
+     * Copy the collision's location.
+     *
+     * @return a new vector (in physics-space coordinates, not null)
+     */
     public Vector3f getPositionWorldOnA() {
         return getPositionWorldOnA(new Vector3f());
     }
 
+    /**
+     * Copy the collision's location.
+     *
+     * @param positionWorldOnA storage for the result (not null, modified)
+     * @return a location vector (in physics-space coordinates, not null)
+     */
     public Vector3f getPositionWorldOnA(Vector3f positionWorldOnA) {
         getPositionWorldOnA(manifoldPointObjectId, positionWorldOnA);
         return positionWorldOnA;
     }
     private native void getPositionWorldOnA(long manifoldPointObjectId, Vector3f positionWorldOnA);
 
+    /**
+     * Copy the collision's location.
+     *
+     * @return a new location vector (in physics-space coordinates, not null)
+     */
     public Vector3f getPositionWorldOnB() {
         return getPositionWorldOnB(new Vector3f());
     }
 
+    /**
+     * Copy the collision's location.
+     *
+     * @param positionWorldOnB storage for the result (not null, modified)
+     * @return a location vector (in physics-space coordinates, not null)
+     */
     public Vector3f getPositionWorldOnB(Vector3f positionWorldOnB) {
         getPositionWorldOnB(manifoldPointObjectId, positionWorldOnB);
         return positionWorldOnB;

+ 10 - 0
jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionEventFactory.java

@@ -41,6 +41,11 @@ public class PhysicsCollisionEventFactory {
 
     private ConcurrentLinkedQueue<PhysicsCollisionEvent> eventBuffer = new ConcurrentLinkedQueue<PhysicsCollisionEvent>();
 
+    /**
+     * Obtain an unused event.
+     * 
+     * @return an event (not null)
+     */
     public PhysicsCollisionEvent getEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, long manifoldPointObjectId) {
         PhysicsCollisionEvent event = eventBuffer.poll();
         if (event == null) {
@@ -51,6 +56,11 @@ public class PhysicsCollisionEventFactory {
         return event;
     }
 
+    /**
+     * Recycle the specified event.
+     * 
+     * @param event 
+     */
     public void recycle(PhysicsCollisionEvent event) {
         event.clean();
         eventBuffer.add(event);

+ 158 - 28
jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java

@@ -38,67 +38,147 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Base class for collision objects (PhysicsRigidBody, PhysicsGhostObject)
+ * The abstract base class for collision objects based on Bullet's
+ * btCollisionObject.
+ * <p>
+ * Collision objects include PhysicsCharacter, PhysicsRigidBody, and
+ * PhysicsGhostObject.
+ *
  * @author normenhansen
  */
 public abstract class PhysicsCollisionObject implements Savable {
 
+    /**
+     * Unique identifier of the btCollisionObject. Constructors are responsible
+     * for setting this to a non-zero value. The id might change if the object
+     * gets rebuilt.
+     */
     protected long objectId = 0;
+    /**
+     * shape associated with this object (not null)
+     */
     protected CollisionShape collisionShape;
+    /**
+     * collideWithGroups bitmask that represents "no groups"
+     */
     public static final int COLLISION_GROUP_NONE = 0x00000000;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #1
+     */
     public static final int COLLISION_GROUP_01 = 0x00000001;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #2
+     */
     public static final int COLLISION_GROUP_02 = 0x00000002;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #3
+     */
     public static final int COLLISION_GROUP_03 = 0x00000004;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #4
+     */
     public static final int COLLISION_GROUP_04 = 0x00000008;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #5
+     */
     public static final int COLLISION_GROUP_05 = 0x00000010;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #6
+     */
     public static final int COLLISION_GROUP_06 = 0x00000020;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #7
+     */
     public static final int COLLISION_GROUP_07 = 0x00000040;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #8
+     */
     public static final int COLLISION_GROUP_08 = 0x00000080;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #9
+     */
     public static final int COLLISION_GROUP_09 = 0x00000100;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #10
+     */
     public static final int COLLISION_GROUP_10 = 0x00000200;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #11
+     */
     public static final int COLLISION_GROUP_11 = 0x00000400;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #12
+     */
     public static final int COLLISION_GROUP_12 = 0x00000800;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #13
+     */
     public static final int COLLISION_GROUP_13 = 0x00001000;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #14
+     */
     public static final int COLLISION_GROUP_14 = 0x00002000;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #15
+     */
     public static final int COLLISION_GROUP_15 = 0x00004000;
+    /**
+     * collisionGroup/collideWithGroups bitmask that represents group #16
+     */
     public static final int COLLISION_GROUP_16 = 0x00008000;
+    /**
+     * collision group to which this physics object belongs (default=group #1)
+     */
     protected int collisionGroup = 0x00000001;
+    /**
+     * collision groups with which this object can collide (default=only group
+     * #1)
+     */
     protected int collisionGroupsMask = 0x00000001;
     private Object userObject;
 
     /**
-     * Sets a CollisionShape to this physics object, note that the object should
-     * not be in the physics space when adding a new collision shape as it is rebuilt
-     * on the physics side.
-     * @param collisionShape the CollisionShape to set
+     * Apply the specified CollisionShape to this object. Note that the object
+     * should not be in any physics space while changing shape; the object gets
+     * rebuilt on the physics side.
+     *
+     * @param collisionShape the shape to apply (not null, alias created)
      */
     public void setCollisionShape(CollisionShape collisionShape) {
         this.collisionShape = collisionShape;
     }
 
     /**
-     * @return the CollisionShape of this PhysicsNode, to be able to reuse it with
-     * other physics nodes (increases performance)
+     * Access the shape of this physics object.
+     *
+     * @return the pre-existing instance, which can then be applied to other
+     * physics objects (increases performance)
      */
     public CollisionShape getCollisionShape() {
         return collisionShape;
     }
 
     /**
-     * Returns the collision group for this collision shape
-     * @return The collision group
+     * Read the collision group for this physics object.
+     *
+     * @return the collision group (bit mask with exactly one bit set)
      */
     public int getCollisionGroup() {
         return collisionGroup;
     }
 
     /**
-     * Sets the collision group number for this physics object. <br>
-     * The groups are integer bit masks and some pre-made variables are available in CollisionObject.
-     * All physics objects are by default in COLLISION_GROUP_01.<br>
-     * Two object will collide when <b>one</b> of the parties has the
-     * collisionGroup of the other in its collideWithGroups set.
-     * @param collisionGroup the collisionGroup to set
+     * Alter the collision group for this physics object.
+     * <p>
+     * Groups are represented by integer bit masks with exactly 1 bit set.
+     * Pre-made variables are available in PhysicsCollisionObject. By default,
+     * physics objects are in COLLISION_GROUP_01.
+     * <p>
+     * Two objects can collide only if one of them has the collisionGroup of the
+     * other in its collideWithGroups set.
+     *
+     * @param collisionGroup the collisionGroup to apply (bit mask with exactly
+     * 1 bit set)
      */
     public void setCollisionGroup(int collisionGroup) {
         this.collisionGroup = collisionGroup;
@@ -108,10 +188,12 @@ public abstract class PhysicsCollisionObject implements Savable {
     }
 
     /**
-     * Add a group that this object will collide with.<br>
-     * Two object will collide when <b>one</b> of the parties has the
-     * collisionGroup of the other in its collideWithGroups set.<br>
-     * @param collisionGroup
+     * Add collision groups to the set with which this object can collide.
+     *
+     * Two objects can collide only if one of them has the collisionGroup of the
+     * other in its collideWithGroups set.
+     *
+     * @param collisionGroup groups to add (bit mask)
      */
     public void addCollideWithGroup(int collisionGroup) {
         this.collisionGroupsMask = this.collisionGroupsMask | collisionGroup;
@@ -121,8 +203,9 @@ public abstract class PhysicsCollisionObject implements Savable {
     }
 
     /**
-     * Remove a group from the list this object collides with.
-     * @param collisionGroup
+     * Remove collision groups from the set with which this object can collide.
+     *
+     * @param collisionGroup groups to remove, ORed together (bit mask)
      */
     public void removeCollideWithGroup(int collisionGroup) {
         this.collisionGroupsMask = this.collisionGroupsMask & ~collisionGroup;
@@ -132,8 +215,9 @@ public abstract class PhysicsCollisionObject implements Savable {
     }
 
     /**
-     * Directly set the bitmask for collision groups that this object collides with.
-     * @param collisionGroups
+     * Directly alter the collision groups with which this object can collide.
+     *
+     * @param collisionGroups desired groups, ORed together (bit mask)
      */
     public void setCollideWithGroups(int collisionGroups) {
         this.collisionGroupsMask = collisionGroups;
@@ -143,13 +227,18 @@ public abstract class PhysicsCollisionObject implements Savable {
     }
 
     /**
-     * Gets the bitmask of collision groups that this object collides with.
-     * @return Collision groups mask
+     * Read the set of collision groups with which this object can collide.
+     *
+     * @return bit mask
      */
     public int getCollideWithGroups() {
         return collisionGroupsMask;
     }
 
+    /**
+     * Initialize the user pointer and collision-group information of this
+     * object.
+     */
     protected void initUserPointer() {
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "initUserPointer() objectId = {0}", Long.toHexString(objectId));
         initUserPointer(objectId, collisionGroup, collisionGroupsMask);
@@ -157,27 +246,51 @@ public abstract class PhysicsCollisionObject implements Savable {
     native void initUserPointer(long objectId, int group, int groups);
 
     /**
-     * @return the userObject
+     * Access the user object associated with this collision object.
+     *
+     * @return the pre-existing instance, or null if none
      */
     public Object getUserObject() {
         return userObject;
     }
 
     /**
-     * @param userObject the userObject to set
+     * Associate a user object (such as a Spatial) with this collision object.
+     *
+     * @param userObject the object to associate with this collision object
+     * (alias created, may be null)
      */
     public void setUserObject(Object userObject) {
         this.userObject = userObject;
     }
     
-    public long getObjectId(){
+    /**
+     * Read the id of the btCollisionObject.
+     *
+     * @return the unique identifier (not zero)
+     */
+     public long getObjectId(){
         return objectId;
     }
     
+    /**
+     * Attach the identified btCollisionShape to the identified
+     * btCollisionObject. Native method.
+     *
+     * @param objectId the unique identifier of the btCollisionObject (not zero)
+     * @param collisionShapeId the unique identifier of the btCollisionShape
+     * (not zero)
+     */
     protected native void attachCollisionShape(long objectId, long collisionShapeId);
     native void setCollisionGroup(long objectId, int collisionGroup);
     native void setCollideWithGroups(long objectId, int collisionGroups);
 
+    /**
+     * Serialize this object, for example when saving to a J3O file.
+     *
+     * @param e exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter e) throws IOException {
         OutputCapsule capsule = e.getCapsule(this);
@@ -186,6 +299,12 @@ public abstract class PhysicsCollisionObject implements Savable {
         capsule.write(collisionShape, "collisionShape", null);
     }
 
+    /**
+     * De-serialize this object, for example when loading from a J3O file.
+     *
+     * @param e importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter e) throws IOException {
         InputCapsule capsule = e.getCapsule(this);
@@ -195,6 +314,12 @@ public abstract class PhysicsCollisionObject implements Savable {
         collisionShape = shape;
     }
 
+    /**
+     * Finalize this collision object just before it is destroyed. Should be
+     * invoked only by a subclass or by the garbage collector.
+     *
+     * @throws Throwable ignored by the garbage collector
+     */
     @Override
     protected void finalize() throws Throwable {
         super.finalize();
@@ -202,5 +327,10 @@ public abstract class PhysicsCollisionObject implements Savable {
         finalizeNative(objectId);
     }
 
+    /**
+     * Finalize the identified btCollisionObject. Native method.
+     *
+     * @param objectId the unique identifier of the btCollisionObject (not zero)
+     */
     protected native void finalizeNative(long objectId);
 }

+ 29 - 9
jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsRayTestResult.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,47 +34,67 @@ package com.jme3.bullet.collision;
 import com.jme3.math.Vector3f;
 
 /**
- * Contains the results of a PhysicsSpace rayTest
- *  bulletAppState.getPhysicsSpace().rayTest(new Vector3f(0,1000,0),new Vector3f(0,-1000,0));
-    javap -s java.util.List
+ * Represent the results of a Bullet ray test.
+ *
  * @author Empire-Phoenix,normenhansen
  */
 public class PhysicsRayTestResult {
 
+    /**
+     * collision object that was hit
+     */
     private PhysicsCollisionObject collisionObject;
+    /**
+     * normal vector at the point of contact
+     */
     private Vector3f hitNormalLocal;
+    /**
+     * fraction of the ray's total length (from=0, to=1, &ge;0, &le;1)
+     */
     private float hitFraction;
+    /**
+     * true&rarr;need to transform normal into world space
+     */
     private boolean normalInWorldSpace = true;
 
     /**
-     * allocated by native code only
+     * A private constructor to inhibit instantiation of this class by Java.
+     * These results are instantiated exclusively by native code.
      */
     private PhysicsRayTestResult() {
     }
 
     /**
-     * @return the collisionObject
+     * Access the collision object that was hit.
+     *
+     * @return the pre-existing instance
      */
     public PhysicsCollisionObject getCollisionObject() {
         return collisionObject;
     }
 
     /**
-     * @return the hitNormalLocal
+     * Access the normal vector at the point of contact.
+     *
+     * @return a pre-existing unit vector (not null)
      */
     public Vector3f getHitNormalLocal() {
         return hitNormalLocal;
     }
 
     /**
-     * @return the hitFraction
+     * Read the fraction of the ray's total length.
+     *
+     * @return fraction (from=0, to=1, &ge;0, &le;1)
      */
     public float getHitFraction() {
         return hitFraction;
     }
 
     /**
-     * @return the normalInWorldSpace
+     * Test whether the normal is in world space.
+     *
+     * @return true if in world space, otherwise false
      */
     public boolean isNormalInWorldSpace() {
         return normalInWorldSpace;

+ 40 - 6
jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsSweepTestResult.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,16 +34,33 @@ package com.jme3.bullet.collision;
 import com.jme3.math.Vector3f;
 
 /**
- * Contains the results of a PhysicsSpace rayTest
+ * Represent the results of a Bullet sweep test.
+ *
  * @author normenhansen
  */
 public class PhysicsSweepTestResult {
 
+    /**
+     * collision object that was hit
+     */
     private PhysicsCollisionObject collisionObject;
+    /**
+     * normal vector at the point of contact
+     */
     private Vector3f hitNormalLocal;
+    /**
+     * fraction of the way between the transforms (from=0, to=1, &ge;0, &le;1)
+     */
     private float hitFraction;
+    /**
+     * true&rarr;need to transform normal into world space
+     */
     private boolean normalInWorldSpace;
 
+    /**
+     * A private constructor to inhibit instantiation of this class by Java.
+     * These results are instantiated exclusively by native code.
+     */
     public PhysicsSweepTestResult() {
     }
 
@@ -55,33 +72,50 @@ public class PhysicsSweepTestResult {
     }
 
     /**
-     * @return the collisionObject
+     * Access the collision object that was hit.
+     *
+     * @return the pre-existing instance
      */
     public PhysicsCollisionObject getCollisionObject() {
         return collisionObject;
     }
 
     /**
-     * @return the hitNormalLocal
+     * Access the normal vector at the point of contact.
+     *
+     * @return the pre-existing vector (not null)
      */
     public Vector3f getHitNormalLocal() {
         return hitNormalLocal;
     }
 
     /**
-     * @return the hitFraction
+     * Read the fraction of fraction of the way between the transforms (from=0,
+     * to=1, &ge;0, &le;1)
+     *
+     * @return fraction (from=0, to=1, &ge;0, &le;1)
      */
     public float getHitFraction() {
         return hitFraction;
     }
 
     /**
-     * @return the normalInWorldSpace
+     * Test whether the normal is in world space.
+     *
+     * @return true if in world space, otherwise false
      */
     public boolean isNormalInWorldSpace() {
         return normalInWorldSpace;
     }
 
+    /**
+     * Fill in the fields of this result.
+     * 
+     * @param collisionObject
+     * @param hitNormalLocal
+     * @param hitFraction
+     * @param normalInWorldSpace 
+     */
     public void fill(PhysicsCollisionObject collisionObject, Vector3f hitNormalLocal, float hitFraction, boolean normalInWorldSpace) {
         this.collisionObject = collisionObject;
         this.hitNormalLocal = hitNormalLocal;

+ 36 - 5
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,35 +41,63 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Basic box collision shape
+ * A rectangular-solid collision shape based on Bullet's btBoxShape.
+ *
  * @author normenhansen
  */
 public class BoxCollisionShape extends CollisionShape {
 
+    /**
+     * copy of half-extents of the box on each local axis (not null, no negative
+     * component)
+     */
     private Vector3f halfExtents;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public BoxCollisionShape() {
     }
 
     /**
-     * creates a collision box from the given halfExtents
-     * @param halfExtents the halfExtents of the CollisionBox
+     * Instantiate a box shape with the specified half extents.
+     *
+     * @param halfExtents the desired unscaled half extents (not null, no
+     * negative component, alias created)
      */
     public BoxCollisionShape(Vector3f halfExtents) {
         this.halfExtents = halfExtents;
         createShape();
     }
 
+    /**
+     * Access the half extents of the box.
+     *
+     * @return the pre-existing instance (not null, no negative component)
+     */
     public final Vector3f getHalfExtents() {
         return halfExtents;
     }
-    
+
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.write(halfExtents, "halfExtents", new Vector3f(1, 1, 1));
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -78,6 +106,9 @@ public class BoxCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
         objectId = createShape(halfExtents);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));

+ 64 - 12
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,20 +41,37 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Basic capsule collision shape
+ * A capsule collision shape based on Bullet's btCapsuleShapeX, btCapsuleShape,
+ * or btCapsuleShapeZ. These shapes have no margin and cannot be scaled.
+ *
  * @author normenhansen
  */
 public class CapsuleCollisionShape extends CollisionShape{
-    protected float radius,height;
-    protected int axis;
+    /**
+     * copy of height of the cylindrical portion (&ge;0)
+     */
+    private float height;
+    /**
+     * copy of radius (&ge;0)
+     */
+    private float radius;
+    /**
+     * copy of main (height) axis (0&rarr;X, 1&rarr;Y, 2&rarr;Z)
+     */
+    private int axis;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public CapsuleCollisionShape() {
     }
 
     /**
-     * creates a new CapsuleCollisionShape with the given radius and height
-     * @param radius the radius of the capsule
-     * @param height the height of the capsule
+     * Instantiate a Y-axis capsule shape with the specified radius and height.
+     *
+     * @param radius the desired radius (&ge;0)
+     * @param height the desired height (of the cylindrical portion) (&ge;0)
      */
     public CapsuleCollisionShape(float radius, float height) {
         this.radius=radius;
@@ -64,10 +81,11 @@ public class CapsuleCollisionShape extends CollisionShape{
     }
 
     /**
-     * creates a capsule shape around the given axis (0=X,1=Y,2=Z)
-     * @param radius
-     * @param height
-     * @param axis
+     * Instantiate a capsule shape around the specified main (height) axis.
+     *
+     * @param radius the desired radius (&ge;0)
+     * @param height the desired height (of the cylindrical portion) (&ge;0)
+     * @param axis which local axis: 0&rarr;X, 1&rarr;Y, 2&rarr;Z
      */
     public CapsuleCollisionShape(float radius, float height, int axis) {
         this.radius=radius;
@@ -76,20 +94,39 @@ public class CapsuleCollisionShape extends CollisionShape{
         createShape();
     }
 
+    /**
+     * Read the radius of the capsule.
+     *
+     * @return the radius (&ge;0)
+     */
     public float getRadius() {
         return radius;
     }
 
+    /**
+     * Read the height (of the cylindrical portion) of the capsule.
+     *
+     * @return height (&ge;0)
+     */
     public float getHeight() {
         return height;
     }
 
+    /**
+     * Determine the main (height) axis of the capsule.
+     *
+     * @return 0 for local X, 1 for local Y, or 2 for local Z
+     */
     public int getAxis() {
         return axis;
     }
 
     /**
-     * WARNING - CompoundCollisionShape scaling has no effect.
+     * Alter the scaling factors of this shape. Scaling is disabled
+     * for capsule shapes.
+     *
+     * @param scale the desired scaling factor for each local axis (not null, no
+     * negative component, unaffected, default=1,1,1)
      */
     @Override
     public void setScale(Vector3f scale) {
@@ -98,6 +135,12 @@ public class CapsuleCollisionShape extends CollisionShape{
         }
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
@@ -106,6 +149,12 @@ public class CapsuleCollisionShape extends CollisionShape{
         capsule.write(axis, "axis", 1);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -115,6 +164,9 @@ public class CapsuleCollisionShape extends CollisionShape{
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape(){
         objectId = createShape(axis, radius, height);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));

+ 74 - 6
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,15 +38,31 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * This Object holds information about a jbullet CollisionShape to be able to reuse
- * CollisionShapes (as suggested in bullet manuals)
- * TODO: add static methods to create shapes from nodes (like jbullet-jme constructor)
+ * The abstract base class for collision shapes based on Bullet's
+ * btCollisionShape.
+ * <p>
+ * Collision shapes include BoxCollisionShape and CapsuleCollisionShape. As
+ * suggested in the Bullet manual, a single collision shape can be shared among
+ * multiple collision objects.
+ *
  * @author normenhansen
  */
 public abstract class CollisionShape implements Savable {
 
+    /**
+     * unique identifier of the btCollisionShape
+     * <p>
+     * Constructors are responsible for setting this to a non-zero value. After
+     * that, the id never changes.
+     */
     protected long objectId = 0;
+    /**
+     * copy of scaling factors: one for each local axis (default=1,1,1)
+     */
     protected Vector3f scale = new Vector3f(1, 1, 1);
+    /**
+     * copy of collision margin (in physics-space units, &gt;0, default=0)
+     */
     protected float margin = 0.0f;
 
     public CollisionShape() {
@@ -70,7 +86,9 @@ public abstract class CollisionShape implements Savable {
 //    private native void calculateLocalInertia(long objectId, long shapeId, float mass);
 
     /**
-     * used internally
+     * Read the id of the btCollisionShape.
+     *
+     * @return the unique identifier (not zero)
      */
     public long getObjectId() {
         return objectId;
@@ -83,21 +101,52 @@ public abstract class CollisionShape implements Savable {
         this.objectId = id;
     }
 
+    /**
+     * Alter the scaling factors of this shape. CAUTION: Not all shapes can be
+     * scaled.
+     * <p>
+     * Note that if the shape is shared (between collision objects and/or
+     * compound shapes) changes can have unintended consequences.
+     *
+     * @param scale the desired scaling factor for each local axis (not null, no
+     * negative component, unaffected, default=1,1,1)
+     */
     public void setScale(Vector3f scale) {
         this.scale.set(scale);
         setLocalScaling(objectId, scale);
     }
-    
+    /**
+     * Access the scaling factors.
+     *
+     * @return the pre-existing vector (not null)
+     */
     public Vector3f getScale() {
         return scale;
     }
 
+    /**
+     * Read the collision margin for this shape.
+     *
+     * @return the margin distance (in physics-space units, &ge;0)
+     */
     public float getMargin() {
         return getMargin(objectId);
     }
     
     private native float getMargin(long objectId);
 
+    /**
+     * Alter the collision margin of this shape. CAUTION: Margin is applied
+     * differently, depending on the type of shape. Generally the collision
+     * margin expands the object, creating a gap. Don't set the collision margin
+     * to zero.
+     * <p>
+     * Note that if the shape is shared (between collision objects and/or
+     * compound shapes) changes can have unintended consequences.
+     *
+     * @param margin the desired margin distance (in physics-space units, &gt;0,
+     * default=0)
+     */
     public void setMargin(float margin) {
         setMargin(objectId, margin);
         this.margin = margin;
@@ -107,18 +156,37 @@ public abstract class CollisionShape implements Savable {
     
     private native void setMargin(long objectId, float margin);
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.write(scale, "scale", new Vector3f(1, 1, 1));
         capsule.write(getMargin(), "margin", 0.0f);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
+    @Override
     public void read(JmeImporter im) throws IOException {
         InputCapsule capsule = im.getCapsule(this);
         this.scale = (Vector3f) capsule.readSavable("scale", new Vector3f(1, 1, 1));
         this.margin = capsule.readFloat("margin", 0.0f);
     }
 
+    /**
+     * Finalize this shape just before it is destroyed. Should be invoked only
+     * by a subclass or by the garbage collector.
+     *
+     * @throws Throwable ignored by the garbage collector
+     */
     @Override
     protected void finalize() throws Throwable {
         super.finalize();

+ 44 - 11
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,23 +46,33 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * A CompoundCollisionShape allows combining multiple base shapes
- * to generate a more sophisticated shape.
+ * A collision shape formed by combining convex child shapes, based on Bullet's
+ * btCompoundShape.
+ *
  * @author normenhansen
  */
 public class CompoundCollisionShape extends CollisionShape {
 
+    /**
+     * children of this shape
+     */
     protected ArrayList<ChildCollisionShape> children = new ArrayList<ChildCollisionShape>();
 
+    /**
+     * Instantiate an empty compound shape (with no children).
+     */
     public CompoundCollisionShape() {
         objectId = createShape();//new CompoundShape();
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));
     }
 
     /**
-     * adds a child shape at the given local translation
-     * @param shape the child shape to add
-     * @param location the local location of the child shape
+     * Add a child shape with the specified local translation.
+     *
+     * @param shape the child shape to add (not null, not a compound shape,
+     * alias created)
+     * @param location the local coordinates of the child shape's center (not
+     * null, unaffected)
      */
     public void addChildShape(CollisionShape shape, Vector3f location) {
 //        Transform transA = new Transform(Converter.convert(new Matrix3f()));
@@ -73,9 +83,14 @@ public class CompoundCollisionShape extends CollisionShape {
     }
 
     /**
-     * adds a child shape at the given local translation
-     * @param shape the child shape to add
-     * @param location the local location of the child shape
+     * Add a child shape with the specified local translation and orientation.
+     *
+     * @param shape the child shape to add (not null, not a compound shape,
+     * alias created)
+     * @param location the local coordinates of the child shape's center (not
+     * null, unaffected)
+     * @param rotation the local orientation of the child shape (not null,
+     * unaffected)
      */
     public void addChildShape(CollisionShape shape, Vector3f location, Matrix3f rotation) {
         if(shape instanceof CompoundCollisionShape){
@@ -101,8 +116,9 @@ public class CompoundCollisionShape extends CollisionShape {
     }
 
     /**
-     * removes a child shape
-     * @param shape the child shape to remove
+     * Remove a child from this shape.
+     *
+     * @param shape the child shape to remove (not null)
      */
     public void removeChildShape(CollisionShape shape) {
         removeChildShape(objectId, shape.getObjectId());
@@ -115,6 +131,11 @@ public class CompoundCollisionShape extends CollisionShape {
         }
     }
 
+    /**
+     * Access the list of children.
+     *
+     * @return the pre-existing list (not null)
+     */
     public List<ChildCollisionShape> getChildren() {
         return children;
     }
@@ -125,12 +146,24 @@ public class CompoundCollisionShape extends CollisionShape {
     
     private native long removeChildShape(long objectId, long childId);
     
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.writeSavableArrayList(children, "children", new ArrayList<ChildCollisionShape>());
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);

+ 55 - 2
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,18 +41,40 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
+ * A conical collision shape based on Bullet's btConeShapeX, btConeShape, or
+ * btConeShapeZ.
  *
  * @author normenhansen
  */
 public class ConeCollisionShape extends CollisionShape {
 
+    /**
+     * copy of radius (&ge;0)
+     */
     protected float radius;
+    /**
+     * copy of height (&ge;0)
+     */
     protected float height;
+    /**
+     * copy of main (height) axis (0&rarr;X, 1&rarr;Y, 2&rarr;Z)
+     */
     protected int axis;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public ConeCollisionShape() {
     }
 
+    /**
+     * Instantiate a cone shape around the specified main (height) axis.
+     *
+     * @param radius the desired radius (&ge;0)
+     * @param height the desired height (&ge;0)
+     * @param axis which local axis: 0&rarr;X, 1&rarr;Y, 2&rarr;Z
+     */
     public ConeCollisionShape(float radius, float height, int axis) {
         this.radius = radius;
         this.height = height;
@@ -60,6 +82,12 @@ public class ConeCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate a cone shape oriented along the Y axis.
+     *
+     * @param radius the desired radius (&ge;0)
+     * @param height the desired height (&ge;0)
+     */
     public ConeCollisionShape(float radius, float height) {
         this.radius = radius;
         this.height = height;
@@ -67,14 +95,30 @@ public class ConeCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Read the radius of the cone.
+     *
+     * @return radius (&ge;0)
+     */
     public float getRadius() {
         return radius;
     }
-    
+
+    /**
+     * Read the height of the cone.
+     *
+     * @return height (&ge;0)
+     */
     public float getHeight() {
         return height;
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
@@ -83,6 +127,12 @@ public class ConeCollisionShape extends CollisionShape {
         capsule.write(axis, "axis", PhysicsSpace.AXIS_Y);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -92,6 +142,9 @@ public class ConeCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
         objectId = createShape(axis, radius, height);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));

+ 54 - 8
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,20 +41,35 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Basic cylinder collision shape
+ * A cylindrical collision shape based on Bullet's btCylinderShapeX, new
+ * btCylinderShape, or btCylinderShapeZ.
+ *
  * @author normenhansen
  */
 public class CylinderCollisionShape extends CollisionShape {
 
+    /**
+     * copy of half-extents of the cylinder on each local axis (not null, no
+     * negative component)
+     */
     protected Vector3f halfExtents;
+    /**
+     * copy of main (height) axis (0&rarr;X, 1&rarr;Y, 2&rarr;Z)
+     */
     protected int axis;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public CylinderCollisionShape() {
     }
 
     /**
-     * creates a cylinder shape from the given halfextents
-     * @param halfExtents the halfextents to use
+     * Instantiate a Z-axis cylinder shape with the specified half extents.
+     *
+     * @param halfExtents the desired unscaled half extents (not null, no
+     * negative component, alias created)
      */
     public CylinderCollisionShape(Vector3f halfExtents) {
         this.halfExtents = halfExtents;
@@ -63,9 +78,11 @@ public class CylinderCollisionShape extends CollisionShape {
     }
 
     /**
-     * Creates a cylinder shape around the given axis from the given halfextents
-     * @param halfExtents the halfextents to use
-     * @param axis (0=X,1=Y,2=Z)
+     * Instantiate a cylinder shape around the specified axis.
+     *
+     * @param halfExtents the desired unscaled half extents (not null, no 
+     * negative component, alias created)
+     * @param axis which local axis: 0&rarr;X, 1&rarr;Y, 2&rarr;Z
      */
     public CylinderCollisionShape(Vector3f halfExtents, int axis) {
         this.halfExtents = halfExtents;
@@ -73,16 +90,30 @@ public class CylinderCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Access the half extents of the cylinder.
+     *
+     * @return the pre-existing vector (not null, no negative component)
+     */
     public final Vector3f getHalfExtents() {
         return halfExtents;
     }
 
+    /**
+     * Determine the main axis of the cylinder.
+     *
+     * @return 0&rarr;X, 1&rarr;Y, 2&rarr;Z
+     */
     public int getAxis() {
         return axis;
     }
 
     /**
-     * WARNING - CompoundCollisionShape scaling has no effect.
+     * Alter the scaling factors of this shape. Scaling is disabled
+     * for cylinder shapes.
+     *
+     * @param scale the desired scaling factor for each local axis (not null, no
+     * negative component, unaffected, default=1,1,1)
      */
     @Override
     public void setScale(Vector3f scale) {
@@ -91,6 +122,12 @@ public class CylinderCollisionShape extends CollisionShape {
     	 }
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
@@ -98,6 +135,12 @@ public class CylinderCollisionShape extends CollisionShape {
         capsule.write(axis, "axis", 1);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -106,6 +149,9 @@ public class CylinderCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
         objectId = createShape(axis, halfExtents);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));

+ 34 - 3
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,8 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Basic mesh collision shape
+ * A mesh collision shape based on Bullet's btGImpactMeshShape.
+ *
  * @author normenhansen
  */
 public class GImpactCollisionShape extends CollisionShape {
@@ -55,14 +56,23 @@ public class GImpactCollisionShape extends CollisionShape {
 //    protected Vector3f worldScale;
     protected int numVertices, numTriangles, vertexStride, triangleIndexStride;
     protected ByteBuffer triangleIndexBase, vertexBase;
+    /**
+     * Unique identifier of the Bullet mesh. The constructor sets this to a
+     * non-zero value.
+     */
     protected long meshId = 0;
 //    protected IndexedMesh bulletMesh;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public GImpactCollisionShape() {
     }
 
     /**
-     * creates a collision shape from the given Mesh
+     * Instantiate a shape based on the specified JME mesh.
+     *
      * @param mesh the Mesh to use
      */
     public GImpactCollisionShape(Mesh mesh) {
@@ -105,6 +115,12 @@ public class GImpactCollisionShape extends CollisionShape {
 //    public Mesh createJmeMesh() {
 //        return Converter.convert(bulletMesh);
 //    }
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
@@ -118,6 +134,12 @@ public class GImpactCollisionShape extends CollisionShape {
         capsule.write(vertexBase.array(), "vertexBase", new byte[0]);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -132,6 +154,9 @@ public class GImpactCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
 //        bulletMesh = new IndexedMesh();
 //        bulletMesh.numVertices = numVertices;
@@ -157,6 +182,12 @@ public class GImpactCollisionShape extends CollisionShape {
 
     private native long createShape(long meshId);
 
+    /**
+     * Finalize this shape just before it is destroyed. Should be invoked only
+     * by a subclass or by the garbage collector.
+     *
+     * @throws Throwable ignored by the garbage collector
+     */
     @Override
     protected void finalize() throws Throwable {
         super.finalize();

+ 65 - 9
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -45,36 +45,72 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Uses Bullet Physics Heightfield terrain collision system. This is MUCH faster
- * than using a regular mesh.
- * There are a couple tricks though:
- *	-No rotation or translation is supported.
- *	-The collision bbox must be centered around 0,0,0 with the height above and below the y-axis being
- *	equal on either side. If not, the whole collision box is shifted vertically and things don't collide
- *	as they should.
- * 
+ * A terrain collision shape based on Bullet's btHeightfieldTerrainShape.
+ * <p>
+ * This is much more efficient than a regular mesh, but it has a couple
+ * limitations:
+ * <ul>
+ * <li>No rotation or translation.</li>
+ * <li>The collision bounding box must be centered on (0,0,0) with the height
+ * above and below the X-Z plane being equal on either side. If not, the whole
+ * collision box is shifted vertically and objects won't collide properly.</li>
+ * </ul>
+ *
  * @author Brent Owens
  */
 public class HeightfieldCollisionShape extends CollisionShape {
 
+    /**
+     * number of rows in the heightfield (&gt;1)
+     */
     protected int heightStickWidth;
+    /**
+     * number of columns in the heightfield (&gt;1)
+     */
     protected int heightStickLength;
+    /**
+     * array of heightfield samples
+     */
     protected float[] heightfieldData;
     protected float heightScale;
     protected float minHeight;
     protected float maxHeight;
+    /**
+     * index of the height axis (0&rarr;X, 1&rarr;Y, 2&rarr;Z)
+     */
     protected int upAxis;
     protected boolean flipQuadEdges;
+    /**
+     * buffer for passing height data to Bullet
+     * <p>
+     * A Java reference must persist after createShape() completes, or else the
+     * buffer might get garbage collected.
+     */    
     protected ByteBuffer bbuf;
 //    protected FloatBuffer fbuf;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public HeightfieldCollisionShape() {
     }
 
+    /**
+     * Instantiate a new shape for the specified height map.
+     *
+     * @param heightmap (not null, length&ge;4, length a perfect square)
+     */
     public HeightfieldCollisionShape(float[] heightmap) {
         createCollisionHeightfield(heightmap, Vector3f.UNIT_XYZ);
     }
 
+    /**
+     * Instantiate a new shape for the specified height map and scale vector.
+     *
+     * @param heightmap (not null, length&ge;4, length a perfect square)
+     * @param scale (not null, no negative component, unaffected, default=1,1,1)
+     */
     public HeightfieldCollisionShape(float[] heightmap, Vector3f scale) {
         createCollisionHeightfield(heightmap, scale);
     }
@@ -120,6 +156,9 @@ public class HeightfieldCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
         bbuf = BufferUtils.createByteBuffer(heightfieldData.length * 4); 
 //        fbuf = bbuf.asFloatBuffer();//FloatBuffer.wrap(heightfieldData);
@@ -138,11 +177,22 @@ public class HeightfieldCollisionShape extends CollisionShape {
 
     private native long createShape(int heightStickWidth, int heightStickLength, ByteBuffer heightfieldData, float heightScale, float minHeight, float maxHeight, int upAxis, boolean flipQuadEdges);
 
+    /**
+     * Does nothing.
+     * 
+     * @return null
+     */
     public Mesh createJmeMesh() {
         //TODO return Converter.convert(bulletMesh);
         return null;
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
@@ -156,6 +206,12 @@ public class HeightfieldCollisionShape extends CollisionShape {
         capsule.write(flipQuadEdges, "flipQuadEdges", false);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);

+ 44 - 1
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,24 +44,52 @@ import java.nio.FloatBuffer;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+/**
+ * A convex hull collision shape based on Bullet's btConvexHullShape.
+ */
 public class HullCollisionShape extends CollisionShape {
 
     private float[] points;
 //    protected FloatBuffer fbuf;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public HullCollisionShape() {
     }
 
+    /**
+     * Instantiate a collision shape based on the specified JME mesh. For best
+     * performance and stability, use the mesh should have no more than 100
+     * vertices.
+     *
+     * @param mesh a mesh on which to base the shape (not null, at least one
+     * vertex)
+     */
     public HullCollisionShape(Mesh mesh) {
         this.points = getPoints(mesh);
         createShape();
     }
 
+    /**
+     * Instantiate a collision shape based on the specified array of
+     * coordinates.
+     *
+     * @param points an array of coordinates on which to base the shape (not
+     * null, not empty, length a multiple of 3)
+     */
     public HullCollisionShape(float[] points) {
         this.points = points;
         createShape();
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
@@ -70,6 +98,12 @@ public class HullCollisionShape extends CollisionShape {
         capsule.write(points, "points", null);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter im) throws IOException {
         super.read(im);
@@ -89,6 +123,9 @@ public class HullCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
 //        ObjectArrayList<Vector3f> pointList = new ObjectArrayList<Vector3f>();
 //        for (int i = 0; i < points.length; i += 3) {
@@ -114,6 +151,12 @@ public class HullCollisionShape extends CollisionShape {
 
     private native long createShape(ByteBuffer points);
 
+    /**
+     * Copy the vertex positions from a JME mesh.
+     *
+     * @param mesh the mesh to read (not null)
+     * @return a new array (not null, length a multiple of 3)
+     */
     protected float[] getPoints(Mesh mesh) {
         FloatBuffer vertices = mesh.getFloatBuffer(Type.Position);
         vertices.rewind();

+ 51 - 24
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@ import com.jme3.scene.mesh.IndexBuffer;
 import com.jme3.util.BufferUtils;
 
 /**
- * Basic mesh collision shape
+ * A mesh collision shape based on Bullet's btBvhTriangleMeshShape.
  *
  * @author normenhansen
  */
@@ -64,38 +64,45 @@ public class MeshCollisionShape extends CollisionShape {
     private static final String NATIVE_BVH = "nativeBvh";
     protected int numVertices, numTriangles, vertexStride, triangleIndexStride;
     protected ByteBuffer triangleIndexBase, vertexBase;
+    /**
+     * Unique identifier of the Bullet mesh. The constructor sets this to a
+     * non-zero value.
+     */
     protected long meshId = 0;
     protected long nativeBVHBuffer = 0;
     private boolean memoryOptimized;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public MeshCollisionShape() {
     }
 
     /**
-     * Creates a collision shape from the given Mesh. 
-     * Default behavior, more optimized for memory usage.
+     * Instantiate a collision shape based on the specified JME mesh, optimized
+     * for memory usage.
      *
-     * @param mesh
+     * @param mesh the mesh on which to base the shape (not null)
      */
     public MeshCollisionShape(Mesh mesh) {
         this(mesh, true);
     }
 
     /**
-     * Creates a collision shape from the given Mesh.
-     * <code>memoryOptimized</code> determines if optimized instead of 
-     * quantized BVH will be used.
-     * Internally, <code>memoryOptimized</code> BVH is slower to calculate (~4x) 
-     * but also smaller (~0.5x). 
-     * It is preferable to use the memory optimized version and then serialize
-     * the resulting MeshCollisionshape as this will also save the
-     * generated BVH. 
-     * An exception can be procedurally / generated collision shapes, where
-     * the generation time is more of a concern
+     * Instantiate a collision shape based on the specified JME mesh.
+     * <p>
+     * <code>memoryOptimized</code> determines if optimized instead of quantized
+     * BVH will be used. Internally, <code>memoryOptimized</code> BVH is slower
+     * to calculate (~4x) but also smaller (~0.5x). It is preferable to use the
+     * memory optimized version and then serialize the resulting
+     * MeshCollisionshape as this will also save the generated BVH. An exception
+     * can be procedurally / generated collision shapes, where the generation
+     * time is more of a concern
      *
-     * @param mesh the Mesh to use
-     * @param memoryOptimized True to generate a memory optimized BVH,
-     * false to generate quantized BVH.
+     * @param mesh the mesh on which to base the shape (not null)
+     * @param memoryOptimized true to generate a memory-optimized BVH, false to
+     * generate quantized BVH
      */
     public MeshCollisionShape(final Mesh mesh, final boolean memoryOptimized) {
         this.memoryOptimized = memoryOptimized;
@@ -103,16 +110,15 @@ public class MeshCollisionShape extends CollisionShape {
     }
 
     /**
-     * Advanced constructor, usually you don’t want to use this, but the Mesh
-     * based one. Passing false values can lead to a crash, use at own risk
-     *
+     * An advanced constructor. Passing false values can lead to a crash.
+     * Usually you don’t want to use this. Use at own risk.
+     * <p>
      * This constructor bypasses all copy logic normally used, this allows for
-     * faster bullet shape generation when using procedurally generated Meshes.
-     *
+     * faster Bullet shape generation when using procedurally generated Meshes.
      *
      * @param indices the raw index buffer
      * @param vertices the raw vertex buffer
-     * @param memoryOptimized use quantisize BVH, uses less memory, but slower
+     * @param memoryOptimized use quantized BVH, uses less memory, but slower
      */
     public MeshCollisionShape(ByteBuffer indices, ByteBuffer vertices, boolean memoryOptimized) {
         this.triangleIndexBase = indices;
@@ -153,6 +159,12 @@ public class MeshCollisionShape extends CollisionShape {
         this.createShape(null);
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(final JmeExporter ex) throws IOException {
         super.write(ex);
@@ -178,6 +190,12 @@ public class MeshCollisionShape extends CollisionShape {
         }
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(final JmeImporter im) throws IOException {
         super.read(im);
@@ -195,6 +213,9 @@ public class MeshCollisionShape extends CollisionShape {
         createShape(nativeBvh);
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     private void createShape(byte bvh[]) {
         boolean buildBvh=bvh==null||bvh.length==0;
         this.meshId = NativeMeshUtil.createTriangleIndexVertexArray(this.triangleIndexBase, this.vertexBase, this.numTriangles, this.numVertices, this.vertexStride, this.triangleIndexStride);
@@ -216,6 +237,12 @@ public class MeshCollisionShape extends CollisionShape {
     
     private native long createShape(boolean memoryOptimized, boolean buildBvt, long meshId);
 
+    /**
+     * Finalize this shape just before it is destroyed. Should be invoked only
+     * by a subclass or by the garbage collector.
+     *
+     * @throws Throwable ignored by the garbage collector
+     */
     @Override
     public void finalize() throws Throwable {
         super.finalize();

+ 32 - 3
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,34 +42,60 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
+ * A planar collision shape based on Bullet's btStaticPlaneShape.
  *
  * @author normenhansen
  */
 public class PlaneCollisionShape extends CollisionShape{
+    /**
+     * description of the plane
+     */
     private Plane plane;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public PlaneCollisionShape() {
     }
 
     /**
-     * Creates a plane Collision shape
-     * @param plane the plane that defines the shape
+     * Instantiate a plane shape defined by the specified plane.
+     *
+     * @param plane the desired plane (not null, alias created)
      */
     public PlaneCollisionShape(Plane plane) {
         this.plane = plane;
         createShape();
     }
 
+    /**
+     * Access the defining plane.
+     *
+     * @return the pre-existing instance (not null)
+     */
     public final Plane getPlane() {
         return plane;
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.write(plane, "collisionPlane", new Plane());
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -77,6 +103,9 @@ public class PlaneCollisionShape extends CollisionShape{
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
         objectId = createShape(plane.getNormal(), plane.getConstant());
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));

+ 52 - 2
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,16 +41,33 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * A simple point, line, triangle or quad collisionShape based on one to four points-
+ * A simple point, line-segment, triangle, or tetrahedron collision shape based
+ * on Bullet's btBU_Simplex1to4.
+ *
  * @author normenhansen
  */
 public class SimplexCollisionShape extends CollisionShape {
 
+    /**
+     * vertex positions
+     */
     private Vector3f vector1, vector2, vector3, vector4;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public SimplexCollisionShape() {
     }
 
+    /**
+     * Instantiate a tetrahedral collision shape based on the specified points.
+     *
+     * @param point1 the coordinates of 1st point (not null, alias created)
+     * @param point2 the coordinates of 2nd point (not null, alias created)
+     * @param point3 the coordinates of 3rd point (not null, alias created)
+     * @param point4 the coordinates of 4th point (not null, alias created)
+     */
     public SimplexCollisionShape(Vector3f point1, Vector3f point2, Vector3f point3, Vector3f point4) {
         vector1 = point1;
         vector2 = point2;
@@ -59,6 +76,13 @@ public class SimplexCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate a triangular collision shape based on the specified points.
+     *
+     * @param point1 the coordinates of 1st point (not null, alias created)
+     * @param point2 the coordinates of 2nd point (not null, alias created)
+     * @param point3 the coordinates of 3rd point (not null, alias created)
+     */
     public SimplexCollisionShape(Vector3f point1, Vector3f point2, Vector3f point3) {
         vector1 = point1;
         vector2 = point2;
@@ -66,17 +90,34 @@ public class SimplexCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate a line-segment collision shape based on the specified points.
+     *
+     * @param point1 the coordinates of 1st point (not null, alias created)
+     * @param point2 the coordinates of 2nd point (not null, alias created)
+     */
     public SimplexCollisionShape(Vector3f point1, Vector3f point2) {
         vector1 = point1;
         vector2 = point2;
         createShape();
     }
 
+    /**
+     * Instantiate a point collision shape based on the specified points.
+     *
+     * @param point1 the coordinates of point (not null, alias created)
+     */
     public SimplexCollisionShape(Vector3f point1) {
         vector1 = point1;
         createShape();
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
@@ -86,6 +127,12 @@ public class SimplexCollisionShape extends CollisionShape {
         capsule.write(vector4, "simplexPoint4", null);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -96,6 +143,9 @@ public class SimplexCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
         if (vector4 != null) {
             objectId = createShape(vector1, vector2, vector3, vector4);

+ 39 - 5
jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,35 +41,62 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Basic sphere collision shape
+ * A spherical collision shape based on Bullet's btSphereShape. These shapes
+ * have no margin and cannot be scaled.
+ *
  * @author normenhansen
  */
 public class SphereCollisionShape extends CollisionShape {
 
+    /**
+     * copy of radius (&ge;0)
+     */
     protected float radius;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public SphereCollisionShape() {
     }
 
     /**
-     * creates a SphereCollisionShape with the given radius
-     * @param radius
+     * Instantiate a sphere shape with the specified radius.
+     *
+     * @param radius the desired radius (&ge;0)
      */
     public SphereCollisionShape(float radius) {
         this.radius = radius;
         createShape();
     }
 
+    /**
+     * Read the radius of the sphere.
+     *
+     * @return the radius (&ge;0)
+     */
     public float getRadius() {
         return radius;
     }
 
+    /**
+     * Serialize this shape, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.write(radius, "radius", 0.5f);
     }
 
+    /**
+     * De-serialize this shape, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -78,7 +105,11 @@ public class SphereCollisionShape extends CollisionShape {
     }
 
     /**
-     * WARNING - CompoundCollisionShape scaling has no effect.
+     * Alter the scaling factors of this shape. Scaling is disabled
+     * for sphere shapes.
+     *
+     * @param scale the desired scaling factor for each local axis (not null, no
+     * negative component, unaffected, default=1,1,1)
      */
     @Override
     public void setScale(Vector3f scale) {
@@ -87,6 +118,9 @@ public class SphereCollisionShape extends CollisionShape {
         }
     }
 
+    /**
+     * Instantiate the configured shape in Bullet.
+     */
     protected void createShape() {
         objectId = createShape(radius);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));

+ 62 - 6
jme3-bullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java

@@ -43,10 +43,13 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * <i>From bullet manual:</i><br>
- * To create ragdolls, the cone twist constraint is very useful for limbs like the upper arm.
- * It is a special point to point constraint that adds cone and twist axis limits.
- * The x-axis serves as twist axis.
+ * A joint based on Bullet's btConeTwistConstraint.
+ * <p>
+ * <i>From the Bullet manual:</i><br>
+ * To create ragdolls, the cone twist constraint is very useful for limbs like
+ * the upper arm. It is a special point to point constraint that adds cone and
+ * twist axis limits. The x-axis serves as twist axis.
+ *
  * @author normenhansen
  */
 public class ConeJoint extends PhysicsJoint {
@@ -57,12 +60,25 @@ public class ConeJoint extends PhysicsJoint {
     protected float twistSpan = 1e30f;
     protected boolean angularOnly = false;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public ConeJoint() {
     }
 
     /**
-     * @param pivotA local translation of the joint connection point in node A
-     * @param pivotB local translation of the joint connection point in node B
+     * Instantiate a ConeJoint. To be effective, the joint must be added to a
+     * physics space.
+     *
+     * @param nodeA the 1st body connected by the joint (not null, alias
+     * created)
+     * @param nodeB the 2nd body connected by the joint (not null, alias
+     * created)
+     * @param pivotA the local offset of the connection point in node A (not
+     * null, alias created)
+     * @param pivotB the local offset of the connection point in node B (not
+     * null, alias created)
      */
     public ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB) {
         super(nodeA, nodeB, pivotA, pivotB);
@@ -72,8 +88,21 @@ public class ConeJoint extends PhysicsJoint {
     }
 
     /**
+     * Instantiate a ConeJoint. To be effective, the joint must be added to a
+     * physics space.
+     *
+     * @param nodeA the 1st body connected by the joint (not null, alias
+     * created)
+     * @param nodeB the 2nd body connected by the joint (not null, alias
+     * created)
      * @param pivotA local translation of the joint connection point in node A
+     * (not null, alias created)
      * @param pivotB local translation of the joint connection point in node B
+     * (not null, alias created)
+     * @param rotA the local orientation of the connection to node A (not null,
+     * alias created)
+     * @param rotB the local orientation of the connection to node B (not null,
+     * alias created)
      */
     public ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB) {
         super(nodeA, nodeB, pivotA, pivotB);
@@ -82,6 +111,13 @@ public class ConeJoint extends PhysicsJoint {
         createJoint();
     }
 
+    /**
+     * Alter the angular limits for this joint.
+     *
+     * @param swingSpan1 angle (in radians)
+     * @param swingSpan2 angle (in radians)
+     * @param twistSpan angle (in radians)
+     */
     public void setLimit(float swingSpan1, float swingSpan2, float twistSpan) {
         this.swingSpan1 = swingSpan1;
         this.swingSpan2 = swingSpan2;
@@ -91,6 +127,11 @@ public class ConeJoint extends PhysicsJoint {
 
     private native void setLimit(long objectId, float swingSpan1, float swingSpan2, float twistSpan);
 
+    /**
+     * Alter whether this joint is angular only.
+     *
+     * @param value the desired setting (default=false)
+     */
     public void setAngularOnly(boolean value) {
         angularOnly = value;
         setAngularOnly(objectId, value);
@@ -98,6 +139,12 @@ public class ConeJoint extends PhysicsJoint {
 
     private native void setAngularOnly(long objectId, boolean value);
 
+    /**
+     * Serialize this joint, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     @Override
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
@@ -111,6 +158,12 @@ public class ConeJoint extends PhysicsJoint {
         capsule.write(twistSpan, "twistSpan", 1e30f);
     }
 
+    /**
+     * De-serialize this joint, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     @Override
     public void read(JmeImporter im) throws IOException {
         super.read(im);
@@ -125,6 +178,9 @@ public class ConeJoint extends PhysicsJoint {
         createJoint();
     }
 
+    /**
+     * Create the configured joint in Bullet.
+     */
     protected void createJoint() {
         objectId = createJoint(nodeA.getObjectId(), nodeB.getObjectId(), pivotA, rotA, pivotB, rotB);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Joint {0}", Long.toHexString(objectId));

+ 117 - 22
jme3-bullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java

@@ -42,29 +42,63 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * <i>From bullet manual:</i><br>
- * Hinge constraint, or revolute joint restricts two additional angular degrees of freedom,
- * so the body can only rotate around one axis, the hinge axis.
- * This can be useful to represent doors or wheels rotating around one axis.
- * The user can specify limits and motor for the hinge.
+ * A joint based on Bullet's btHingeConstraint.
+ * <p>
+ * <i>From the Bullet manual:</i><br>
+ * Hinge constraint, or revolute joint restricts two additional angular degrees
+ * of freedom, so the body can only rotate around one axis, the hinge axis. This
+ * can be useful to represent doors or wheels rotating around one axis. The user
+ * can specify limits and motor for the hinge.
+ *
  * @author normenhansen
  */
 public class HingeJoint extends PhysicsJoint {
 
     protected Vector3f axisA;
     protected Vector3f axisB;
+    /**
+     * copy of the angular-only flag (default=false)
+     */
     protected boolean angularOnly = false;
+    /**
+     * copy of the limit's bias factor, how strictly position errors (drift) is
+     * corrected (default=0.3)
+     */
     protected float biasFactor = 0.3f;
+    /**
+     * copy of the limit's relaxation factor, the rate at which velocity errors
+     * are corrected (default=1)
+     */
     protected float relaxationFactor = 1.0f;
+    /**
+     * copy of the limit's softness, the range fraction at which velocity-error
+     * correction starts operating (default=0.9)
+     */
     protected float limitSoftness = 0.9f;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public HingeJoint() {
     }
 
     /**
-     * Creates a new HingeJoint
-     * @param pivotA local translation of the joint connection point in node A
-     * @param pivotB local translation of the joint connection point in node B
+     * Instantiate a HingeJoint. To be effective, the joint must be added to a
+     * physics space.
+     *
+     * @param nodeA the 1st body connected by the joint (not null, alias
+     * created)
+     * @param nodeB the 2nd body connected by the joint (not null, alias
+     * created)
+     * @param pivotA the local offset of the connection point in node A (not
+     * null, alias created)
+     * @param pivotB the local offset of the connection point in node B (not
+     * null, alias created)
+     * @param axisA the local axis of the connection to node A (not null, alias
+     * created)
+     * @param axisB the local axis of the connection to node B (not null, alias
+     * created)
      */
     public HingeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Vector3f axisA, Vector3f axisB) {
         super(nodeA, nodeB, pivotA, pivotB);
@@ -74,10 +108,11 @@ public class HingeJoint extends PhysicsJoint {
     }
 
     /**
-     * Enables the motor.
-     * @param enable if true, motor is enabled.
-     * @param targetVelocity the target velocity of the rotation.
-     * @param maxMotorImpulse the max force applied to the hinge to rotate it.
+     * Enable or disable this joint's motor.
+     *
+     * @param enable true to enable, false to disable
+     * @param targetVelocity the desired target velocity
+     * @param maxMotorImpulse the desired maximum rotational force
      */
     public void enableMotor(boolean enable, float targetVelocity, float maxMotorImpulse) {
         enableMotor(objectId, enable, targetVelocity, maxMotorImpulse);
@@ -85,18 +120,33 @@ public class HingeJoint extends PhysicsJoint {
 
     private native void enableMotor(long objectId, boolean enable, float targetVelocity, float maxMotorImpulse);
 
+    /**
+     * Test whether this joint's motor is enabled.
+     *
+     * @return true if enabled, otherwise false
+     */
     public boolean getEnableMotor() {
         return getEnableAngularMotor(objectId);
     }
 
     private native boolean getEnableAngularMotor(long objectId);
 
+    /**
+     * Read the motor's target velocity.
+     *
+     * @return velocity
+     */
     public float getMotorTargetVelocity() {
         return getMotorTargetVelocity(objectId);
     }
 
     private native float getMotorTargetVelocity(long objectId);
 
+    /**
+     * Read the motor's maximum impulse.
+     *
+     * @return impulse
+     */
     public float getMaxMotorImpulse() {
         return getMaxMotorImpulse(objectId);
     }
@@ -104,9 +154,10 @@ public class HingeJoint extends PhysicsJoint {
     private native float getMaxMotorImpulse(long objectId);
 
     /**
-     * Sets the limits of this joint.
-     * @param low the low limit in radians.
-     * @param high the high limit in radians.
+     * Alter this joint's limits.
+     *
+     * @param low the desired lower limit of the hinge angle (in radians)
+     * @param high the desired upper limit of the joint angle (in radians)
      */
     public void setLimit(float low, float high) {
         setLimit(objectId, low, high);
@@ -115,13 +166,20 @@ public class HingeJoint extends PhysicsJoint {
     private native void setLimit(long objectId, float low, float high);
 
     /**
-     * Sets the limits of this joint.
-     * If you're above the softness, velocities that would shoot through the actual limit are slowed down. The bias be in the range of 0.2 - 0.5.
-     * @param low the low limit in radians.
-     * @param high the high limit in radians.
-     * @param _softness the factor at which the velocity error correction starts operating,i.e a softness of 0.9 means that the vel. corr starts at 90% of the limit range.
-     * @param _biasFactor the magnitude of the position correction. It tells you how strictly the position error (drift ) is corrected.
-     * @param _relaxationFactor the rate at which velocity errors are corrected. This can be seen as the strength of the limits. A low value will make the limits more spongy.
+     * Alter this joint's limits. If you're above the softness, velocities that
+     * would shoot through the actual limit are slowed down. The bias should be
+     * in the range of 0.2 - 0.5.
+     *
+     * @param low the desired lower limit of the hinge angle (in radians)
+     * @param high the desired upper limit of the joint angle (in radians)
+     * @param _softness the desired range fraction at which velocity-error
+     * correction starts operating. A softness of 0.9 means that the correction
+     * starts at 90% of the limit range. (default=0.9)
+     * @param _biasFactor the desired magnitude of the position correction, how
+     * strictly position errors (drift) is corrected. (default=0.3)
+     * @param _relaxationFactor the desired rate at which velocity errors are
+     * corrected. This can be seen as the strength of the limits. A low value
+     * will make the limits more spongy. (default=1)
      */
     public void setLimit(float low, float high, float _softness, float _biasFactor, float _relaxationFactor) {
         biasFactor = _biasFactor;
@@ -132,18 +190,34 @@ public class HingeJoint extends PhysicsJoint {
 
     private native void setLimit(long objectId, float low, float high, float _softness, float _biasFactor, float _relaxationFactor);
 
+    /**
+     * Read the upper limit of the hinge angle.
+     *
+     * @return angle (in radians)
+     */
     public float getUpperLimit() {
         return getUpperLimit(objectId);
     }
 
     private native float getUpperLimit(long objectId);
 
+    /**
+     * Read the lower limit of the hinge angle.
+     *
+     * @return the angle (in radians)
+     */
     public float getLowerLimit() {
         return getLowerLimit(objectId);
     }
 
     private native float getLowerLimit(long objectId);
 
+    /**
+     * Alter the hinge translation flag.
+     *
+     * @param angularOnly true&rarr;rotate only, false&rarr;rotate and translate
+     * (default=false)
+     */
     public void setAngularOnly(boolean angularOnly) {
         this.angularOnly = angularOnly;
         setAngularOnly(objectId, angularOnly);
@@ -151,12 +225,23 @@ public class HingeJoint extends PhysicsJoint {
 
     private native void setAngularOnly(long objectId, boolean angularOnly);
 
+    /**
+     * Read the hinge angle.
+     *
+     * @return the angle (in radians)
+     */
     public float getHingeAngle() {
         return getHingeAngle(objectId);
     }
 
     private native float getHingeAngle(long objectId);
 
+    /**
+     * Serialize this joint, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);
@@ -177,6 +262,12 @@ public class HingeJoint extends PhysicsJoint {
         capsule.write(getMaxMotorImpulse(), "maxMotorImpulse", 0.0f);
     }
 
+    /**
+     * De-serialize this joint, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         super.read(im);
         InputCapsule capsule = im.getCapsule(this);
@@ -200,9 +291,13 @@ public class HingeJoint extends PhysicsJoint {
         setLimit(lowerLimit, upperLimit, limitSoftness, biasFactor, relaxationFactor);
     }
 
+    /**
+     * Create the configured joint in Bullet.
+     */
     protected void createJoint() {
         objectId = createJoint(nodeA.getObjectId(), nodeB.getObjectId(), pivotA, axisA, pivotB, axisB);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Joint {0}", Long.toHexString(objectId));
+        setAngularOnly(objectId, angularOnly);
     }
 
     private native long createJoint(long objectIdA, long objectIdB, Vector3f pivotA, Vector3f axisA, Vector3f pivotB, Vector3f axisB);

+ 94 - 10
jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2018 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,24 +39,59 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * <p>PhysicsJoint - Basic Phyiscs Joint</p>
+ * The abstract base class for physics joints based on Bullet's
+ * btTypedConstraint, used to connect 2 dynamic rigid bodies in the same
+ * physics space.
+ * <p>
+ * Joints include ConeJoint, HingeJoint, Point2PointJoint, and SixDofJoint.
+ *
  * @author normenhansen
  */
 public abstract class PhysicsJoint implements Savable {
 
+    /**
+     * Unique identifier of the Bullet constraint. Constructors are responsible
+     * for setting this to a non-zero value. After that, the id never changes.
+     */
     protected long objectId = 0;
+    /**
+     * one of the connected rigid bodies
+     */
     protected PhysicsRigidBody nodeA;
+    /**
+     * the other connected rigid body
+     */
     protected PhysicsRigidBody nodeB;
+    /**
+     * local offset of this joint's connection point in node A
+     */
     protected Vector3f pivotA;
+    /**
+     * local offset of this joint's connection point in node B
+     */
     protected Vector3f pivotB;
     protected boolean collisionBetweenLinkedBodys = true;
 
+    /**
+     * No-argument constructor needed by SavableClassUtil. Do not invoke
+     * directly!
+     */
     public PhysicsJoint() {
     }
 
     /**
-     * @param pivotA local translation of the joint connection point in node A
-     * @param pivotB local translation of the joint connection point in node B
+     * Instantiate a PhysicsJoint. To be effective, the joint must be added to
+     * the physics space of the two bodies. Also, the bodies must be dynamic and
+     * distinct.
+     *
+     * @param nodeA the 1st body connected by the joint (not null, alias
+     * created)
+     * @param nodeB the 2nd body connected by the joint (not null, alias
+     * created)
+     * @param pivotA local offset of the joint connection point in node A (not
+     * null, alias created)
+     * @param pivotB local offset of the joint connection point in node B (not
+     * null, alias created)
      */
     public PhysicsJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB) {
         this.nodeA = nodeA;
@@ -67,6 +102,11 @@ public abstract class PhysicsJoint implements Savable {
         nodeB.addJoint(this);
     }
 
+    /**
+     * Read the magnitude of the applied impulse.
+     *
+     * @return impulse
+     */
     public float getAppliedImpulse() {
         return getAppliedImpulse(objectId);
     }
@@ -74,52 +114,84 @@ public abstract class PhysicsJoint implements Savable {
     private native float getAppliedImpulse(long objectId);
 
     /**
-     * @return the constraint
+     * Read the id of the Bullet constraint.
+     *
+     * @return the unique identifier (not zero)
      */
     public long getObjectId() {
         return objectId;
     }
 
     /**
-     * @return the collisionBetweenLinkedBodys
+     * Test whether collisions are allowed between the linked bodies.
+     *
+     * @return true if collision are allowed, otherwise false
      */
     public boolean isCollisionBetweenLinkedBodys() {
         return collisionBetweenLinkedBodys;
     }
 
     /**
-     * toggles collisions between linked bodys<br>
-     * joint has to be removed from and added to PhyiscsSpace to apply this.
-     * @param collisionBetweenLinkedBodys set to false to have no collisions between linked bodys
+     * Enable or disable collisions between the linked bodies. The joint must be
+     * removed from and added to PhysicsSpace for this change to be effective.
+     *
+     * @param collisionBetweenLinkedBodys true &rarr; allow collisions, false &rarr; prevent them
      */
     public void setCollisionBetweenLinkedBodys(boolean collisionBetweenLinkedBodys) {
         this.collisionBetweenLinkedBodys = collisionBetweenLinkedBodys;
     }
 
+    /**
+     * Access the 1st body specified in during construction.
+     *
+     * @return the pre-existing body
+     */
     public PhysicsRigidBody getBodyA() {
         return nodeA;
     }
 
+    /**
+     * Access the 2nd body specified in during construction.
+     *
+     * @return the pre-existing body
+     */
     public PhysicsRigidBody getBodyB() {
         return nodeB;
     }
 
+    /**
+     * Access the local offset of the joint connection point in node A.
+     *
+     * @return the pre-existing vector (not null)
+     */
     public Vector3f getPivotA() {
         return pivotA;
     }
 
+    /**
+     * Access the local offset of the joint connection point in node A.
+     *
+     * @return the pre-existing vector (not null)
+     */
     public Vector3f getPivotB() {
         return pivotB;
     }
 
     /**
-     * destroys this joint and removes it from its connected PhysicsRigidBodys joint lists
+     * Destroy this joint and remove it from the joint lists of its connected
+     * bodies.
      */
     public void destroy() {
         getBodyA().removeJoint(this);
         getBodyB().removeJoint(this);
     }
 
+    /**
+     * Serialize this joint, for example when saving to a J3O file.
+     *
+     * @param ex exporter (not null)
+     * @throws IOException from exporter
+     */
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.write(nodeA, "nodeA", null);
@@ -128,6 +200,12 @@ public abstract class PhysicsJoint implements Savable {
         capsule.write(pivotB, "pivotB", null);
     }
 
+    /**
+     * De-serialize this joint, for example when loading from a J3O file.
+     *
+     * @param im importer (not null)
+     * @throws IOException from importer
+     */
     public void read(JmeImporter im) throws IOException {
         InputCapsule capsule = im.getCapsule(this);
         this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", new PhysicsRigidBody()));
@@ -136,6 +214,12 @@ public abstract class PhysicsJoint implements Savable {
         this.pivotB = (Vector3f) capsule.readSavable("pivotB", new Vector3f());
     }
 
+    /**
+     * Finalize this physics joint just before it is destroyed. Should be
+     * invoked only by a subclass or by the garbage collector.
+     *
+     * @throws Throwable ignored by the garbage collector
+     */
     @Override
     protected void finalize() throws Throwable {
         super.finalize();

Некоторые файлы не были показаны из-за большого количества измененных файлов