Class Sphere3f
- java.lang.Object
-
- WildMagic.LibFoundation.Mathematics.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 Summary
Fields Modifier and Type Field Description Vector3f
Center
The sphere is represented as |X-C| = R where C is the centerfloat
Radius
Sphere Radiusprivate static long
serialVersionUID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
Copy(Sphere3f rkSphere)
Copyvoid
dispose()
delete memorystatic boolean
InSphere(Vector3f rkPoint, Sphere3f rkSphere)
Test if input point is inside input sphere.void
MergeSpheres(Sphere3f rkSphere)
Merge this with input sphere, changing this.static Sphere3f
MergeSpheres(Sphere3f rkSphere0, Sphere3f rkSphere1)
Merge the two input spheres, return result.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 centerfRadius
- 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
- pointrkSphere
- 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 mergerkSphere1
- 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'
-
-