Sphere
An analytical 3D sphere defined by a center and radius. This class is mainly used as a Bounding Sphere for 3D objects.
The sphere is mutable and not thread-safe. Use each instance from one thread only.
The constructor stores the given center by reference (it does not copy it). Sharing that vector with another object means later mutations are visible through every alias; use set or clone for independent storage.
A sphere with a negative radius is considered empty (see isEmpty); a radius of 0 contains only the center point and is not empty.
Constructors
Properties
Functions
Transforms this sphere with the given 4x4 transformation matrix matrix.
Returns true if this sphere contains the given point inclusive of the surface of the sphere.
Returns the closest distance from the boundary of the sphere to the given point. If the sphere contains the point, the distance will be negative.
Expands the boundaries of this sphere to include the given point.
Sets this sphere from json laid out as [centerX, centerY, centerZ, radius].
Writes a bounding box that encloses this sphere into target.
Returns true if this sphere intersects with the given box.
Returns true if this sphere intersects with the given plane.
Returns true if this sphere intersects with the given one sphere.
Computes a bounding sphere for points. The center is optionalCenter when given, otherwise the center of the points' bounding box. The radius reaches the farthest point, so this is not always the smallest possible sphere.
Returns this sphere as [centerX, centerY, centerZ, radius]. three.js returns an object with center and radius fields instead.