A 3D sphere.
Kind: global class
Sphere
Boolean
Boolean
\*
Boolean
Boolean
Create the Sphere.
Param | Type | Description |
---|---|---|
center | Vector3 |
Sphere center position. |
radius | Number |
Sphere radius. |
Sphere
Return a clone of this sphere.
Kind: instance method of Sphere
Returns: Sphere
- Cloned sphere.
Boolean
Check 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. |
Boolean
Check 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. |
Boolean
Check 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. |
Boolean
Check 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. |
Sphere
Create sphere from a dictionary.
Kind: static method of Sphere
Returns: Sphere
- Newly created sphere.
Param | Type | Description |
---|---|---|
data | \* |
Dictionary with {center, radius}. |
Sphere
Lerp 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). |