OROCHI
 
Loading...
Searching...
No Matches
GxOtFrustumCulling Class Reference

カリング用オクツリー、階層的カリングを行う More...

#include <GxOtFrustumCulling.h>

Inheritance diagram for GxOtFrustumCulling:
Collaboration diagram for GxOtFrustumCulling:

Classes

struct  GxCullingMeshParam
 ジョブを投げる際に使うスレッド関数用のパラメータ More...
 
class  GxCullingOctant
 カリング用オクツリーのオクタント More...
 
struct  GxHQeryParam
 階層クエリの為のパラメータ More...
 

Public Types

定義
enum  OCTANT {
  OCTANT_INSIDE = 2 , OCTANT_CROSS = 4 , OCTANT_OUTSIDE = 8 , OCTANT_FORCED = 16 ,
  OCTANT_IGNORE = 32 , OCTANT_INIT = 64
}
 オクタントステータス More...
 

Public Member Functions

初期化
 GxOtFrustumCulling (void)
 デフォルトコンストラクタ
 
 GxOtFrustumCulling (GxAllocatorList::ALLOCATOR_TYPE allocateType)
 コンストラクタ
 
 ~GxOtFrustumCulling (void) override
 デストラクタ
 
アクセサ
constexpr GxArraygetGlobalMeshList (void) const
 グローバルなメッシュリストを取得
 
constexpr GxArraygetGlobalInstanceList (void) const
 グローバルなインスタンスリストを取得
 
GX_FORCE_INLINE b32 isJudgePartsFlagState (void) const
 パーツフラグがOFFのメッシュならツリーに追加しないかどうかを判定
 
GX_FORCE_INLINE void setJudgePartsFlagState (const b32 &value)
 パーツフラグがOFFのメッシュならツリーに追加しないかどうかを設定
 
GX_FORCE_INLINE b32 isEmpty (void) const override
 
- Public Member Functions inherited from GxOctree
 GxOctree (void)
 デフォルトコンストラクタ
 
 GxOctree (GxAllocatorList::ALLOCATOR_TYPE allocateType)
 コンストラクタ
 
 ~GxOctree (void) override
 デストラクタ
 
b32 findObject (GxClassBaseRoot *pObject) const
 オブジェクトを検索
 
b32 addObject (GxClassBaseRoot *pObject, const GxVector3 &min, const GxVector3 &max)
 オブジェクトをオクツリーに追加
 
b32 eraseObject (GxClassBaseRoot *pObject, const GxVector3 &min, const GxVector3 &max)
 オブジェクトをオクツリーから削除
 
void eraseAllObject (void)
 全てのオブジェクトを削除
 
void initialize (u32 level, GxVector3 &min, GxVector3 &max, u32 levelNonShared=0, u32 numCsecShared=10)
 
virtual void beginBuildTree (void)
 ツリーの構築
 
virtual void finishBuildTree (void)
 ツリーの破棄
 
b32 updateTreeSize (GxVector3 &min, GxVector3 &max)
 ツリーのサイズを更新
 
GX_FORCE_INLINE void startCulling (void)
 カリング開始
 
GX_FORCE_INLINE void endCulling (void)
 カリング終了
 
u32 getPointMortonCode (const f32 &x, const f32 &y, const f32 &z) const
 指定ポイントのモートン順序のコードを取得
 
u32 getBBMortonCode (const GxVector3 &min, const GxVector3 &max) const
 二つの空間座標からBBが含まれる、最上位空間のモートンコードを取得
 
u32 getMortonCode (const u32 &x, const u32 &y, const u32 &z) const
 モートン順序のコードを取得
 
GX_FORCE_INLINE b32 isRegisting (void) const
 
GX_FORCE_INLINE GxArraygetNodeArray (void)
 ノード配列を取得
 
GX_FORCE_INLINE const GxArraygetNodeArray (void) const
 ノード配列を取得
 
