Package org.joml

Class Spheref

    • Field Detail

      • x

        public float x
        The x coordinate of the sphere's center.
      • y

        public float y
        The y coordinate of the sphere's center.
      • z

        public float z
        The z coordinate of the sphere's center.
      • r

        public float r
        The sphere's radius.
    • Constructor Detail

      • Spheref

        public Spheref​()
        Create a new Spheref with center position (0, 0, 0) and radius = 0.
      • Spheref

        public Spheref​(Spheref source)
        Create a new Spheref as a copy of the given source.
        Parameters:
        source - the Spheref to copy from
      • Spheref

        public Spheref​(Vector3fc c,
                       float r)
        Create a new Spheref with center position c and radius r.
        Parameters:
        c - the center position of the sphere
        r - the radius of the sphere
      • Spheref

        public Spheref​(float x,
                       float y,
                       float z,
                       float r)
        Create a new Spheref with center position (x, y, z) and radius r.
        Parameters:
        x - the x coordinate of the sphere's center
        y - the y coordinate of the sphere's center
        z - the z coordinate of the sphere's center
        r - the radius of the sphere
    • Method Detail

      • translate

        public Spheref translate​(Vector3fc xyz)
        Translate this by the given vector xyz.
        Parameters:
        xyz - the vector to translate by
        Returns:
        this
      • translate

        public Spheref translate​(Vector3fc xyz,
                                 Spheref dest)
        Translate this by the given vector xyz and store the result in dest.
        Parameters:
        xyz - the vector to translate by
        dest - will hold the result
        Returns:
        dest
      • translate

        public Spheref translate​(float x,
                                 float y,
                                 float z)
        Translate this by the vector (x, y, z).
        Parameters:
        x - the x coordinate to translate by
        y - the y coordinate to translate by
        z - the z coordinate to translate by
        Returns:
        this
      • translate

        public Spheref translate​(float x,
                                 float y,
                                 float z,
                                 Spheref dest)
        Translate this by the vector (x, y, z) and store the result in dest.
        Parameters:
        x - the x coordinate to translate by
        y - the y coordinate to translate by
        z - the z coordinate to translate by
        dest - will hold the result
        Returns:
        dest
      • hashCode

        public int hashCode​()
        Overrides:
        hashCode in class Object
      • toString

        public String toString​()
        Return a string representation of this sphere.

        This method creates a new DecimalFormat on every invocation with the format string "0.000E0;-".

        Overrides:
        toString in class Object
        Returns:
        the string representation
      • toString

        public String toString​(NumberFormat formatter)
        Return a string representation of this sphere by formatting the components with the given NumberFormat.
        Parameters:
        formatter - the NumberFormat used to format the components with
        Returns:
        the string representation