Package org.joml

Class Sphered

    • Field Detail

      • x

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

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

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

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

      • Sphered

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

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

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

        public Sphered​(Vector3dc c,
                       double r)
        Create a new Sphered with center position c and radius r.
        Parameters:
        c - the center position of the sphere
        r - the radius of the sphere
      • Sphered

        public Sphered​(double x,
                       double y,
                       double z,
                       double r)
        Create a new Sphered 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 Sphered translate​(Vector3dc xyz)
        Translate this by the given vector xyz.
        Parameters:
        xyz - the vector to translate by
        Returns:
        this
      • translate

        public Sphered translate​(Vector3dc xyz,
                                 Sphered 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 Sphered translate​(Vector3fc xyz)
        Translate this by the given vector xyz.
        Parameters:
        xyz - the vector to translate by
        Returns:
        this
      • translate

        public Sphered translate​(Vector3fc xyz,
                                 Sphered 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 Sphered translate​(double x,
                                 double y,
                                 double 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 Sphered translate​(double x,
                                 double y,
                                 double z,
                                 Sphered 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