public class CapsuleCollisionShape extends CollisionShape
margin, objectId, scale| Modifier | Constructor and Description |
|---|---|
protected |
CapsuleCollisionShape()
No-argument constructor needed by SavableClassUtil.
|
|
CapsuleCollisionShape(float radius,
float height)
Instantiate a Y-axis capsule shape with the specified radius and height.
|
|
CapsuleCollisionShape(float radius,
float height,
int axis)
Instantiate a capsule shape around the specified main (height) axis.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createShape()
Instantiate the configured shape in Bullet.
|
int |
getAxis()
Determine the main (height) axis of the capsule.
|
float |
getHeight()
Read the height (of the cylindrical portion) of the capsule.
|
float |
getRadius()
Read the radius of the capsule.
|
void |
read(JmeImporter im)
De-serialize this shape, for example when loading from a J3O file.
|
void |
setScale(Vector3f scale)
Alter the scaling factors of this shape.
|
void |
write(JmeExporter ex)
Serialize this shape, for example when saving to a J3O file.
|
finalize, getDefaultMargin, getMargin, getObjectId, getScale, isNonMoving, setDefaultMargin, setMargin, setObjectIdprotected CapsuleCollisionShape()
public CapsuleCollisionShape(float radius,
float height)
radius - the desired radius (≥0)height - the desired height (of the cylindrical portion) (≥0)public CapsuleCollisionShape(float radius,
float height,
int axis)
radius - the desired radius (≥0)height - the desired height (of the cylindrical portion) (≥0)axis - which local axis: 0→X, 1→Y, 2→Zpublic float getRadius()
public float getHeight()
public int getAxis()
public void setScale(Vector3f scale)
setScale in class CollisionShapescale - the desired scaling factor for each local axis (not null, no
negative component, unaffected, default=1,1,1)public void write(JmeExporter ex) throws java.io.IOException
write in interface Savablewrite in class CollisionShapeex - exporter (not null)java.io.IOException - from exporterpublic void read(JmeImporter im) throws java.io.IOException
read in interface Savableread in class CollisionShapeim - importer (not null)java.io.IOException - from importerprotected void createShape()