Class PlaneCollider

java.lang.Object
jsim.collision.ColliderShape
jsim.collision.PlaneCollider

public final class PlaneCollider extends ColliderShape
Infinite half-space collider.

The plane is defined in the body's local frame as: n·p = d, where n is the outward normal and d is the signed distance from the body's local origin. For a floor at Z=0 with normal pointing up, use normal (0,0,1) and offset 0.

PlaneColliders must be attached to RigidBodyFlags.STATIC bodies. They produce an AABB that covers the entire simulation volume.

  • Nested Class Summary

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

    ColliderShape.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    Outward normal in body-local space (should be unit length).
    final double
    Outward normal in body-local space (should be unit length).
    final double
    Outward normal in body-local space (should be unit length).
    final double
    Signed distance from the body origin to the plane surface along the normal.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlaneCollider(double nx, double ny, double nz, double offset)
    Create an infinite half-space plane collider.
  • 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

    • nx

      public final double nx
      Outward normal in body-local space (should be unit length).
    • ny

      public final double ny
      Outward normal in body-local space (should be unit length).
    • nz

      public final double nz
      Outward normal in body-local space (should be unit length).
    • offset

      public final double offset
      Signed distance from the body origin to the plane surface along the normal.
  • Constructor Details

    • PlaneCollider

      public PlaneCollider(double nx, double ny, double nz, double offset)
      Create an infinite half-space plane collider.
      Parameters:
      nx - outward normal X component (will be normalized)
      ny - outward normal Y component
      nz - outward normal Z component
      offset - signed distance from the body origin to the plane surface along the normal
  • 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