nlib
nn::nlib::simd::Intersection Class Reference

The class with the collection of functions that determine intersections. More...

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

Public Types

enum  PlaneResult {
  kPlaneFront = 0,
  kPlaneInterect = 1,
  kPlaneBack = 2
}
 The return value types when determining intersection with a plane. The front of the plane is on the same side as the same direction of the normal of the plane. More...
 

Static Public Member Functions

static SimdVector PlaneLine (SimdPlaneArg plane, SimdVectorArg line_point, SimdVectorArg line_dir_normalized) noexcept
 Calculates the point where a line intersects with a plane in three-dimensional space. More...
 
static SimdVector PlaneRay (SimdPlaneArg plane, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Calculates the point where a ray intersects with a plane in three-dimensional space. More...
 
static SimdVector PlaneSegment (SimdPlaneArg plane, SimdVectorArg segment_point0, SimdVectorArg segment_point1) noexcept
 Calculates the point where a line segment intersects with a plane in three-dimensional space. More...
 
static bool SphereRay (float *distance, SimdSphereArg sphere, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Determines whether a sphere and ray intersect in three-dimensional space. More...
 
static bool TriangleRay (float *distance, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Determines whether a triangle and ray intersect in three-dimensional space. More...
 
static PlaneResult TrianglePlane (SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2, SimdPlaneArg plane_normalized) noexcept
 Determines whether a triangle and plane intersect in three-dimensional space. More...
 
static PlaneResult SpherePlane (SimdSphereArg sphere, SimdPlaneArg plane_normalized) noexcept
 Determines whether a sphere and plane intersect in three-dimensional space. More...
 
static bool SphereSphere (SimdSphereArg sphere0, SimdSphereArg sphere1) noexcept
 Determines whether two spheres intersect in three-dimensional space. More...
 
static f128x2 PlanePlane (SimdPlaneArg plane0, SimdPlaneArg plane1) noexcept
 Determines whether two planes intersect in three-dimensional space. More...
 
static bool SphereTriangle (SimdSphereArg sphere, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 Determines whether a sphere and triangle intersect in three-dimensional space. More...
 
static PlaneResult AxisAlignedBoxPlane (const AxisAlignedBox &aabb, SimdPlaneArg plane_normalized) noexcept
 Determines whether an AABB and plane intersect in three-dimensional space. More...
 
static bool AxisAlignedBoxRay (const AxisAlignedBox &aabb, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Determines whether an AABB and ray intersect in three-dimensional space. More...
 
static bool AxisAlignedBoxSphere (const AxisAlignedBox &aabb, SimdSphereArg sphere) noexcept
 Determines whether an AABB and sphere intersect in three-dimensional space. More...
 
static bool AxisAlignedBoxAxisAlignedBox (const AxisAlignedBox &aabb0, const AxisAlignedBox &aabb1) noexcept
 Determines whether two AABBs intersect in three-dimensional space. More...
 
static bool AxisAlignedBoxTriangle (const AxisAlignedBox &aabb, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 Determines whether an AABB and triangle intersect in three-dimensional space. More...
 
static bool OrientedBoxSphere (const OrientedBox &box, SimdSphereArg sphere) noexcept
 Determines whether an OBB and sphere intersect in three-dimensional space. More...
 
static bool OrientedBoxAxisAlignedBox (const OrientedBox &box, const AxisAlignedBox &aabb) noexcept
 Determines whether an OBB and AABB intersect in three-dimensional space. More...
 
static bool OrientedBoxOrientedBox (const OrientedBox &box0, const OrientedBox &box1) noexcept
 Determines whether two OBBs intersect in three-dimensional space. More...
 
static bool OrientedBoxTriangle (const OrientedBox &box, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 Determines whether an OBB and triangle intersect in three-dimensional space. More...
 
static PlaneResult OrientedBoxPlane (const OrientedBox &box, SimdPlaneArg plane_normalized) noexcept
 Determines whether an OBB and plane intersect in three-dimensional space. More...
 
static bool OrientedBoxRay (const OrientedBox &box, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Determines whether an OBB and ray intersect in three-dimensional space. More...
 
static bool FrustumSphere (const Frustum &frustum, SimdSphereArg sphere) noexcept
 Determines whether a frustum and sphere intersect. More...
 
static bool FrustumAxisAlignedBox (const Frustum &frustum, const AxisAlignedBox &aabb) noexcept
 Determines whether a frustum and AABB intersect. More...
 
static bool FrustumOrientedBox (const Frustum &frustum, const OrientedBox &obb) noexcept
 Determines whether a frustum and OBB intersect. More...
 
static bool FrustumTriangle (const Frustum &frustum, SimdVectorArg triangle_point0, SimdVectorArg triangle_point1, SimdVectorArg triangle_point2) noexcept
 Determines whether a frustum and triangle intersect. More...
 
static PlaneResult FrustumPlane (const Frustum &frustum, SimdPlaneArg plane) noexcept
 Determines whether a frustum and plane intersect. More...
 
static bool FrustumRay (const Frustum &frustum, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Determines whether a frustum and ray intersect. More...
 

Detailed Description

The class with the collection of functions that determine intersections.

Description
All members of this class are static functions. The class cannot be instantiated.

Definition at line 191 of file SimdGeometry.h.

Member Enumeration Documentation

◆ PlaneResult

The return value types when determining intersection with a plane. The front of the plane is on the same side as the same direction of the normal of the plane.

Enumerator
kPlaneFront 

The target object is in front of the plane.

kPlaneInterect 

The target object intersects with the plane.

kPlaneBack 

The target object is behind the plane.

Definition at line 194 of file SimdGeometry.h.

Member Function Documentation

◆ AxisAlignedBoxAxisAlignedBox()

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

Determines whether two AABBs intersect in three-dimensional space.

Parameters
[in]aabb0An AABB in three-dimensional space.
[in]aabb1An AABB in three-dimensional space.
Returns
Returns true if they intersect.

◆ AxisAlignedBoxPlane()

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

Determines whether an AABB and plane intersect in three-dimensional space.

Parameters
[in]aabbAn AABB in three-dimensional space.
[in]plane_normalizedThe normalized plane in three-dimensional space.
Returns
The positional relation of the AABB and the plane in three-dimensional space.

◆ AxisAlignedBoxRay()

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

Determines whether an AABB and ray intersect in three-dimensional space.

Parameters
[in]aabbAn AABB in three-dimensional space.
[in]ray_pointA three-dimensional vector representing the starting point of the ray.
[in]ray_dir_normalizedA unit vector representing the direction of the ray.
Returns
Returns true if they intersect.

◆ AxisAlignedBoxSphere()

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

Determines whether an AABB and sphere intersect in three-dimensional space.

Parameters
[in]aabbAn AABB in three-dimensional space.
[in]sphereA sphere in three-dimensional space.
Returns
Returns true if they intersect.

◆ AxisAlignedBoxTriangle()

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

Determines whether an AABB and triangle intersect in three-dimensional space.

Parameters
[in]aabbAn AABB in three-dimensional space.
[in]triangle_point0A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point1A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point2A three-dimensional vector representing a vertex of the triangle.
Returns
Returns true if they intersect.

◆ FrustumAxisAlignedBox()

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

Determines whether a frustum and AABB intersect.

Parameters
[in]frustumA frustum.
[in]aabbAn AABB in three-dimensional space.
Returns
Returns true if they intersect.

◆ FrustumOrientedBox()

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

Determines whether a frustum and OBB intersect.

Parameters
[in]frustumA frustum.
[in]obbAn OBB in three-dimensional space.
Returns
Returns true if they intersect.

◆ FrustumPlane()

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

Determines whether a frustum and plane intersect.

Parameters
[in]frustumA frustum.
[in]planeA plane in three-dimensional space.
Returns
Returns true if they intersect.

◆ FrustumRay()

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

Determines whether a frustum and ray intersect.

Parameters
[in]frustumA frustum.
[in]ray_pointA three-dimensional vector representing the starting point of the ray.
[in]ray_dir_normalizedA unit vector representing the direction of the ray.
Returns
Returns true if they intersect.

◆ FrustumSphere()

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

Determines whether a frustum and sphere intersect.

Parameters
[in]frustumA frustum.
[in]sphereA sphere in three-dimensional space.
Returns
Returns true if they intersect.

◆ FrustumTriangle()

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

Determines whether a frustum and triangle intersect.

Parameters
[in]frustumA frustum.
[in]triangle_point0A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point1A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point2A three-dimensional vector representing a vertex of the triangle.
Returns
Returns true if they intersect.

◆ OrientedBoxAxisAlignedBox()

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

Determines whether an OBB and AABB intersect in three-dimensional space.

Parameters
[in]boxAn OBB in three-dimensional space.
[in]aabbAn AABB in three-dimensional space.
Returns
Returns true if they intersect.

◆ OrientedBoxOrientedBox()

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

Determines whether two OBBs intersect in three-dimensional space.

Parameters
[in]box0An OBB in three-dimensional space.
[in]box1An OBB in three-dimensional space.
Returns
Returns true if they intersect.

◆ OrientedBoxPlane()

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

Determines whether an OBB and plane intersect in three-dimensional space.

Parameters
[in]boxAn OBB in three-dimensional space.
[in]plane_normalizedThe normalized plane in three-dimensional space.
Returns
The positional relation of the OBB and the plane in three-dimensional space.

◆ OrientedBoxRay()

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

Determines whether an OBB and ray intersect in three-dimensional space.

Parameters
[in]boxAn OBB in three-dimensional space.
[in]ray_pointA three-dimensional vector representing the starting point of the ray.
[in]ray_dir_normalizedA unit vector representing the direction of the ray.
Returns
Returns true if they intersect.

◆ OrientedBoxSphere()

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

Determines whether an OBB and sphere intersect in three-dimensional space.

Parameters
[in]boxAn OBB in three-dimensional space.
[in]sphereA sphere in three-dimensional space.
Returns
Returns true if they intersect.

◆ OrientedBoxTriangle()

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

Determines whether an OBB and triangle intersect in three-dimensional space.

Parameters
[in]boxAn OBB in three-dimensional space.
[in]triangle_point0A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point1A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point2A three-dimensional vector representing a vertex of the triangle.
Returns
Returns true if they intersect.

◆ PlaneLine()

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

Calculates the point where a line intersects with a plane in three-dimensional space.

Parameters
[in]planeA plane in three-dimensional space.
[in]line_pointA three-dimensional vector representing the position of a point on a line.
[in]line_dir_normalizedA unit vector representing the direction of the line.
Returns
A three-dimensional vector representing the intersection of the plane and the line.
Description
If there is no point of intersection (because the line and the plane are parallel to each other) the function returns a vector with NaN set for each element.

◆ PlanePlane()

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

Determines whether two planes intersect in three-dimensional space.

Parameters
[in]plane0A plane in three-dimensional space.
[in]plane1A plane in three-dimensional space.
Returns
Returns two points on the line where they intersect in three-dimensional space.
Description
If there is no point of intersection (because the planes are parallel) the function returns a vector with NaN set for each element.

◆ PlaneRay()

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

Calculates the point where a ray intersects with a plane in three-dimensional space.

Parameters
[in]planeA plane in three-dimensional space.
[in]ray_pointA three-dimensional vector representing the starting point of the ray.
[in]ray_dir_normalizedA unit vector representing the direction of the ray.
Returns
A three-dimensional vector representing the intersection of the plane and the ray.
Description
If there is no point of intersection, the function returns a vector with NaN set for each element.

◆ PlaneSegment()

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

Calculates the point where a line segment intersects with a plane in three-dimensional space.

Parameters
[in]planeA plane in three-dimensional space.
[in]segment_point0The starting point of the line segment.
[in]segment_point1The ending point of the line segment.
Returns
A three-dimensional vector representing the intersection of the plane and the line segment.
Description
If there is no point of intersection, the function returns a vector with NaN set for each element.

◆ SpherePlane()

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

Determines whether a sphere and plane intersect in three-dimensional space.

Parameters
[in]sphereA sphere in three-dimensional space.
[in]plane_normalizedThe normalized plane in three-dimensional space.
Returns
The positional relation of the sphere and the plane.

◆ SphereRay()

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

Determines whether a sphere and ray intersect in three-dimensional space.

Parameters
[out]distanceIf not NULL and they intersect, stores the distance from the starting point of the ray to the point of intersection.
[in]sphereA sphere in three-dimensional space.
[in]ray_pointA three-dimensional vector representing the starting point of the ray.
[in]ray_dir_normalizedA unit vector representing the direction of the ray.
Returns
Returns true if they intersect.

◆ SphereSphere()

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

Determines whether two spheres intersect in three-dimensional space.

Parameters
[in]sphere0A sphere in three-dimensional space.
[in]sphere1A sphere in three-dimensional space.
Returns
Returns true if they intersect.

◆ SphereTriangle()

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

Determines whether a sphere and triangle intersect in three-dimensional space.

Parameters
[in]sphereA sphere in three-dimensional space.
[in]triangle_point0A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point1A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point2A three-dimensional vector representing a vertex of the triangle.
Returns
Returns true if they intersect.

◆ TrianglePlane()

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

Determines whether a triangle and plane intersect in three-dimensional space.

Parameters
[in]triangle_point0A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point1A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point2A three-dimensional vector representing a vertex of the triangle.
[in]plane_normalizedThe normalized plane in three-dimensional space.
Returns
The positional relation of the triangle and the plane.

◆ 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

Determines whether a triangle and ray intersect in three-dimensional space.

Parameters
[out]distanceIf not NULL and they intersect, stores the distance from the starting point of the ray to the point of intersection.
[in]triangle_point0A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point1A three-dimensional vector representing a vertex of the triangle.
[in]triangle_point2A three-dimensional vector representing a vertex of the triangle.
[in]ray_pointA three-dimensional vector representing the starting point of the ray.
[in]ray_dir_normalizedA unit vector representing the direction of the ray.
Returns
Returns true if they intersect.

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