Package com.jme3.bullet.collision.shapes
Class CollisionShape
java.lang.Object
com.jme3.bullet.collision.shapes.CollisionShape
- All Implemented Interfaces:
Savable
- Direct Known Subclasses:
BoxCollisionShape,CapsuleCollisionShape,CompoundCollisionShape,ConeCollisionShape,CylinderCollisionShape,GImpactCollisionShape,HeightfieldCollisionShape,HullCollisionShape,MeshCollisionShape,PlaneCollisionShape,SimplexCollisionShape,SphereCollisionShape
This Object holds information about a jbullet CollisionShape to be able to reuse
CollisionShapes (as suggested in bullet manuals)
TODO: add static methods to create shapes from nodes (like jbullet-jme constructor)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateLocalInertia(float mass, javax.vecmath.Vector3f vector) used internally, not safecom.bulletphysics.collision.shapes.CollisionShapeused internallystatic floatRead the default margin for new shapes.floatgetScale()voidread(JmeImporter im) voidsetCShape(com.bulletphysics.collision.shapes.CollisionShape cShape) used internallystatic voidsetDefaultMargin(float margin) Alter the default margin for new shapes.voidsetMargin(float margin) voidvoidwrite(JmeExporter ex)
-
Field Details
-
cShape
protected com.bulletphysics.collision.shapes.CollisionShape cShape -
scale
-
margin
protected float margincopy of collision margin (in physics-space units, >0, default=0)
-
-
Constructor Details
-
CollisionShape
protected CollisionShape()
-
-
Method Details
-
calculateLocalInertia
public void calculateLocalInertia(float mass, javax.vecmath.Vector3f vector) used internally, not safe- Parameters:
mass- the desired mass for the bodyvector- storage for the result (not null, modified)
-
getCShape
public com.bulletphysics.collision.shapes.CollisionShape getCShape()used internally- Returns:
- the pre-existing instance
-
setCShape
public void setCShape(com.bulletphysics.collision.shapes.CollisionShape cShape) used internally- Parameters:
cShape- the shape to use (alias created)
-
setScale
-
getMargin
public float getMargin() -
setDefaultMargin
public static void setDefaultMargin(float margin) Alter the default margin for new shapes.- Parameters:
margin- the desired margin distance (in physics-space units, >0, default=0.04)
-
getDefaultMargin
public static float getDefaultMargin()Read the default margin for new shapes.- Returns:
- margin the default margin distance (in physics-space units, >0)
-
setMargin
public void setMargin(float margin) -
getScale
-
write
- Specified by:
writein interfaceSavable- Throws:
IOException
-
read
- Specified by:
readin interfaceSavable- Throws:
IOException
-