![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
A sphere class.
The default constructor.
Murl.Math.Sphere new()
Constructor taking individual center position coordinates and a radius.
Murl.Math.Sphere new(Number centerX, Number centerY, Number centerZ, Number radius)
centerX | The center x-position coordinate. |
centerY | The center y-position coordinate. |
centerZ | The center z-position coordinate. |
radius | The radius. |
Constructor taking a box.
Murl.Math.Sphere new(Murl.Math.Box box)
box | The box to fit in. |
Constructor uniting two given spheres.
Murl.Math.Sphere new(Murl.Math.Sphere s1, Murl.Math.Sphere s2)
s1 | The first sphere to unite. |
s2 | The second sphere to unite. |
Constructor taking a center position vector and a radius.
Murl.Math.Sphere new(Murl.Math.Vector center, Number radius)
center | The center position. |
radius | The radius. |
Constructor taking the three points of a triangle.
Murl.Math.Sphere new(Murl.Math.Vector a, Murl.Math.Vector b, Murl.Math.Vector c)
a | The first triangle point. |
b | The second triangle point. |
c | The third triangle point. |
Clear the sphere
Clear()
Set the sphere to fit into a box.
Set(Murl.Math.Box box)
box | The box to fit in. |
Copy the content of a source sphere to the sphere instance.
Set(Murl.Math.Sphere other)
other | The sphere to copy from. |
Unite two spheres to the sphere instance.
Set(Murl.Math.Sphere s1, Murl.Math.Sphere s2)
s1 | The first sphere to unite. |
s2 | The second sphere to unite. |
Set a center position vector and a radius.
Set(Murl.Math.Vector center, Number radius)
center | The center position. |
radius | The radius. |
Set the sphere containing a single point. The center of the sphere is set to the given point, and the radius to 0.
SetBounding(Murl.Math.Vector a)
a | The point. |
Set the sphere containing two points. The center of the sphere is set to the position at half way between the given points, and the radius to half their distance.
SetBounding(Murl.Math.Vector a, Murl.Math.Vector b)
a | The first point. |
b | The second point. |
Set the sphere using three points lying on the sphere boundary.
SetBounding(Murl.Math.Vector a, Murl.Math.Vector b, Murl.Math.Vector c)
a | The first point. |
b | The second point. |
c | The third point. |
Set the sphere using four points lying on the sphere boundary.
SetBounding(Murl.Math.Vector a, Murl.Math.Vector b, Murl.Math.Vector c, Murl.Math.Vector d)
a | The first point. |
b | The second point. |
c | The third point. |
d | The fourth point. |
Set the sphere containing a single point.
SetContaining(Murl.Math.Vector a)
a | The point. |
Set the sphere containing two points. This is equal to setting the sphere with the given two points lying on the surface of the returned sphere.
SetContaining(Murl.Math.Vector a, Murl.Math.Vector b)
a | The first point. |
b | The second point. |
Set the sphere containing three points. This is different to SetBounding() in that one of the given points may lie inside the returned sphere and not on the boundary.
SetContaining(Murl.Math.Vector a, Murl.Math.Vector b, Murl.Math.Vector c)
a | The first point. |
b | The second point. |
c | The third point. |
Set the center position.
SetCenter(Murl.Math.Vector center)
center | The center position. |
Get the center position.
Murl.Math.Vector GetCenter()
Set the radius.
SetRadius(Number radius)
radius | The radius. |
Get the radius.
Number GetRadius()
Unite this sphere with another sphere.
Unite(Murl.Math.Sphere other)
other | The other sphere to unite. |
Include a point in this sphere.
Include(Murl.Math.Vector point)
point | The point to include. |
Check if a given sphere is intersecting this sphere.
Boolean IsIntersecting(Murl.Math.Sphere other)
other | The other sphere to check. |
Check if a given point is inside this sphere.
Boolean IsContaining(Murl.Math.Vector p)
p | The point to check. |
Check if a the sphere is empty. A sphere is only empty when created with the default constructor, explicitly cleared by calling Clear(), or duplicated from another empty sphere or box. As soon as a single point is included, the sphere is considered "not empty".
Boolean IsEmpty()
Get the flags.
Integer GetFlags()
Get the string representation of the object.
String ToString()
Converts the object content to a string in a reasonable format.