OROCHI
 
Loading...
Searching...
No Matches
GxCollision::GxWorld Class Reference

Collision基本ワールドクラス More...

#include <GxCollision.h>

Inheritance diagram for GxCollision::GxWorld:
Collaboration diagram for GxCollision::GxWorld:

Public Member Functions

初期化
 GxWorld (void)
 デフォルトコンストラクタ
 
 ~GxWorld (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 GxClassBaseRoot & operator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRtti & getRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObject * getDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

Static Public Attributes

定義
static constexpr u32 COLLISION_ALGORITHM_NUM = GxMath::VALUE_2
 アルゴリズム個数
 
static constexpr u32 GX_COLLISION_DEFAULT_STACK_ALLOCATOR_SIZE = GxMath::VALUE_64K
 コリジョンのスタックアロケーターサイズデフォルト値
 
static constexpr u32 GX_COLLISION_DEFAULT_MAX_PERSISTENT_MANIFOLD_POOL_SIZE = GxMath::VALUE_8
 コリジョンの汎用的な最大プールサイズデフォルト値
 
static constexpr u32 GX_COLLISION_DEFAULT_MAX_COLLISION_ALGORITHM_POOL_SIZE = GxMath::VALUE_8
 コリジョンのコリジョンアルゴリズム用最大プールサイズデフォルト値
 

メンバ変数

b32 _active
 処理を実行するかフラグ
 
u32 _listClassCount
 リストの個数
 
GxArrayClassBase ** _ppCollisionList
 AddされたCollisionクラスをスレッド毎に記憶するリスト
 
GxArrayClassBase _collisionList
 Collisionクラスを記憶するリスト
 
btCollisionConfiguration * _pBulletConfiguration
 BULLET当たり設定
 
btCollisionDispatcher * _pBulletDispatcher
 BULLET当たり判定用
 
btAxisSweep3 * _pBulletBroadphase
 BULLETブロードフェイズ処理用
 
btCollisionWorld * _pBulletWorld
 BULLETコリジョンワールド
 
btCollisionAlgorithmCreateFunc * _pBulletAlgorithmCreateFunction [COLLISION_ALGORITHM_NUM]
 BULLET判定用アルゴリズム
 
GxVector3 _worldAabbMin
 ワールドAABBのMin
 
GxVector3 _worldAabbMax
 ワールドAABBのMax
 
u16 _maxHandles
 当たり判定オブジェクト個数
 
u32 _btStackAllocatorSize
 Bulletのスタックアロケーターサイズ
 
u32 _btMaxPersistentManifoldPoolSize
 Bulletのマニフォールドの最大プールサイズ
 
u32 _btMaxCollisionAlgorithmPoolSize
 Bulletのコリジョンアルゴリズム最大プールサイズ
 

操作

virtual b32 alloc (u32 meshCount, const GxVector3 &worldAabbMin, const GxVector3 &worldAabbMax, u16 maxHandles, u32 stackAllocatorSize=GX_COLLISION_DEFAULT_STACK_ALLOCATOR_SIZE, u32 maxPersistentManifoldPoolSize=GX_COLLISION_DEFAULT_MAX_PERSISTENT_MANIFOLD_POOL_SIZE, u32 maxCollisionAlgorithmPoolSize=GX_COLLISION_DEFAULT_MAX_COLLISION_ALGORITHM_POOL_SIZE)
 ワールドのメモリ確保
 
virtual void prepareCheck (void)
 当たり判定チェック前準備
 
virtual void check (void)
 
virtual void preBulletUpdate (void)
 
virtual GX_FORCE_INLINE void postBulletUpdate (void)
 
virtual void executePostCheckCallback (void)
 chekc後コールバックを実行
 
virtual GX_FORCE_INLINE void postCheck (void)
 check後処理
 
virtual void registerObject (GxCollision::GxObject *pObject)
 ワールドにオブジェクトを登録する
 
void banObject (GxCollision::GxObject *pObject)
 ワールドからオブジェクトを登録解除する
 
void addClass (u32 threadIndex, GxCollision *pObject)
 クラス登録
 
void detachClass (GxCollision *pCollision)
 クラス削除
 
void detachObjectFromBullet (GxObject *pObject)
 Bulletワールドからデタッチ
 
constexpr btCollisionWorld * getBulletWorld (void) const
 Bulletワールドを取得
 
b32 createBulletWorld (void)
 
b32 deleteBulletWorld (void)
 
void freeMesh (void)
 メッシュリストの解放
 
b32 addMesh (u32 index, GxCollision::GxObject *pMesh)
 背景当たりをリストに追加
 
b32 eraseMesh (GxCollision::GxObject *pMesh)
 メッシュをリストから削除(アドレス指定版)
 
virtual GxCollision::GxRayCallback * createRayCallback (const btVector3 &rayFrom, const btVector3 &rayEnd, GxConditionInformation *pConditionInfo)
 
b32 checkRayClosestVsWorld (GxCollision::GxRayResult &rayResult, const GxVector3 &startPosition, const GxVector3 &endPosition, GxConditionInformation *pConditionInfo=nullptr)
 登録されている全オブジェクトとのレイチェック(最も近い交差点)
 
b32 checkRayClosestVsSingle (GxCollision::GxRayResult &rayResult, GxObject *pTargetObject, const GxVector3 &startPosition, const GxVector3 &endPosition, GxConditionInformation *pConditionInfo=nullptr)
 指定オブジェクトとのレイチェック
 
virtual GxCollision::GxConvexCallback * createConvexCallback (const btVector3 &checkFrom, const btVector3 &checkEnd, GxConditionInformation *pConditionInfo)
 
b32 checkCapsuleClosestVsWorld (GxCollision::GxRayResult &rayResult, const GxVector3 &startPosition, const GxVector3 &endPosition, f32 radius, GxConditionInformation *pConditionInfo=nullptr)
 
b32 checkCapsuleClosestVsSingle (GxCollision::GxRayResult &rayResult, GxObject *pTargetObject, const GxVector3 &startPosition, const GxVector3 &endPosition, f32 radius, GxConditionInformation *pConditionInfo=nullptr)
 
static void customNearCallback (btBroadphasePair &collisionPair, btCollisionDispatcher &dispatcher, const btDispatcherInfo &dispatchInfo)
 近距離当たり判定コールバック(BULLETで用意されたものをオーバーライド)
 

アクセサ

GX_FORCE_INLINE void setActive (b32 active)
 アクティブ設定
 
GX_FORCE_INLINE b32 isActive (void)
 アクティブか判定
 
b32 setMeshCount (u32 count)
 メッシュ登録個数設定
 
GxCollision::GxObject * getMesh (u32 index)
 メッシュアドレスの取得
 
constexpr u32 getMeshCount (void) const
 メッシュオブジェクト個数の取得
 
u32 getActiveMeshCount (void)
 アクティブな個数の取得
 
constexpr u32 getListClassCount (void) const
 リスト個数取得
 
b32 setListClassCount (u32 count)
 リスト個数設定
 
constexpr GxArrayClassBase * getListClass (u32 index) const
 リストの取得
 
constexpr u32 getCollisionCount (void) const
 登録コリジョンの個数を取得
 
GX_FORCE_INLINE GxArrayClassBase * getCollisionList (void)
 登録コリジョンリストを取得
 
GX_FORCE_INLINE void getPropertyList (void *const pValue, u32 index)
 再生クラスアドレスの取得
 
GX_FORCE_INLINE void setPropertyList (const void *const, u32)
 再生クラスアドレスの設定
 
GX_FORCE_INLINE void setPropertyListClassCount (u32 count)
 リスト個数設定
 

Additional Inherited Members

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

Detailed Description

Collision基本ワールドクラス

Member Function Documentation

◆ addClass()

void GxCollision::GxWorld::addClass ( u32 threadIndex,
GxCollision * pCollision )

クラス登録

Parameters
threadIndex[in] スレッドインデックス
pCollision[in] 登録するコリジョン
Here is the caller graph for this function:

◆ addMesh()

b32 GxCollision::GxWorld::addMesh ( u32 index,
GxCollision::GxObject * pMesh )

背景当たりをリストに追加

Parameters
index[in] 登録したいリストのインデックス番号
pMesh[in] リストに登録するメッシュ
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc()

b32 GxCollision::GxWorld::alloc ( u32 meshCount,
const GxVector3 & worldAabbMin,
const GxVector3 & worldAabbMax,
u16 maxHandles,
u32 stackAllocatorSize = GX_COLLISION_DEFAULT_STACK_ALLOCATOR_SIZE,
u32 maxPersistentManifoldPoolSize = GX_COLLISION_DEFAULT_MAX_PERSISTENT_MANIFOLD_POOL_SIZE,
u32 maxCollisionAlgorithmPoolSize = GX_COLLISION_DEFAULT_MAX_COLLISION_ALGORITHM_POOL_SIZE )
virtual

ワールドのメモリ確保

Parameters
meshCount[in] メッシュ最大登録個数
worldAabbMin[in] ワールドの広さ(最小値)
worldAabbMax[in] ワールドの広さ(最大値)
maxHandles[in] 当たり判定オブジェクト個数
stackAllocatorSize[in] Bulletのスタックアロケーターサイズ
maxPersistentManifoldPoolSize[in] Bulletのマニフォールドの最大プールサイズ
maxCollisionAlgorithmPoolSize[in] Bulletのコリジョンアルゴリズム最大プールサイズ
Returns
成功ならtrue

◆ banObject()

void GxCollision::GxWorld::banObject ( GxCollision::GxObject * pObject)

ワールドからオブジェクトを登録解除する

Parameters
pObject[in] 登録解除するオブジェクト
threadIndex[in] スレッドインデックス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check()

void GxCollision::GxWorld::check ( void )
virtual

当たり判定チェック

Note
preBulletUpdate() -> Bulletでの計算 -> postBulletUpdate() -> executePostCheckCallback()

Reimplemented in GxAdjustHit::GxWorld.

Here is the call graph for this function:

◆ checkCapsuleClosestVsSingle()

b32 GxCollision::GxWorld::checkCapsuleClosestVsSingle ( GxCollision::GxRayResult & rayResult,
GxObject * pTargetObject,
const GxVector3 & startPosition,
const GxVector3 & endPosition,
f32 radius,
GxConditionInformation * pConditionInformation = nullptr )

指定オブジェクトとのカプセルチェック(最も近い交差点)
startPosおよびendPosはカプセル頭の球中心座標であることに注意してください。
ヒット位置がstartPosより手前のものは、当たらなかったものとして処理されます。

Parameters
rayResult[out] カプセルチェックの結果格納先
pTargetObject[in] 判定を行う相手オブジェクト
startPosition[in] カプセル開始位置
endPosition[in] カプセル終了位置
radius[in] カプセル半径
pConditionInformation[in] カプセルチェック詳細設定
Returns
カプセルがヒットしたらtrue
Here is the call graph for this function:

◆ checkCapsuleClosestVsWorld()

b32 GxCollision::GxWorld::checkCapsuleClosestVsWorld ( GxCollision::GxRayResult & rayResult,
const GxVector3 & startPosition,
const GxVector3 & endPosition,
f32 radius,
GxConditionInformation * pConditionInformation = nullptr )

登録されている全オブジェクトとのカプセルチェック(最も近い交差点)
startPosおよびendPosはカプセル頭の球中心座標であることに注意してください。
ヒット位置がstartPosより手前のものは、当たらなかったものとして処理されます。

Parameters
rayResult[out] カプセルチェックの結果格納先
startPosition[in] カプセル開始位置(球の中心位置)
endPosition[in] カプセル終了位置(球の中心位置)
radius[in] カプセル半径
pConditionInformation[in] カプセルチェック詳細設定
Returns
カプセルがヒットするオブジェクトが存在したらtrue
Here is the call graph for this function:

◆ checkRayClosestVsSingle()

b32 GxCollision::GxWorld::checkRayClosestVsSingle ( GxCollision::GxRayResult & rayResult,
GxObject * pTargetObject,
const GxVector3 & startPosition,
const GxVector3 & endPosition,
GxConditionInformation * pConditionInformation = nullptr )

指定オブジェクトとのレイチェック

Parameters
rayResult[out] レイチェックの結果格納先
pTargetObject[in] 判定を行う相手オブジェクト
startPosition[in] レイ開始位置
endPosition[in] レイ終了位置
pConditionInformation[in] レイチェック詳細設定
Returns
レイがヒットしたらtrue
Here is the call graph for this function:

◆ checkRayClosestVsWorld()

b32 GxCollision::GxWorld::checkRayClosestVsWorld ( GxCollision::GxRayResult & rayResult,
const GxVector3 & startPosition,
const GxVector3 & endPosition,
GxConditionInformation * pConditionInformation = nullptr )

登録されている全オブジェクトとのレイチェック(最も近い交差点)

Parameters
rayResult[out] レイチェックの結果格納先
startPosition[in] レイ開始位置
endPosition[in] レイ終了位置
pConditionInformation[in] レイチェック詳細設定
Returns
レイがヒットするオブジェクトが存在したらtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createBulletWorld()

b32 GxCollision::GxWorld::createBulletWorld ( void )

Bulletワールドの作成 Bulletが内部で確保しているメモリをクリアするために、Bulletワールドを作り直す時に使える。

Returns
成功ならtrue
Here is the call graph for this function:

◆ createConvexCallback()

GxCollision::GxConvexCallback * GxCollision::GxWorld::createConvexCallback ( const btVector3 & checkFrom,
const btVector3 & checkTo,
GxConditionInformation * pConditionInformation )
virtual

カプセルチェック用コールバックを生成
この関数が返すGxConvexCallbackをカスタマイズすることで フラグチェックなどのの挙動を変更することが出来ます。
詳しくはGxCollision::GxRayCallbackのコメントを参照してください。

Parameters
checkFrom[in] チェック開始座標
checkTo[in] チェック終了座標
pConditionInformation[in] 詳細条件(フラグ等)
Returns
コールバック

Reimplemented in GxAttackHit::GxWorld, GxBackgroundHit::GxWorld, and GxObjectHit::GxWorld.

◆ createRayCallback()

GxCollision::GxRayCallback * GxCollision::GxWorld::createRayCallback ( const btVector3 & rayFrom,
const btVector3 & rayTo,
GxConditionInformation * pConditionInformation )
virtual

レイチェック用コールバックを生成
この関数が返すGxRayCallbackをカスタマイズすることで フラグチェックなどの挙動を変更することが出来ます。
詳しくはGxCollision::GxRayCallbackのコメントを参照してください。

Parameters
rayFrom[in] レイ開始座標
rayTo[in] レイ終了座標
pConditionInformation[in] 詳細条件(フラグ等)
Returns
コールバック関数

Reimplemented in GxAttackHit::GxWorld, and GxBackgroundHit::GxWorld.

◆ customNearCallback()

void GxCollision::GxWorld::customNearCallback ( btBroadphasePair & collisionPair,
btCollisionDispatcher & dispatcher,
const btDispatcherInfo & dispatchInformation )
static

近距離当たり判定コールバック(BULLETで用意されたものをオーバーライド)

Parameters
collisionPair[in] コリジョンペア
dispatcher[in] ディスパッチャー
dispatchInformation[in] ディスパッチャー情報
Here is the caller graph for this function:

◆ deleteBulletWorld()

b32 GxCollision::GxWorld::deleteBulletWorld ( void )

Bulletワールドの削除 Bulletが内部で確保しているメモリをクリアするために、Bulletワールドを作り直す時に使える。 所属するGxCollision, GxObjectが「全て」削除されている必要があることに注意してください。 createBulletWorld()とセットで使用してください。

Returns
成功ならtrue

◆ detachClass()

void GxCollision::GxWorld::detachClass ( GxCollision * pCollision)

クラス削除

Parameters
pCollision[in] 削除するコリジョン
Here is the call graph for this function:
Here is the caller graph for this function:

◆ detachObjectFromBullet()

void GxCollision::GxWorld::detachObjectFromBullet ( GxObject * pObject)

Bulletワールドからデタッチ

Parameters
pObject[in] 削除するコリジョン
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eraseMesh()

b32 GxCollision::GxWorld::eraseMesh ( GxCollision::GxObject * pMesh)

メッシュをリストから削除(アドレス指定版)

Parameters
pMesh[in] リストから削除したいメッシュのアドレス
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executePostCheckCallback()

void GxCollision::GxWorld::executePostCheckCallback ( void )
virtual

chekc後コールバックを実行

Reimplemented in GxAdjustHit::GxWorld.

Here is the call graph for this function:

◆ getActiveMeshCount()

u32 GxCollision::GxWorld::getActiveMeshCount ( void )

アクティブな個数の取得

Returns
現在アクティブなメッシュの個数

◆ getMesh()

GxCollision::GxObject * GxCollision::GxWorld::getMesh ( u32 index)

メッシュアドレスの取得

Parameters
index[in] 取得したいメッシュのインデックス
Returns
登録されているメッシュ

◆ postBulletUpdate()

virtual GX_FORCE_INLINE void GxCollision::GxWorld::postBulletUpdate ( void )
inlinevirtual

Bullet更新後処理

Note
コリジョンのデータをBulletから受け取る

Reimplemented in GxAdjustHit::GxWorld, GxAttackHit::GxWorld, and GxEventHit::GxWorld.

◆ postCheck()

virtual GX_FORCE_INLINE void GxCollision::GxWorld::postCheck ( void )
inlinevirtual

check後処理

Reimplemented in GxBackgroundHit::GxWorld.

◆ preBulletUpdate()

void GxCollision::GxWorld::preBulletUpdate ( void )
virtual

Bullet更新前処理

Note
コリジョンのデータをBulletに渡す
Here is the call graph for this function:

◆ registerObject()

void GxCollision::GxWorld::registerObject ( GxCollision::GxObject * pObject)
virtual

ワールドにオブジェクトを登録する

Parameters
pObject[in] 追加するオブジェクト
threadIndex[in] スレッドインデックス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setListClassCount()

b32 GxCollision::GxWorld::setListClassCount ( u32 count)

リスト個数設定

Parameters
count[in] リスト個数
Here is the caller graph for this function:

◆ setMeshCount()

b32 GxCollision::GxWorld::setMeshCount ( u32 count)

メッシュ登録個数設定

Parameters
count[in] メッシュの個数
Returns
成功ならtrue

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