public class SimplexCollisionShape extends ConvexShape
btBU_Simplex1to4. These shapes cannot be scaled.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
loggerXenableContactFilter, logger, margin, scaleloggerN| Constructor and Description |
|---|
SimplexCollisionShape(java.nio.FloatBuffer buffer,
int startPosition,
int endPosition)
Instantiate a simplex shape based on the specified FloatBuffer range.
|
SimplexCollisionShape(Vector3f location)
Instantiate a point shape based on the specified location.
|
SimplexCollisionShape(Vector3f[] vertices)
Instantiate a simplex shape based on the specified array.
|
SimplexCollisionShape(Vector3f point1,
Vector3f point2)
Instantiate a line-segment shape based on the specified endpoints.
|
SimplexCollisionShape(Vector3f vertex1,
Vector3f vertex2,
Vector3f vertex3)
Instantiate a triangular shape based on the specified vertices.
|
SimplexCollisionShape(Vector3f vertex1,
Vector3f vertex2,
Vector3f vertex3,
Vector3f vertex4)
Instantiate a tetrahedral shape based on the specified vertices.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canScale(Vector3f scale)
Test whether the specified scale factors can be applied to the shape.
|
Vector3f |
copyVertex(int index,
Vector3f storeResult)
Copy the indexed vertex.
|
float[] |
copyVertices()
Copy the unscaled vertex locations.
|
int |
countMeshVertices()
Count the points used to generate the simplex.
|
Vector3f |
getHalfExtents(Vector3f storeResult)
Calculate the unscaled half extents of the simplex.
|
float |
maxRadius()
Calculate how far the shape extends from its origin, including margin.
|
protected void |
recalculateAabb()
Recalculate the shape's bounding box if necessary.
|
HullCollisionShape |
toHullShape()
Approximate this shape with a HullCollisionShape.
|
float |
unscaledVolume()
Calculate the unscaled volume of the simplex.
|
isConcave, isConvex, scaledVolume, toSplittableShapeaabbCenter, boundingBox, boundingBox, canSplit, getDefaultMargin, getMargin, getScale, getScaleDp, getShapeType, getShapeType, isContactFilterEnabled, isInfinite, isNonMoving, isPolyhedral, 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 SimplexCollisionShape(Vector3f location)
location - the location of the point (in shape coordinates, not
null, unaffected)public SimplexCollisionShape(Vector3f point1, Vector3f point2)
point1 - the location of first endpoint (in shape coordinates, not
null, unaffected)point2 - the location of 2nd endpoint (in shape coordinates, not
null, unaffected)public SimplexCollisionShape(Vector3f vertex1, Vector3f vertex2, Vector3f vertex3)
vertex1 - the location of first vertex (in shape coordinates, not
null, unaffected)vertex2 - the location of 2nd vertex (in shape coordinates, not
null, unaffected)vertex3 - the location of 3rd vertex (in shape coordinates, not
null, unaffected)public SimplexCollisionShape(Vector3f vertex1, Vector3f vertex2, Vector3f vertex3, Vector3f vertex4)
vertex1 - the location of first vertex (in shape coordinates, not
null, unaffected)vertex2 - the location of 2nd vertex (in shape coordinates, not
null, unaffected)vertex3 - the location of 3rd vertex (in shape coordinates, not
null, unaffected)vertex4 - the location of 4th vertex (in shape coordinates, not
null, unaffected)public SimplexCollisionShape(java.nio.FloatBuffer buffer,
int startPosition,
int endPosition)
buffer - the buffer that contains the vertex locations (not null,
unaffected)startPosition - the buffer position at which the vertex locations
start (≥0, ≤endPosition-3)endPosition - the buffer position at which the vertex locations end
(≥startPosition+3, ≤capacity)public SimplexCollisionShape(Vector3f[] vertices)
vertices - an array of vertex locations (not null, not empty,
unaffected)public Vector3f copyVertex(int index, Vector3f storeResult)
index - (≥0, <4)storeResult - storage for the result (modified if not null)public float[] copyVertices()
public int countMeshVertices()
public Vector3f getHalfExtents(Vector3f storeResult)
storeResult - storage for the result (modified if not null)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 maxRadius()
maxRadius in class CollisionShapeprotected void recalculateAabb()
recalculateAabb in class CollisionShapepublic HullCollisionShape toHullShape()
toHullShape in class ConvexShape