Class SphereCollider

java.lang.Object
rosequartz.coll.Collider
rosequartz.coll.SphereCollider
All Implemented Interfaces:
Serializable

public final class SphereCollider extends Collider implements Serializable
Represents a collider in the shape of a sphere.
See Also:
Serialized Form
  • Constructor Details

    • SphereCollider

      public SphereCollider(float x, float y, float z, float radius)
      Constructs a sphere-collider from the position of its center and its radius.
      Parameters:
      x - position of the center on the x-axis
      y - position of the center on the y-axis
      z - position of the center on the z-axis
      radius - radius
    • SphereCollider

      public SphereCollider(Vec3 xyz, float radius)
      Constructs a sphere-collider from the position of its center and its radius.
      Parameters:
      xyz - position of the center
      radius - radius
  • Method Details

    • setPosition

      public SphereCollider setPosition(float x, float y, float z)
      Sets the position of the center of the sphere.
      Parameters:
      x - position of the center on the x-axis
      y - position of the center on the y-axis
      z - position of the center on the z-axis
      Returns:
      this
    • setPosition

      public SphereCollider setPosition(Vec3 xyz)
      Sets the position of the center of the sphere.
      Parameters:
      xyz - position of the center
      Returns:
      this
    • setRadius

      public SphereCollider setRadius(float radius)
      Sets the radius of the sphere.
      Parameters:
      radius - radius
      Returns:
      this
    • getCenterX

      public float getCenterX()
    • getCenterY

      public float getCenterY()
    • getCenterZ

      public float getCenterZ()
    • getRadius

      public float getRadius()
      Gets the radius of the sphere.
      Returns:
      radius
    • toString

      public String toString()
      Overrides:
      toString in class Object