3D の視錐台を定義します。 More...
#include <ViewFrustum.h>
Public Member Functions | |
ViewFrustum (const Matrix &viewProjMatrix) | |
指定されたビュープロジェクション行列を使用して初期化します。 | |
void | SetViewProjMatrix (const Matrix &viewProjMatrix) |
指定されたビュープロジェクション行列を使用してこの視錐台を再構築します。 | |
bool | Intersects (const Vector3 &point) const |
指定した点がこの視錐台の内側にあるかを判定します。 | |
bool | Intersects (const Vector3 ¢er, float radius) const |
指定した球がこの視錐台と交差するかを判定します。 | |
void | GetCornerPoints (Vector3 *points) const |
錐台の各頂点を取得します。 | |
const Plane & | GetPlane (FrustumPlane plane) const |
錐台の指定した面を取得します。 |
3D の視錐台を定義します。
視錐台は主に 3D 空間上のカメラの視野を表すために使用します。 カメラを表すビュープロジェクション行列から作成できます。
視錐台の外側にあるオブジェクトは通常、レンダリングする必要はありません。 Intersects() を使用して視錐台とオブジェクトの交差判定 (内側に存在するか) を行うことで、 レンダリングが必要かをチェックできます。
Lumino::ViewFrustum::ViewFrustum | ( | const Matrix & | viewProjMatrix | ) |
指定されたビュープロジェクション行列を使用して初期化します。
[in] | viewProjMatrix | : 視錐台の生成に使用するビュープロジェクション行列 |
void Lumino::ViewFrustum::GetCornerPoints | ( | Vector3 * | points | ) | const |
錐台の各頂点を取得します。
[out] | points | : 頂点座標を格納する配列 (要素数は 8 であること) |
頂点の順番は、Near平面の左上、右上、右下、左下、Far平面の左上、右上、右下、左下です。
bool Lumino::ViewFrustum::Intersects | ( | const Vector3 & | point | ) | const |
指定した点がこの視錐台の内側にあるかを判定します。
[in] | point | : 判定する点 |
bool Lumino::ViewFrustum::Intersects | ( | const Vector3 & | center, |
float | radius | ||
) | const |
指定した球がこの視錐台と交差するかを判定します。
[in] | center | : 球の中心点 |
[in] | radius | : 球の半径 |
void Lumino::ViewFrustum::SetViewProjMatrix | ( | const Matrix & | viewProjMatrix | ) |
指定されたビュープロジェクション行列を使用してこの視錐台を再構築します。
[in] | viewProjMatrix | : 視錐台の生成に使用するビュープロジェクション行列 |