Class SphereCollider

java.lang.Object
jsim.collision.ColliderShape
jsim.collision.SphereCollider

public final class SphereCollider extends ColliderShape
Sphere shape centred at the body's local origin.
  • Field Details

    • radius

      public final double radius
      Radius of the sphere in metres.
  • Constructor Details

    • SphereCollider

      public SphereCollider(double radius)
      Creates a sphere collider with the given radius.
      Parameters:
      radius - the sphere radius in metres; must be positive
  • 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