Sphere
A two dimensional surface that extends infinitely in 3d space, represented in Hessian normal form by a unit length normal vector and a constant.
Properties
center(0, 0, 0)
A Vector3 defining the center of the sphere.
radius0
The radius of the sphere.
Methods
set
set From Points
Computes the minimum bounding sphere for an array of Array| points. If optionalCenter is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing Array| points is calculated.
Parameters
Returns Sphere
clone
copy
empty
If the radius smaller than zero, this will return false, otherwise return true.
Returns boolean
contains Point
distance To Point
intersects Sphere
Checks to see if two spheres intersect.
Parameters
- sphere: Sphere
Sphere to check for intersection against.
Returns boolean
- sphere: Sphere
intersects Box
intersects Plane
clamp Point
Clamps a point within the sphere. If the point is outside the sphere, it will clamp it to the closest point on the edge of the sphere. Points already inside the sphere will not be affected.
Parameters
Returns Vector3
get Bounding Box
Returns a Minimum Bounding Box for the sphere.
Parameters
- target: Box3
the result will be copied into this Box3.
Returns Box3
- target: Box3
apply Matrix4
translate
equals
Checks to see if the two spheres' centers and radii are equal.
Parameters
- sphere: Sphere
Returns boolean
A two dimensional surface that extends infinitely in 3d space, represented in Hessian normal form by a unit length normal vector and a constant.