public class SphereCollisionShape extends ConvexShape
btSphereShape. 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 |
|---|
SphereCollisionShape(float radius)
Instantiate a sphere shape with the specified radius.
|
SphereCollisionShape(java.nio.FloatBuffer buffer,
int startPosition,
int endPosition)
Instantiate a sphere shape that encloses the sample locations in the
specified FloatBuffer range.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canScale(Vector3f scale)
Test whether the specified scale factors can be applied to the shape.
|
float |
getMargin()
Return the collision margin of the shape.
|
float |
getRadius()
Return the radius of the sphere.
|
float |
maxRadius()
Calculate how far the scaled shape extends from its center.
|
float |
scaledVolume()
Estimate the volume of this shape, including scale and margin.
|
void |
setMargin(float margin)
Alter the collision margin of this shape.
|
HullCollisionShape |
toHullShape()
Approximate this shape with a HullCollisionShape.
|
float |
unscaledVolume()
Return the unscaled volume of the sphere.
|
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 SphereCollisionShape(java.nio.FloatBuffer buffer,
int startPosition,
int endPosition)
buffer - the buffer that contains the sample locations (not null,
unaffected)startPosition - the position at which the sample locations start
(≥0, ≤endPosition)endPosition - the position at which the sample locations end
(≥startPosition, ≤capacity)public SphereCollisionShape(float radius)
radius - the desired unscaled radius (in shape units, ≥0)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