com.bulletphysics.collision.shapes
Class CapsuleShape
java.lang.Object
com.bulletphysics.collision.shapes.CollisionShape
com.bulletphysics.collision.shapes.ConvexShape
com.bulletphysics.collision.shapes.ConvexInternalShape
com.bulletphysics.collision.shapes.CapsuleShape
- Direct Known Subclasses:
- CapsuleShapeX, CapsuleShapeZ
public class CapsuleShape
- extends ConvexInternalShape
CapsuleShape represents a capsule around the Y axis, there is also the
CapsuleShapeX aligned around the X axis and CapsuleShapeZ around
the Z axis.
The total height is height+2*radius, so the height is just the height between
the center of each "sphere" of the capsule caps.
CapsuleShape is a convex hull of two spheres. The MultiSphereShape is
a more general collision shape that takes the convex hull of multiple sphere,
so it can also represent a capsule when just using two spheres.
|
Constructor Summary |
CapsuleShape(float radius,
float height)
|
CapsuleShape
public CapsuleShape(float radius,
float height)
localGetSupportingVertexWithoutMargin
public Vector3f localGetSupportingVertexWithoutMargin(Vector3f vec0,
Vector3f out)
- Specified by:
localGetSupportingVertexWithoutMargin in class ConvexShape
batchedUnitVectorGetSupportingVertexWithoutMargin
public void batchedUnitVectorGetSupportingVertexWithoutMargin(Vector3f[] vectors,
Vector3f[] supportVerticesOut,
int numVectors)
- Specified by:
batchedUnitVectorGetSupportingVertexWithoutMargin in class ConvexShape
calculateLocalInertia
public void calculateLocalInertia(float mass,
Vector3f inertia)
- Specified by:
calculateLocalInertia in class CollisionShape
getShapeType
public BroadphaseNativeType getShapeType()
- Specified by:
getShapeType in class CollisionShape
getAabb
public void getAabb(Transform t,
Vector3f aabbMin,
Vector3f aabbMax)
- Description copied from class:
ConvexInternalShape
- getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
- Overrides:
getAabb in class ConvexInternalShape
getName
public String getName()
- Specified by:
getName in class CollisionShape
getUpAxis
public int getUpAxis()
getRadius
public float getRadius()
getHalfHeight
public float getHalfHeight()