Class PxCapsuleController


public class PxCapsuleController extends PxController
A capsule character controller.

The capsule is defined as a position, a vertical height, and a radius. The height is the distance between the two sphere centers at the end of the capsule. In other words:

p = pos (returned by controller)
h = height
r = radius

p = center of capsule
top sphere center = p.y + h*0.5
bottom sphere center = p.y - h*0.5
top capsule point = p.y + h*0.5 + r
bottom capsule point = p.y - h*0.5 - r

  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxCapsuleController

      protected PxCapsuleController()
    • PxCapsuleController

      protected PxCapsuleController(long address)
  • Method Details

    • wrapPointer

      public static PxCapsuleController wrapPointer(long address)
    • arrayGet

      public static PxCapsuleController arrayGet(long baseAddress, int index)
    • getRadius

      public float getRadius()
      Gets controller's radius.
      Returns:
      The radius of the controller.
      See Also:
    • setRadius

      public boolean setRadius(float radius)
      Sets controller's radius.

      \warning this doesn't check for collisions.

      Parameters:
      radius - The new radius for the controller.
      Returns:
      Currently always true.
      See Also:
    • getHeight

      public float getHeight()
      Gets controller's height.
      Returns:
      The height of the capsule controller.
      See Also:
    • setHeight

      public boolean setHeight(float height)
      Resets controller's height.

      \warning this doesn't check for collisions.

      Parameters:
      height - The new height for the controller.
      Returns:
      Currently always true.
      See Also:
    • getClimbingMode

      public PxCapsuleClimbingModeEnum getClimbingMode()
      Gets controller's climbing mode.
      Returns:
      The capsule controller's climbing mode.
      See Also:
    • setClimbingMode

      public boolean setClimbingMode(PxCapsuleClimbingModeEnum mode)
      Sets controller's climbing mode.
      Parameters:
      mode - The capsule controller's climbing mode.
      See Also: