Murl Engine Lua Addon API  Version 1.0 beta
Murl.Math.Box

A box class describing the minimum and maximum coordinate of a 3d-box.


Table members

Functions


Murl.Math.Box.new()

The default constructor.

Murl.Math.Box new()

Returns
Murl.Math.Box

Murl.Math.Box.new(b1, b2)

Constructor uniting two given boxes.

Murl.Math.Box new(Murl.Math.Box b1, Murl.Math.Box b2)

Parameters
b1The first box.
b2The second box.
Returns
Murl.Math.Box

Murl.Math.Box.new(sphere)

Constructor taking a sphere. The box is only approximated and slightly larger than it needs to be.

Murl.Math.Box new(Murl.Math.Sphere sphere)

Parameters
sphereThe sphere to enclose.
Returns
Murl.Math.Box

Murl.Math.Box.new(point)

Constructor taking a single coordinate.

Murl.Math.Box new(Murl.Math.Vector point)

Parameters
pointThe coordinate for minimum and maximum.
Returns
Murl.Math.Box

Murl.Math.Box.new(min, max)

Constructor taking minimum and maximum coordinates.

Murl.Math.Box new(Murl.Math.Vector min, Murl.Math.Vector max)

Parameters
minThe minimum coordinate.
maxThe maximum coordinate.
Returns
Murl.Math.Box

Murl.Math.Box.new(a, b, c)

Constructor taking the three points of a triangle.

Murl.Math.Box new(Murl.Math.Vector a, Murl.Math.Vector b, Murl.Math.Vector c)

Parameters
aThe first triangle coordinate.
bThe second triangle coordinate.
cThe third triangle coordinate.
Returns
Murl.Math.Box


Methods


Clear()

Clear the box

Clear()


Set(other)

Set the coordinates from a box.

Set(Murl.Math.Box other)

Parameters
otherThe box to copy from.

Set(b1, b2)

Set the coordinates by uniting two given boxes.

Set(Murl.Math.Box b1, Murl.Math.Box b2)

Parameters
b1The first box.
b2The second box.

Set(sphere)

Set the coordinates by a sphere. The box is only approximated and slightly larger than it needs to be.

Set(Murl.Math.Sphere sphere)

Parameters
sphereThe sphere to enclose.

Set(point)

Set the coordinates to a single coordinate.

Set(Murl.Math.Vector point)

Parameters
pointThe coordinate for minimum and maximum.

Set(min, max)

Set the minimum and maximum coordinates.

Set(Murl.Math.Vector min, Murl.Math.Vector max)

Parameters
minThe minimum coordinate.
maxThe maximum coordinate.

Set(a, b, c)

Set the coordinates by the three points of a triangle.

Set(Murl.Math.Vector a, Murl.Math.Vector b, Murl.Math.Vector c)

Parameters
aThe first triangle coordinate.
bThe second triangle coordinate.
cThe third triangle coordinate.

SetMinimum(min)

Set the minimum coordinate.

SetMinimum(Murl.Math.Vector min)

Parameters
minThe minimum coordinate.

SetMaximum(max)

Set the maximum coordinate.

SetMaximum(Murl.Math.Vector max)

Parameters
maxThe maximum coordinate.

GetMinimum()

Get the minimum coordinate.

Murl.Math.Vector GetMinimum()

Returns
Murl.Math.Vector The minimum coordinate.

GetMaximum()

Get the maximum coordinate.

Murl.Math.Vector GetMaximum()

Returns
Murl.Math.Vector The maximum coordinate.

Unite(other)

Unite this box with another box.

Unite(Murl.Math.Box other)

Parameters
otherThe other box to unite.

Include(point)

Include a point in this box.

Include(Murl.Math.Vector point)

Parameters
pointThe point to include.

IsIntersecting(other)

Check if a given box is intersecting this box.

Boolean IsIntersecting(Murl.Math.Box other)

Parameters
otherThe other box to check.
Returns
Boolean true if the other box is intersecting this box.

IsEmpty()

Check if a the box is empty. A box is only empty when created with the default constructor, explicitly cleared by calling Clear(), or duplicated from another empty box or sphere. As soon as a single point is included, the box is considered "not empty".

Boolean IsEmpty()

Returns
Boolean true if the box is empty.

GetFlags()

Get the flags.

Integer GetFlags()

Returns
Integer The bit-mask of flags.

ToString()

Get the string representation of the object.

String ToString()

Returns
String The string representation of the object.


Metamethods


The tostring operator

Converts the object content to a string in a reasonable format.

Returns
ToString()