# BoxBase

Engine/source/math/mBoxBase.h

Base class for box geometries.

More...

## Public Types

enum
```Edges {
NearLeftEdge
NearBottomEdge
NearRightEdge
NearTopEdge
FarLeftEdge
FarTopEdge
FarRightEdge
FarBottomEdge
LeftTopEdge
LeftBottomEdge
RightTopEdge
RightBottomEdge
NUM_EDGES
InvalidEdge
}
```

Indices for the edges of the box.

enum
```PlaneMasks {
PlaneMaskLeft = ( 1 << LeftPlane )
PlaneMaskRight = ( 1 << RightPlane )
PlaneMaskTop = ( 1 << TopPlane )
PlaneMaskBottom = ( 1 << BottomPlane )
PlaneMaskNear = ( 1 << NearPlane )
PlaneMaskFar = ( 1 << FarPlane )
PlaneMaskAll = 0xFFFFFFFF
}
```
enum
```Planes {
LeftPlane
RightPlane
NearPlane
FarPlane
TopPlane
BottomPlane
NUM_PLANES
}
```

Indices for the side planes of the box.

enum
```Points {
NearBottomRight
NearTopRight
NearTopLeft
NearBottomLeft
FarBottomRight
FarTopRight
FarTopLeft
FarBottomLeft
NUM_POINTS
InvalidPoint = NUM_POINTS
}
```

Indices of the corner points.

## Public Static Functions

```void
```
```getEdgePointIndices(Edges edge, Points & outP1, Points & outP2)
```

Get the start and end point of the given edge.

```Points
```
```getOppositePoint(Points p)
```

Return the point index for the opposite corner of p.

```Points
```
```getPlanePointIndex(Planes plane, U32 i)
```
```Points
```
```getPointIndexFromOctant(const Point3F & p)
```

Return the point index for the corner point that corresponds to the octant that p points to.

## Detailed Description

Base class for box geometries.

## Public Types

```Edges
```

### Enumerator

NearLeftEdge
NearBottomEdge
NearRightEdge
NearTopEdge
FarLeftEdge
FarTopEdge
FarRightEdge
FarBottomEdge
LeftTopEdge
LeftBottomEdge
RightTopEdge
RightBottomEdge
NUM_EDGES
InvalidEdge

Indices for the edges of the box.

```PlaneMasks
```

### Enumerator

PlaneMaskLeft = ( 1 << LeftPlane )
PlaneMaskRight = ( 1 << RightPlane )
PlaneMaskTop = ( 1 << TopPlane )
PlaneMaskBottom = ( 1 << BottomPlane )
PlaneMaskNear = ( 1 << NearPlane )
PlaneMaskFar = ( 1 << FarPlane )
PlaneMaskAll = 0xFFFFFFFF
```Planes
```

### Enumerator

LeftPlane
RightPlane
NearPlane
FarPlane
TopPlane
BottomPlane
NUM_PLANES

Indices for the side planes of the box.

Each pair of planes has successive indices. Also, the planes are ordered by X (left&right), Y (near&far), and Z (top&bottom).

```Points
```

### Enumerator

NearBottomRight
NearTopRight
NearTopLeft
NearBottomLeft
FarBottomRight
FarTopRight
FarTopLeft
FarBottomLeft
NUM_POINTS
InvalidPoint = NUM_POINTS

Indices of the corner points.

note:

The order defined here is expected by several places in the code!

## Public Static Functions

```getEdgePointIndices(Edges edge, Points & outP1, Points & outP2)
```

Get the start and end point of the given edge.

```getOppositePoint(Points p)
```

Return the point index for the opposite corner of p.

```getPlanePointIndex(Planes plane, U32 i)
```

```getPointIndexFromOctant(const Point3F & p)
```

Return the point index for the corner point that corresponds to the octant that p points to.