nlib
nn::nlib::simd::DistanceSq Class Reference

The class with the collection of functions that perform square-of-distance calculations. More...

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

Static Public Member Functions

static f128 PointLine (SimdVectorArg point, SimdVectorArg line_point, SimdVectorArg line_dir_normalized) noexcept
 Calculates the distance between a line and a point in three-dimensional space. More...
 
static f128 PointRay (SimdVectorArg point, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Calculates the distance between a ray (a half-line) and a point in three-dimensional space. More...
 
static f128 PointSegment (SimdVectorArg point, SimdVectorArg segment_point0, SimdVectorArg segment_point1) noexcept
 Calculates the distance between a line segment and a point in three-dimensional space. More...
 
static f128 PointPlane (SimdVector *point_on_plane, SimdVectorArg point, SimdPlaneArg plane_normalized) noexcept
 Calculates the distance between a point and a plane in three-dimensional space. More...
 
static f128 SpherePlane (SimdSphereArg sphere, SimdPlaneArg plane_normalized) noexcept
 Calculates the distance between a sphere and a plane in three-dimensional space. More...
 
static f128 PointAxisAlignedBox (SimdVector *point_on_box, SimdVectorArg point, const AxisAlignedBox &aabb) noexcept
 Calculates the distance between a point and an AABB in three-dimensional space. More...
 
static f128 LineLine (SimdVector *point_on_line0, SimdVector *point_on_line1, SimdVectorArg line0_point, SimdVectorArg line0_dir_normalized, SimdVectorArg line1_point, SimdVectorArg line1_dir_normalized) noexcept
 Calculates the distance between two lines in three-dimensional space. More...
 
static f128 SegmentSegment (SimdVector *point_on_segment0, SimdVector *point_on_segment1, SimdVectorArg segment0_point0, SimdVectorArg segment0_point1, SimdVectorArg segment1_point0, SimdVectorArg segment1_point1) noexcept
 Calculates the distance between a line segment and a line segment in three-dimensional space. More...
 
static f128 LineRay (SimdVector *point_on_line, SimdVector *point_on_ray, SimdVectorArg line_point, SimdVectorArg line_dir_normalized, SimdVectorArg ray_point, SimdVectorArg ray_dir_normalized) noexcept
 Calculates the distance between a line and a ray in three-dimensional space. More...
 
static f128 LineSegment (SimdVector *point_on_line, SimdVector *point_on_segment, SimdVectorArg line_point, SimdVectorArg line_dir_normalized, SimdVectorArg segment_point0, SimdVectorArg segment_point1) noexcept
 Calculates the distance between a line and a line segment in three-dimensional space. More...
 
static f128 RayRay (SimdVector *point_on_ray0, SimdVector *point_on_ray1, SimdVectorArg ray0_point, SimdVectorArg ray0_dir_normalized, SimdVectorArg ray1_point, SimdVectorArg ray1_dir_normalized) noexcept
 Calculates the distance between a ray and a ray in three-dimensional space. More...
 
static f128 RaySegment (SimdVector *point_on_ray, SimdVector *point_on_segment, SimdVectorArg ray_point0, SimdVectorArg ray_dir_normalized, SimdVectorArg segment_point0, SimdVectorArg segment_point1) noexcept
 Calculates the distance between a ray and a line segment in three-dimensional space. More...
 

Detailed Description

The class with the collection of functions that perform square-of-distance calculations.

Definition at line 147 of file SimdGeometry.h.

Member Function Documentation

◆ LineLine()

nn::nlib::simd::DistanceSq::LineLine ( SimdVector point_on_line0,
SimdVector point_on_line1,
SimdVectorArg  line0_point,
SimdVectorArg  line0_dir_normalized,
SimdVectorArg  line1_point,
SimdVectorArg  line1_dir_normalized 
)
staticnoexcept

Calculates the distance between two lines in three-dimensional space.

Parameters
[out]point_on_line0If not NULL, stores the point on line 0 that is nearest to line 1.
[out]point_on_line1If not NULL, stores the point on line 1 that is nearest to line 0.
[in]line0_pointA three-dimensional vector representing the position of a point on line 0.
[in]line0_dir_normalizedA unit vector representing the direction of line 0.
[in]line1_pointA three-dimensional vector representing the position of a point on line 1.
[in]line1_dir_normalizedA unit vector representing the direction of line 1.
Returns
The distance is stored in each lane.

◆ LineRay()

nn::nlib::simd::DistanceSq::LineRay ( SimdVector point_on_line,
SimdVector point_on_ray,
SimdVectorArg  line_point,
SimdVectorArg  line_dir_normalized,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

Calculates the distance between a line and a ray in three-dimensional space.

Parameters
[out]point_on_lineIf not NULL, stores the point on the line that is nearest to the ray.
[out]point_on_rayIf not NULL, stores the point on the ray that is nearest to the line.
[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.
[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
The distance is stored in each lane.

◆ LineSegment()

nn::nlib::simd::DistanceSq::LineSegment ( SimdVector point_on_line,
SimdVector point_on_segment,
SimdVectorArg  line_point,
SimdVectorArg  line_dir_normalized,
SimdVectorArg  segment_point0,
SimdVectorArg  segment_point1 
)
staticnoexcept

Calculates the distance between a line and a line segment in three-dimensional space.

Parameters
[out]point_on_lineIf not NULL, stores the point on the line that is nearest to the line segment.
[out]point_on_segmentIf not NULL, stores the point on the line segment that is nearest to the line.
[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.
[in]segment_point0The starting point of the line segment.
[in]segment_point1The ending point of the line segment.
Returns
The distance is stored in each lane.

◆ PointAxisAlignedBox()

nn::nlib::simd::DistanceSq::PointAxisAlignedBox ( SimdVector point_on_box,
SimdVectorArg  point,
const AxisAlignedBox aabb 
)
staticnoexcept

Calculates the distance between a point and an AABB in three-dimensional space.

Parameters
[out]point_on_boxIf not NULL, stores the point where point projects on the AABB.
[in]pointA point in three-dimensional space.
[in]aabbAABB
Returns
The distance is stored in each lane.

◆ PointLine()

nn::nlib::simd::DistanceSq::PointLine ( SimdVectorArg  point,
SimdVectorArg  line_point,
SimdVectorArg  line_dir_normalized 
)
staticnoexcept

Calculates the distance between a line and a point in three-dimensional space.

Parameters
[in]pointA point 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
The distance is stored in each lane.

◆ PointPlane()

nn::nlib::simd::DistanceSq::PointPlane ( SimdVector point_on_plane,
SimdVectorArg  point,
SimdPlaneArg  plane_normalized 
)
staticnoexcept

Calculates the distance between a point and a plane in three-dimensional space.

Parameters
[out]point_on_planeIf not NULL, stores the point where point projects on the plane.
[in]pointA point in three-dimensional space.
[in]plane_normalizedThe normalized plane in three-dimensional space.
Returns
The distance is stored in each lane.

◆ PointRay()

nn::nlib::simd::DistanceSq::PointRay ( SimdVectorArg  point,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized 
)
staticnoexcept

Calculates the distance between a ray (a half-line) and a point in three-dimensional space.

Parameters
[in]pointA point in three-dimensional space.
[in]ray_pointThe starting point of the ray in three-dimensional space.
[in]ray_dir_normalizedA unit vector representing the direction of the ray.
Returns
The distance is stored in each lane.

◆ PointSegment()

nn::nlib::simd::DistanceSq::PointSegment ( SimdVectorArg  point,
SimdVectorArg  segment_point0,
SimdVectorArg  segment_point1 
)
staticnoexcept

Calculates the distance between a line segment and a point in three-dimensional space.

Parameters
[in]pointA point in three-dimensional space.
[in]segment_point0The starting point of the line segment in three-dimensional space.
[in]segment_point1The ending point of the line segment in three-dimensional space.
Returns
The distance is stored in each lane.

◆ RayRay()

nn::nlib::simd::DistanceSq::RayRay ( SimdVector point_on_ray0,
SimdVector point_on_ray1,
SimdVectorArg  ray0_point,
SimdVectorArg  ray0_dir_normalized,
SimdVectorArg  ray1_point,
SimdVectorArg  ray1_dir_normalized 
)
staticnoexcept

Calculates the distance between a ray and a ray in three-dimensional space.

Parameters
[out]point_on_ray0If not NULL, stores the point on ray 0 that is nearest to ray 1.
[out]point_on_ray1If not NULL, stores the point on ray 1 that is nearest to ray 0.
[in]ray0_pointA three-dimensional vector representing the starting point of ray 0.
[in]ray0_dir_normalizedA unit vector representing the direction of ray 0.
[in]ray1_pointA three-dimensional vector representing the starting point of ray 1.
[in]ray1_dir_normalizedA unit vector representing the direction of ray 1.
Returns
The distance is stored in each lane.

◆ RaySegment()

nn::nlib::simd::DistanceSq::RaySegment ( SimdVector point_on_ray,
SimdVector point_on_segment,
SimdVectorArg  ray_point,
SimdVectorArg  ray_dir_normalized,
SimdVectorArg  segment_point0,
SimdVectorArg  segment_point1 
)
staticnoexcept

Calculates the distance between a ray and a line segment in three-dimensional space.

Parameters
[out]point_on_rayIf not NULL, stores the point on the ray that is nearest to the line segment.
[out]point_on_segmentIf not NULL, stores the point on the line segment that is nearest to the ray.
[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.
[in]segment_point0The starting point of the line segment.
[in]segment_point1The ending point of the line segment.
Returns
The distance is stored in each lane.

◆ SegmentSegment()

nn::nlib::simd::DistanceSq::SegmentSegment ( SimdVector point_on_segment0,
SimdVector point_on_segment1,
SimdVectorArg  segment0_point0,
SimdVectorArg  segment0_point1,
SimdVectorArg  segment1_point0,
SimdVectorArg  segment1_point1 
)
staticnoexcept

Calculates the distance between a line segment and a line segment in three-dimensional space.

Parameters
[out]point_on_segment0If not NULL, stores the point on line segment 0 that is nearest to line segment 1.
[out]point_on_segment1If not NULL, stores the point on line segment 1 that is nearest to line segment 0.
[in]segment0_point0The starting point of line segment 0.
[in]segment0_point1The ending point of line segment 0.
[in]segment1_point0The starting point of line segment 1.
[in]segment1_point1The ending point of line segment 1.
Returns
The distance is stored in each lane.

◆ SpherePlane()

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

Calculates the distance between a sphere and a plane in three-dimensional space.

Parameters
[in]sphereA sphere in three-dimensional space.
[in]plane_normalizedThe normalized plane in three-dimensional space.
Returns
The distance is stored in each lane.

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