Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IBoundingVolume

The IBoundingVolume interface.

This interface represents a simple bounding volume in 3D space that encloses the outer bounds of some geometry, which are used for e.g. visibility determination (a.k.a. culling), and optionally provides an "inner" volume that is used for alignment purposes.


Table members

Methods


Clear()

Clear the bounding volume. This method clears the bounding value by setting all of its internal values to zero.

Boolean Clear()

Returns
Boolean true if successful.

SetLocalBounds(box)

Set the local bounding volume extent from a box.

Boolean SetLocalBounds(Murl.Math.Box box)

Parameters
boxThe local bounding box.
Returns
Boolean true if successful.

SetLocalBounds(outerBox, innerBox)

Set the local bounding volume extent from an inner and outer box.

Boolean SetLocalBounds(Murl.Math.Box outerBox, Murl.Math.Box innerBox)

Parameters
outerBoxThe local outer bounding box.
innerBoxThe local inner bounding box.
Returns
Boolean true if successful.

SetLocalBounds(sphere)

Set the local bounding volume extent from a sphere.

Boolean SetLocalBounds(Murl.Math.Sphere sphere)

Parameters
sphereThe local bounding sphere.
Returns
Boolean true if successful.

SetLocalBounds(sphereCenter, sphereRadius)

Set the local bounding volume extent. This method sets the bounding volume to enclose the sphere represented by the given sphere center and radius.

Boolean SetLocalBounds(Murl.Math.Vector sphereCenter, Number sphereRadius)

Parameters
sphereCenterThe bounding sphere center.
sphereRadiusThe bounding sphere radius.
Returns
Boolean true if successful.

SetLocalBounds(minExtent, maxExtent)

Set the local bounding volume extent. This method sets the bounding volume to enclose the given minimum and maximum values in local 3D (object) space.

Boolean SetLocalBounds(Murl.Math.Vector minExtent, Murl.Math.Vector maxExtent)

Parameters
minExtentA vector containing minimum X, Y and Z values of a bounding box.
maxExtentA vector containing maximum X, Y and Z values of a bounding box.
Returns
Boolean true if successful.

SetLocalBounds(minOuterExtent, maxOuterExtent, minInnerExtent, maxInnerExtent)

Set the local bounding volume extent. This method sets the bounding volume to enclose the given minimum and maximum values in local 3D (object) space, for both an inner and outer box.

Boolean SetLocalBounds(Murl.Math.Vector minOuterExtent, Murl.Math.Vector maxOuterExtent, Murl.Math.Vector minInnerExtent, Murl.Math.Vector maxInnerExtent)

Parameters
minOuterExtentA vector containing minimum values of the outer bounding box.
maxOuterExtentA vector containing maximum values of the outer bounding box.
minInnerExtentA vector containing minimum values of the inner bounding box.
maxInnerExtentA vector containing maximum values of the inner bounding box.
Returns
Boolean true if successful.

UniteLocalBounds(other)

Unite the local bounding volume with a given other one.

Boolean UniteLocalBounds(Murl.Graph.IBoundingVolume other)

Parameters
otherThe other bounding volume to unite with.
Returns
Boolean true if successful.

UniteLocalBounds(other, baseTransform, baseScale)

Unite the local bounding volume with a given other one using an additional transformation.

Boolean UniteLocalBounds(Murl.Graph.IBoundingVolume other, Murl.Math.Matrix baseTransform, Murl.Math.Vector baseScale)

Parameters
otherThe other bounding volume to unite with.
baseTransformThe transform to apply to the other volume.
baseScaleThe scale factor to apply to the other volume.
Returns
Boolean true if successful.

GetLocalSphere()

Get the bounding sphere in object space.

Murl.Math.Sphere GetLocalSphere()

Returns
Murl.Math.Sphere A constant reference to the local object space bounding sphere.

GetWorldSphere()

Get the bounding sphere in world space.

Murl.Math.Sphere GetWorldSphere()

Returns
Murl.Math.Sphere A constant reference to the world space bounding sphere.

CalculateWorldSphereRelativeToBase(baseTransform, baseScale)

Calculate the bounding sphere relative to a given base transform and scale.

Murl.Math.Sphere CalculateWorldSphereRelativeToBase(Murl.Math.Matrix baseTransform, Murl.Math.Vector baseScale)

Parameters
baseTransformThe base transform to use.
baseScaleThe base scale factor to use.
Returns
Murl.Math.Sphere The calculated sphere.

CalculateWorldSphereRelativeToView(viewTransform, viewScale)

Calculate the bounding sphere relative to a given view transform and scale.

