public class BoxCollisionShape extends ConvexShape
btBoxShape. For a rectangle, use Box2dShape.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
loggerXenableContactFilter, logger, margin, scaleloggerN| Constructor and Description |
|---|
BoxCollisionShape(float halfExtent)
Instantiate a cube with the specified half extent.
|
BoxCollisionShape(java.nio.FloatBuffer buffer,
int startPosition,
int endPosition)
Instantiate a box shape that encloses the sample locations in the
specified FloatBuffer range.
|
BoxCollisionShape(float xHalfExtent,
float yHalfExtent,
float zHalfExtent)
Instantiate a box with the specified half extents.
|
BoxCollisionShape(Vector3f halfExtents)
Instantiate a box with the specified half extents.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3f |
getHalfExtents(Vector3f storeResult)
Copy the half extents of the box.
|
float |
maxRadius()
Calculate how far the scaled shape extends from its center.
|
float |
scaledVolume()
Estimate the volume of the collision shape, including scale and margin.
|
HullCollisionShape |
toHullShape()
Approximate this shape with a HullCollisionShape.
|
float |
unscaledVolume()
Return the unscaled volume of the box.
|
isConcave, isConvex, toSplittableShapeaabbCenter, boundingBox, boundingBox, canScale, canSplit, getDefaultMargin, getMargin, getScale, getScaleDp, getShapeType, getShapeType, isContactFilterEnabled, isInfinite, isNonMoving, isPolyhedral, nativeMargin, recalculateAabb, 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 BoxCollisionShape(float halfExtent)
halfExtent - the desired half extent on each local axis, before
scaling and excluding margin (≥0)public BoxCollisionShape(float xHalfExtent,
float yHalfExtent,
float zHalfExtent)
xHalfExtent - the desired half extent on the local X axis, before
scaling and excluding margin (≥0)yHalfExtent - the desired half extent on the local Y axis, before
scaling and excluding margin (≥0)zHalfExtent - the desired half extent on the local Z axis, before
scaling and excluding margin (≥0)public BoxCollisionShape(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 BoxCollisionShape(Vector3f halfExtents)
halfExtents - the desired half extents on each local axis, before
scaling and excluding margin (not null, all components ≥0, unaffected)public Vector3f getHalfExtents(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public float unscaledVolume()
public float maxRadius()
maxRadius in class CollisionShapepublic float scaledVolume()
scaledVolume in class ConvexShapepublic HullCollisionShape toHullShape()
toHullShape in class ConvexShape