Lumino
ln::ViewFrustum Struct Reference

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 &center, float radius) const
 指定した球がこの視錐台と交差するかを判定します。 More...
 
IntersectResult intersects (const Box &box) const
 指定した Box がこの視錐台と交差するかを判定します。
 
void getCornerPoints (Vector3 *points) const
 錐台の各頂点を取得します。 More...
 
const Planeplane (FrustumPlane plane) const
 錐台の指定した面を取得します。 More...
 

Detailed Description

3D の視錐台を定義します。

視錐台は主に 3D 空間上のカメラの視野を表すために使用します。 カメラを表すビュープロジェクション行列から作成できます。

視錐台の外側にあるオブジェクトは通常、レンダリングする必要はありません。 intersects() を使用して視錐台とオブジェクトの交差判定 (内側に存在するか) を行うことで、レンダリングが必要かをチェックできます。

Constructor & Destructor Documentation

◆ ViewFrustum()

ln::ViewFrustum::ViewFrustum ( const Matrix viewProjMatrix)

指定されたビュープロジェクション行列を使用して初期化します。

Parameters
[in]viewProjMatrix: 視錐台の生成に使用するビュープロジェクション行列

Member Function Documentation

◆ getCornerPoints()

void ln::ViewFrustum::getCornerPoints ( Vector3 points) const

錐台の各頂点を取得します。

Parameters
[out]points: 頂点座標を格納する配列 (要素数は 8 であること) 頂点の順番は、Near平面の左上、右上、右下、左下、Far平面の左上、右上、右下、左下です。

◆ intersects() [1/2]

bool ln::ViewFrustum::intersects ( const Vector3 point) const

指定した点がこの視錐台の内側にあるかを判定します。

Parameters
[in]point: 判定する点
Returns
点が内側にある場合は true、そうでない場合は false。

◆ intersects() [2/2]

bool ln::ViewFrustum::intersects ( const Vector3 center,
float  radius 
) const

指定した球がこの視錐台と交差するかを判定します。

Parameters
[in]center: 球の中心点
[in]radius: 球の半径
Returns
交差する場合は true、そうでない場合は false。(接触している場合も true)

◆ plane()

const Plane& ln::ViewFrustum::plane ( FrustumPlane  plane) const
inline

錐台の指定した面を取得します。

Parameters
[in]plane: 取得する面

◆ setViewProjMatrix()

void ln::ViewFrustum::setViewProjMatrix ( const Matrix viewProjMatrix)

指定されたビュープロジェクション行列を使用してこの視錐台を再構築します。

Parameters
[in]viewProjMatrix: 視錐台の生成に使用するビュープロジェクション行列

The documentation for this struct was generated from the following file: