Düzenle

Aracılığıyla paylaş


BoundingBoxHelper Class

Definition

The BoundingBoxHelper class contains functions for getting geometric info from the non-axis-aligned bounding box of a GameObject. These functions can be used to align another object to the center of a certain face or the center of an edge of a face... etc. The BoundingBoxHelper static function can be used for a one time calculation. The dynamic functions can be used to obtain boundingcube info on an object's Update loop. Operations are minimized in the dynamic use scenario.

public ref class BoundingBoxHelper
public class BoundingBoxHelper
type BoundingBoxHelper = class
Public Class BoundingBoxHelper
Inheritance
BoundingBoxHelper

Constructors

BoundingBoxHelper()

Methods

GetFaceBottomCentroid(Int32)

Get the center of the bottom edge of a face of the bounding box determined by index

GetFaceCentroid(Int32)

This function returns the centroid of a face of the bounding cube of an object specified by the index parameter;

GetFaceCorners(Int32)

This function returns the four corners of a face of a bounding cube specified by index.

GetFaceEdgeMidpoints(Int32)

This function returns the midpoints of each of the edges of the face of the bounding box

GetFaceIndices(Int32)

this function gets the indices of the bounding cube corners that make up a face.

GetFaceNormal(Int32)

Get the normal of the face of the bounding cube specified by index

GetIndexOfForwardFace(Vector3)

This function gets the index of the face of the bounding cube that is most facing the lookAtPoint. This could be the headPosition or camera position if the face that was facing the view is desired.

GetRawBBCorners(BoundingBox)
Obsolete.
Obsolete.

This function calculates the untransformed bounding box corner points of a GameObject.

GetRawBoundsCorners(BoxCollider)

Calculates the untransformed corner points of the given collider bounds

GetUntransformedCornersFromObject(BoxCollider, List<Vector3>)

static function that performs one-time non-persistent calculation of corner points of given bounds without taking world transform into account.

UpdateNonAABoundingBoxCornerPositions(BoundingBox, List<Vector3>)
Obsolete.

Objects that align to an target's bounding box can call this function in the object's UpdateLoop to get current bound points;

UpdateNonAABoundsCornerPositions(BoxCollider, List<Vector3>)

Returns the corner points of the given collider bounds

Applies to