com.jme3.bullet.util
Class CollisionShapeFactory
java.lang.Object
com.jme3.bullet.util.CollisionShapeFactory
public class CollisionShapeFactory
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollisionShapeFactory
public CollisionShapeFactory()
createMeshShape
public static CollisionShape createMeshShape(Spatial spatial)
- This type of collision shape is mesh-accurate and meant for immovable "world objects".
Examples include terrain, houses or whole shooter levels.
Objects with "mesh" type collision shape will not collide with each other.
Creates a HeightfieldCollisionShape if the supplied spatial is a TerrainQuad.
- Returns:
- A MeshCollisionShape or a CompoundCollisionShape with MeshCollisionShapes as children if the supplied spatial is a Node. A HeightieldCollisionShape if a TerrainQuad was supplied.
createDynamicMeshShape
public static CollisionShape createDynamicMeshShape(Spatial spatial)
- This method creates a hull shape for the given Spatial.
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.
- Returns:
- A HullCollisionShape or a CompoundCollisionShape with HullCollisionShapes as children if the supplied spatial is a Node.
createBoxShape
public static CollisionShape createBoxShape(Spatial spatial)
shiftCompoundShapeContents
public static void shiftCompoundShapeContents(CompoundCollisionShape compoundShape,
Vector3f vector)
- This method moves each child shape of a compound shape by the given vector
- Parameters:
vector
-