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

コリジョンシステムクラス More...

#include <GxSysCollision.h>

Inheritance diagram for GxSysCollision:
Collaboration diagram for GxSysCollision:

Public Member Functions

初期化
 GxSysCollision (void)
 デフォルトコンストラクタ
 
 ~GxSysCollision (void) override
 デストラクタ
 
b32 initialize (const GxClassBase *pInitialInformation) override
 初期化
 
void terminate (void) override
 終了処理
 
アクセサ
constexpr void setOnRadian (f32 radian)
 上に乗れる角度の設定(0度が平坦)
 
constexpr f32 getOnRadian (void) const
 上に乗れる角度の取得
 
GX_FORCE_INLINE b32 isOnNormal (const GxVector3 &normal) const
 上に乗れる角度か判定
 
GX_FORCE_INLINE b32 isCeilingNormal (const GxVector3 &normal) const
 天井の角度か判定
 
GX_FORCE_INLINE void getPropertyWorld (void *const pValue, u32 index)
 ワールド取得
 
constexpr void setPropertyWorld (const void *const, u32)
 ワールド設定
 
constexpr u32 getPropertyWorldCount (void) const
 ワールド数取得
 
constexpr void setPropertyWorldCount (u32)
 ワールド数設定
 
constexpr void getPropertyOnRadian (void *const pValue)
 
constexpr void setPropertyOnRadian (const void *const pValue)
 
- Public Member Functions inherited from GxSysCollisionBase
 GxSysCollisionBase (void)
 デフォルトコンストラクタ
 
 ~GxSysCollisionBase (void) override
 デストラクタ
 
virtual GX_FORCE_INLINE void setup (void)
 update()前に毎フレーム呼ぶ準備
 
- Public Member Functions inherited from GxSysBase
template<typename T >
T * getModule (void) const
 モジュールを取得
 
 GxSysBase (void)
 デフォルトコンストラクタ
 
 ~GxSysBase (void) override
 デストラクタ
 
b32 isLocked (void)
 クリティカルセクションのロック状態を確認する
 
void sleep (f32 time)
 スリープ(スクリプト用)
 
- 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)
 デフォルトオブジェクト判定
 
- Public Member Functions inherited from SingletonBase< GxSysCollisionBase >
 SingletonBase (void)
 コンストラクタ
 
 ~SingletonBase (void)
 デストラクタ
 

Static Public Attributes

定義
static constexpr u32 CHECK_FLAG_ALL = 0xffffffffUL
 全フラグ定数
 
static constexpr u32 DEFAULT_MESH_MAX = GxMath::VALUE_8
 デフォルトメッシュ最大数
 
static constexpr u32 DEFAULT_TASK_MAX = GxMath::VALUE_128
 デフォルトタスク最大数
 
static constexpr u32 DEFAULT_OBJECT_MAX = GxMath::VALUE_8
 デフォルトオブジェクト最大数
 
static constexpr u32 DEFAULT_EVENT_MAX = GxMath::VALUE_64
 デフォルトイベント最大数
 
static constexpr u32 DEFAULT_MESH_CONTACT_MAX = GxMath::VALUE_16
 デフォルトメッシュコンタクト最大数
 
static constexpr u32 DEFAULT_MESH_POLYGON_MAX = 0x4000
 デフォルトメッシュポリゴン最大数
 

操作

void update (void) override
 更新
 
b32 addWorld (GxCollision::GxWorld *pWorld)
 ワールドをリストへ追加
 
b32 checkWorld (GxCollision::GxWorld *pCheckWorld)
 指定ワールドが存在するかどうかチェック
 
void eraseWorld (GxCollision::GxWorld *pSearchWorld)
 指定ワールドをリストから削除
 
void eraseAllWorld (void)
 全ワールドをリストから削除
 
GxCollision::GxWorldgetWorld (u32 index)
 指定ワールドを取得
 
virtual GX_FORCE_INLINE GxBackgroundHit::GxWorldgetBackgroundHitWorld (void)
 背景あたりワールド取得
 
virtual GX_FORCE_INLINE GxObjectHit::GxWorldgetObjectHitWorld (void)
 オブジェクトあたりワールド取得
 
virtual GX_FORCE_INLINE GxEventHit::GxWorldgetEventHitWorld (void)
 イベントあたりワールド取得
 
virtual GX_FORCE_INLINE GxAttackHit::GxWorldgetAttackHitWorld (void)
 攻撃あたりワールド取得
 
b32 resetAllBulletWorld (void)
 
virtual GxCollision::GxObjectcreateObjectFromResource (GxResCollisionObject *pRes, GxCollision *pCollision, GxUnitModelBase *pModel, const GxMatrixAffine *pMatrix, u32 index, u32 id)
 
