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

コリジョン基本クラス More...

#include <GxCollision.h>

Inheritance diagram for GxCollision:
Collaboration diagram for GxCollision:

Classes

class  GxConditionInformation
 
struct  GxConvexCallback
 
class  GxObject
 Collision基本オブジェクトクラス More...
 
struct  GxRayCallback
 
struct  GxRayResult
 レイ判定情報 More...
 
class  GxWorld
 Collision基本ワールドクラス More...
 

Public Member Functions

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

定義

enum class  COLLISION_SHAPE {
  ERROR_ = -1 , SPHERE = 0 , BOX , CYLINDER ,
  MULTISPHERE , TRIMESH , PLANE , RAY ,
  BEAM , CAPSULE , CONVEX , COMPOUND ,
  WHEEL , MAX
}
 コリジョン形状 More...
 
typedef void(GxClassBaseRoot::*) COLLISION_CALLBACK(void)
 コールバック定義
 
static const f32 BULLET_MARGIN = CONVEX_DISTANCE_MARGIN
 Bulletのマージン値
 

メンバ変数

GxWorld_pRegisterWorld
 親ワールド
 
COLLISION_CALLBACK _pCallback
 補正用コールバック
 
GxArrayClassBase _listObject
 オブジェクトのリスト
 

操作

void clearList (void)
 全オブジェクトをリストから削除
 
virtual GxObjectallocObject (void)
 オブジェクトのメモリ確保
 
virtual GxObjectcreateSphere (b32 active, u32 id, const GxMatrixAffine *pMatrix, const GxVector3 &offset, const GxShapeSphere &sphere)
 球の作成
 
virtual GxObjectcreateBox (b32 active, u32 id, const GxMatrixAffine *pMatrix, const GxVector3 &offset, const GxShapeBox &box)
 ボックスの作成
 
virtual GxObjectcreateMultisphere (b32 active, u32 id, const GxMatrixAffine *pMatrix0, const GxVector3 &offset0, const GxMatrixAffine *pMatrix1, const GxVector3 &offset1, const GxShapeMultisphere &multisphere)
 マルチ球の作成
 
virtual GxObjectcreateCylinder (b32 active, u32 id, const GxMatrixAffine *pMatrix, const GxVector3 &offset, const GxShapeCylinder &cylinder)
 円柱の作成
 
virtual GxObjectcreateCapsule (b32 active, u32 id, const GxMatrixAffine *pMatrix, const GxVector3 &offset, const GxShapeCapsule &capsule)
 カプセルの作成
 
virtual GxObjectcreateMesh (u32 index, b32 active, const GxMatrixAffine *pMatrix, const GxVector3 &offset, const GxShapeTrimesh &trimesh, btTriangleIndexVertexArray *pVertex, b32 isCompress=true, GxVector3 *pAabbMin=nullptr, GxVector3 *pAabbMax=nullptr)
 背景メッシュの作成
 
virtual GxObjectcreateMesh (u32 index, b32 active, const GxMatrixAffine *pMatrix, const GxVector3 &offset, const GxShapeTrimesh &trimesh, btBvhTriangleMeshShape *pTrimeshShape)
 背景メッシュの作成
 
GxObjectgetObject (u32 index)
 指定インデックスのオブジェクトを取得
 
virtual void deleteObject (GxObject *pObject)
 オブジェクトを削除する
 
virtual void detachObject (GxObject *pObject)
 オブジェクトをリストから切り離す
 
virtual void initialize (GxWorld *pRegistWorld, GxUnitBase *pUnit, GxCollision::COLLISION_CALLBACK pCallback, u32 threadIndex)
 初期設定(スレッドセーフ)
 
virtual void prepareCheck (void)
 当たり判定チェック前準備
 
virtual void update (void)
 位置の更新
 
constexpr GxWorldgetWorld (void) const
 登録ワールドの取得
 
constexpr GxUnitBasegetUnit (void) const
 登録ユニットの取得
 
virtual GX_FORCE_INLINE void initializeActiveOn (void)
 アクティブON時のパラメタ初期化
 
virtual GX_FORCE_INLINE void initializeActiveOff (void)
 アクティブOFF時のパラメタ初期化
 
virtual GX_FORCE_INLINE void initializeUpdate (void)
 更新前のパラメタ初期化
 
virtual void executePostCheckCallback (void)
 チェック後コールバック関数の呼び出し
 
constexpr void setWorldNull (void)
 登録ワールドの削除
 
virtual GxObjectaddObject (void)
 オブジェクトの追加
 

アクセサ

GX_FORCE_INLINE void setHitCallback (GxCollision::COLLISION_CALLBACK pCallback)
 コールバックを設定
 
