Collision基本ワールドクラス More...
#include <GxCollision.h>
Public Member Functions | |
初期化 | |
GxWorld (void) | |
デフォルトコンストラクタ | |
~GxWorld (void) override | |
デストラクタ | |
![]() | |
constexpr | GxClassBase (void) |
コンストラクタ | |
constexpr | GxClassBase (const GxClassBase &base) |
コピーコンストラクタ | |
~GxClassBase (void) override | |
デストラクタ | |
![]() | |
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 GX_FORCE_INLINE GxRtti & | __getStaticRtti (void) |
Rttiの取得 | |
Collision基本ワールドクラス
void GxCollision::GxWorld::addClass | ( | u32 | threadIndex, |
GxCollision * | pCollision ) |
クラス登録
threadIndex | [in] スレッドインデックス |
pCollision | [in] 登録するコリジョン |
b32 GxCollision::GxWorld::addMesh | ( | u32 | index, |
GxCollision::GxObject * | pMesh ) |
背景当たりをリストに追加
index | [in] 登録したいリストのインデックス番号 |
pMesh | [in] リストに登録するメッシュ |
|
virtual |
ワールドのメモリ確保
meshCount | [in] メッシュ最大登録個数 |
worldAabbMin | [in] ワールドの広さ(最小値) |
worldAabbMax | [in] ワールドの広さ(最大値) |
maxHandles | [in] 当たり判定オブジェクト個数 |
stackAllocatorSize | [in] Bulletのスタックアロケーターサイズ |
maxPersistentManifoldPoolSize | [in] Bulletのマニフォールドの最大プールサイズ |
maxCollisionAlgorithmPoolSize | [in] Bulletのコリジョンアルゴリズム最大プールサイズ |
void GxCollision::GxWorld::banObject | ( | GxCollision::GxObject * | pObject | ) |
ワールドからオブジェクトを登録解除する
pObject | [in] 登録解除するオブジェクト |
threadIndex | [in] スレッドインデックス |
|
virtual |
当たり判定チェック
Reimplemented in GxAdjustHit::GxWorld.
b32 GxCollision::GxWorld::checkCapsuleClosestVsSingle | ( | GxCollision::GxRayResult & | rayResult, |
GxObject * | pTargetObject, | ||
const GxVector3 & | startPosition, | ||
const GxVector3 & | endPosition, | ||
f32 | radius, | ||
GxConditionInformation * | pConditionInformation = nullptr ) |
指定オブジェクトとのカプセルチェック(最も近い交差点)
startPosおよびendPosはカプセル頭の球中心座標であることに注意してください。
ヒット位置がstartPosより手前のものは、当たらなかったものとして処理されます。
rayResult | [out] カプセルチェックの結果格納先 |
pTargetObject | [in] 判定を行う相手オブジェクト |
startPosition | [in] カプセル開始位置 |
endPosition | [in] カプセル終了位置 |
radius | [in] カプセル半径 |
pConditionInformation | [in] カプセルチェック詳細設定 |
b32 GxCollision::GxWorld::checkCapsuleClosestVsWorld | ( | GxCollision::GxRayResult & | rayResult, |
const GxVector3 & | startPosition, | ||
const GxVector3 & | endPosition, | ||
f32 | radius, | ||
GxConditionInformation * | pConditionInformation = nullptr ) |
登録されている全オブジェクトとのカプセルチェック(最も近い交差点)
startPosおよびendPosはカプセル頭の球中心座標であることに注意してください。
ヒット位置がstartPosより手前のものは、当たらなかったものとして処理されます。
rayResult | [out] カプセルチェックの結果格納先 |
startPosition | [in] カプセル開始位置(球の中心位置) |
endPosition | [in] カプセル終了位置(球の中心位置) |
radius | [in] カプセル半径 |
pConditionInformation | [in] カプセルチェック詳細設定 |
b32 GxCollision::GxWorld::checkRayClosestVsSingle | ( | GxCollision::GxRayResult & | rayResult, |
GxObject * | pTargetObject, | ||
const GxVector3 & | startPosition, | ||
const GxVector3 & | endPosition, | ||
GxConditionInformation * | pConditionInformation = nullptr ) |
指定オブジェクトとのレイチェック
rayResult | [out] レイチェックの結果格納先 |
pTargetObject | [in] 判定を行う相手オブジェクト |
startPosition | [in] レイ開始位置 |
endPosition | [in] レイ終了位置 |
pConditionInformation | [in] レイチェック詳細設定 |
b32 GxCollision::GxWorld::checkRayClosestVsWorld | ( | GxCollision::GxRayResult & | rayResult, |
const GxVector3 & | startPosition, | ||
const GxVector3 & | endPosition, | ||
GxConditionInformation * | pConditionInformation = nullptr ) |
登録されている全オブジェクトとのレイチェック(最も近い交差点)
rayResult | [out] レイチェックの結果格納先 |
startPosition | [in] レイ開始位置 |
endPosition | [in] レイ終了位置 |
pConditionInformation | [in] レイチェック詳細設定 |
b32 GxCollision::GxWorld::createBulletWorld | ( | void | ) |
Bulletワールドの作成 Bulletが内部で確保しているメモリをクリアするために、Bulletワールドを作り直す時に使える。
|
virtual |
カプセルチェック用コールバックを生成
この関数が返すGxConvexCallbackをカスタマイズすることで フラグチェックなどのの挙動を変更することが出来ます。
詳しくはGxCollision::GxRayCallbackのコメントを参照してください。
checkFrom | [in] チェック開始座標 |
checkTo | [in] チェック終了座標 |
pConditionInformation | [in] 詳細条件(フラグ等) |
Reimplemented in GxAttackHit::GxWorld, GxBackgroundHit::GxWorld, and GxObjectHit::GxWorld.
|
virtual |
レイチェック用コールバックを生成
この関数が返すGxRayCallbackをカスタマイズすることで フラグチェックなどの挙動を変更することが出来ます。
詳しくはGxCollision::GxRayCallbackのコメントを参照してください。
rayFrom | [in] レイ開始座標 |
rayTo | [in] レイ終了座標 |
pConditionInformation | [in] 詳細条件(フラグ等) |
Reimplemented in GxAttackHit::GxWorld, and GxBackgroundHit::GxWorld.
|
static |
近距離当たり判定コールバック(BULLETで用意されたものをオーバーライド)
collisionPair | [in] コリジョンペア |
dispatcher | [in] ディスパッチャー |
dispatchInformation | [in] ディスパッチャー情報 |
b32 GxCollision::GxWorld::deleteBulletWorld | ( | void | ) |
Bulletワールドの削除 Bulletが内部で確保しているメモリをクリアするために、Bulletワールドを作り直す時に使える。 所属するGxCollision, GxObjectが「全て」削除されている必要があることに注意してください。 createBulletWorld()とセットで使用してください。
void GxCollision::GxWorld::detachClass | ( | GxCollision * | pCollision | ) |
クラス削除
pCollision | [in] 削除するコリジョン |
void GxCollision::GxWorld::detachObjectFromBullet | ( | GxObject * | pObject | ) |
Bulletワールドからデタッチ
pObject | [in] 削除するコリジョン |
b32 GxCollision::GxWorld::eraseMesh | ( | GxCollision::GxObject * | pMesh | ) |
メッシュをリストから削除(アドレス指定版)
pMesh | [in] リストから削除したいメッシュのアドレス |
|
virtual |
u32 GxCollision::GxWorld::getActiveMeshCount | ( | void | ) |
アクティブな個数の取得
GxCollision::GxObject * GxCollision::GxWorld::getMesh | ( | u32 | index | ) |
メッシュアドレスの取得
index | [in] 取得したいメッシュのインデックス |
|
inlinevirtual |
Bullet更新後処理
Reimplemented in GxAdjustHit::GxWorld, GxAttackHit::GxWorld, and GxEventHit::GxWorld.
|
inlinevirtual |
check後処理
Reimplemented in GxBackgroundHit::GxWorld.
|
virtual |
Bullet更新前処理
|
virtual |
ワールドにオブジェクトを登録する
pObject | [in] 追加するオブジェクト |
threadIndex | [in] スレッドインデックス |
b32 GxCollision::GxWorld::setListClassCount | ( | u32 | count | ) |
リスト個数設定
count | [in] リスト個数 |
b32 GxCollision::GxWorld::setMeshCount | ( | u32 | count | ) |
メッシュ登録個数設定
count | [in] メッシュの個数 |