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

8分木クラス More...

#include <GxOctree.h>

Inheritance diagram for GxOctree:
Collaboration diagram for GxOctree:

Classes

class  GxNode
 8分木ノードクラス More...
 

Public Member Functions

初期化
 GxOctree (void)
 デフォルトコンストラクタ
 
 GxOctree (GxAllocatorList::ALLOCATOR_TYPE allocateType)
 コンストラクタ
 
 ~GxOctree (void) override
 デストラクタ
 
- 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)
 デフォルトオブジェクト判定
 

メンバ変数

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
 アロケータ種別
 

操作

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)
 全てのオブジェクトを削除
 
virtual b32 windowQueryForBB (GxArray &arvSpaces, const GxVector3 &min, const GxVector3 &max)
 ウインドウクエリを行う
 
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)
 ツリーのサイズを更新
 
virtual void eraseTree (void)
 全体を削除
 
GX_FORCE_INLINE void startCulling (void)
 カリング開始
 
GX_FORCE_INLINE void endCulling (void)
 カリング終了
 
virtual GxOctree::GxNodeallocateNode (void)
 GxNodeのメモリ確保
 
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)
 下層の空間情報を取得
 

アクセサ

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
 
virtual b32 isEmpty (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
 
GX_FORCE_INLINE const u32 getElementIndex (const u32 &level, const u32 &localIndex) const
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 

Detailed Description

8分木クラス

Constructor & Destructor Documentation

◆ GxOctree()

GxOctree::GxOctree ( GxAllocatorList::ALLOCATOR_TYPE allocateType)

コンストラクタ

Parameters
allocateType[in] 使用アロケータ
Here is the call graph for this function:

Member Function Documentation

◆ addObject()

b32 GxOctree::addObject ( GxClassBaseRoot * pObject,
const GxVector3 & min,
const GxVector3 & max )

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

Parameters
pObject[in] 登録するオブジェクト
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Returns
成功したらtrue

◆ allocateNode()

GxOctree::GxNode * GxOctree::allocateNode ( void )
protectedvirtual

GxNodeのメモリ確保

Returns
確保ノード

Reimplemented in GxOtFrustumCulling.

◆ eraseObject()

b32 GxOctree::eraseObject ( GxClassBaseRoot * pObject,
const GxVector3 & min,
const GxVector3 & max )

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

Parameters
pObject[in] 削除するオブジェクト
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Returns
成功したらtrue

◆ eraseTree()

void GxOctree::eraseTree ( void )
virtual

全体を削除

Reimplemented in GxOtFrustumCulling.

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

◆ findObject()

b32 GxOctree::findObject ( GxClassBaseRoot * pObject) const

オブジェクトを検索

Parameters
pObject[in] 検索対象のメッシュ
Returns
発見したらtrue

◆ getBBMortonCode()

u32 GxOctree::getBBMortonCode ( const GxVector3 & min,
const GxVector3 & max ) const

二つの空間座標からBBが含まれる、最上位空間のモートンコードを取得

Parameters
minバウンディングボックスのmin座標
maxバウンディングボックスのmax座標
Returns
モートンコード
Here is the call graph for this function:

◆ getElementIndex()

GX_FORCE_INLINE const u32 GxOctree::getElementIndex ( const u32 & level,
const u32 & localIndex ) const
inlineprotected

要素数を取得

Parameters
level[in] レベル
localIndex[in] インデックス
Returns
要素数
Here is the caller graph for this function:

◆ getGlobalObjectList()

GxArray * GxOctree::getGlobalObjectList ( void ) const
inlineconstexpr

グローバルのオブジェクトリストを取得

Returns
リスト

◆ getLeafNodeCount()

GX_FORCE_INLINE const u32 GxOctree::getLeafNodeCount ( u32 leaf) const
inline

葉のノード数の取得

Parameters
leaf[in] 葉
Returns
ノード数
Here is the call graph for this function:

◆ getMax() [1/2]

GX_FORCE_INLINE GxVector3 & GxOctree::getMax ( void )
inline

ツリーのAABBの最大値を取得

Returns
最大値

◆ getMax() [2/2]

GX_FORCE_INLINE const GxVector3 & GxOctree::getMax ( void ) const
inline

ツリーのAABBの最大値を取得

Returns
最大値

◆ getMin() [1/2]

GX_FORCE_INLINE GxVector3 & GxOctree::getMin ( void )
inline

ツリーのAABBの最小値を取得

Returns
最小値

◆ getMin() [2/2]

GX_FORCE_INLINE const GxVector3 & GxOctree::getMin ( void ) const
inline

ツリーのAABBの最小値を取得

Returns
最小値

◆ getMortonCode()

u32 GxOctree::getMortonCode ( const u32 & x,
const u32 & y,
const u32 & z ) const

モートン順序のコードを取得

Parameters
x位置座標
y位置座標
x位置座標
Returns
モートンコード
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNodeArray() [1/2]

GX_FORCE_INLINE GxArray & GxOctree::getNodeArray ( void )
inline

ノード配列を取得

Returns
ノード配列

◆ getNodeArray() [2/2]

GX_FORCE_INLINE const GxArray & GxOctree::getNodeArray ( void ) const
inline

ノード配列を取得

Returns
ノード配列

◆ getNodeCount()

u32 GxOctree::getNodeCount ( void ) const
inlineconstexpr

ノード数の取得

Returns
ノード数
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPointMortonCode()

u32 GxOctree::getPointMortonCode ( const f32 & x,
const f32 & y,
const f32 & z ) const

指定ポイントのモートン順序のコードを取得

Parameters
x[in] X座標
y[in] Y座標
z[in] Z座標
Returns
モートンコード
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTreeLevel()

u32 GxOctree::getTreeLevel ( void ) const
inlineconstexpr

ツリーのレベルを取得

Returns
レベル

◆ getUnitLength() [1/2]

GX_FORCE_INLINE GxVector3 & GxOctree::getUnitLength ( void )
inline

ツリーの最下層オクタントのサイズを取得

Returns
サイズ

◆ getUnitLength() [2/2]

GX_FORCE_INLINE const GxVector3 & GxOctree::getUnitLength ( void ) const
inline

ツリーの最下層オクタントのサイズを取得

Returns
サイズ

◆ getUnitNodeCount()

GX_FORCE_INLINE const u32 GxOctree::getUnitNodeCount ( const u32 & level) const
inline

各軸に配置されるノード数を取得

Parameters
level[in] レベル
Returns
ノード数
Here is the caller graph for this function:

◆ initialize()

void GxOctree::initialize ( u32 level,
GxVector3 & min,
GxVector3 & max,
u32 levelNonShared = 0,
u32 numCriticalSectionShared = 10 )

ツリーを初期化 levelNonShared, numCsecSharedを変更することで、使用する同期オブジェクト数が変わる。

Parameters
level[in] ツリーの深さ
min[in] オクツリーのバウンディングボックスのmin
max[in] オクツリーのバウンディングボックスのmax
levelNonShared[in] 同期オブジェクトを共有しないツリー深さ。生成されるオブジェクト数は1で1+8, 2で1+8+64, 3で1+8+64+512...
numCriticalSectionShared[in] 共有同期オブジェクトの数
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

virtual b32 GxOctree::isEmpty ( void ) const
inlinevirtual

空判定

Returns
空ならtrue

Reimplemented in GxOtFrustumCulling.

Here is the call graph for this function:

◆ isRegisting()

GX_FORCE_INLINE b32 GxOctree::isRegisting ( void ) const
inline

カリング中判定

Returns
カリング中ならtrue

◆ queryHighLevel()

void GxOctree::queryHighLevel ( s32 & levelCount,
u32 & arExorN,
const GxVector3 & min,
const GxVector3 & max ) const
protected

与えれれた座標でAABB、直線などが作られる場合にのオブジェクトが含まれれる最上位空間を取得

Parameters
levelCount[out] ツリーの深さ
arExorN[out] ???
min[in] バウンディングボックスのmin
max[in] バウンディングボックスのmax
Here is the call graph for this function:
Here is the caller graph for this function:

◆ queryLowerLevelSpaces()

void GxOctree::queryLowerLevelSpaces ( const GxVector3 & leftTopBack,
const u32 & initAABB,
const u32 & parentLevelCount,
const u32 & parentSpace,
b32 * pDirtyFlags )
protected

下層の空間情報を取得

Parameters
leftTopBack[in] 左上前座標
initAABB[in] 最初のAABB
parentLevelCount[in] 親のレベル階層
parentSpace[in] 親の空間
pDirtyFlags[in] ダーティフラグ
Here is the caller graph for this function:

◆ updateTreeSize()

b32 GxOctree::updateTreeSize ( GxVector3 & min,
GxVector3 & max )

ツリーのサイズを更新

Parameters
minオクツリーのバウンディングボックスのmin
maxオクツリーのバウンディングボックスのmax
Returns
ツリーの定義域に変化があればtrue,なければfalse
Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowQueryForBB()

b32 GxOctree::windowQueryForBB ( GxArray & spaces,
const GxVector3 & min,
const GxVector3 & max )
virtual

ウインドウクエリを行う

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

Reimplemented in GxOtFrustumCulling.

Here is the call graph for this function:

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