public class CapsuleCollisionShape extends ConvexShape
btCapsuleShapeX,
btCapsuleShape, or btCapsuleShapeZ. These shapes have no
margin and can only be scaled uniformly.MultiSphere| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
loggerXenableContactFilter, logger, margin, scaleloggerN| Constructor and Description |
|---|
CapsuleCollisionShape(float radius,
float height)
Instantiate a Y-axis capsule shape with the specified radius and height.
|
CapsuleCollisionShape(float radius,
float height,
int axisIndex)
Instantiate a capsule shape around the specified main (height) axis.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canScale(Vector3f scale)
Test whether the specified scale factors can be applied to the shape.
|
int |
getAxis()
Return the main (height) axis of the capsule.
|
float |
getHeight()
Return the height of the cylindrical portion.
|
float |
getMargin()
Return the collision margin of the shape.
|
float |
getRadius()
Return the radius of the capsule.
|
float |
maxRadius()
Calculate how far the scaled shape extends from its center.
|
float |
scaledVolume()
Estimate the volume of the shape, including scale and margin.
|
void |
setMargin(float margin)
Alter the collision margin of the shape.
|
HullCollisionShape |
toHullShape()
Approximate this shape with a HullCollisionShape.
|
float |
unscaledVolume()
Return the unscaled volume of the capsule.
|
isConcave, isConvex, toSplittableShapeaabbCenter, boundingBox, boundingBox, canSplit, getDefaultMargin, getScale, getScaleDp, getShapeType, getShapeType, isContactFilterEnabled, isInfinite, isNonMoving, isPolyhedral, nativeMargin, recalculateAabb, setContactFilterEnabled, setDefaultMargin, setNativeId, setScale, setScale, setUserIndex, setUserIndex2, toString, updateScale, userIndex, userIndex2compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObjectpublic static final java.util.logging.Logger logger2
public CapsuleCollisionShape(float radius,
float height)
radius - the desired radius (in shape units, ≥0)height - the desired height of the cylindrical portion (in shape
units, ≥0)public CapsuleCollisionShape(float radius,
float height,
int axisIndex)
radius - the desired radius (in shape units, ≥0)height - the desired height of the cylindrical portion (in shape
units, ≥0)axisIndex - which local axis to use for the height: 0→X,
1→Y, 2→Zpublic int getAxis()
public float getHeight()
public float getRadius()
public float unscaledVolume()
public boolean canScale(Vector3f scale)
canScale in class CollisionShapescale - the desired scale factor for each local axis (may be null,
unaffected)public float getMargin()
getMargin in class CollisionShapepublic float maxRadius()
maxRadius in class CollisionShapepublic float scaledVolume()
scaledVolume in class ConvexShapepublic void setMargin(float margin)
setMargin in class CollisionShapemargin - the desired margin thickness (in physics-space units)public HullCollisionShape toHullShape()
toHullShape in class ConvexShape