
A 3D sphere.
Kind: global class
SphereBooleanBoolean\*BooleanBooleanCreate the Sphere.
| Param | Type | Description |
|---|---|---|
| center | Vector3 |
Sphere center position. |
| radius | Number |
Sphere radius. |
SphereReturn a clone of this sphere.
Kind: instance method of Sphere
Returns: Sphere - Cloned sphere.
BooleanCheck if this sphere contains a Vector3.
Kind: instance method of Sphere
Returns: Boolean - if point is contained within the sphere.
| Param | Type | Description |
|---|---|---|
| p | Vector3 |
Point to check. |
BooleanCheck if equal to another sphere.
Kind: instance method of Sphere
Returns: Boolean - True if spheres are equal, false otherwise.
| Param | Type | Description |
|---|---|---|
| other | Sphere |
Other sphere to compare to. |
\*Convert to dictionary.
Kind: instance method of Sphere
Returns: \* - Dictionary with {center, radius}.
| Param | Type | Description |
|---|---|---|
| minimized | Boolean |
If true, will not include keys that their values are 0. You can use fromDict on minimized dicts. |
BooleanCheck if collide with a box.
Kind: instance method of Sphere
Returns: Boolean - True if collide, false otherwise.
| Param | Type | Description |
|---|---|---|
| box | Box |
Box to check. |
BooleanCheck if collide with a plane.
Kind: instance method of Sphere
Returns: Boolean - True if collide, false otherwise.
| Param | Type | Description |
|---|---|---|
| plane | Plane |
Plane to test. |
SphereCreate sphere from a dictionary.
Kind: static method of Sphere
Returns: Sphere - Newly created sphere.
| Param | Type | Description |
|---|---|---|
| data | \* |
Dictionary with {center, radius}. |
SphereLerp between two sphere.
Kind: static method of Sphere
Returns: Sphere - result sphere.
| Param | Type | Description |
|---|---|---|
| p1 | Sphere |
First sphere. |
| p2 | Sphere |
Second sphere. |
| a | Number |
Lerp factor (0.0 - 1.0). |