## Libraries.Game.Collision.Shapes.Box Documentation

This class describes the box shape in 3D.

## Summary

### Actions Summary Table

ActionsDescription
CalculateLocalInertia(number mass, Libraries.Compute.Vector3 inertia)This action approximates the mass moment of inertia of a box relative to that box's local origin.
CalculateTemporalBoundingBox(Libraries.Game.Collision.PhysicsPosition3D currentTransform, Libraries.Compute.Vector3 linearVelocity, Libraries.Compute.Vector3 angularVelocity, number timeStep, Libraries.Game.BoundingBox temporalBoundingBox)This action calculates the rectangular cube that will contain both the object in its position currently and also contain the object in a position after "timeStep" seconds from now.
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
ComputeBoundingBox(Libraries.Game.BoundingBox boundingBox, Libraries.Game.Collision.PhysicsPosition3D transform)This action finds the bounding box that would bound the Box in its current position.
Copy()This action sets another box to have the properties of the current box.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetAngularMotionDisc()This calculates the maximum distance between any point to the center of the 3D object.
GetBoundingSphere(Libraries.Compute.Vector3 center)This action finds the center (relative to the object's local origin) and the radius of a sphere that would bound the object that is at its current position.
GetChildCount()This action returns how many children shapes are attached to this box.
GetEdge(integer i, Libraries.Compute.Vector3 pa, Libraries.Compute.Vector3 pb)This action calculates the vertices that makes up one of the edges of this box.
GetHalfExtentsWithMargin()This action returns a vector that records information about the box's width, height, and depth with an offset.
GetHalfExtentsWithoutMargin()This action returns a vector that records information about the box's width, height, and depth without an offset.
GetHashCode()This action gets the hash code for an object.
GetLocalScaling(Libraries.Compute.Vector3 out)This action returns how the 3D object has been scaled to the shape that it has right now.
GetMargin()This action returns the offset of the box that will bound the object to prevent objects going through each other graphically.
GetNumberOfEdges()This action returns 12 for 12 edges that makes up a box.
GetNumberOfPlanes()This action returns 6 for 6 planes that makes up a box.
GetNumberOfVertices()This action returns 8 for 8 vertices that makes up a box.
GetNumberPreferredPenetrationDirections()This action calculates the preferred number of directions to check if another object has penetrated this box.
GetPlane(Libraries.Compute.Vector3 planeNormal, Libraries.Compute.Vector3 planeSupport, integer i)This action returns one of the 6 planes that made up the bounding box for this box.
GetPlaneEquation(Libraries.Compute.Plane plane, integer i)This action calculates the equation of one of the planes that makes up a box.
GetPreferredPenetrationDirection(integer index, Libraries.Compute.Vector3 penetrationVector)This action calculates one of the directions to check if another object has penetrated this box.
GetType()This action returns what type of 3D object the 3D object is.
GetVertex(integer i, Libraries.Compute.Vector3 vertex)This action returns the ith vertex of this box.
IsInside(Libraries.Compute.Vector3 point, number tolerance)This action calculates if a point is inside the box.
LocalGetSupportingVertex(Libraries.Compute.Vector3 vector)This action finds the vertex with an offset (margin) of the 3D shape that is furthest away in a direction specified by "Vector3 vector".
LocalGetSupportingVertexWithoutMargin(Libraries.Compute.Vector3 vector)This action finds the vertex with an offset (margin) of the 3D shape that is furthest away in a direction specified by "Vector3 vector" without an offset.
Scale(Libraries.Compute.Vector3 scale)This action scales the Box from its current size.
Set(number width, number height, number depth)This action sets the properties of this box using passed in sizes.
SetLocalScaling(Libraries.Compute.Vector3 scaling)This action scales the size of the Box from its original size.
SetMargin(number margin)This action sets the offset of the box that will bound the object to prevent objects going through each other graphically.
SetType(integer type)This action sets what type of 3D object this 3D object is.

## Actions Documentation

### CalculateLocalInertia(number mass, Libraries.Compute.Vector3 inertia)

This action approximates the mass moment of inertia of a box relative to that box's local origin.

### CalculateTemporalBoundingBox(Libraries.Game.Collision.PhysicsPosition3D currentTransform, Libraries.Compute.Vector3 linearVelocity, Libraries.Compute.Vector3 angularVelocity, number timeStep, Libraries.Game.BoundingBox temporalBoundingBox)

This action calculates the rectangular cube that will contain both the object in its position currently and also contain the object in a position after "timeStep" seconds from now.

### 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 (smaller)``````

#### Return

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

### ComputeBoundingBox(Libraries.Game.BoundingBox boundingBox, Libraries.Game.Collision.PhysicsPosition3D transform)

This action finds the bounding box that would bound the Box in its current position.

### Copy()

This action sets another box to have the properties of the current box.

### 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(t)``````

#### Return

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

### GetAngularMotionDisc()

This calculates the maximum distance between any point to the center of the 3D object.

number:

### GetBoundingSphere(Libraries.Compute.Vector3 center)

This action finds the center (relative to the object's local origin) and the radius of a sphere that would bound the object that is at its current position.

number:

### GetChildCount()

This action returns how many children shapes are attached to this box.

integer:

### GetEdge(integer i, Libraries.Compute.Vector3 pa, Libraries.Compute.Vector3 pb)

This action calculates the vertices that makes up one of the edges of this box.

### GetHalfExtentsWithMargin()

This action returns a vector that records information about the box's width, height, and depth with an offset.

### GetHalfExtentsWithoutMargin()

This action returns a vector that records information about the box's width, height, and depth without an offset.

### 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.

### GetLocalScaling(Libraries.Compute.Vector3 out)

This action returns how the 3D object has been scaled to the shape that it has right now.

### GetMargin()

This action returns the offset of the box that will bound the object to prevent objects going through each other graphically.

number:

### GetNumberOfEdges()

This action returns 12 for 12 edges that makes up a box.

integer:

### GetNumberOfPlanes()

This action returns 6 for 6 planes that makes up a box.

integer:

### GetNumberOfVertices()

This action returns 8 for 8 vertices that makes up a box.

integer:

### GetNumberPreferredPenetrationDirections()

This action calculates the preferred number of directions to check if another object has penetrated this box.

integer:

### GetPlane(Libraries.Compute.Vector3 planeNormal, Libraries.Compute.Vector3 planeSupport, integer i)

This action returns one of the 6 planes that made up the bounding box for this box.

### GetPlaneEquation(Libraries.Compute.Plane plane, integer i)

This action calculates the equation of one of the planes that makes up a box.

### GetPreferredPenetrationDirection(integer index, Libraries.Compute.Vector3 penetrationVector)

This action calculates one of the directions to check if another object has penetrated this box.

### GetType()

This action returns what type of 3D object the 3D object is.

integer:

### GetVertex(integer i, Libraries.Compute.Vector3 vertex)

This action returns the ith vertex of this box.

### IsInside(Libraries.Compute.Vector3 point, number tolerance)

This action calculates if a point is inside the box.

boolean:

### LocalGetSupportingVertex(Libraries.Compute.Vector3 vector)

This action finds the vertex with an offset (margin) of the 3D shape that is furthest away in a direction specified by "Vector3 vector".

### LocalGetSupportingVertexWithoutMargin(Libraries.Compute.Vector3 vector)

This action finds the vertex with an offset (margin) of the 3D shape that is furthest away in a direction specified by "Vector3 vector" without an offset.

### Scale(Libraries.Compute.Vector3 scale)

This action scales the Box from its current size.

### Set(number width, number height, number depth)

This action sets the properties of this box using passed in sizes.

### SetLocalScaling(Libraries.Compute.Vector3 scaling)

This action scales the size of the Box from its original size.

### SetMargin(number margin)

This action sets the offset of the box that will bound the object to prevent objects going through each other graphically.

### SetType(integer type)

This action sets what type of 3D object this 3D object is.