Class CapsuleShapeSettings

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

public class CapsuleShapeSettings extends ConvexShapeSettings
Settings used to construct a CapsuleShape.
  • Constructor Details

    • CapsuleShapeSettings

      public CapsuleShapeSettings(float halfHeight, float radius)
      Instantiate settings for the specified dimensions.
      Parameters:
      halfHeight - half the desired height of the cylindrical portion
      radius - the desired radius
    • CapsuleShapeSettings

      public CapsuleShapeSettings(float halfHeight, float radius, PhysicsMaterial material)
      Instantiate settings for the specified dimensions and material.
      Parameters:
      halfHeight - half the desired height of the cylindrical portion
      radius - the desired radius
      material - the desired material (default=null)
  • Method Details

    • getHalfHeightOfCylinder

      public float getHalfHeightOfCylinder()
      Return the half height of the cylindrical portion. The settings are unaffected. (native attribute: mHalfHeightOfCylinder)
      Returns:
      half the height
    • getRadius

      public float getRadius()
      Return the radius. The settings are unaffected. (native attribute: mRadius)
      Returns:
      the radius (≥0)
    • setHalfHeightOfCylinder

      public void setHalfHeightOfCylinder(float halfHeight)
      Alter the half height of the cylindrical portion. (native attribute: mHalfHeightOfCylinder)
      Parameters:
      halfHeight - one half of the desired height of the cylindrical portion (≥0)
    • setRadius

      public void setRadius(float radius)
      Alter the radius. (native attribute: mRadius)
      Parameters:
      radius - the radius (≥0)