Package com.jme3.bullet.util
Class CollisionShapeFactory
java.lang.Object
com.jme3.bullet.util.CollisionShapeFactory
A utility class for generating collision shapes from Spatials.
 
This class is shared between JBullet and Native Bullet.
- 
Method SummaryModifier and TypeMethodDescriptionstatic CollisionShapecreateBoxShape(Spatial spatial) Create a box shape for the given Spatial.static CollisionShapecreateDynamicMeshShape(Spatial spatial) Create a hull shape for the given Spatial.static CollisionShapecreateMeshShape(Spatial spatial) Create a mesh shape for the given Spatial.static voidshiftCompoundShapeContents(CompoundCollisionShape compoundShape, Vector3f vector) This method moves each child shape of a compound shape by the given vector
- 
Method Details- 
createMeshShapeCreate a mesh shape for the given 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. - Parameters:
- spatial- the spatial on which to base the shape (not null)
- Returns:
- A MeshCollisionShape or a CompoundCollisionShape with MeshCollisionShapes as children if the supplied spatial is a Node. A HeightfieldCollisionShape if a TerrainQuad was supplied.
 
- 
createDynamicMeshShapeCreate a hull shape for the given Spatial.For mesh-accurate animated meshes (CPU intense!) use GImpact shapes. - Parameters:
- spatial- the spatial on which to base the shape (not null)
- Returns:
- a HullCollisionShape (if spatial is a Geometry) or a CompoundCollisionShape with HullCollisionShapes as children (if spatial is a Node)
 
- 
createBoxShapeCreate a box shape for the given Spatial.- Parameters:
- spatial- the spatial on which to base the shape (not null)
- Returns:
- a BoxCollisionShape (if spatial is a Geometry) or a CompoundCollisionShape with BoxCollisionShapes as children (if spatial is a Node)
 
- 
shiftCompoundShapeContentspublic static void shiftCompoundShapeContents(CompoundCollisionShape compoundShape, Vector3f vector) This method moves each child shape of a compound shape by the given vector- Parameters:
- compoundShape- the shape to modify (not null)
- vector- the offset vector (not null, unaffected)
 
 
-