virtual GX_FORCE_INLINE u32 getCollisionObjectResVersion (void)
 
virtual b32 checkFloor (GxCollision::GxRayResult &rayResult, const GxVector3 &position, const f32 marginLower=100.f, const f32 marginUpper=100.f, GxBackgroundHit::GxConditionInformationBackgroundHit *pCondition=nullptr)
 床チェック(TYPE_STATICな背景あたりとの下方レイチェック)
 
b32 raycastBackgroundHit (const GxVector3 &position0, const GxVector3 &position1, GxVector3 *pHitPosition=nullptr, GxVector3 *pNormal=nullptr) override
 背景あたりとのレイチェック
 
static void * allocateMemoryBullet (size_t size)
 Bullet用メモリ確保
 
static void * allocateMemoryAlignedBullet (size_t size, s32 alignment)
 Bullet用アラインメント有りメモリ確保
 
static void freeMemoryBullet (void *pAddress)
 Bullet用メモリ解放
 
static b32 checkSegmentVsObject (GxCollision::GxRayResult &rayResult, GxCollision::GxObject *pObject, const GxVector3 &position0, const GxVector3 &position1, u32 checkFlag=0xffffffff)
 指定したオブジェクトと線分のヒットチェック
 
static b32 checkCapsuleVsObject (GxCollision::GxRayResult &rayResult, GxCollision::GxObject *pObject, const GxVector3 &position0, const GxVector3 &position1, f32 radius, u32 checkFlag=0xffffffff)
 指定したオブジェクトとカプセルのヒットチェック
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 
- Static Public Member Functions inherited from SingletonBase< GxSysCollisionBase >
static GX_FORCE_INLINE GxSysCollisionBasegetSingleton (void)
 参照を取得
 
static constexpr GxSysCollisionBasegetSingletonPointer (void)
 ポインタを取得
 
- Protected Types inherited from GxSysBase
enum class  LOCK_TYPE { SEQUENTIAL_THREAD_SAFE , THREAD_SAFE }
 ロックタイプ More...
 
- Protected Member Functions inherited from GxSysBase
void terminateGxModules (void)
 GXモジュールの終了処理
 
void lock (LOCK_TYPE type=LOCK_TYPE::THREAD_SAFE)
 クリティカルセクションに入る
 
void unlock (LOCK_TYPE type=LOCK_TYPE::THREAD_SAFE)
 クリティカルセクションを出る
 
template<typename T >
T * addModule (void)
 モジュールを作成
 
template<typename T >
void removeModule (void)
 モジュールを削除
 

Detailed Description

コリジョンシステムクラス

Member Function Documentation

◆ addWorld()

b32 GxSysCollision::addWorld ( GxCollision::GxWorld * pWorld)

ワールドをリストへ追加

Parameters
pWorld[in] リストへ追加したいワールド
Returns
成功ならtrue
Here is the call graph for this function:

◆ allocateMemoryAlignedBullet()

void * GxSysCollision::allocateMemoryAlignedBullet ( size_t size,
s32 alignment )
static

Bullet用アラインメント有りメモリ確保

Parameters
size[in] サイズ
alignment[in] アラインメント
Returns
確保アドレス
Here is the caller graph for this function:

◆ allocateMemoryBullet()

void * GxSysCollision::allocateMemoryBullet ( size_t size)
static

Bullet用メモリ確保

Parameters
size[in] サイズ
Returns
確保アドレス
Here is the caller graph for this function:

◆ checkCapsuleVsObject()

b32 GxSysCollision::checkCapsuleVsObject ( GxCollision::GxRayResult & rayResult,
GxCollision::GxObject * pObject,
const GxVector3 & position0,
const GxVector3 & position1,
f32 radius,
u32 checkFlag = 0xffffffff )
static

指定したオブジェクトとカプセルのヒットチェック

Parameters
rayResult[out] ヒット情報
pObject[in] チェックするオブジェクト
position0[in] カプセル開始点
position1[in] カプセル終了点
radius[in] カプセル半径
checkFlag[in] どの当たりに当たるか
Returns
ヒットしたらtrue
Here is the call graph for this function:

◆ checkFloor()

b32 GxSysCollision::checkFloor ( GxCollision::GxRayResult & rayResult,
const GxVector3 & position,
const f32 marginLower = 100.f,
const f32 marginUpper = 100.f,
GxBackgroundHit::GxConditionInformationBackgroundHit * pCondition = nullptr )
virtual

床チェック(TYPE_STATICな背景あたりとの下方レイチェック)

