public class MultiSphere extends ConvexShape
btMultiSphereShape. Unlike
a CapsuleCollisionShape or a SphereCollisionShape, these
shapes have margins and can be scaled non-uniformly.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
loggerXenableContactFilter, logger, margin, scaleloggerN| Constructor and Description |
|---|
MultiSphere(float radius)
Instantiate a centered sphere shape with the specified radius.
|
MultiSphere(float radius,
float height)
Instantiate a centered Y-axis capsule shape with the specified radius and
height.
|
MultiSphere(float radius,
float height,
int axisIndex)
Instantiate a centered capsule shape with the specified radius, height,
and axis.
|
MultiSphere(java.util.List<Vector3f> centers,
java.util.List<java.lang.Float> radii)
Instantiate a multi-sphere shape with the specified centers and radii.
|
MultiSphere(RectangularSolid rectangularSolid)
Instantiate a 4-sphere shape to fill the specified RectangularSolid.
|
MultiSphere(Vector3f[] centers,
float... radii)
Instantiate a multi-sphere shape with the specified centers and radii.
|
MultiSphere(Vector3f center,
float radius)
Instantiate an eccentric sphere shape with the specified center and
radius.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3f |
copyCenter(int sphereIndex,
Vector3f storeResult)
Copy the location of the center of the indexed sphere.
|
int |
countSpheres()
Count the spheres in the shape.
|
float |
getRadius(int sphereIndex)
Return the radius of the indexed sphere.
|
protected void |
recalculateAabb()
Recalculate the shape's bounding box if necessary.
|
float |
scaledVolume()
Estimate the volume of the shape, including scale and margin.
|
HullCollisionShape |
toHullShape()
Approximate this shape with a HullCollisionShape.
|
isConcave, isConvex, toSplittableShapeaabbCenter, boundingBox, boundingBox, canScale, canSplit, getDefaultMargin, getMargin, getScale, getScaleDp, getShapeType, getShapeType, isContactFilterEnabled, isInfinite, isNonMoving, isPolyhedral, maxRadius, nativeMargin, setContactFilterEnabled, setDefaultMargin, setMargin, 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 MultiSphere(float radius)
radius - the desired radius (in shape units, ≥0)public MultiSphere(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 MultiSphere(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 MultiSphere(java.util.List<Vector3f> centers, java.util.List<java.lang.Float> radii)
centers - the list of center locations (in shape coordinates, not
null, not empty)radii - the list of radii (in shape units, not null, not empty, each
≥0)public MultiSphere(RectangularSolid rectangularSolid)
rectangularSolid - the solid on which to base the shape (not null)public MultiSphere(Vector3f center, float radius)
center - the location of the sphere's center (in shape coordinates,
not null, unaffected)radius - the desired radius (in shape units, ≥0)public MultiSphere(Vector3f[] centers, float... radii)
centers - the array of center locations (in shape coordinates, not
null, not empty)radii - the array of radii (in shape units, not null, not empty,
each ≥0)public Vector3f copyCenter(int sphereIndex, Vector3f storeResult)
sphereIndex - which sphere to read (≥0)storeResult - storage for the result (modified if not null)storeResult or a new instance, not null)public int countSpheres()
public float getRadius(int sphereIndex)
sphereIndex - which sphere to read (≥0)protected void recalculateAabb()
recalculateAabb in class CollisionShapepublic float scaledVolume()
scaledVolume in class ConvexShapepublic HullCollisionShape toHullShape()
toHullShape in class ConvexShape