Murl.Math.Sphere CalculateWorldSphereRelativeToView(Murl.Math.Matrix viewTransform, Murl.Math.Vector viewScale)

Parameters
viewTransformThe view transform to use.
viewScaleThe view scale factor to use.
Returns
Murl.Math.Sphere The calculated sphere.

GetOuterLocalBox()

Get the outer bounding box in object space.

Murl.Math.Box GetOuterLocalBox()

Returns
Murl.Math.Box A constant reference to the local object space outer bounding box.

GetOuterWorldBox()

Get the outer bounding box in world space.

Murl.Math.Box GetOuterWorldBox()

Returns
Murl.Math.Box A constant reference to the world space outer bounding box.

CalculateOuterWorldBoxRelativeToBase(baseTransform, baseScale)

Calculate the outer bounding box relative to a given base transform and scale.

Murl.Math.Box CalculateOuterWorldBoxRelativeToBase(Murl.Math.Matrix baseTransform, Murl.Math.Vector baseScale)

Parameters
baseTransformThe base transform to use.
baseScaleThe base scale factor to use.
Returns
Murl.Math.Box The calculated box.

CalculateOuterWorldBoxRelativeToView(viewTransform, viewScale)

Calculate the outer bounding box relative to a given view transform and scale.

Murl.Math.Box CalculateOuterWorldBoxRelativeToView(Murl.Math.Matrix viewTransform, Murl.Math.Vector viewScale)

Parameters
viewTransformThe view transform to use.
viewScaleThe view scale factor to use.
Returns
Murl.Math.Box The calculated box.

GetInnerLocalBox()

Get the inner bounding box in object space.

Murl.Math.Box GetInnerLocalBox()

Returns
Murl.Math.Box A constant reference to the local object space inner bounding box.

GetInnerWorldBox()

Get the inner bounding box in world space.

Murl.Math.Box GetInnerWorldBox()

Returns
Murl.Math.Box A constant reference to the world space inner bounding box.

CalculateInnerWorldBoxRelativeToBase(baseTransform, baseScale)

Calculate the inner bounding box relative to a given base transform and scale.

Murl.Math.Box CalculateInnerWorldBoxRelativeToBase(Murl.Math.Matrix baseTransform, Murl.Math.Vector baseScale)

Parameters
baseTransformThe base transform to use.
baseScaleThe base scale factor to use.
Returns
Murl.Math.Box The calculated box.

CalculateInnerWorldBoxRelativeToView(viewTransform, viewScale)

Calculate the inner bounding box relative to a given view transform and scale.

Murl.Math.Box CalculateInnerWorldBoxRelativeToView(Murl.Math.Matrix viewTransform, Murl.Math.Vector viewScale)

Parameters
viewTransformThe view transform to use.
viewScaleThe view scale factor to use.
Returns
Murl.Math.Box The calculated box.

SetWorldTransform(worldTransform)

Set the bounding volume's current world transform matrix.

Boolean SetWorldTransform(Murl.Math.Matrix worldTransform)

Parameters
worldTransformThe world transform matrix.
Returns
Boolean true if successful.

ClearWorldTransform()

Clear the bounding volume's current world transform matrix.

Boolean ClearWorldTransform()

Returns
Boolean true if successful.

GetWorldTransform()

Get the bounding volume's current world transform matrix.

Murl.Math.Matrix GetWorldTransform()

Returns
Murl.Math.Matrix The world transform matrix.

SetWorldScaleFactor(worldScaleFactor)

Set the bounding volume's current world scale factor.

Boolean SetWorldScaleFactor(Murl.Math.Vector worldScaleFactor)

Parameters
worldScaleFactorThe world scale factor in X, Y and Z direction.
Returns
Boolean true if successful.

ClearWorldScaleFactor()

Reset the bounding volume's current world scale factor to 1.

Boolean ClearWorldScaleFactor()

Returns
Boolean true if successful.

GetWorldScaleFactor()

Get the bounding volume's current world scale factor.

Murl.Math.Vector GetWorldScaleFactor()

Returns
Murl.Math.Vector The world scale factor in X, Y and Z direction.

IsIntersecting(other)

Check if the bounding volume intersects another one.

Boolean IsIntersecting(Murl.Graph.IBoundingVolume other)

Parameters
otherThe bounding volume to check against.
Returns
Boolean true if both volumes are intersecting.

IsEmpty()

Check if the bounding volume is empty.

Boolean IsEmpty()

Returns
Boolean true if the volume is empty.

HasInnerBox()

Check if the bounding volume has an inner box.

Boolean HasInnerBox()

Returns
Boolean true if the volume has an inner box.