# OrientedBox3F

Engine/source/math/mOrientedBox.h

An oriented bounding box (OBB) described by a center point, three normalizes axis vectors, and half-extents along each of the axes.

More...

## Public Types

enum
```Axis {
RightVector
ForwardVector
UpVector
}
```

## Protected Attributes

```Point3F
```
```mAxes 
```

Normalized axis vectors.

```Point3F
```
```mCenter
```

Center point.

```Point3F
```
```mHalfExtents
```

Box half-extents along each axis.

```Point3F
```
```mPoints [NUM_POINTS]
```

Corner points.

## Protected Functions

```void
```
```_initPoints()
```

## Public Functions

```OrientedBox3F()
```
```OrientedBox3F(const MatrixF & transform, const Box3F & aabb)
```
```OrientedBox3F(const MatrixF & transform, const Point3F & extents)
```
```const Point3F &
```
```getAxis(U32 i)
```

Return the normalized axis vector for the given world-space axis.

```const Point3F &
```
```getCenter()
```

Return the center point of the bounding box.

```const Point3F &
```
```getHalfExtents()
```

Return the half-extents along each axis.

```const Point3F *
```
```getPoints()
```

Return the corner points of the box.

```bool
```
```isContained(const Point3F & point)
```

Return true if the given point is contained in the OBB.

```operator const Point3F*()
```

Return the array of corner points for the box.

```void
```
```set(const MatrixF & transform, const Box3F & aabb)
```

Compute the OBB from an AABB in the given transform space.

```void
```
```set(const MatrixF & transform, const Point3F & extents)
```

Compute the OBB values from the given transform and extents.

## Detailed Description

An oriented bounding box (OBB) described by a center point, three normalizes axis vectors, and half-extents along each of the axes.

```Axis
```

RightVector
ForwardVector
UpVector

## Protected Attributes

```Point3F mAxes 
```

Normalized axis vectors.

```Point3F mCenter
```

Center point.

```Point3F mHalfExtents
```

Box half-extents along each axis.

```Point3F mPoints [NUM_POINTS]
```

Corner points.

## Protected Functions

```_initPoints()
```

## Public Functions

```OrientedBox3F()
```

```OrientedBox3F(const MatrixF & transform, const Box3F & aabb)
```

```OrientedBox3F(const MatrixF & transform, const Point3F & extents)
```

```getAxis(U32 i)
```

Return the normalized axis vector for the given world-space axis.

```getCenter()
```

Return the center point of the bounding box.

```getHalfExtents()
```

Return the half-extents along each axis.

Since the OBBs are symmetrical across each axis, we store half-extents instead of full extents as usually half-extents are needed in the computations.

```getPoints()
```

Return the corner points of the box.

```isContained(const Point3F & point)
```

Return true if the given point is contained in the OBB.

```operator const Point3F*()
```

Return the array of corner points for the box.

```set(const MatrixF & transform, const Box3F & aabb)
```

Compute the OBB from an AABB in the given transform space.

Parameters:

 transform Transform space for the AABB. aabb An axis-aligned bounding box in the given transform space.

```set(const MatrixF & transform, const Point3F & extents)
```

Compute the OBB values from the given transform and extents.

Parameters:

 transform World->object space transform. extents Box extent on each axis.