GX_FORCE_INLINE GxVector3getUnitLength (void)
 
GX_FORCE_INLINE const GxVector3getUnitLength (void) const
 
GX_FORCE_INLINE GxVector3getMin (void)
 
GX_FORCE_INLINE const GxVector3getMin (void) const
 
GX_FORCE_INLINE GxVector3getMax (void)
 
GX_FORCE_INLINE const GxVector3getMax (void) const
 
constexpr u32 getTreeLevel (void) const
 
constexpr u32 getNodeCount (void) const
 
GX_FORCE_INLINE const u32 getLeafNodeCount (u32 leaf) const
 
GX_FORCE_INLINE const u32 getUnitNodeCount (const u32 &level) const
 
constexpr GxArraygetGlobalObjectList (void) const
 
- Public Member Functions inherited from GxClassBase
constexpr GxClassBase (void)
 コンストラクタ
 
constexpr GxClassBase (const GxClassBase &base)
 コピーコンストラクタ
 
 ~GxClassBase (void) override
 デストラクタ
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

操作

void eraseTree (void) override
 ツリーの削除
 
void resetCullingFlags (void)
 全てのオブジェクトのカリングフラグをリセット
 
GxCullingMeshGroupAliasfindMesh (const GxResModel::GxMesh *pMesh) const
 メッシュが既に登録済みか検索
 
b32 windowQueryForBB (GxArray &arvSpaces, const GxVector3 &min, const GxVector3 &max) override
 ウインドウクエリを行う(階層カリング用)
 
b32 addMesh (const GxResModel::GxMesh *pMesh, const GxUnitModelBase *pUnit, u32 beginIndex, u32 endIndex, u8 ***pppCullingFlag, const GxVector3 &min, const GxVector3 &max)
 オブジェクトをオクツリーに追加
 
b32 eraseMesh (const GxResModel::GxMesh *pMesh, u32 beginIndex, u32 endIndex, const GxVector3 &min, const GxVector3 &max)
 オブジェクトをオクツリーから削除
 
void eraseAllMeshes (void)
 全てのオブジェクトを取り除く
 
GxCullingInstanceAliasfindInstance (const GxMatrixAffine *pMatrix, u32 index)
 インスタンスが既に登録済みか検索
 
b32 addInstance (const GxMatrixAffine *pMatrix, const GxUnitModelBase *pUnit, u32 beginIndex, u32 endIndex, u8 ***pppCullingFlag, const GxVector3 &min, const GxVector3 &max)
 オブジェクトをオクツリーに追加
 
b32 eraseInstance (GxMatrixAffine *pMatrix, u32 beginIndex, u32 endIndex, const GxVector3 &min, const GxVector3 &max)
 オブジェクトをオクツリーから削除
 
void eraseAllInstances (void)
 全てのオブジェクトを削除
 
void hierarchicalQueryForFrustum (GxArray &arvSpaces, b32 **ppState, const GxShapeFrustum &frustum)
 フラスタムを使って、階層的にクエリを行う
 
void hierarchicalQueryForFrustum (const GxShapeFrustum &frustum)
 フラスタムを使って階層的にクエリを行う
 
void assembleHitNodeArray (GxArray &arvSpaces, b32 **ppState)
 階層カリングで交差判定が出たノードを取得
 
void cullingMeshGroup (void *pArgument)
 グループ単位でカリング処理(又はフラグ更新処理)
 
void cullingInstanceGroup (void *pArgument)
 グループ単位でカリング処理(又はフラグ更新処理)
 
void cullingUnitGroup (void *pArgument)
 グループ単位でカリング処理(又はフラグ更新処理)
 
GxOctree::GxNodeallocateNode (void) override
 GxNodeのメモリ確保
 
void hierarchicalQueryForFrustumCB (void *pArgument)
 フラスタムを使って階層的にクエリを行う
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 
- Protected Member Functions inherited from GxOctree
constexpr u32 part1By2 (u32 value) const
 3ビットトビに分割
 
