Sphere
A sphere.
Constructor Summary
Public Constructor | ||
public |
constructor(center: Vector3, radius: Number) Constructs a new sphere. |
Method Summary
Public Methods | ||
public |
clampPoint(p: Vector3, target: Vector3): Vector3 Clamps the given point to this sphere. |
|
public |
Clones this sphere. |
|
public |
containsPoint(p: Vector3): Boolean Checks if the given point lies inside this sphere. |
|
public |
Copies the given sphere. |
|
public |
distanceToPoint(p: Vector3): Number Calculates the distance from this sphere to the given point. |
|
public |
Checks if this sphere equals the given one. |
|
public |
intersectsBox(b: Box3): Boolean Checks if the this sphere intersects with the given box. |
|
public |
intersectsPlane(p: Plane): Boolean Checks if the this sphere intersects with the given plane. |
|
public |
Checks if the this sphere intersects with the given one. |
|
public |
Checks if this sphere is empty. |
|
public |
Sets the center and the radius. |
|
public |
setFromBox(box: Box3): Sphere Computes the bounding sphere of the given box. |
|
public |
setFromPoints(points: Vector3[], center: Vector3): Sphere Sets this sphere from points. |
|
public |
Translates this sphere. |
Public Constructors
Public Methods
public clampPoint(p: Vector3, target: Vector3): Vector3 source
Clamps the given point to this sphere.
public containsPoint(p: Vector3): Boolean source
Checks if the given point lies inside this sphere.
Params:
Name | Type | Attribute | Description |
p | Vector3 | A point. |
public copy(s: Sphere): Sphere source
Copies the given sphere.
Params:
Name | Type | Attribute | Description |
s | Sphere | A sphere. |
public distanceToPoint(p: Vector3): Number source
Calculates the distance from this sphere to the given point.
Params:
Name | Type | Attribute | Description |
p | Vector3 | A point. |
public equals(s: Sphere): Boolean source
Checks if this sphere equals the given one.
Params:
Name | Type | Attribute | Description |
s | Sphere | A sphere. |
public intersectsBox(b: Box3): Boolean source
Checks if the this sphere intersects with the given box.
Params:
Name | Type | Attribute | Description |
b | Box3 | A box. |
public intersectsPlane(p: Plane): Boolean source
Checks if the this sphere intersects with the given plane.
Params:
Name | Type | Attribute | Description |
p | Plane | A plane. |
public intersectsSphere(s: Sphere): Boolean source
Checks if the this sphere intersects with the given one.
Params:
Name | Type | Attribute | Description |
s | Sphere | A sphere. |
public setFromBox(box: Box3): Sphere source
Computes the bounding sphere of the given box.
Params:
Name | Type | Attribute | Description |
box | Box3 | A box. |