球形状クラス More...
#include <GxShape.h>


Public Member Functions | |
初期化 | |
| GxShapeSphere (void) | |
| デフォルトコンストラクタ | |
| GxShapeSphere (f32 radius, const GxVector3 &position) | |
| コンストラクタ | |
| ~GxShapeSphere (void) override | |
| デストラクタ | |
アクセサ | |
| constexpr f32 | getRadius (void) const |
| 半径取得 | |
| constexpr void | setRadius (f32 radius) |
| 半径設定 | |
| GX_FORCE_INLINE const GxVector3 & | getPosition (void) const |
| 位置取得 | |
| GX_FORCE_INLINE void | setPosition (const GxVector3 &position) |
| 位置設定 | |
| const GxVector3 | getNormal (const GxVector3 &position) const override |
| 指定位置への法線を求める | |
| b32 | isInclude (const GxVector3 &point) const override |
| 指定点が含まれているか判定 | |
| b32 | isHitRay (const GxVector3 &rayStart, const GxVector3 &rayEnd, GxVector3 *pHitPosition=nullptr, GxVector3 *pNormal=nullptr) const |
| 線分の衝突判定 | |
Public Member Functions inherited from GxShape | |
| GxShape (void) | |
| コンストラクタ | |
| ~GxShape (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) |
| デフォルトオブジェクト判定 | |
操作 | |
| b32 | createBounding (const GxVector3 *pVertex, const u32 vertexCount) |
| 境界作成(GxVector3指定) | |
| b32 | createBounding (const void *pVertex, const u32 vertexCount, const u32 stride) |
| 境界作成(void*指定) | |
| b32 | createMinSphereRough (const u32 vertexCount, const GxVector3 *pVertex) |
Additional Inherited Members | |
Static Public Member Functions inherited from GxShape | |
| static b32 | isHit (const GxShapeSphere &sphere0, const GxShapeSphere &sphere1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 球と球の衝突判定 | |
| static b32 | isHit (const GxShapeSphere &sphere, const GxShapeBox &box, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 球と箱の衝突判定 | |
| static b32 | isHit (const GxShapeSphere &sphere, const GxShapeCylinder &cylinder, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 球と円柱の衝突判定 | |
| static b32 | isHit (const GxShapeSphere &sphere, const GxShapeMultisphere &multisphere, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 球とカプセルの衝突判定 | |
| static b32 | isHit (const GxShapeSphere &sphere, const GxShapePlane &plane, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 球と平面の衝突判定 | |
| static b32 | isHit (const GxShapeSphere &sphere, const GxShapeTrimesh &trimesh, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 球と三角メッシュの衝突判定 | |
| static b32 | isHitSphereRay (const GxShapeSphere &sphere, const GxShapeRay &ray, f32 *pParameter=nullptr, GxVector3 *pHitNormal=nullptr) |
| 球と線分の衝突判定 | |
| static b32 | isHit (const GxShapeSphere &sphere, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 球と光束の衝突判定 | |
| static b32 | isHit (const GxShapeBox &box0, const GxShapeBox &box1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 箱と箱の衝突判定 | |
| static b32 | isHit (const GxShapeBox &box, const GxShapeCylinder &cylinder, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 箱と円柱の衝突判定 | |
| static b32 | isHit (const GxShapeBox &box, const GxShapeMultisphere &multisphere, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 箱とカプセルの衝突判定 | |
| static b32 | isHit (const GxShapeBox &box, const GxShapePlane &plane, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 箱と平面の衝突判定 | |
| static b32 | isHit (const GxShapeBox &box, const GxVector3 &n, const GxVector3 &p, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 箱と平面の衝突判定 | |
| static b32 | isHit (const GxShapeBox &box, const GxShapeTrimesh &trimesh, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 箱と三角メッシュの衝突判定 | |
| static b32 | isHitBoxRay (const GxShapeBox &box, const GxShapeRay &ray, f32 *pParam=nullptr, GxVector3 *pHitNormal=nullptr) |
| 箱と線分の衝突判定 | |
| static b32 | isHit (const GxShapeBox &box, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 箱と光束の衝突判定 | |
| static b32 | isHit (const GxShapeCylinder &cylinder0, const GxShapeCylinder &cylinder1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 円柱と円柱の衝突判定 | |
| static b32 | isHit (const GxShapeCylinder &cylinder, const GxShapeMultisphere &multisphere, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 円柱とカプセルの衝突判定 | |
| static b32 | isHit (const GxShapeCylinder &cylinder, const GxShapePlane &plane, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 円柱と平面の衝突判定 | |
| static b32 | isHit (const GxShapeCylinder &cylinder, const GxShapeTrimesh &trimesh, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 円柱と三角メッシュの衝突判定 | |
| static b32 | isHitCylinderRay (const GxShapeCylinder &cylinder, const GxShapeRay &ray, f32 *pParameter=nullptr, GxVector3 *pHitNormal=nullptr) |
| 円柱と線分の衝突判定 | |
| static b32 | isHit (const GxShapeCylinder &cylinder, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 円柱と光束の衝突判定 | |
| static b32 | isHit (const GxShapeCapsule &multisphere0, const GxShapeCapsule &multisphere1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| カプセルとカプセルの衝突判定 | |
| static b32 | isHit (const GxShapeCapsule &multisphere, const GxShapePlane &plane, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| カプセルと平面の衝突判定 | |
| static b32 | isHit (const GxShapeCapsule &multisphere, const GxShapeTrimesh &trimesh, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| カプセルと三角メッシュの衝突判定 | |
| static b32 | isHitCapsuleRay (const GxShapeCapsule &multisphere, const GxShapeRay &ray, f32 *pParameter=nullptr, GxVector3 *pHitNormal=nullptr) |
| カプセルと線分の衝突判定 | |
| static b32 | isHit (const GxShapeCapsule &multisphere, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| カプセルと光束の衝突判定 | |
| static b32 | isHit (const GxShapeMultisphere &multisphere0, const GxShapeMultisphere &multisphere1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| マルチ球とマルチ球の衝突判定 | |
| static b32 | isHit (const GxShapeMultisphere &multisphere, const GxShapePlane &plane, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| マルチ球と平面の衝突判定 | |
| static b32 | isHit (const GxShapeMultisphere &multisphere, const GxShapeTrimesh &trimesh, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| マルチ球と三角メッシュの衝突判定 | |
| static b32 | isHitMultisphereRay (const GxShapeMultisphere &multisphere, const GxShapeRay &ray, f32 *pParameter=nullptr, GxVector3 *pHitNormal=nullptr) |
| マルチ球と線分の衝突判定 | |
| static b32 | isHit (const GxShapeMultisphere &multisphere, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| マルチ球と光束の衝突判定 | |
| static b32 | isHit (const GxShapeAxisAlignedBox &aab0, const GxShapeAxisAlignedBox &aab1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| AABとAABの衝突判定 | |
| static b32 | isHit (const GxShapeAxisAlignedBox &aabb, const GxShapePlane &plane, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| AABBと平面の交差判定 | |
| static b32 | isHit (const GxShapeAxisAlignedBox &aabb, const GxVector3 &n, const GxVector3 &p, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| AABBと平面の交差判定 | |
| static b32 | isHit (const GxShapePlane &plane0, const GxShapePlane &plane1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 平面と平面の衝突判定 | |
| static b32 | isHit (const GxShapePlane &plane, const GxShapeTrimesh &trimesh, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 平面と三角メッシュの衝突判定 | |
| static b32 | isHitPlaneRay (const GxShapePlane &plane, const GxShapeRay &ray, f32 *pParameter=nullptr, GxVector3 *pHitNormal=nullptr) |
| 平面と線分の衝突判定 | |
| static b32 | isHit (const GxShapePlane &plane, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 平面と光束の衝突判定 | |
| static b32 | isHit (const GxShapeTrimesh &trimesh0, const GxShapeTrimesh &trimesh1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 三角メッシュと三角メッシュの衝突判定 | |
| static b32 | isHit (const GxShapeTrimesh &trimesh, const GxShapeRay &ray, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 三角メッシュと線分の衝突判定 | |
| static b32 | isHit (const GxShapeTrimesh &trimesh, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 三角メッシュと光束の衝突判定 | |
| static b32 | isHit (const GxShapeRay &ray0, const GxShapeRay &ray1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 線分と線分の衝突判定 | |
| static b32 | isHit (const GxShapeRay &ray, const GxShapeBeam &beam, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 線分と光束の衝突判定 | |
| static b32 | isHit (const GxShapeBeam &beam0, const GxShapeBeam &beam1, GxVector3 *pHitPosition=nullptr, GxVector3 *pAdjustVector=nullptr) |
| 光束と光束の衝突判定 | |
| static void | getClosestPoint (const GxVector3 &point, const GxShapeBox &box, GxVector3 &closestPoint, GxVector3 &surfacePoint) |
| 点と箱の最近接点を求める | |
| static void | getClosestPoint (const GxVector3 &point, const GxShapeRay &ray, GxVector3 &closestPoint) |
| 点と線分の最近接点を求める | |
Static Public Member Functions inherited from GxClassBaseRoot | |
| static GX_FORCE_INLINE GxRtti & | __getStaticRtti (void) |
| Rttiの取得 | |
Static Public Attributes inherited from GxShape | |
| static const f32 | HIT_DISTANCE = 5.0e-1 |
| この距離未満なら衝突と判定 | |
| static const f32 | NORMALIZED_JUDGE_MAX = 1.0e-3 |
| fabs(lengthSquare - 1.f)がこの値未満なら正規化と判定 | |
球形状クラス
境界作成(GxVector3指定)
| pVertex | [in] 境界内に含めたい点座標 |
| vertexCount | [in] pVertexの数 |

| b32 GxShapeSphere::createBounding | ( | const void * | pVertex, |
| const u32 | vertexCount, | ||
| const u32 | stride ) |
境界作成(void*指定)
| pVertex | [in] 頂点座標セット先頭ポインタ |
| vertexCount | [in] 座標セットの数 |
| stride | [in] 次座標セットまでの幅(void* pPosNext = GX_POINTER_ADD(pPosOld, stride) ) |

ラフな最小包含球を作成する
| vertexCount | [in] pVertexの頂点数 |
| pVertex | [in] 球に含めたい点座標 |

| b32 GxShapeSphere::isHitRay | ( | const GxVector3 & | rayStart, |
| const GxVector3 & | rayEnd, | ||
| GxVector3 * | pHitPosition = nullptr, | ||
| GxVector3 * | pNormal = nullptr ) const |
線分の衝突判定
| rayStart | [in] 線分開始座標 |
| rayEnd | [in] 線分終了座標 |
| pHitPosition | [out] 衝突座標 |
| pNormal | [out] 線分が衝突した面の法線 |

指定点が含まれているか判定
| point | [in] チェックする点の座標 |
Reimplemented from GxShape.