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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateLocalInertia
(float mass, javax.vecmath.Vector3f vector) used internally, not safecom.bulletphysics.collision.shapes.CollisionShape
used internallystatic float
Read the default margin for new shapes.float
getScale()
void
read
(JmeImporter im) void
setCShape
(com.bulletphysics.collision.shapes.CollisionShape cShape) used internallystatic void
setDefaultMargin
(float margin) Alter the default margin for new shapes.void
setMargin
(float margin) void
void
write
(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:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-