void queryHighLevel (s32 &levelCount, u32 &arExorN, const GxVector3 &min, const GxVector3 &max) const
 与えれれた座標でAABB、直線などが作られる場合にのオブジェクトが含まれれる最上位空間を取得
 
void queryLowerLevelSpaces (const GxVector3 &leftTopBack, const u32 &initialAABB, const u32 &aunParentLevelN, const u32 &aunParentSpace, b32 *pDirtyFlags)
 下層の空間情報を取得
 
GX_FORCE_INLINE const u32 getElementIndex (const u32 &level, const u32 &localIndex) const
 
- Protected Attributes inherited from GxOctree
u32 _level
 
u32 * _pStartIndex
 
u32 * _pUnitCount
 
GxVector3 _leftTopBack
 
GxVector3 _rightBottomFront
 
GxVector3 _unitLength
 
GxArray _nodePointerArray
 
b32_pTemporaryFind
 
b32_pDirtyFlags [GxThread::THREAD_MAX]
 
GxArray_pGlobalObjectList
 インスタンスグローバルリスト
 
GxCriticalSection _criticalSectionArray
 
GxCriticalSection _criticalSectionRegist
 
b32 _inCulling
 
GxAllocatorList::ALLOCATOR_TYPE _allocatorType
 アロケータ種別
 

Detailed Description

カリング用オクツリー、階層的カリングを行う

Member Enumeration Documentation

◆ OCTANT

オクタントステータス

Enumerator
OCTANT_INSIDE 

フラスタムの内側

OCTANT_CROSS 

フラスタムの境界をまたいでいる

OCTANT_OUTSIDE 

フラスタムの外

OCTANT_FORCED 

強制カリングされた

OCTANT_IGNORE 

無視

OCTANT_INIT 

初期値

Member Function Documentation

◆ addInstance()

b32 GxOtFrustumCulling::addInstance ( const GxMatrixAffine * pObject,
const GxUnitModelBase * pWorldMatrix,
u32 beginIndex,
u32 endIndex,
u8 *** pppCullingFlag,
const GxVector3 & min,
const GxVector3 & max )

オブジェクトをオクツリーに追加

Parameters
pObject[in] 登録するオブジェクト
pWorldMatrix[in] ワールドマトリクス
beginIndex[in] 開始インデックス
endIndex[in] 終了インデックス
pppCullingFlag[in] カリングフラグ
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Returns
追加したらtrue
Here is the call graph for this function:

◆ addMesh()

b32 GxOtFrustumCulling::addMesh ( const GxResModel::GxMesh * pObject,
const GxUnitModelBase * pModel,
u32 beginIndex,
u32 endIndex,
u8 *** pppCullingFlag,
const GxVector3 & min,
const GxVector3 & max )

オブジェクトをオクツリーに追加

Parameters
pObject[in] オブジェクト
pModel[in] モデル
beginIndex[in] 開始インデックス
endIndex[in] 終了インデックス
pppCullingFlag[in] カリングフラグ
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Returns
追加したらtrue
Here is the call graph for this function:

◆ allocateNode()

GxOctree::GxNode * GxOtFrustumCulling::allocateNode ( void )
overrideprotectedvirtual

GxNodeのメモリ確保

Returns
確保ノード

Reimplemented from GxOctree.

◆ assembleHitNodeArray()

void GxOtFrustumCulling::assembleHitNodeArray ( GxArray & spaces,
b32 ** ppState )

階層カリングで交差判定が出たノードを取得

Parameters
spaces[in] バウンディングボックスに含まれる全てのノード
ppState[in] ステータス
Here is the caller graph for this function:

◆ cullingInstanceGroup()

void GxOtFrustumCulling::cullingInstanceGroup ( void * pArgument)

グループ単位でカリング処理(又はフラグ更新処理)

