Class representing the view frustum.
More...
#include "nn/nlib/simd/SimdGeometry.h"
|
| Frustum () noexcept |
| Instantiates the object with default parameters (default constructor). Does not configure the default settings for the data members.
|
|
| Frustum (const Frustum &rhs) noexcept |
| Copy constructor.
|
|
Frustum & | operator= (const Frustum &rhs) noexcept |
| Assignment operator.
|
|
| Frustum (SimdVectorArg center, SimdQuaternionArg rotation, float top, float bottom, float left, float right, float n, float f) noexcept |
| Specifies the parameters and constructs a view frustum. More...
|
|
void | Set (SimdVectorArg center, SimdQuaternionArg rotation, float top, float bottom, float left, float right, float n, float f) noexcept |
| Performs the same operations as the constructor. See the description of the constructor.
|
|
void | Transform (Frustum *frustum, float scale, SimdQuaternionArg rotation, SimdVectorArg translation) const noexcept |
| Performs a 3D transform on an existing frustum and stores the transformed frustum in frustum. More...
|
|
void | Transform (Frustum *frustum, SimdMatrixArg m) const noexcept |
| Performs a 3D transform on an existing frustum and stores the transformed frustum in frustum. More...
|
|
void | GetCorners (Float3 *corners) const noexcept |
| Gets the vertices of the frustum in world coordinates. More...
|
|
Class representing the view frustum.
- Description
- This class holds data for the six planes in (normalized) local coordinates that make up the view frustum, in addition to the vector that represents the position and the quaternion that represents the rotation.
Definition at line 118 of file SimdGeometry.h.
◆ Frustum()
nn::nlib::simd::Frustum::Frustum |
( |
SimdVectorArg |
center, |
|
|
SimdQuaternionArg |
rotation, |
|
|
float |
top, |
|
|
float |
bottom, |
|
|
float |
left, |
|
|
float |
right, |
|
|
float |
n, |
|
|
float |
f |
|
) |
| |
|
noexcept |
Specifies the parameters and constructs a view frustum.
- Parameters
-
[in] | center | The three-dimensional vector representing the position of the frustum. |
[in] | rotation | A quaternion indicating the orientation of the frustum. |
[in] | top | Y-coordinate of the top of the near plane. |
[in] | bottom | Y-coordinate of the bottom of the near plane. |
[in] | left | X-coordinate on the left side of the near plane. |
[in] | right | X-coordinate on the right side of the near plane. |
[in] | n | The distance to the near plane. |
[in] | f | The distance to the far plane. |
- Description
- The vertices of the frustum (in the local coordinate system) take the following values.
-
Near plane: (left, top, -n), (right, top, -n), (right, bottom, -n), (left, bottom, -n)
-
Far plane: (left * f/n, top * f/n, -f), (right * f/n, top * f/n, -f), (right * f/n, bottom * f/n, -f), (left * f/n, bottom * f/n, -f)
- The following planes are kept in normalized forms inside the class. In all cases, the normal points toward the outside of the frustum, to enable such things as more efficient determination of containment relations.
-
Near plane: z + n = 0
-
Far plane: -z - f = 0
-
Top plane: y + (top/n)z = 0
-
Bottom plane: -y - (bottom/n)z = 0
-
Left plane: -x - (left/n)z = 0
-
Right plane: x + (right/n)z = 0
- These planes are located in world coordinates, rotated by the amount of rotation and translated by the amount of center.
◆ GetCorners()
nn::nlib::simd::Frustum::GetCorners |
( |
Float3 * |
corners | ) |
const |
|
noexcept |
Gets the vertices of the frustum in world coordinates.
- Parameters
-
[out] | corners | The region storing the vertices. You must allocate a region that can hold the data for eight vertices. |
- Description
- The vertices are stored in a specific order, starting with the vertices for the near plane (clockwise, starting with the upper left and then proceeding to the upper right, lower right, and lower left), followed by the vertices for the far plane (similarly clockwise, starting with the upper left and then proceeding to the upper right, lower right, and lower left).
◆ Transform() [1/2]
Performs a 3D transform on an existing frustum and stores the transformed frustum in frustum.
- Parameters
-
[out] | frustum | Stores the transformed frustum. |
[in] | scale | The scaling. |
[in] | rotation | The rotation. |
[in] | translation | The translation. |
◆ Transform() [2/2]
Performs a 3D transform on an existing frustum and stores the transformed frustum in frustum.
- Parameters
-
[out] | frustum | Stores the transformed frustum. |
[in] | m | A 3D transform matrix. |
- Description
- Scaling uses the maximum values along the xyz axes.
The documentation for this class was generated from the following files: