Class Sphere3f

  • All Implemented Interfaces:
    java.io.Serializable

    public class Sphere3f
    extends java.lang.Object
    implements java.io.Serializable
    The sphere is represented as |X-C| = R where C is the center and R is the radius.
    See Also:
    Serialized Form
    • Field Detail

      • Center

        public Vector3f Center
        The sphere is represented as |X-C| = R where C is the center
      • Radius

        public float Radius
        Sphere Radius
    • Constructor Detail

      • Sphere3f

        public Sphere3f()
        Constructor: uninitialized
      • Sphere3f

        public Sphere3f​(Sphere3f rkSphere)
        Copy Constructor
        Parameters:
        rkSphere - sphere to copy.
      • Sphere3f

        public Sphere3f​(Vector3f rkCenter,
                        float fRadius)
        Constructor
        Parameters:
        rkCenter - sphere center
        fRadius - sphere radius
    • Method Detail

      • ContSphereAverage

        public static Sphere3f ContSphereAverage​(int iQuantity,
                                                 Vector3f[] akPoint)
        Creates a sphere containing all input points, with the center of the sphere the center of the points.
        Parameters:
        iQuantity - number of input points.
        akPoint - input points
        Returns:
        new sphere containing all points.
      • InSphere

        public static boolean InSphere​(Vector3f rkPoint,
                                       Sphere3f rkSphere)
        Test if input point is inside input sphere.
        Parameters:
        rkPoint - point
        rkSphere - sphere
        Returns:
        true if point is inside sphere.
      • MergeSpheres

        public static Sphere3f MergeSpheres​(Sphere3f rkSphere0,
                                            Sphere3f rkSphere1)
        Merge the two input spheres, return result.
        Parameters:
        rkSphere0 - sphere0 to merge
        rkSphere1 - sphere1 to merge
        Returns:
        sphere result of merge
      • Copy

        public void Copy​(Sphere3f rkSphere)
        Copy
        Parameters:
        rkSphere - sphere to copy.
      • dispose

        public void dispose()
        delete memory
      • MergeSpheres

        public void MergeSpheres​(Sphere3f rkSphere)
        Merge this with input sphere, changing this.
        Parameters:
        rkSphere - sphere to merge with 'this'