All Implemented Interfaces:
ConstJoltPhysicsObject, ConstShape, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class CapsuleShape extends ConvexShape
A Shape to represent a right circular cylinder capped by 2 hemispheres.
  • Constructor Details

    • CapsuleShape

      public CapsuleShape(float halfHeight, float radius)
      Instantiate a shape with the specified dimensions.
      Parameters:
      halfHeight - half the desired height of the cylindrical portion
      radius - the desired radius
  • Method Details

    • getHalfHeightOfCylinder

      public float getHalfHeightOfCylinder()
      Return the half height of the cylindrical portion. The shape is unaffected.
      Returns:
      1/2 of the height (≥0)
    • getRadius

      public float getRadius()
      Return the radius. The shape is unaffected.
      Returns:
      the radius (≥0)