Class BoxCollider


public final class BoxCollider extends ColliderShape
Axis-aligned-in-body-space box centred at the body's local origin. Half-extents are the distances from the centre to each face.
  • Nested Class Summary

    Nested classes/interfaces inherited from class jsim.collision.ColliderShape

    ColliderShape.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    Half-extents along each body-local axis (metres).
    final double
    Half-extents along each body-local axis (metres).
    final double
    Half-extents along each body-local axis (metres).
  • Constructor Summary

    Constructors
    Constructor
    Description
    BoxCollider(double halfX, double halfY, double halfZ)
    Create a box collider with the given half-extents.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    computeAABB(edu.wpi.first.math.geometry.Pose3d pose, double[] out)
    Compute the world-space AABB of this shape given the body's pose.
    The shape type of this collider.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • halfX

      public final double halfX
      Half-extents along each body-local axis (metres).
    • halfY

      public final double halfY
      Half-extents along each body-local axis (metres).
    • halfZ

      public final double halfZ
      Half-extents along each body-local axis (metres).
  • Constructor Details

    • BoxCollider

      public BoxCollider(double halfX, double halfY, double halfZ)
      Create a box collider with the given half-extents.
      Parameters:
      halfX - half-extent along the body-local X axis (metres)
      halfY - half-extent along the body-local Y axis (metres)
      halfZ - half-extent along the body-local Z axis (metres)
  • Method Details

    • getType

      public ColliderShape.Type getType()
      Description copied from class: ColliderShape
      The shape type of this collider.
      Specified by:
      getType in class ColliderShape
      Returns:
      this shape's type tag
    • computeAABB

      public void computeAABB(edu.wpi.first.math.geometry.Pose3d pose, double[] out)
      Description copied from class: ColliderShape
      Compute the world-space AABB of this shape given the body's pose.
      Specified by:
      computeAABB in class ColliderShape
      Parameters:
      pose - world-space pose of the body (position in metres, orientation as quaternion)
      out - receives [minX, minY, minZ, maxX, maxY, maxZ] in metres