Unigine.BoundBox Struct

Notice
The functions listed below are the members of the Unigine.MathLib namespace.

BoundBoxoperator* ( mat4 m, BoundBox bs ) #

Multiplies the matrix by the bounding box and returns the resulting bounding box.

Return value

Resulting bounding box.

BoundBoxoperator* ( dmat4 m, BoundBox bs ) #

Multiplies the matrix by the bounding box and returns the resulting bounding box.

Bounding box.

voidSet ( vec3 min_, vec3 max_ ) #

Initializes the bounding box by the minimum and maximum coordinates.

Arguments

• vec3 min_ - Minimum coordinates of the bounding box.
• vec3 max_ - Maximum coordinates of the bounding box.

voidSet ( vec3[] points ) #

Sets the bounding box by the coordinates of points in space to be enclosed by it.

Arguments

• vec3[] points - Array of points to be enclosed by the bounding box.

voidSet ( BoundBox bb ) #

Sets the bounding box equal to the bounding box specified in the argument.

voidSet ( BoundBox bb, mat4 transform ) #

Sets the bounding box by the given bounding box with the given transformation matrix taken into account.

Arguments

• BoundBox bb - Bounding box.
• mat4 transform - Transformation matrix (mat4) to be set.

voidSet ( BoundBox bb, dmat4 transform ) #

Sets the bounding box by the given bounding box with the given transformation matrix taken into account.

Arguments

• BoundBox bb - Bounding box.
• dmat4 transform - Transformation matrix (dmat4) to be set.

voidSet ( BoundSphere bs ) #

Sets the bounding box by the bounding sphere.

voidClear ( ) #

Clears the bounding box by setting all components/elements to 0.

boolEquals ( BoundBox other ) #

Checks if the current bounding box is equal to the specified argument considering the predefined accuracy (epsilon).

Arguments

• BoundBox other - Bounding box to be checked for equality.

Return value

true if the size and position of both bounding boxes are equal; otherwise, false.

boolEqualsNearly ( BoundBox other, float epsilon ) #

Checks if the argument represents the same bounding box with regard to the specified accuracy (epsilon).

Arguments

• BoundBox other - Bounding box to be checked for equality.
• float epsilon - Epsilon value, that determines accuracy of comparison.

Return value

true if the size and position of both bounding boxes are equal; otherwise, false.

boolEquals ( object obj ) #

Checks if the object and the bounding box are equal considering the predefined accuracy (epsilon).

Return value

true if the size and position of the object and the bounding box are equal; otherwise, false.

intGetHashCode ( ) #

Returns a hash code for the current object. Serves as the default hash function.

Hash code.

voidSetTransform ( mat4 transform ) #

Sets the given transformation matrix to the bounding box.

Arguments

• mat4 transform - Transformation matrix (mat4) to be set.

voidSetTransform ( dmat4 transform ) #

Sets the given transformation matrix to the bounding box.

Arguments

• dmat4 transform - Transformation matrix (dmat4) to be set.

voidSetTransform ( BoundSphere bs, mat4 transform ) #

Sets the transformation matrix of the current bounding box for including the given bounding sphere with the given transformation matrix taken into account.

Arguments

• BoundSphere bs - Bounding sphere.
• mat4 transform - Transformation matrix (mat4) to be set.

voidSetTransform ( BoundSphere bs, dmat4 transform ) #

Sets the transformation matrix of the current bounding box for including the given bounding sphere with the given transformation matrix taken into account.

Arguments

• BoundSphere bs - Bounding sphere.
• dmat4 transform - Transformation matrix (dmat4) to be set.

voidExpand ( vec3 point ) #

Expands the current bounding box to enclose the given point.

Arguments

• vec3 point - Point coordinates.

voidExpand ( vec3[] points ) #

Expands the current bounding box to enclose all given points.

Arguments

• vec3[] points - Array of points to be enclosed by the bounding box.

voidExpand ( BoundSphere bs ) #

Expands the current bounding box to enclose the given bounding sphere.

voidExpand ( BoundBox bb ) #

Expands the current bounding box to enclose the given bounding box.

boolInside ( vec3 point ) #

Checks if the given point is inside the bounding box.

Arguments

• vec3 point - Point coordinates.

Return value

true if the point is inside the bounding box; otherwise, false.

boolInside ( vec3 point, float radius ) #

Checks if the given sphere is inside the current bounding box.

Arguments

• vec3 point - Coordinates of the center of the sphere.

Return value

true if the sphere is inside the bounding box; otherwise, false.

boolinside ( vec3 min_, vec3 max_ ) #

Checks if the box with the given coordinates is inside the current bounding box.

Arguments

• vec3 min_ - Minimum coordinates of the box.
• vec3 max_ - Maximum coordinates of the box.

Return value

true if the box is inside the bounding box; otherwise, false.

boolInsideValid ( vec3 point ) #

Checks if given point is inside the bounding box.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bound are valid.

Arguments

• vec3 point - Point coordinates.

Return value

true if the point is inside the bounding box; otherwise, false.

boolInsideValid ( vec3 point, float radius ) #

Checks if the sphere is inside the bounding box.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bound are valid.

Arguments

• vec3 point - Coordinates of the center of the sphere.

Return value

true if the sphere is inside the bounding box; otherwise, false.

boolInsideValid ( vec3 min_, vec3 max_ ) #

Checks if the box specified in the argument is inside the current bound.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bound are valid.

Arguments

• vec3 min_ - Minimum coordinates of the box.
• vec3 max_ - Maximum coordinates of the box.

