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