Skip to main content

vrbox

Module: Maths

A box.

#include <lua_api.h>

Public Functions​

TypeName
booleancontains(Any b)
(vrTestContain) Returns whether or object A completly contains object B.
Anycopy()
(vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane
numbergetExtent()
(vrAABoxExtent) Returns the largest dimension of an axis aligned bounding box.
booleanintersects(Any b)
(vrTestIntersection) Returns whether or not two objects are intersecting one another.
vrboxmerge(vrbox](../classes/vrbox.mdx) r)
(vrAABoxMerge) Returns an axis aligned bounding box that contains two other bounding boxes.
Anyoperator=()
vrboxtransform(vrmatrix4](../classes/vrmatrix4.mdx) matrix)
(vrAABoxTransform) Returns an axis aligned bounding box transformed by a matrix.

Public Attributes​

TypeName
vrvec3center
Centre of the box.
vrvec3centre
Centre of the box.
vrvec3dimensions
Dimensions of the box.
vrvec3max
Maximum in each axis of the box.
vrvec3min
Minimum in each axis of the box.

Public Functions Documentation​

contains​

boolean contains(
Any b
)

(vrTestContain) Returns whether or object A completly contains object B.

Parameters:

  • b A sphere, AABB, or vec3

Return: true if b is inside a

copy​

Any copy()

(vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane

getExtent​

number getExtent()

(vrAABoxExtent) Returns the largest dimension of an axis aligned bounding box.

intersects​

boolean intersects(
Any b
)

(vrTestIntersection) Returns whether or not two objects are intersecting one another.

Parameters:

  • b A sphere or AABB

Return: True if the objects are intersecting

merge​

vrbox merge(
vrbox r
)

(vrAABoxMerge) Returns an axis aligned bounding box that contains two other bounding boxes.

operator=​

Any operator=()

transform​

vrbox transform(
vrmatrix4 matrix
)

(vrAABoxTransform) Returns an axis aligned bounding box transformed by a matrix.

Public Attributes Documentation​

center​

vrvec3 center;

Centre of the box.

centre​

vrvec3 centre;

Centre of the box.

dimensions​

vrvec3 dimensions;

Dimensions of the box.

max​

vrvec3 max;

Maximum in each axis of the box.

min​

vrvec3 min;

Minimum in each axis of the box.