Package com.jme3.bullet.collision.shapes
Class CapsuleCollisionShape
java.lang.Object
com.jme3.bullet.collision.shapes.CollisionShape
com.jme3.bullet.collision.shapes.CapsuleCollisionShape
- All Implemented Interfaces:
Savable
Basic capsule collision shape
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected floatprotected floatFields inherited from class com.jme3.bullet.collision.shapes.CollisionShape
cShape, margin, scale -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCapsuleCollisionShape(float radius, float height) Creates a new CapsuleCollisionShape with the given radius and height.CapsuleCollisionShape(float radius, float height, int axis) Creates a capsule shape around the given axis (0=X,1=Y,2=Z). -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintgetAxis()floatfloatvoidread(JmeImporter im) voidwrite(JmeExporter ex) Methods inherited from class com.jme3.bullet.collision.shapes.CollisionShape
calculateLocalInertia, getCShape, getDefaultMargin, getMargin, getScale, setCShape, setDefaultMargin, setMargin, setScale
-
Field Details
-
radius
protected float radius -
height
protected float height -
axis
protected int axis
-
-
Constructor Details
-
CapsuleCollisionShape
protected CapsuleCollisionShape() -
CapsuleCollisionShape
public CapsuleCollisionShape(float radius, float height) Creates a new CapsuleCollisionShape with the given radius and height. The capsule is oriented along the Y axis (1).- Parameters:
radius- the radius of the capsuleheight- the height of the capsule
-
CapsuleCollisionShape
public CapsuleCollisionShape(float radius, float height, int axis) Creates a capsule shape around the given axis (0=X,1=Y,2=Z).- Parameters:
radius- the desired unscaled radiusheight- the desired unscaled height of the cylindrical portionaxis- which local axis for the height: 0→X, 1→Y, 2→Z
-
-
Method Details
-
getRadius
public float getRadius() -
getHeight
public float getHeight() -
getAxis
public int getAxis() -
write
- Specified by:
writein interfaceSavable- Overrides:
writein classCollisionShape- Throws:
IOException
-
read
- Specified by:
readin interfaceSavable- Overrides:
readin classCollisionShape- Throws:
IOException
-
createShape
protected void createShape()
-