Return value

true if the box is inside the bounding box; otherwise, false.

boolInsideValid ( vec3[] points ) #

Checks if the points specified in the argument are inside the current bound.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bound are valid.

Arguments

• vec3[] points - Array of points.

Return value

true if the specified points are inside the bounding box; otherwise, false.

boolInside ( BoundSphere bs ) #

Checks if the bounding sphere specified in the argument is inside the current bounding box.

Return value

true if the bounding sphere is inside the bounding box; otherwise, false.

boolInside ( BoundBox bb ) #

Checks if the bounding box specified in the argument is inside the current bounding box.

Return value

true if the bounding box is inside the bounding box; otherwise, false.

boolInsideValid ( BoundSphere bs ) #

Checks if the bounding sphere specified in the argument is inside the current bounding box.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bounding box are valid.

Return value

true if the bounding sphere is inside the bounding box; otherwise, false.

boolInsideValid ( BoundBox bb ) #

Checks if the bounding box specified in the argument is inside the current bounding box.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bounding box are valid.

Return value

true if the bounding box is inside the bounding box; otherwise, false.

boolInsideAll ( BoundSphere bs ) #

Checks if the whole bounding sphere specified in the argument is inside the current bounding box.

Return value

true if the whole bounding sphere is inside the bounding box; otherwise, false.

boolInsideAll ( BoundBox bb ) #

Checks if the whole bounding box specified in the argument is inside the current bounding box.

Return value

true if the whole bounding box is inside the bounding box; otherwise, false.

boolInsideAllValid ( BoundSphere bs ) #

Checks if the bounding sphere specified in the argument is inside the current bounding box.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bounding box are valid.

Return value

true if the whole bounding sphere is inside the bounding box; otherwise, false.

boolInsideAllValid ( BoundBox bb ) #

Checks if the whole bounding box specified in the argument is inside the current bounding box.
Notice
The method doesn't check if the minimum and maximum coordinates of the current bounding box are valid.

Return value

true if the whole bounding box is inside the bounding box; otherwise, false.

boolInsideCube ( int face, vec3 offset ) #

Checks if a face of the current bounding box is inside the cube represented by minimum and maximum coordinates of the bounding box.

Arguments

• int face - The face index from 0 to 5.
• vec3 offset - Offset.

Return value

true if the face is inside the bounding cube; otherwise, false.

boolRayIntersection ( vec3 point, vec3 direction ) #

Checks for an intersection between a ray and the current bounding box.

Arguments

• vec3 point - Starting point of the ray.
• vec3 direction - Direction vector of the ray.

Return value

true if the given ray intersects the bounding box; otherwise, false.

boolIRayIntersection ( vec3 point, vec3 idirection ) #

Checks for an intersection between a ray and the current bounding box. This function uses the inverse direction of the ray, which increases performance.

Arguments

• vec3 point - Starting point of the ray.
• vec3 idirection - Inverse direction of the ray.

Return value

true if the given ray intersects the bounding box; otherwise, false.

boolGetIntersection ( vec3 p0, vec3 p1 ) #

Checks for an intersection between a line and the current bounding box.

Arguments

• vec3 p0 - Starting point of the line.
• vec3 p1 - Enging point of the line.

Return value

true if the given line intersects the bounding box; otherwise, false.

boolRayIntersectionValid ( vec3 point, vec3 direction ) #

Checks for an intersection between a ray and the current bounding box.
Notice
This function doesn't check if the minimum and maximum coordinates of the bounding box are valid.

Arguments

• vec3 point - Starting point of the ray.
• vec3 direction - Direction vector of the ray.

Return value

true if the given ray intersects the bounding box; otherwise, false.

boolIRayIntersectionValid ( vec3 point, vec3 idirection ) #

Checks for an intersection between a ray and the current bounding box. This function uses the inverse direction of the ray, which increases performance.
Notice
This function doesn't check if the minimum and maximum coordinates of the bounding box are valid.

Arguments

• vec3 point - Starting point of the ray.
• vec3 idirection - Inverse direction of the ray.

Return value

true if the given ray intersects the bounding box; otherwise, false.

boolGetIntersectionValid ( vec3 p0, vec3 p1 ) #

Checks for an intersection between a line and the current bounding box.
Notice
This function doesn't check if the minimum and maximum coordinates of the bounding box are valid.

Arguments

• vec3 p0 - Starting point of the line.
• vec3 p1 - Enging point of the line.

Return value

true if the given line intersects the bounding box; otherwise, false.

floatDistance ( ) #

Returns the distance from the origin of coordinates to the closest vertex of the bounding box.

Return value

Distance in units if the minimum and maximum coordinates of the bounding box are valid; otherwise, INF.

floatDistance ( vec3 point ) #

Returns the distance from the given point to the closest vertex of the bounding box.

Arguments

• vec3 point - Coordinates of a point.

Return value

Distance, in units, if the minimum and maximum coordinates of the bounding box are valid; otherwise, INF.

floatDistanceValid ( ) #

Returns the distance from the origin of coordinates to the closest vertex of the bounding box.
Notice
This function doesn't check if the minimum and maximum coordinates of the bounding box are valid.

Return value

Distance, in units.

floatDistanceValid ( vec3 point ) #

Returns the distance from the given point to the closest vertex of the bounding box.
Notice
This function doesn't check if the minimum and maximum coordinates of the bounding box are valid.

Return value

Distance, in units.
Last update: 2021-08-24