GX_FORCE_INLINE b32 isActive (void) const
 アクティブ判定
 
void setActive (b32 active)
 アクティブ状態の設定
 
constexpr u32 getObjectCount (void) const
 登録オブジェクトの個数を取得
 
GX_FORCE_INLINE void getPropertyActive (void *const pValue)
 アクティブを取得
 
GX_FORCE_INLINE void setPropertyActive (const void *const pValue)
 アクティブを設定
 
GX_FORCE_INLINE void getPropertyObject (void *const pValue, u32 index)
 当たりオブジェクトを取得
 
constexpr void setPropertyObject (const void *const, u32)
 当たりオブジェクトを設定
 
constexpr u32 getPropertyObjectCount (void) const
 当たりオブジェクト数を取得
 
constexpr void setPropertyObjectCount (u32)
 当たりオブジェクト数を設定
 
GX_FORCE_INLINE void setOffsetAdjustVector (const GxVector3 &offset)
 押返しベクトルのオフセットを設定
 
GX_FORCE_INLINE GxVector3 getOffsetAdjustVector (void)
 押返しベクトルのオフセットを取得
 

Additional Inherited Members

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

Detailed Description

コリジョン基本クラス

Member Enumeration Documentation

◆ COLLISION_SHAPE

enum class GxCollision::COLLISION_SHAPE
strong

コリジョン形状

Enumerator
ERROR_ 

エラー

SPHERE 

BOX 

CYLINDER 

円柱

MULTISPHERE 

マルチ球

TRIMESH 

三角形メッシュ

PLANE 

平面

RAY 

BEAM 

CAPSULE 

カプセル

CONVEX 

凸形状

COMPOUND 

複合形状(物理用)

WHEEL 

車輪(物理用)

MAX 

定義数

Member Function Documentation

◆ addObject()

GxCollision::GxObject * GxCollision::addObject ( void )
protectedvirtual

オブジェクトの追加

Returns
追加したオブジェクト

Reimplemented in GxAdjustHit, GxAttackHit, and GxEventHit.

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

◆ allocObject()

GxCollision::GxObject * GxCollision::allocObject ( void )
virtual

オブジェクトのメモリ確保

Returns
確保したオブジェクト

Reimplemented in GxAdjustHit, GxAttackHit, GxBackgroundHit, GxEventHit, and GxObjectHit.

Here is the caller graph for this function:

◆ createBox()

GxCollision::GxObject * GxCollision::createBox ( b32 active,
u32 id,
const GxMatrixAffine * pMatrix,
const GxVector3 & offset,
const GxShapeBox & box )
virtual

ボックスの作成

Parameters
active[in] 登録後すぐアクティブにするかどうか
id[in] 当たりID
pMatrix[in] 引っ付けるマトリクス
offset[in] マトリクスからのオフセット
box[in] ボックス形状
Returns
確保したオブジェクトのアドレス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCapsule()

GxCollision::GxObject * GxCollision::createCapsule ( b32 active,
u32 id,
const GxMatrixAffine * pMatrix,
const GxVector3 & offset,
const GxShapeCapsule & capsule )
virtual

カプセルの作成

Parameters
active[in] 登録後すぐアクティブにするかどうか
id[in] 当たりID
pMatrix[in] 引っ付けるマトリクス
offset[in] マトリクスからのオフセット
capsule[in] カプセル形状
Returns
確保したオブジェクトのアドレス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCylinder()

GxCollision::GxObject * GxCollision::createCylinder ( b32 active,
u32 id,
const GxMatrixAffine * pMatrix,
const GxVector3 & offset,
const GxShapeCylinder & cylinder )
virtual

円柱の作成

Parameters
active[in] 登録後すぐアクティブにするかどうか
id[in] 当たりID
pMatrix[in] 引っ付けるマトリクス
offset[in] マトリクスからのオフセット
cylinder[in] 円柱形状
Returns
確保したオブジェクト
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMesh() [1/2]

GxCollision::GxObject * GxCollision::createMesh ( u32 index,
b32 active,
const GxMatrixAffine * pMatrix,
const GxVector3 & offset,
const GxShapeTrimesh & trimesh,
btBvhTriangleMeshShape * pBtTrimeshShape )
virtual

背景メッシュの作成

Parameters
index[in] メッシュインデックス
active[in] 登録後すぐアクティブにするかどうか
pMatrix[in] 引っ付けるマトリクス
offset[in] マトリクスからのオフセット
trimesh[in] 三角形メッシュ形状
pBtTrimeshShape[in] 外部で作成したBULLETのメッシュシェイプ
Returns
確保したオブジェクト
Here is the call graph for this function:

