bullet_pitfalls.adoc 1.6 KB

123456789101112131415161718192021222324252627282930
  1. = Bullet Physics Pitfalls
  2. :revnumber: 2.0
  3. :revdate: 2020/07/27
  4. Bullet physics is not without its problems. Unfortunately, many of those are outside of the control of the jMonkeyEngine Core Team and thus cannot be fixed.
  5. == Sweep Test Issues
  6. . When using link:{link-javadoc}/com/jme3/bullet/PhysicsSpace.html#sweepTest(com.jme3.bullet.collision.shapes.CollisionShape, com.jme3.math.Transform, com.jme3.math.Transform)[PhysicsSpace.sweepTest()], ensure that the distance between the transforms is at least 0.4wu or greater.
  7. . Note that the sweep will not detect collisions if it done inside of a collision shape. It must be on the edge of a collision shape to detect any collisions.
  8. == Ghost Control AABB Collision only
  9. As the javadoc for link:{link-javadoc}/com/jme3/bullet/objects/PhysicsGhostObject.html[PhysicsObjectControl] says, the ghost object collision detection uses AABB (Axis-aligned bounding box) collision only, regardless of the collision shape it has been assigned.
  10. *Workaround:*+
  11. Please use PhysicsSpace.sweepTest() instead, or kinematic physics objects with link:{link-javadoc}/com/jme3/bullet/PhysicsSpace.html#addCollisionListener(com.jme3.bullet.collision.PhysicsCollisionListener)[collision listeners].
  12. == Rigid bodies fall through ground
  13. This usually happens if the ground physics object has large triangles or consists of a large BoxCollisionShape.
  14. *Workaround:*+
  15. * For meshes with large triangles - Subdivide the mesh in a model editor such as Blender.
  16. * For large boxes - separate into smaller boxes or use a MeshCollisionShape for terrain instead of BoxCollisionShape.