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

角錐台 More...

#include <GxShape.h>

Inheritance diagram for GxShapeFrustum:
Collaboration diagram for GxShapeFrustum:

Public Member Functions

初期化
 GxShapeFrustum (void)
 デフォルトコンストラクタ
 
 GxShapeFrustum (const GxMatrixAffine &top, f32 nearZ, f32 farZ, f32 fov, f32 aspectRatio)
 コンストラクタ
 
 ~GxShapeFrustum (void) override
 デストラクタ
 
アクセサ
GX_FORCE_INLINE const GxMatrixAffinegetTop (void) const
 
constexpr f32 getNearZ (void) const
 
constexpr f32 getFarZ (void) const
 
constexpr f32 getFov (void) const
 
constexpr f32 getAspectRatio (void) const
 
void updateParameter (const GxMatrixAffine &top, f32 nearZ, f32 farZ, f32 fov, f32 aspectRatio)
 パラメタ更新
 
- 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 GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

操作

b32 checkBounding (const GxShapeSphere &sphere) const
 境界形状との交差判定:球
 
b32 checkWithAABB (const GxShapeAxisAlignedBox &aabb, u32 &intersect) const
 境界形状との交差判定:AABB
 
b32 checkWithOBB (const GxShapeBox &obb) const
 境界形状との交差判定:OBB
 
b32 checkBounding (const GxShapeCylinder &cylinder) const
 境界形状との交差判定:円柱
 
const GxVector3 getNormal (const GxVector3 &position) const override
 指定位置への法線を求める
 
b32 isInclude (const GxVector3 &point) const override
 指定点が含まれているか判定
 
void getVertex (GxVector3 *pNearPlane, GxVector3 *pFarPlane) const
 頂点を取得(近面と遠面を別で取得)
 
void getVertex (GxVector3 *pVertex) const
 頂点を取得(近面と遠面を一緒に取得)
 
void getFarPlaneVertex (GxVector3 *pFarPlane) const
 遠面の頂点を取得
 

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)がこの値未満なら正規化と判定
 

Detailed Description

角錐台

Constructor & Destructor Documentation

◆ GxShapeFrustum()

GxShapeFrustum::GxShapeFrustum ( const GxMatrixAffine & top,
f32 nearZ,
f32 farZ,
f32 fov,
f32 aspectRatio )

コンストラクタ

Parameters
top[in] 角錐頂点をposとし、底面方向を-z、幅方向をxとするマトリクス
nearZ[in] 近面までの距離
farZ[in] 遠面までの距離
fov[in] 視野角(y方向)
aspectRatio[in] アスペクト比(幅/高さ)
Here is the call graph for this function:

Member Function Documentation

◆ checkBounding() [1/2]

b32 GxShapeFrustum::checkBounding ( const GxShapeCylinder & cylinder) const

境界形状との交差判定:円柱

Parameters
cylinder[in] 判定する円柱
Returns
衝突したらtrue
Here is the call graph for this function:

◆ checkBounding() [2/2]

b32 GxShapeFrustum::checkBounding ( const GxShapeSphere & sphere) const

境界形状との交差判定:球

Parameters
sphere[in] 判定する球
Returns
衝突したらtrue
Note
6平面とのチェックで近似しているので、 角付近では実際よりも広い範囲で衝突と判定する
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkWithAABB()

b32 GxShapeFrustum::checkWithAABB ( const GxShapeAxisAlignedBox & aabb,
u32 & intersect ) const

境界形状との交差判定:AABB

Parameters
aabb[in] 判定するAABB( top方向に各軸が向いているものとする )
intersect[in] 交差なら1, 内包なら0
Returns
衝突したらtrue
Note
AABBの軸方向はtop方向に各軸が向いているものとする
Here is the call graph for this function:

◆ checkWithOBB()

b32 GxShapeFrustum::checkWithOBB ( const GxShapeBox & obb) const

境界形状との交差判定:OBB

Parameters
obb[in] 判定するOBB
Returns
衝突したらtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAspectRatio()

f32 GxShapeFrustum::getAspectRatio ( void ) const
inlineconstexpr

アスペクト比を取得

Returns
アスペクト比

◆ getFarPlaneVertex()

void GxShapeFrustum::getFarPlaneVertex ( GxVector3 * pFarPlane) const

遠面の頂点を取得

Parameters
pFarPlane[out] 遠い面の座標(4点)
Note
座標格納順は 2━0 ┃ ┃ 3━1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFarZ()

f32 GxShapeFrustum::getFarZ ( void ) const
inlineconstexpr

farクリップを取得

Returns
farクリップ
Here is the caller graph for this function:

◆ getFov()

f32 GxShapeFrustum::getFov ( void ) const
inlineconstexpr

fovを取得

Returns
fov

◆ getNearZ()

f32 GxShapeFrustum::getNearZ ( void ) const
inlineconstexpr

nearクリップを取得

Returns
nearクリップ
Here is the caller graph for this function:

◆ getNormal()

const GxVector3 GxShapeFrustum::getNormal ( const GxVector3 & position) const
overridevirtual

指定位置への法線を求める

Parameters
position[in] 表面位置
Returns
法線

Implements GxShape.

◆ getTop()

GX_FORCE_INLINE const GxMatrixAffine & GxShapeFrustum::getTop ( void ) const
inline

マトリクスを取得

Returns
マトリクス
Here is the caller graph for this function:

◆ getVertex() [1/2]

void GxShapeFrustum::getVertex ( GxVector3 * pNearPlane,
GxVector3 * pFarPlane ) const

頂点を取得(近面と遠面を別で取得)

Parameters
pNearPlane[out] 近面の座標(4点)
pFarPlane[out] 遠い面の座標(4点)
Note
座標格納順は 0━2 ┃ ┃ 1━3
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVertex() [2/2]

void GxShapeFrustum::getVertex ( GxVector3 * pVertex) const

頂点を取得(近面と遠面を一緒に取得)

Parameters
pVertex[out] 頂点座標(8点)
Note
座標格納順は 2━0 6━4 ┃近┃ ┃遠┃ 3━1 7━5
Here is the call graph for this function:

◆ isInclude()

b32 GxShapeFrustum::isInclude ( const GxVector3 & point) const
overridevirtual

指定点が含まれているか判定

Parameters
point[in] 判定点
Returns
含まれていたらtrue

Reimplemented from GxShape.

◆ updateParameter()

void GxShapeFrustum::updateParameter ( const GxMatrixAffine & top,
f32 nearZ,
f32 farZ,
f32 fov,
f32 aspectRatio )

パラメタ更新

Parameters
top[in] 角錐頂点をposとし、底面方向を-z、幅方向をxとするマトリクス
nearZ[in] 近面までの距離
farZ[in] 遠面までの距離
fov[in] 視野角(y方向)
aspectRatio[in] アスペクト比(幅/高さ)
Here is the call graph for this function:
Here is the caller graph for this function:

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