Libraries.Game.BoundingBox Documentation

This class specifies the size and the location of a box that will surround other 3D objects. The box is used in collision detectio

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
CalculateDimensions()This is tested using the Separating Axis Theore
Clear()This action will clear out the values of the BoundingBox, resetting all of its values to zer
Combine(Libraries.Game.BoundingBox box1, Libraries.Game.BoundingBox box2)This action will test to see if this BoundingBox intersects with the given BoundingBo
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Contains(Libraries.Compute.Vector3 point)This action will test to see if the point indicated by the given Vector3 is contained inside this BoundingBo
Contains(Libraries.Game.BoundingBox bounds)This action will test to see if this BoundingBox totally contains a given BoundingBox.
Copy()The Copy action will return a new BoundingBox with the same bounds as this BoundingBo
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
Extend(Libraries.Game.BoundingBox bounds, Libraries.Compute.Matrix4 transform)This action will extend the BoundingBox to contain the given BoundingBox, offset by the given Matrix
Extend(number x, number y, number z)This action will extend the BoundingBox to contain the point at the given X, Y, and Z coordinate
Extend(Libraries.Compute.Vector3 center, number radius)This action will extend the BoundingBox to contain a sphere denoted by a center point and a radiu
Extend(Libraries.Game.BoundingBox bounds)This action will extend the BoundingBox to contain the provided bound
Extend(Libraries.Compute.Vector3 point)This action will extend the BoundingBox to include the given poin
GetCenter()GetCenter will return a Vector3 object containing the point at the center of the BoundingBo
GetCenterX()GetCenterX will return the X coordinate of the center of the BoundingBo
GetCenterY()GetCenterY will return the Y coordinate of the center of the BoundingBo
GetCenterZ()GetCenterZ will return the Z coordinate of the center of the BoundingBo
GetDepth()GetDepth will return the height of the BoundingBo
GetDimensions()GetDimensions will return the width, height, and depth of the BoundingBox, stored within a Vector3 objec
GetHashCode()This action gets the hash code for an object.
GetHeight()GetHeight will return the height of the BoundingBo
GetMaximum()GetMaximum will return the "maximum" point of the BoundingBox.
GetMinimum()GetMinimum will return the "minimum" point of the BoundingBox.
GetPerimeter()This action returns the perimeter of the BoundingBox2
GetWidth()GetWidth will return the width of the BoundingBo
Intersects(Libraries.Game.BoundingBox bounds)This action will test to see if this BoundingBox intersects with the given BoundingBo
Invalidate()This action will invalidate the BoundingBox, making its minimum values to positive infinity and setting its maximum values to negative infinit
IsValid()This action will return whether or not the BoundingBox defines a real, 3-dimensional area.
Multiply(Libraries.Compute.Matrix4 transform)This action will multiply the size of the region of the BoundingBox by the values contained in the given Matrix
Set(Libraries.Game.BoundingBox bounds)When provided with a BoundingBox as a parameter, the Set action will set the BoundingBox to match the bounds of the paramete
Set(Libraries.Containers.Array<Libraries.Compute.Vector3> points)Providing the Set action with an array of points will set the BoundingBox to the minimum possible size that contains all of the given point
Set(Libraries.Compute.Vector3 min, Libraries.Compute.Vector3 max)The Set action can be provided with a pair of vectors to set the bounds of this BoundingBox.
TestOverlap(Libraries.Game.BoundingBox boundingBox)This action returns the perimeter of the BoundingBox2

Actions Documentation

CalculateDimensions()

This is tested using the Separating Axis Theore

Clear()

This action will clear out the values of the BoundingBox, resetting all of its values to zer

Combine(Libraries.Game.BoundingBox box1, Libraries.Game.BoundingBox box2)

This action will test to see if this BoundingBox intersects with the given BoundingBo

Parameters

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smalle

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Contains(Libraries.Compute.Vector3 point)

This action will test to see if the point indicated by the given Vector3 is contained inside this BoundingBo

Parameters

Return

boolean:

Contains(Libraries.Game.BoundingBox bounds)

This action will test to see if this BoundingBox totally contains a given BoundingBox. If any part of the given BoundingBox is outside this one, it will return fals

Parameters

Return

boolean:

Copy()

The Copy action will return a new BoundingBox with the same bounds as this BoundingBo

Return

Libraries.Game.BoundingBox:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Extend(Libraries.Game.BoundingBox bounds, Libraries.Compute.Matrix4 transform)

This action will extend the BoundingBox to contain the given BoundingBox, offset by the given Matrix

Parameters

Extend(number x, number y, number z)

This action will extend the BoundingBox to contain the point at the given X, Y, and Z coordinate

Parameters

Extend(Libraries.Compute.Vector3 center, number radius)

This action will extend the BoundingBox to contain a sphere denoted by a center point and a radiu

Parameters

Extend(Libraries.Game.BoundingBox bounds)

This action will extend the BoundingBox to contain the provided bound

Parameters

Extend(Libraries.Compute.Vector3 point)

This action will extend the BoundingBox to include the given poin

Parameters

GetCenter()

GetCenter will return a Vector3 object containing the point at the center of the BoundingBo

Return

Libraries.Compute.Vector3:

GetCenterX()

GetCenterX will return the X coordinate of the center of the BoundingBo

Return

number:

GetCenterY()

GetCenterY will return the Y coordinate of the center of the BoundingBo

Return

number:

GetCenterZ()

GetCenterZ will return the Z coordinate of the center of the BoundingBo

Return

number:

GetDepth()

GetDepth will return the height of the BoundingBo

Return

number:

GetDimensions()

GetDimensions will return the width, height, and depth of the BoundingBox, stored within a Vector3 objec

Return

Libraries.Compute.Vector3:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode

Return

integer: The integer hash code of the object.

GetHeight()

GetHeight will return the height of the BoundingBo

Return

number:

GetMaximum()

GetMaximum will return the "maximum" point of the BoundingBox. This is specifically the point of the BoundingBox with the highest X, Y, and Z values. The point will be returned as a Vector

Return

Libraries.Compute.Vector3:

GetMinimum()

GetMinimum will return the "minimum" point of the BoundingBox. This is specifically the point of the BoundingBox with the lowest X, Y, and Z values. The point will be returned as a Vector

Return

Libraries.Compute.Vector3:

GetPerimeter()

This action returns the perimeter of the BoundingBox2

Return

number:

GetWidth()

GetWidth will return the width of the BoundingBo

Return

number:

Intersects(Libraries.Game.BoundingBox bounds)

This action will test to see if this BoundingBox intersects with the given BoundingBo

Parameters

Return

boolean:

Invalidate()

This action will invalidate the BoundingBox, making its minimum values to positive infinity and setting its maximum values to negative infinit

IsValid()

This action will return whether or not the BoundingBox defines a real, 3-dimensional area. This requires all of the values of the "minimum" point to be less than the values of the "maximum" poin

Return

boolean:

Multiply(Libraries.Compute.Matrix4 transform)

This action will multiply the size of the region of the BoundingBox by the values contained in the given Matrix

Parameters

Set(Libraries.Game.BoundingBox bounds)

When provided with a BoundingBox as a parameter, the Set action will set the BoundingBox to match the bounds of the paramete

Parameters

Set(Libraries.Containers.Array<Libraries.Compute.Vector3> points)

Providing the Set action with an array of points will set the BoundingBox to the minimum possible size that contains all of the given point

Parameters

Set(Libraries.Compute.Vector3 min, Libraries.Compute.Vector3 max)

The Set action can be provided with a pair of vectors to set the bounds of this BoundingBox. The first vector should represent the "minimum" point of the bounds, or the point with the lowest X, Y, and Z values. The second vector should represent the "maximum" point of the bounsd, or the point with the highest X, Y, and Z value

Parameters

TestOverlap(Libraries.Game.BoundingBox boundingBox)

This action returns the perimeter of the BoundingBox2

Parameters

Return

boolean: