Class CapsuleShape

  extended by com.bulletphysics.collision.shapes.CollisionShape
      extended by com.bulletphysics.collision.shapes.ConvexShape
          extended by com.bulletphysics.collision.shapes.ConvexInternalShape
              extended by 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.

Field Summary
Fields inherited from class com.bulletphysics.collision.shapes.ConvexShape
Constructor Summary
CapsuleShape(float radius, float height)
Method Summary
 void batchedUnitVectorGetSupportingVertexWithoutMargin(Vector3f[] vectors, Vector3f[] supportVerticesOut, int numVectors)
 void calculateLocalInertia(float mass, Vector3f inertia)
 void getAabb(Transform t, Vector3f aabbMin, Vector3f aabbMax)
          getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
 float getHalfHeight()
 String getName()
 float getRadius()
 BroadphaseNativeType getShapeType()
 int getUpAxis()
 Vector3f localGetSupportingVertexWithoutMargin(Vector3f vec0, Vector3f out)
Methods inherited from class com.bulletphysics.collision.shapes.ConvexInternalShape
getAabbSlow, getLocalScaling, getMargin, getNumPreferredPenetrationDirections, getPreferredPenetrationDirection, localGetSupportingVertex, setLocalScaling, setMargin
Methods inherited from class com.bulletphysics.collision.shapes.CollisionShape
calculateTemporalAabb, getAngularMotionDisc, getBoundingSphere, getUserPointer, isCompound, isConcave, isConvex, isInfinite, isPolyhedral, setUserPointer
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CapsuleShape(float radius,
                    float height)
Method Detail


public Vector3f localGetSupportingVertexWithoutMargin(Vector3f vec0,
                                                      Vector3f out)
Specified by:
localGetSupportingVertexWithoutMargin in class ConvexShape


public void batchedUnitVectorGetSupportingVertexWithoutMargin(Vector3f[] vectors,
                                                              Vector3f[] supportVerticesOut,
                                                              int numVectors)
Specified by:
batchedUnitVectorGetSupportingVertexWithoutMargin in class ConvexShape


public void calculateLocalInertia(float mass,
                                  Vector3f inertia)
Specified by:
calculateLocalInertia in class CollisionShape


public BroadphaseNativeType getShapeType()
Specified by:
getShapeType in class CollisionShape


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.

getAabb in class ConvexInternalShape


public String getName()
Specified by:
getName in class CollisionShape


public int getUpAxis()


public float getRadius()


public float getHalfHeight()