物理演算クラス More...
#include <GxDynamics.h>
Classes | |
class | GxConditionInformation |
class | GxConstraint |
GxDynamics 拘束クラス More... | |
class | GxObject |
GxDynamics基本オブジェクトクラス More... | |
struct | GxParamConeTwist |
ConeTwist設定パラメタ構造体 More... | |
struct | GxRayResult |
レイ判定情報 More... | |
struct | GxRigidBodyParam |
剛体パラメタ構造体 More... | |
class | GxWorld |
GxDynamics 基本ワールドクラス More... | |
Public Member Functions | |
初期化 | |
GxDynamics (void) | |
デフォルトコンストラクタ | |
~GxDynamics (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) |
デフォルトオブジェクト判定 | |
Protected Attributes | |
メンバ変数 | |
b32 | _active |
クラスを使用できるかフラグ | |
DYNAMICS_CALLBACK | _pCallback |
後処理用コールバック | |
GxArrayClassBase | _listObject |
オブジェクトのリスト | |
GxArrayClassBase | _listConstraint |
拘束クラスのリスト | |
GxWorld * | _pRegisterWorld |
オブジェクトを登録するワールド | |
GxUnitBase * | _pUnit |
使用するユニット | |
定義 | |
typedef void(GxClassBaseRoot::*) | DYNAMICS_CALLBACK(void) |
後処理用コールバック | |
static const GxColor | COLOR_OBJECT |
描画色 | |
static constexpr u32 | FLAG_ALL = 0x7fffffff |
全フラグ定数 | |
操作 | |
void | clearList (void) |
全オブジェクト、拘束クラスをリストから削除する | |
virtual GX_FORCE_INLINE GxObject * | allocObject (void) |
オブジェクトのメモリ確保 | |
GxObject * | getObject (u32 index) |
指定インデックスのオブジェクトを取得 | |
u32 | getObjectCount (void) |
オブジェクトの数を取得 | |
virtual void | deleteObject (GxObject *pObject) |
オブジェクトを削除する | |
virtual void | detachObject (GxObject *pObject) |
オブジェクトをリストから切り離す | |
virtual void | detachConstraint (GxConstraint *pConstraint) |
拘束をリストから切り離す | |
GxObject * | createSphere (b32 active, GxMatrixAffine *pMatrix, s32 jointIndex, const GxVector3 &offset, const GxQuaternion &rotateOffset, const GxShapeSphere &sphere, const GxRigidBodyParam &rigidParam, f32 margin=DYNAMICS_COLLISION_MARGIN) |
球の作成 | |
GxObject * | createBox (b32 active, GxMatrixAffine *pMatrix, s32 jointIndex, const GxVector3 &offset, const GxQuaternion &rotateOffset, const GxShapeBox &box, const GxRigidBodyParam &rigidParam, f32 margin=DYNAMICS_COLLISION_MARGIN) |
箱の作成 | |
GxObject * | createCylinder (b32 active, GxMatrixAffine *pMatrix, s32 jointIndex, const GxVector3 &offset, const GxQuaternion &rotateOffset, const GxShapeCylinder &cylinder, const GxRigidBodyParam &rigidParam, f32 margin=DYNAMICS_COLLISION_MARGIN) |
円柱の作成 | |
GxObject * | createMultisphere (b32 active, GxMatrixAffine *pMatrix, s32 jointIndex, const GxVector3 &offset, const GxQuaternion &rotateOffset, const GxShapeMultisphere &multisphere, const GxRigidBodyParam &rigidParam, f32 margin=DYNAMICS_COLLISION_MARGIN) |
マルチ球の作成 | |
GxObject * | createCapsule (b32 active, GxMatrixAffine *pMatrix, s32 jointIndex, const GxVector3 &offset, const GxQuaternion &rotateOffset, const GxShapeCapsule &capsule, const GxRigidBodyParam &rigidParam, f32 margin=DYNAMICS_COLLISION_MARGIN) |
カプセルの作成 | |
virtual GxObject * | createConvexShape (b32 active, GxMatrixAffine *pMatrix, s32 jointIndex, const GxVector3 &offset, const GxQuaternion &rotateOffset, const GxVector3 *pVertex, u32 numVertex, const GxRigidBodyParam &rigidParam, f32 margin) |
凸形状の作成 | |
GxObject * | createMesh (u32 index, b32 active, GxMatrixAffine *pMatrix, const GxVector3 &offset, const GxQuaternion &rotateOffset, const GxShapeTrimesh &trimesh, f32 friction=0.5f, b32 isCompress=true, GxVector3 *pAabbMin=nullptr, GxVector3 *pAabbMax=nullptr, f32 margin=DYNAMICS_COLLISION_MARGIN) |
背景用剛体の作成 | |
GxObject * | createCompoundObject (GxMatrixAffine *pMatrix, s32 jointIndex, const GxVector3 &offset, const GxQuaternion &rotateOffset, f32 margin=DYNAMICS_COLLISION_MARGIN) |
複合形状の作成 | |
GX_FORCE_INLINE b32 | isActive (void) const |
アクティブ判定 | |
void | setActive (b32 active) |
全剛体をアクティブにするか設定 | |
virtual GxConstraint * | allocConstraint (void) |
拘束クラスのメモリ確保 | |
GxConstraint * | getConstraint (u32 index) |
指定インデックスの拘束クラスを取得 | |
u32 | getConstraintCount (void) |
拘束クラスの数を取得 | |
virtual void | deleteConstraint (GxDynamics::GxConstraint *pConstraint) |
拘束クラスを削除 | |
GxConstraint * | createConstraintSpherical (b32 active, GxDynamics::GxObject *pObject0, GxDynamics::GxObject *pObject1, const GxVector3 &pivot0, const GxVector3 &pivot1, b32 disableCollisions=false) |
GxConstraint * | createConstraintRevolute (b32 active, GxDynamics::GxObject *pObject0, GxDynamics::GxObject *pObject1, const GxMatrixAffine &matrix0, const GxMatrixAffine &matrix1, b32 disableCollisions=false) |
GxConstraint * | createConstraintRevolute (b32 active, GxDynamics::GxObject *pObject0, GxDynamics::GxObject *pObject1, const GxVector3 &pivot0, const GxVector3 &pivot1, const GxVector3 &axis0, const GxVector3 &axis1, const GxVector3 &base0, const GxVector3 &base1, b32 disableCollisions=false) |
GxConstraint * | createConstraintConeTwist (b32 active, GxDynamics::GxObject *pObject0, GxDynamics::GxObject *pObject1, const GxMatrixAffine &matrix0, const GxMatrixAffine &matrix1, const GxParamConeTwist ¶m) |
GxConstraint * | createConstraintFixed (b32 active, GxDynamics::GxObject *pObject0, GxDynamics::GxObject *pObject1, const GxVector3 &pivot0, const GxVector3 &pivot1) |
固定タイプの拘束作成 | |
virtual void | initialize (GxDynamics::GxWorld *pRegisterWorld, GxUnitBase *pUnit, GxDynamics::DYNAMICS_CALLBACK, u32 threadIndex) |
初期設定 | |
virtual void | prepareCheck (void) |
当たり判定チェック前準備 | |
virtual void | preUpdate (void) |
更新前処理 | |
virtual void | postUpdate (void) |
更新後処理 | |
void | setActiveAll (b32 active) |
すべての剛体のアクティブ設定 | |
constexpr GxWorld * | getWorld (void) const |
登録ワールドの取得 | |
GX_FORCE_INLINE void | setCallback (DYNAMICS_CALLBACK pCallback) |
後処理用コールバック関数の設定 | |
void | executeCallback (void) |
後処理用コールバック関数の呼び出し | |
constexpr void | setWorldNull (void) |
登録ワールドの削除 | |
virtual GxObject * | addObject (void) |
オブジェクトの追加 | |
GxConstraint * | addConstraint (void) |
拘束クラスの追加 | |
Additional Inherited Members | |
![]() | |
static GX_FORCE_INLINE GxRtti & | __getStaticRtti (void) |
Rttiの取得 | |
物理演算クラス
|
protected |
拘束クラスの追加
|
protectedvirtual |
オブジェクトの追加
|
virtual |
拘束クラスのメモリ確保
GxDynamics::GxObject * GxDynamics::createBox | ( | b32 | active, |
GxMatrixAffine * | pMatrix, | ||
s32 | jointIndex, | ||
const GxVector3 & | offset, | ||
const GxQuaternion & | rotateOffset, | ||
const GxShapeBox & | box, | ||
const GxRigidBodyParam & | rigidParameter, | ||
f32 | margin = DYNAMICS_COLLISION_MARGIN ) |
箱の作成
active | [in] 登録後すぐアクティブにするかどうか |
pMatrix | [in] 引っ付けるマトリクス |
jointIndex | [in] 関節番号(pMatrixがnullptrのとき有効) |
offset | [in] オフセット |
rotateOffset | [in] 回転オフセット |
box | [in] 箱の形状 |
rigidParameter | [in] 剛体パラメータ |
margin | [in] マージン |
GxDynamics::GxObject * GxDynamics::createCapsule | ( | b32 | active, |
GxMatrixAffine * | pMatrix, | ||
s32 | jointIndex, | ||
const GxVector3 & | offset, | ||
const GxQuaternion & | rotateOffset, | ||
const GxShapeCapsule & | capsule, | ||
const GxRigidBodyParam & | rigidParameter, | ||
f32 | margin = DYNAMICS_COLLISION_MARGIN ) |
カプセルの作成
active | [in] 登録後すぐアクティブにするかどうか |
pMatrix | [in] 引っ付けるマトリクス |
jointIndex | [in] 関節番号(pMatrixがnullptrのときに有効になる) |
offset | [in] マトリクスからのオフセット |
rotateOffset | [in] 回転オフセット |
capsule | [in] カプセル形状 |
rigidParameter | [in] 剛体パラメータ |
margin | [in] マージン |
GxDynamics::GxObject * GxDynamics::createCompoundObject | ( | GxMatrixAffine * | pMatrix, |
s32 | jointIndex, | ||
const GxVector3 & | offset, | ||
const GxQuaternion & | rotateOffset, | ||
f32 | margin = DYNAMICS_COLLISION_MARGIN ) |
複合形状の作成
pMatrix | [in] 引っ付けるマトリクス |
jointIndex | [in] 関節番号(pMatrixがnullptrのときに有効になる) |
offset | [in] オフセット |
rotateOffset | [in] 回転オフセット |
margin | [in] マージン |
GxDynamics::GxConstraint * GxDynamics::createConstraintConeTwist | ( | b32 | active, |
GxDynamics::GxObject * | pObject0, | ||
GxDynamics::GxObject * | pObject1, | ||
const GxMatrixAffine & | matrix0, | ||
const GxMatrixAffine & | matrix1, | ||
const GxParamConeTwist & | parameter ) |
ConeTwistタイプの拘束クラス作成
active | [in] 登録後すぐアクティブにするかどうか |
pObject0 | [in] 拘束するオブジェクト1 |
pObject1 | [in] 拘束するオブジェクト2 |
matrix0 | [in] マトリクス1 |
matrix1 | [in] マトリクス2 |
parameter | [in] 拘束設定パラメータ |
GxDynamics::GxConstraint * GxDynamics::createConstraintFixed | ( | b32 | active, |
GxDynamics::GxObject * | pObject0, | ||
GxDynamics::GxObject * | pObject1, | ||
const GxVector3 & | pivot0, | ||
const GxVector3 & | pivot1 ) |
固定タイプの拘束作成
active | [in] 登録後すぐアクティブにするかどうか |
pObject0 | [in] 拘束するオブジェクト0 |
pObject1 | [in] 拘束するオブジェクト1 |
pivot0 | [in] pObject0座標系での固定位置 |
pivot1 | [in] pObject1座標系での固定位置 |
GxDynamics::GxConstraint * GxDynamics::createConstraintRevolute | ( | b32 | active, |
GxDynamics::GxObject * | pObject0, | ||
GxDynamics::GxObject * | pObject1, | ||
const GxMatrixAffine & | matrix0, | ||
const GxMatrixAffine & | matrix1, | ||
b32 | disableCollisions = false ) |
回転軸タイプの拘束情報作成
active | [in] 登録後すぐアクティブにするかどうか |
pObject0 | [in] 拘束するオブジェクト1 |
pObject1 | [in] 拘束するオブジェクト2 |
matrix0 | [in] マトリクス1 |
matrix1 | [in] マトリクス2 |
disableCollisions | [in] true:pObject0とpObject1間のコリジョンを無視する |
GxDynamics::GxConstraint * GxDynamics::createConstraintRevolute | ( | b32 | active, |
GxDynamics::GxObject * | pObject0, | ||
GxDynamics::GxObject * | pObject1, | ||
const GxVector3 & | pivot0, | ||
const GxVector3 & | pivot1, | ||
const GxVector3 & | axis0, | ||
const GxVector3 & | axis1, | ||
const GxVector3 & | base0, | ||
const GxVector3 & | base1, | ||
b32 | disableCollisions = false ) |
回転軸タイプの拘束情報作成(軸指定)
active | [in] 登録後すぐアクティブにするかどうか |
pObject0 | [in] 拘束するオブジェクト0 |
pObject1 | [in] 拘束するオブジェクト1 |
pivot0 | [in] pObject0 での回転中心 |
pivot1 | [in] pObject1 での回転中心 |
axis0 | [in] pObject0 での回転軸 |
axis1 | [in] pObject1 での回転軸 |
base0 | [in] pObject0 の回転基準方向 |
base1 | [in] pObject1 の回転基準方向 |
disableCollisions | [in] pObject0とpObject1間のコリジョンを無視するならtrue |
GxDynamics::GxConstraint * GxDynamics::createConstraintSpherical | ( | b32 | active, |
GxDynamics::GxObject * | pObject0, | ||
GxDynamics::GxObject * | pObject1, | ||
const GxVector3 & | pivot0, | ||
const GxVector3 & | pivot1, | ||
b32 | disableCollisions = false ) |
球タイプの拘束情報作成
active | [in] 登録後すぐアクティブにするかどうか |
pObject0 | [in] 拘束するオブジェクト0 |
pObject1 | [in] 拘束するオブジェクト1(nullptrの場合、ワールドと拘束) |
pivot0 | [in] pObject0での回転中心位置 |
pivot1 | [in] pObject1での回転中心位置 |
disableCollisions | [in] pObject0とpObject1間のコリジョンを無視するならtrue |
|
virtual |
凸形状の作成
active | [in] 登録後すぐアクティブにするかどうか |
pMatrix | [in] 引っ付けるマトリクス |
jointIndex | [in] 関節番号(pMatrixがnullptrのときに有効になる) |
offset | [in] マトリクスからのオフセット |
rotateOffset | [in] 回転オフセット |
pVertex | [in] 頂点群の先頭アドレス(Nxがいい感じにtriangleを生成するので、順番は考慮しなくてよい) |
countVertex | [in] 頂点数 |
rigidParameter | [in] 剛体パラメータ |
margin | [in] マージン |
GxDynamics::GxObject * GxDynamics::createCylinder | ( | b32 | active, |
GxMatrixAffine * | pMatrix, | ||
s32 | jointIndex, | ||
const GxVector3 & | offset, | ||
const GxQuaternion & | rotateOffset, | ||
const GxShapeCylinder & | cylinder, | ||
const GxRigidBodyParam & | rigidParameter, | ||
f32 | margin = DYNAMICS_COLLISION_MARGIN ) |
円柱の作成
active | [in] 登録後すぐアクティブにするかどうか |
pMatrix | [in] 引っ付けるマトリクス |
jointIndex | [in] 関節番号(pMatrixがnullptrのとき有効) |
offset | [in] マトリクスからのオフセット |
rotateOffset | [in] 回転オフセット |
cylinder | [in] 円柱の形状 |
rigidParameter | [in] 剛体パラメータ |
margin | [in] マージン |
GxDynamics::GxObject * GxDynamics::createMesh | ( | u32 | index, |
b32 | active, | ||
GxMatrixAffine * | pMatrix, | ||
const GxVector3 & | offset, | ||
const GxQuaternion & | rotateOffset, | ||
const GxShapeTrimesh & | trimesh, | ||
f32 | frict = 0.5f, | ||
b32 | isCompress = true, | ||
GxVector3 * | pAabbMin = nullptr, | ||
GxVector3 * | pAabbMax = nullptr, | ||
f32 | margin = DYNAMICS_COLLISION_MARGIN ) |
背景用剛体の作成
index | [in] 背景当たりインデックス |
active | [in] 登録後すぐアクティブにするかどうか |
pMatrix | [in] 引っ付けるマトリクス |
offset | [in] マトリクスからのオフセット |
rotateOffset | [in] 回転オフセット |
trimesh | [in] 三角形メッシュ形状 |
pBtVertex | [in] Bulletのメッシュのデータ |
frict | [in] 摩擦係数(デフォルト 0.5f) |
isCompress | [in] データを圧縮するかどうか(default = true) |
pAabbMin | [in] メッシュを囲むAABBボックスの最小値 |
pAabbMax | [in] メッシュを囲むAABBボックスの最大値 |
margin | [in] マージン |
GxDynamics::GxObject * GxDynamics::createMultisphere | ( | b32 | active, |
GxMatrixAffine * | pMatrix, | ||
s32 | jointIndex, | ||
const GxVector3 & | offset, | ||
const GxQuaternion & | rotateOffset, | ||
const GxShapeMultisphere & | capsule, | ||
const GxRigidBodyParam & | rigidParameter, | ||
f32 | margin = DYNAMICS_COLLISION_MARGIN ) |
マルチ球の作成
active | [in] 登録後すぐアクティブにするかどうか |
pMatrix | [in] 引っ付けるマトリクス |
jointIndex | [in] 関節番号(pMatrixがnullptrのとき有効) |
offset | [in] マトリクスからのオフセット |
rotateOffset | [in] 回転オフセット |
capsule | [in] カプセルの形状 |
rigidParameter | [in] 剛体パラメータ |
margin | [in] マージン |
GxDynamics::GxObject * GxDynamics::createSphere | ( | b32 | active, |
GxMatrixAffine * | pMatrix, | ||
s32 | jointIndex, | ||
const GxVector3 & | offset, | ||
const GxQuaternion & | rotateOffset, | ||
const GxShapeSphere & | sphere, | ||
const GxRigidBodyParam & | rigidParameter, | ||
f32 | margin = DYNAMICS_COLLISION_MARGIN ) |
球の作成
active | [in] 登録後すぐアクティブにするかどうか |
pMatrix | [in] 引っ付けるマトリクス |
jointIndex | [in] 関節番号(pMatrixがnullptrのとき有効) |
offset | [in] オフセット |
rotateOffset | [in] 回転オフセット |
sphere | [in] 球の形状 |
rigidParameter | [in] 剛体パラメータ |
margin | [in] マージン |
|
virtual |
拘束クラスを削除
pConstraint | [in] 削除したい拘束クラス |
|
virtual |
オブジェクトを削除する
pObject | [in] 削除したいオブジェクト |
|
virtual |
拘束をリストから切り離す
pConstraint | [in] 拘束 |
|
virtual |
オブジェクトをリストから切り離す
pObject | [in] 切り離したいオブジェクト |
GxDynamics::GxConstraint * GxDynamics::getConstraint | ( | u32 | index | ) |
指定インデックスの拘束クラスを取得
index | [in] 取得したい拘束クラスのインデックス |
u32 GxDynamics::getConstraintCount | ( | void | ) |
拘束クラスの数を取得
GxDynamics::GxObject * GxDynamics::getObject | ( | u32 | index | ) |
指定インデックスのオブジェクトを取得
index | [in] 取得したいオブジェクトのインデックス |
u32 GxDynamics::getObjectCount | ( | void | ) |
オブジェクトの数を取得
|
virtual |
初期設定
pRegisterWorld | [in] 登録先ワールド |
pUnit | [in] 使用するユニット |
pCallback | [in] 呼び出すコールバック関数 |
threadIndex | [in] スレッドインデックス |
|
virtual |
更新後処理
|
virtual |
更新前処理
void GxDynamics::setActive | ( | b32 | active | ) |
全剛体をアクティブにするか設定
active | [in] 登録している全剛体をアクティブにするならtrue |
void GxDynamics::setActiveAll | ( | b32 | active | ) |
すべての剛体のアクティブ設定
active | [in] アクティブにするならtrue |