Parameters
rayResult[out] ヒット情報
position[in] チェック位置
marginLower[in] -y方向のチェック範囲
marginUpper[in] +y方向のチェック範囲
pCondition[in] チェック条件(default = nullptr)
Returns
チェック範囲内に床有りならtrue
Here is the call graph for this function:

◆ checkSegmentVsObject()

b32 GxSysCollision::checkSegmentVsObject ( GxCollision::GxRayResult & rayResult,
GxCollision::GxObject * pObject,
const GxVector3 & position0,
const GxVector3 & position1,
u32 checkFlag = 0xffffffff )
static

指定したオブジェクトと線分のヒットチェック

Parameters
rayResult[out] ヒット情報
pObject[in] チェックするオブジェクト
position0[in] 線分開始点
position1[in] 線分終了点
checkFlag[in] どの当たりに当たるか
Returns
ヒットしたらtrue
Here is the call graph for this function:

◆ checkWorld()

b32 GxSysCollision::checkWorld ( GxCollision::GxWorld * pCheckWorld)

指定ワールドが存在するかどうかチェック

Parameters
pCheckWorld[in] チェックしたいワールド
Returns
存在するならtrue

◆ createObjectFromResource()

GxCollision::GxObject * GxSysCollision::createObjectFromResource ( GxResCollisionObject * pRes,
GxCollision * pCollision,
GxUnitModelBase * pModel,
const GxMatrixAffine * pMatrix,
u32 index,
u32 id )
virtual

リソースからコリジョンデータを作成

Note
GxResCollisionObject::GxObjectData::_pExtraDataを 設定するためにはこの関数を継承して使うこと。 関連:createExtraData()
Parameters
pRes[in] コリジョンリソース
pCollision[in] コリジョンアドレス
pModel[in] セットするモデルユニットのアドレス
pMatrix[in] アタッチしたいマトリックスのアドレス(データを参照する場合はnullptr)
index[in] オブジェクトデータのインデックス
id[in] ID
Returns
コリジョンオブジェクト
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eraseWorld()

void GxSysCollision::eraseWorld ( GxCollision::GxWorld * pSearchWorld)

指定ワールドをリストから削除

Parameters
pSearchWorld[in] リストから削除したいワールド
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeMemoryBullet()

void GxSysCollision::freeMemoryBullet ( void * pAddress)
static

Bullet用メモリ解放

Parameters
pAddress[in] 解放アドレス
Here is the caller graph for this function:

◆ getCollisionObjectResVersion()

virtual GX_FORCE_INLINE u32 GxSysCollision::getCollisionObjectResVersion ( void )
inlinevirtual

コリジョンオブジェクトリソースバージョンを取得

Note
この関数をオーバーライドすることで、コリジョンオブジェクトリソースのバージョン下位8ビットを変更できます。 関連:GxResCollisionObject::getCurrentResVersion()
Here is the caller graph for this function:

◆ getWorld()

GxCollision::GxWorld * GxSysCollision::getWorld ( u32 index)

指定ワールドを取得

Parameters
u32index [in] 取得したいワールドのインデックス(インデックスはワールドを登録した順番)
Returns
登録されているワールドがあればそのアドレス、なければnullptr
Here is the call graph for this function:

◆ initialize()

b32 GxSysCollision::initialize ( const GxClassBase * pInitialInformation)
overridevirtual

初期化

Parameters
pInitialInformation[in] 初期化情報
Returns
成功ならtrue

Reimplemented from GxSysBase.

Here is the call graph for this function:

◆ raycastBackgroundHit()

b32 GxSysCollision::raycastBackgroundHit ( const GxVector3 & position0,
const GxVector3 & position1,
GxVector3 * pHitPosition = nullptr,
GxVector3 * pNormal = nullptr )
overridevirtual

背景あたりとのレイチェック

Parameters
position0[in] 線分開始点
position1[in] 線分終了点
pHitPosition[out] ヒット位置
pNormal[out] ヒットした箇所の法線
Returns
当たったらtrue

Reimplemented from GxSysCollisionBase.

Here is the call graph for this function:

◆ resetAllBulletWorld()

b32 GxSysCollision::resetAllBulletWorld ( void )

全ワールドのBulletワールドを削除・再生成

Note
Bulletのシステムに起因するメモリゴミを削除するのに利用できます。 全GxWorldに所属するGxCollision, GxObjectが「全て」削除されている必要があることに注意してください。
Returns
成功ならtrue

◆ terminate()

void GxSysCollision::terminate ( void )
overridevirtual

終了処理

Reimplemented from GxSysBase.

Here is the call graph for this function:

◆ update()

void GxSysCollision::update ( void )
overridevirtual

更新

Reimplemented from GxSysBase.

Here is the call graph for this function:

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