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
Modifier and TypeFieldDescriptionprotected int
protected float
protected float
Fields inherited from class com.jme3.bullet.collision.shapes.CollisionShape
cShape, margin, scale
-
Constructor Summary
ModifierConstructorDescriptionprotected
CapsuleCollisionShape
(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 void
int
getAxis()
float
float
void
read
(JmeImporter im) void
write
(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:
write
in interfaceSavable
- Overrides:
write
in classCollisionShape
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classCollisionShape
- Throws:
IOException
-
createShape
protected void createShape()
-