Parameters
pArgument[in] GxCullingInstanceParam型情報

◆ cullingMeshGroup()

void GxOtFrustumCulling::cullingMeshGroup ( void * pArgument)

グループ単位でカリング処理(又はフラグ更新処理)

Parameters
pArgument[in] GxCullingMeshParam型情報

◆ cullingUnitGroup()

void GxOtFrustumCulling::cullingUnitGroup ( void * pArgument)

グループ単位でカリング処理(又はフラグ更新処理)

Parameters
pArgument[in] GxCullingMeshParam型情報

◆ eraseInstance()

b32 GxOtFrustumCulling::eraseInstance ( GxMatrixAffine * pObject,
u32 beginIndex,
u32 endIndex,
const GxVector3 & min,
const GxVector3 & max )

オブジェクトをオクツリーから削除

Parameters
pObject[in] 登録するオブジェクト
beginIndex[in] 開始インデックス
endIndex[in] 終了インデックス
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Returns
削除したらtrue
Here is the call graph for this function:

◆ eraseMesh()

b32 GxOtFrustumCulling::eraseMesh ( const GxResModel::GxMesh * pObject,
u32 beginIndex,
u32 endIndex,
const GxVector3 & min,
const GxVector3 & max )

オブジェクトをオクツリーから削除

Parameters
pObject[in] オブジェクト
beginIndex[in] 開始インデックス
endIndex[in] 終了インデックス
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Returns
削除したらtrue
Here is the call graph for this function:

◆ eraseTree()

void GxOtFrustumCulling::eraseTree ( void )
overridevirtual

ツリーの削除

Reimplemented from GxOctree.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findInstance()

GxCullingInstanceAlias * GxOtFrustumCulling::findInstance ( const GxMatrixAffine * pObject,
u32 index )

インスタンスが既に登録済みか検索

Parameters
pObject[in] 検索対象のメッシュ
index[in] 検索対象のメッシュインデックス
Returns
発見されたメッシュエイリアス
Here is the call graph for this function:

◆ findMesh()

GxCullingMeshGroupAlias * GxOtFrustumCulling::findMesh ( const GxResModel::GxMesh * pObject) const

メッシュが既に登録済みか検索

Parameters
pObject[in] 検索対象のメッシュ
Returns
発見されたメッシュエイリアス
Here is the call graph for this function:

◆ hierarchicalQueryForFrustum() [1/2]

void GxOtFrustumCulling::hierarchicalQueryForFrustum ( const GxShapeFrustum & frustum)

フラスタムを使って階層的にクエリを行う

Parameters
frustumフラスタム情報

◆ hierarchicalQueryForFrustum() [2/2]

void GxOtFrustumCulling::hierarchicalQueryForFrustum ( GxArray & spaces,
b32 ** ppState,
const GxShapeFrustum & frustum )

フラスタムを使って、階層的にクエリを行う

Parameters
spaces[in] 全てのノード
ppState[in] ステータス
frustum[in] フラスタム情報
Here is the caller graph for this function:

◆ hierarchicalQueryForFrustumCB()

void GxOtFrustumCulling::hierarchicalQueryForFrustumCB ( void * pArgument)
protected

フラスタムを使って階層的にクエリを行う

Parameters
pArgumentクエリパラメータ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

GX_FORCE_INLINE b32 GxOtFrustumCulling::isEmpty ( void ) const
inlineoverridevirtual

空判定

Returns
空ならtrue

Reimplemented from GxOctree.

Here is the call graph for this function:

◆ windowQueryForBB()

b32 GxOtFrustumCulling::windowQueryForBB ( GxArray & spaces,
const GxVector3 & min,
const GxVector3 & max )
overridevirtual

ウインドウクエリを行う(階層カリング用)

Parameters
spaces[in] バウンディングボックスに含まれる全てのノード
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Returns
ノードがあればtrue

Reimplemented from GxOctree.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: