bullet_pitfalls.adoc 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. = Bullet Physics Pitfalls
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../
  6. :imagesdir: ../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. 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.
  9. == Sweep Test Issues
  10. . 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.
  11. . 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.
  12. == Ghost Control AABB Collision only
  13. 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.
  14. *Workaround:*+
  15. 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].
  16. == Rigid bodies fall through ground
  17. This usually happens if the ground physics object has large triangles or consists of a large BoxCollisionShape.
  18. *Workaround:*+
  19. * For meshes with large triangles - Subdivide the mesh in a model editor such as Blender.
  20. * For large boxes - seperate into smaller boxes or use a MeshCollisionShape for terrain instead of BoxCollisionShape.