nlib
nn::nlib::simd::Intersection クラス

交差の判定を行う関数をまとめたクラスです。 [詳解]

#include "nn/nlib/simd/SimdGeometry.h"

公開型

enum  PlaneResult {
  PLANE_FRONT = 0,
  PLANE_INTERSECT = 1,
  PLANE_BACK = 2
}
 平面との交差判定の戻り値の型です。平面の法線方向と同じ側を平面の表とします。 [詳解]
 

静的公開メンバ関数

static SimdVector PlaneLine (SimdPlaneArg plane, SimdVectorArg line_point, SimdVectorArg line_dir_normalized) noexcept
 3次元空間上の線が平面と交差する点を計算します。 [詳解]
 
static SimdVector PlaneRay (SimdPlaneArg plane, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 3次元空間上の半直線が平面と交差する点を計算します。 [詳解]
 
static SimdVector PlaneSegment (SimdPlaneArg plane, SimdVectorArg segment_point0, SimdVectorArg segment_point1) noexcept
 3次元空間上の線分が平面と交差する点を計算します。 [詳解]
 
static bool SphereRay (float *distance, SimdSphereArg sphere, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 3次元空間上の球と半直線が交差するかどうかを判定します。 [詳解]
 
static bool TriangleRay (float *distance, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 3次元空間上の三角形と半直線が交差するかどうかを判定します。 [詳解]
 
static PlaneResult TrianglePlane (SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2, SimdPlaneArg plane_normalized) noexcept
 3次元空間上の三角形と平面が交差するかどうかを判定します。 [詳解]
 
static PlaneResult SpherePlane (SimdSphereArg sphere, SimdPlaneArg plane_normalized) noexcept
 3次元空間上の球と平面が交差するかどうかを判定します。 [詳解]
 
static bool SphereSphere (SimdSphereArg sphere0, SimdSphereArg sphere1) noexcept
 3次元空間上の球と球が交差するかどうかを判定します。 [詳解]
 
static f128x2 PlanePlane (SimdPlaneArg plane0, SimdPlaneArg plane1) noexcept
 3次元空間上の平面と平面が交差するかどうかを判定します。 [詳解]
 
static bool SphereTriangle (SimdSphereArg sphere, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 3次元空間上の球と三角形が交差するかどうかを判定します。 [詳解]
 
static PlaneResult AxisAlignedBoxPlane (const AxisAlignedBox &aabb, SimdPlaneArg plane_normalized) noexcept
 AABBと平面が交差するかどうかを判定します。 [詳解]
 
static bool AxisAlignedBoxRay (const AxisAlignedBox &aabb, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 3次元空間上のAABBと半直線が交差するのかどうかを判定します。 [詳解]
 
static bool AxisAlignedBoxSphere (const AxisAlignedBox &aabb, SimdSphereArg sphere) noexcept
 3次元空間上のAABBと球が交差するのかどうかを判定します。 [詳解]
 
static bool AxisAlignedBoxAxisAlignedBox (const AxisAlignedBox &aabb0, const AxisAlignedBox &aabb1) noexcept
 3次元空間上のAABBとAABBが交差するのかどうかを判定します。 [詳解]
 
static bool AxisAlignedBoxTriangle (const AxisAlignedBox &aabb, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 3次元空間上のAABBと三角形が交差するのかどうかを判定します。 [詳解]
 
static bool OrientedBoxSphere (const OrientedBox &box, SimdSphereArg sphere) noexcept
 3次元空間上のOBBと球が交差するのかどうかを判定します。 [詳解]
 
static bool OrientedBoxAxisAlignedBox (const OrientedBox &box, const AxisAlignedBox &aabb) noexcept
 3次元空間上のOBBとAABBが交差するのかどうかを判定します。 [詳解]
 
static bool OrientedBoxOrientedBox (const OrientedBox &box0, const OrientedBox &box1) noexcept
 3次元空間上のOBBとOBBが交差するのかどうかを判定します。 [詳解]
 
static bool OrientedBoxTriangle (const OrientedBox &box, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 3次元空間上のOBBと三角形が交差するのかどうかを判定します。 [詳解]
 
static PlaneResult OrientedBoxPlane (const OrientedBox &box, SimdPlaneArg plane_normalized) noexcept
 3次元空間上のOBBと平面が交差するのかどうかを判定します。 [詳解]
 
static bool OrientedBoxRay (const OrientedBox &box, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 3次元空間上のOBBと半直線が交差するのかどうかを判定します。 [詳解]
 
static bool FrustumSphere (const Frustum &frustum, SimdSphereArg sphere) noexcept
 フラスタムと球が交差するのかどうかを判定します。 [詳解]
 
static bool FrustumAxisAlignedBox (const Frustum &frustum, const AxisAlignedBox &aabb) noexcept
 フラスタムとAABBが交差するのかどうかを判定します。 [詳解]
 
static bool FrustumOrientedBox (const Frustum &frustum, const OrientedBox &obb) noexcept
 フラスタムとOBBが交差するのかどうかを判定します。 [詳解]
 
static bool FrustumTriangle (const Frustum &frustum, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 フラスタムと三角形が交差するのかどうかを判定します。 [詳解]
 
static PlaneResult FrustumPlane (const Frustum &frustum, SimdPlaneArg plane) noexcept
 フラスタムと平面が交差するのかどうかを判定します。 [詳解]
 
static bool FrustumRay (const Frustum &frustum, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 フラスタムと半直線が交差するのかどうかを判定します。 [詳解]
 

詳解

交差の判定を行う関数をまとめたクラスです。

説明
このクラスのメンバは全て静的関数で、クラスをインスタンス化することはできません。

SimdGeometry.h178 行目に定義があります。

列挙型メンバ詳解

§ PlaneResult

平面との交差判定の戻り値の型です。平面の法線方向と同じ側を平面の表とします。

列挙値
PLANE_FRONT 

対象オブジェクトは平面の表側に存在します。

PLANE_INTERSECT 

対象オブジェクトは平面と交差します。

PLANE_BACK 

対象オブジェクトは平面の裏側に存在します。

SimdGeometry.h181 行目に定義があります。

関数詳解

§ AxisAlignedBoxAxisAlignedBox()

nn::nlib::simd::Intersection::AxisAlignedBoxAxisAlignedBox ( const AxisAlignedBox aabb0,
const AxisAlignedBox aabb1 
)
staticnoexcept

3次元空間上のAABBとAABBが交差するのかどうかを判定します。

引数
[in]aabb03次元空間上のAABB
[in]aabb13次元空間上のAABB
戻り値
交差している場合はtrue

§ AxisAlignedBoxPlane()

nn::nlib::simd::Intersection::AxisAlignedBoxPlane ( const AxisAlignedBox aabb,
SimdPlaneArg  plane_normalized 
)
staticnoexcept

AABBと平面が交差するかどうかを判定します。

引数
[in]aabb3次元空間上のAABB
[in]plane_normalized3次元空間上の正規化された平面
戻り値
3次元空間上のAABBと平面との位置関係

§ AxisAlignedBoxRay()

nn::nlib::simd::Intersection::AxisAlignedBoxRay ( const AxisAlignedBox aabb,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

3次元空間上のAABBと半直線が交差するのかどうかを判定します。

引数
[in]aabb3次元空間上のAABB
[in]ray_point半直線の起点の位置を示す3次元ベクトル
[in]ray_dir_normalized半直線の方向を表す単位ベクトル
戻り値
交差している場合はtrue

§ AxisAlignedBoxSphere()

nn::nlib::simd::Intersection::AxisAlignedBoxSphere ( const AxisAlignedBox aabb,
SimdSphereArg  sphere 
)
staticnoexcept

3次元空間上のAABBと球が交差するのかどうかを判定します。

引数
[in]aabb3次元空間上のAABB
[in]sphere3次元空間上の球
戻り値
交差している場合はtrue

§ AxisAlignedBoxTriangle()

nn::nlib::simd::Intersection::AxisAlignedBoxTriangle ( const AxisAlignedBox aabb,
SimdVectorArg  triangle_point0,
SimdVectorArg  triangle_point1,
SimdVectorArg  triangle_point2 
)
staticnoexcept

3次元空間上のAABBと三角形が交差するのかどうかを判定します。

引数
[in]aabb3次元空間上のAABB
[in]triangle_point0三角形の頂点を示す3次元ベクトル
[in]triangle_point1三角形の頂点を示す3次元ベクトル
[in]triangle_point2三角形の頂点を示す3次元ベクトル
戻り値
交差している場合はtrue

§ FrustumAxisAlignedBox()

nn::nlib::simd::Intersection::FrustumAxisAlignedBox ( const Frustum frustum,
const AxisAlignedBox aabb 
)
staticnoexcept

フラスタムとAABBが交差するのかどうかを判定します。

引数
[in]frustumフラスタム
[in]aabb3次元空間上のAABB
戻り値
交差している場合はtrue

§ FrustumOrientedBox()

nn::nlib::simd::Intersection::FrustumOrientedBox ( const Frustum frustum,
const OrientedBox obb 
)
staticnoexcept

フラスタムとOBBが交差するのかどうかを判定します。

引数
[in]frustumフラスタム
[in]obb3次元空間上のOBB
戻り値
交差している場合はtrue

§ FrustumPlane()

nn::nlib::simd::Intersection::FrustumPlane ( const Frustum frustum,
SimdPlaneArg  plane 
)
staticnoexcept

フラスタムと平面が交差するのかどうかを判定します。

引数
[in]frustumフラスタム
[in]plane3次元空間上の平面
戻り値
交差している場合はtrue

§ FrustumRay()

nn::nlib::simd::Intersection::FrustumRay ( const Frustum frustum,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

フラスタムと半直線が交差するのかどうかを判定します。

引数
[in]frustumフラスタム
[in]ray_point半直線の起点の位置を示す3次元ベクトル
[in]ray_dir_normalized半直線の方向を表す単位ベクトル
戻り値
交差している場合はtrue

§ FrustumSphere()

nn::nlib::simd::Intersection::FrustumSphere ( const Frustum frustum,
SimdSphereArg  sphere 
)
staticnoexcept

フラスタムと球が交差するのかどうかを判定します。

引数
[in]frustumフラスタム
[in]sphere3次元空間上の球
戻り値
交差している場合はtrue

§ FrustumTriangle()

nn::nlib::simd::Intersection::FrustumTriangle ( const Frustum frustum,
SimdVectorArg  triangle_point0,
SimdVectorArg  triangle_point1,
SimdVectorArg  triangle_point2 
)
staticnoexcept

フラスタムと三角形が交差するのかどうかを判定します。

引数
[in]frustumフラスタム
[in]triangle_point0三角形の頂点を示す3次元ベクトル
[in]triangle_point1三角形の頂点を示す3次元ベクトル
[in]triangle_point2三角形の頂点を示す3次元ベクトル
戻り値
交差している場合はtrue

§ OrientedBoxAxisAlignedBox()

nn::nlib::simd::Intersection::OrientedBoxAxisAlignedBox ( const OrientedBox box,
const AxisAlignedBox aabb 
)
staticnoexcept

3次元空間上のOBBとAABBが交差するのかどうかを判定します。

引数
[in]box3次元空間上のOBB
[in]aabb3次元空間上のAABB
戻り値
交差している場合はtrue

§ OrientedBoxOrientedBox()

nn::nlib::simd::Intersection::OrientedBoxOrientedBox ( const OrientedBox box0,
const OrientedBox box1 
)
staticnoexcept

3次元空間上のOBBとOBBが交差するのかどうかを判定します。

引数
[in]box03次元空間上のOBB
[in]box13次元空間上のOBB
戻り値
交差している場合はtrue

§ OrientedBoxPlane()

nn::nlib::simd::Intersection::OrientedBoxPlane ( const OrientedBox box,
SimdPlaneArg  plane_normalized 
)
staticnoexcept

3次元空間上のOBBと平面が交差するのかどうかを判定します。

引数
[in]box3次元空間上のOBB
[in]plane_normalized3次元空間上の正規化された平面
戻り値
3次元空間上のOBBと平面との位置関係

§ OrientedBoxRay()

nn::nlib::simd::Intersection::OrientedBoxRay ( const OrientedBox box,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

3次元空間上のOBBと半直線が交差するのかどうかを判定します。

引数
[in]box3次元空間上のOBB
[in]ray_point半直線の起点の位置を示す3次元ベクトル
[in]ray_dir_normalized半直線の方向を表す単位ベクトル
戻り値
交差している場合はtrue

§ OrientedBoxSphere()

nn::nlib::simd::Intersection::OrientedBoxSphere ( const OrientedBox box,
SimdSphereArg  sphere 
)
staticnoexcept

3次元空間上のOBBと球が交差するのかどうかを判定します。

引数
[in]box3次元空間上のOBB
[in]sphere3次元空間上の球
戻り値
交差している場合はtrue

§ OrientedBoxTriangle()

nn::nlib::simd::Intersection::OrientedBoxTriangle ( const OrientedBox box,
SimdVectorArg  triangle_point0,
SimdVectorArg  triangle_point1,
SimdVectorArg  triangle_point2 
)
staticnoexcept

3次元空間上のOBBと三角形が交差するのかどうかを判定します。

引数
[in]box3次元空間上のOBB
[in]triangle_point0三角形の頂点を示す3次元ベクトル
[in]triangle_point1三角形の頂点を示す3次元ベクトル
[in]triangle_point2三角形の頂点を示す3次元ベクトル
戻り値
交差している場合はtrue

§ PlaneLine()

nn::nlib::simd::Intersection::PlaneLine ( SimdPlaneArg  plane,
SimdVectorArg  line_point,
SimdVectorArg  line_dir_normalized 
)
staticnoexcept

3次元空間上の線が平面と交差する点を計算します。

引数
[in]plane3次元空間上の平面
[in]line_point線上の点の位置を示す3次元ベクトル
[in]line_dir_normalized線の方向を表す単位ベクトル
戻り値
平面と線との交点を示す3次元ベクトル
説明
(線と平面が平行なため)交差する点が存在しない場合は、ベクトルの各要素にNaNを設定して返します。

§ PlanePlane()

nn::nlib::simd::Intersection::PlanePlane ( SimdPlaneArg  plane0,
SimdPlaneArg  plane1 
)
staticnoexcept

3次元空間上の平面と平面が交差するかどうかを判定します。

引数
[in]plane03次元空間上の平面
[in]plane13次元空間上の平面
戻り値
3次元空間上で交差する線上の2点を返します。
説明
(平面同士が平行なため)交差する線が存在しない場合は、ベクトルの各要素にNaNを設定して返します。

§ PlaneRay()

nn::nlib::simd::Intersection::PlaneRay ( SimdPlaneArg  plane,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

3次元空間上の半直線が平面と交差する点を計算します。

引数
[in]plane3次元空間上の平面
[in]ray_point半直線の起点の位置を示す3次元ベクトル
[in]ray_dir_normalized半直線の方向を表す単位ベクトル
戻り値
平面と半直線の交点を示す3次元ベクトル
説明
交差する点が存在しない場合は、ベクトルの各要素にNaNを設定して返します。

§ PlaneSegment()

nn::nlib::simd::Intersection::PlaneSegment ( SimdPlaneArg  plane,
SimdVectorArg  segment_point0,
SimdVectorArg  segment_point1 
)
staticnoexcept

3次元空間上の線分が平面と交差する点を計算します。

引数
[in]plane3次元空間上の平面
[in]segment_point0線分の始点
[in]segment_point1線分の終点
戻り値
平面と線分の交点を示す3次元ベクトル
説明
交差する点が存在しない場合は、ベクトルの各要素にNaNを設定して返します。

§ SpherePlane()

nn::nlib::simd::Intersection::SpherePlane ( SimdSphereArg  sphere,
SimdPlaneArg  plane_normalized 
)
staticnoexcept

3次元空間上の球と平面が交差するかどうかを判定します。

引数
[in]sphere3次元空間上の球
[in]plane_normalized3次元空間上の正規化された平面
戻り値
球と平面との位置関係

§ SphereRay()

nn::nlib::simd::Intersection::SphereRay ( float *  distance,
SimdSphereArg  sphere,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

3次元空間上の球と半直線が交差するかどうかを判定します。

引数
[out]distanceNULLでなく交差する場合には半直線の起点と交差点との距離が格納されます。
[in]sphere3次元空間上の球
[in]ray_point半直線の起点の位置を示す3次元ベクトル
[in]ray_dir_normalized半直線の方向を表す単位ベクトル
戻り値
交差している場合はtrue

§ SphereSphere()

nn::nlib::simd::Intersection::SphereSphere ( SimdSphereArg  sphere0,
SimdSphereArg  sphere1 
)
staticnoexcept

3次元空間上の球と球が交差するかどうかを判定します。

引数
[in]sphere03次元空間上の球
[in]sphere13次元空間上の球
戻り値
交差している場合はtrue

§ SphereTriangle()

nn::nlib::simd::Intersection::SphereTriangle ( SimdSphereArg  sphere,
SimdVectorArg  triangle_point0,
SimdVectorArg  triangle_point1,
SimdVectorArg  triangle_point2 
)
staticnoexcept

3次元空間上の球と三角形が交差するかどうかを判定します。

引数
[in]sphere3次元空間上の球
[in]triangle_point0三角形の頂点を示す3次元ベクトル
[in]triangle_point1三角形の頂点を示す3次元ベクトル
[in]triangle_point2三角形の頂点を示す3次元ベクトル
戻り値
交差している場合はtrue

§ TrianglePlane()

nn::nlib::simd::Intersection::TrianglePlane ( SimdVectorArg  triangle_point0,
SimdVectorArg  triangle_point1,
SimdVectorArg  triangle_point2,
SimdPlaneArg  plane_normalized 
)
staticnoexcept

3次元空間上の三角形と平面が交差するかどうかを判定します。

引数
[in]triangle_point0三角形の頂点を示す3次元ベクトル
[in]triangle_point1三角形の頂点を示す3次元ベクトル
[in]triangle_point2三角形の頂点を示す3次元ベクトル
[in]plane_normalized3次元空間上の正規化された平面
戻り値
三角形と平面との位置関係

§ TriangleRay()

nn::nlib::simd::Intersection::TriangleRay ( float *  distance,
SimdVectorArg  triangle_point0,
SimdVectorArg  triangle_point1,
SimdVectorArg  triangle_point2,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

3次元空間上の三角形と半直線が交差するかどうかを判定します。

引数
[out]distanceNULLでなく交差する場合には半直線の起点と交差点との距離が格納されます。
[in]triangle_point0三角形の頂点を示す3次元ベクトル
[in]triangle_point1三角形の頂点を示す3次元ベクトル
[in]triangle_point2三角形の頂点を示す3次元ベクトル
[in]ray_point半直線の起点の位置を示す3次元ベクトル
[in]ray_dir_normalized半直線の方向を表す単位ベクトル
戻り値
交差している場合はtrue

このクラス詳解は次のファイルから抽出されました: