public class CollisionShapeFactory
extends java.lang.Object
This class is shared between JBullet and Native Bullet.
Modifier and Type | Method and Description |
---|---|
static CollisionShape |
createBoxShape(Spatial spatial)
Create a box shape for the given Spatial.
|
static CollisionShape |
createDynamicMeshShape(Spatial spatial)
Create a hull shape for the given Spatial.
|
static CollisionShape |
createMeshShape(Spatial spatial)
Create a mesh shape for the given Spatial.
|
static void |
shiftCompoundShapeContents(CompoundCollisionShape compoundShape,
Vector3f vector)
This method moves each child shape of a compound shape by the given vector
|
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.
spatial
- the spatial on which to base the shape (not null)public static CollisionShape createDynamicMeshShape(Spatial spatial)
For mesh-accurate animated meshes (CPU intense!) use GImpact shapes.
spatial
- the spatial on which to base the shape (not null)public static CollisionShape createBoxShape(Spatial spatial)
spatial
- the spatial on which to base the shape (not null)public static void shiftCompoundShapeContents(CompoundCollisionShape compoundShape, Vector3f vector)
compoundShape
- the shape to modify (not null)vector
- the offset vector (not null, unaffected)