◆ createMesh() [2/2]

GxCollision::GxObject * GxCollision::createMesh ( u32 index,
b32 active,
const GxMatrixAffine * pMatrix,
const GxVector3 & offset,
const GxShapeTrimesh & trimesh,
btTriangleIndexVertexArray * pVertex,
b32 isCompress = true,
GxVector3 * pAabbMin = nullptr,
GxVector3 * pAabbMax = nullptr )
virtual

背景メッシュの作成

Parameters
index[in] メッシュインデックス
active[in] 登録後すぐアクティブにするかどうか
pMatrix[in] 引っ付けるマトリクス
offset[in] マトリクスからのオフセット
trimesh[in] メッシュ
pVertex[in] メッシュのデータ
isCompress[in] データを圧縮するかどうか(default = true)
pAabbMin[in] メッシュを囲むAABBボックスの最小値
pAabbMax[in] メッシュを囲むAABBボックスの最大値
Returns
確保したオブジェクト
Here is the call graph for this function:

◆ createMultisphere()

GxCollision::GxObject * GxCollision::createMultisphere ( b32 active,
u32 id,
const GxMatrixAffine * pMatrix0,
const GxVector3 & offset0,
const GxMatrixAffine * pMatrix1,
const GxVector3 & offset1,
const GxShapeMultisphere & multisphere )
virtual

マルチ球の作成

Parameters
active[in] 登録後すぐアクティブにするかどうか
id[in] 当たりID
pMatrix0[in] 引っ付けるマトリクス0番
offset0[in] マトリクス0番からのオフセット
pMatrix1[in] 引っ付けるマトリクス1番
offset1[in] マトリクス1番からのオフセット
multisphere[in] マルチ球形状
Returns
確保したオブジェクト
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSphere()

GxCollision::GxObject * GxCollision::createSphere ( b32 active,
u32 id,
const GxMatrixAffine * pMatrix,
const GxVector3 & offset,
const GxShapeSphere & sphere )
virtual

球の作成

Parameters
active[in] 登録後すぐアクティブにするかどうか
id[in] 当たりID
pMatrix[in] 引っ付けるマトリクス
offset[in] マトリクスからのオフセット
sphere[in] 球の形状
Returns
確保したオブジェクトのアドレス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteObject()

void GxCollision::deleteObject ( GxCollision::GxObject * pObject)
virtual

オブジェクトを削除する

Parameters
pObject[in] オブジェクト
Here is the call graph for this function:

◆ detachObject()

void GxCollision::detachObject ( GxCollision::GxObject * pObject)
virtual

オブジェクトをリストから切り離す

Parameters
pObject[in] オブジェクト
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executePostCheckCallback()

void GxCollision::executePostCheckCallback ( void )
virtual

チェック後コールバック関数の呼び出し

Reimplemented in GxBackgroundHit.

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

◆ getObject()

GxCollision::GxObject * GxCollision::getObject ( u32 index)

指定インデックスのオブジェクトを取得

Parameters
index[in] オブジェクトのインデックス
Returns
オブジェクト
Here is the call graph for this function:

◆ initialize()

void GxCollision::initialize ( GxWorld * pRegisterWorld,
GxUnitBase * pUnit,
GxCollision::COLLISION_CALLBACK pCallback,
u32 threadIndex )
virtual

初期設定(スレッドセーフ)

Parameters
pRegisterWorld[in] 登録先ワールド
pUnit[in] 使用するユニット
pCallback[in] 呼び出すコールバック関数
threadIndex[in] スレッドインデックス

Reimplemented in GxEventHit.

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

◆ initializeActiveOff()

virtual GX_FORCE_INLINE void GxCollision::initializeActiveOff ( void )
inlinevirtual

アクティブOFF時のパラメタ初期化

Reimplemented in GxAdjustHit.

Here is the caller graph for this function:

◆ initializeActiveOn()

virtual GX_FORCE_INLINE void GxCollision::initializeActiveOn ( void )
inlinevirtual

アクティブON時のパラメタ初期化

Reimplemented in GxAdjustHit.

Here is the caller graph for this function:

◆ initializeUpdate()

virtual GX_FORCE_INLINE void GxCollision::initializeUpdate ( void )
inlinevirtual

更新前のパラメタ初期化

Reimplemented in GxAdjustHit.

Here is the caller graph for this function:

◆ setActive()

void GxCollision::setActive ( b32 active)

アクティブ状態の設定

Parameters
active[in] trueで有効化、false時はisNeedCheck()ではじく
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void GxCollision::update ( void )
virtual

位置の更新

Reimplemented in GxAttackHit, and GxBackgroundHit.

Here is the call graph for this function:

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