PixelLightAPI
.
|
Static class with some useful intersection tools. More...
#include <Intersect.h>
Static Public Member Functions | |
static PLMATH_API bool | SpherePoint (const Sphere &cSphere, const Vector3 &cPoint) |
Check whether there's a sphere/point intersection. | |
static PLMATH_API bool | SpherePoint (const Sphere &cSphere, const Vector4 &cPoint) |
static PLMATH_API float | SphereRay (const Sphere &cSphere, const Vector3 &vRayOrigin, const Vector3 &vRayDir) |
Check whether there's a sphere/ray intersection. | |
static PLMATH_API bool | SphereRay (const Sphere &cSphere, const Vector3 &vRayOrigin, const Vector3 &vRayDirection, Vector3 *pvIntersect=nullptr) |
Check whether there's a sphere/ray intersection. | |
static PLMATH_API bool | SphereRay (const Sphere &cSphere, const Vector3 &vRayOrigin, const Vector3 &vRayDirection, float fDistance, Vector3 *pvIntersect=nullptr) |
Check whether there's a sphere/ray intersection. | |
static PLMATH_API bool | SphereRayInFront (const Sphere &cSphere, const Vector3 &vRayOrigin, const Vector3 &vRayDirection, Vector3 *pvIntersect=nullptr) |
Check whether there's a sphere/ray intersection. | |
static PLMATH_API bool | SphereLine (const Sphere &cSphere, const Vector3 &vStart, const Vector3 &vEnd) |
Check whether there's a sphere/line intersection. | |
static PLMATH_API bool | SphereSphere (const Sphere &cSphere, const Vector3 &vPos, float fRadius) |
Check whether there's a sphere/sphere intersection. | |
static PLMATH_API bool | SphereSphere (const Sphere &cSphere, const Sphere &cSphere2) |
Check whether there's a sphere/sphere intersection. | |
static PLMATH_API bool | SphereSphere (const Sphere &cSphere, const Sphere &cSphere2, const Vector3 &vMove1, const Vector3 &vMove2) |
Check whether a sphere intersects with this sphere while moving. | |
static PLMATH_API bool | SphereAABox (const Vector3 &vSpherePos, float fSphereRadius, const AABoundingBox &cAABox) |
Check whether there's a sphere/axis aligned box intersection. | |
static PLMATH_API bool | SphereAABox (const Sphere &cSphere, const AABoundingBox &cAABox) |
Check whether there's a sphere/axis aligned box intersection. | |
static PLMATH_API bool | SphereBox (const Vector3 &vSpherePos, float fSphereRadius, const BoundingBox &cBox) |
Check whether there's a sphere/box intersection. | |
static PLMATH_API bool | SphereBox (const Sphere &cSphere, const BoundingBox &cBox) |
Check whether there's a sphere/box intersection. | |
static PLMATH_API bool | AABoxPoint (const Vector3 &vAABoxMin, const Vector3 &vAABoxMax, const Vector3 &vPos) |
Check whether a point is inside the axis aligned box. | |
static PLMATH_API bool | AABoxLine (const Vector3 &vAABoxMin, const Vector3 &vAABoxMax, const Vector3 &vStart, const Vector3 &vEnd, float *pfIntersection=nullptr) |
Check whether there's a axis aligned box/line intersection. | |
static PLMATH_API bool | AABoxLine (const Vector3 &vAABoxMin, const Vector3 &vAABoxMax, const Line &cLine, float *pfIntersection=nullptr) |
Check whether there's a axis aligned box/line intersection. | |
static PLMATH_API bool | AABoxSphere (const Vector3 &vAABoxMin, const Vector3 &vAABoxMax, const Vector3 &vSpherePos, float fSphereRadius) |
Check whether there's a axis aligned box/sphere intersection. | |
static PLMATH_API bool | AABoxAABox (const Vector3 &vAABoxMin1, const Vector3 &vAABoxMax1, const Vector3 &vAABoxMin2, const Vector3 &vAABoxMax2) |
Check whether there's a axis aligned box/axis aligned box intersection. | |
static PLMATH_API bool | AABoxAABox (const AABoundingBox &cBox1, const AABoundingBox &cBox2) |
Check whether there's a axis aligned box/axis aligned box intersection. | |
static PLMATH_API bool | BoxPoint (const BoundingBox &cBox, const Vector3 &vPos) |
Check whether a point is inside the box. | |
static PLMATH_API bool | BoxLine (const BoundingBox &cBox, const Vector3 &vA, const Vector3 &vB) |
Check whether a line intersects with the box. | |
static PLMATH_API bool | BoxBox (const BoundingBox &cBox1, const BoundingBox &cBox2) |
Check whether another box intersects with this box. | |
static PLMATH_API bool | BoxBox (const BoundingBox &cBox1, const BoundingBox &cBox2, const Vector3 &vMove1, const Vector3 &vMove2) |
Check whether another box intersects with this box while moving. | |
static PLMATH_API bool | BoxPlaneSet (const BoundingBox &cBox, const PlaneSet &cPlaneSet) |
Check whether the box is in the plane set or not. | |
static PLMATH_API bool | IsPlaneRay (const Plane &cPlane, const Vector3 &vRayDir) |
Checks if there's a plane/ray intersection. | |
static PLMATH_API Vector3 | PlaneRay (const Plane &cPlane, const Vector3 &vRayPos, const Vector3 &vRayDir) |
Returns the plane/ray intersection point. | |
static PLMATH_API float | PlaneLine (const Plane &cPlane, const Vector3 &vStartPos, const Vector3 &vEndPos, Vector3 *pvPos=nullptr) |
Checks if there's a plane/line intersection. | |
static PLMATH_API bool | PlanePlane (const Plane &cPlane, const Plane &cPlane2) |
Checks if there's a plane/plane intersection. | |
static PLMATH_API bool | PlanePlane (const Plane &cPlane, const Plane &cPlane2, Ray &cRay) |
Checks if there's a plane/plane intersection and calculates the intersection ray. | |
static PLMATH_API bool | PlanePlanePlane (const Plane &cP1, const Plane &cP2, const Plane &cP3, Vector3 &vRes) |
Checks if there's an intersection between the three planes and returns the intersection point. | |
static PLMATH_API bool | PlaneSetPoint (const PlaneSet &cPlaneSet, const Vector3 &vPoint) |
Test whether a point is in the plane set. | |
static PLMATH_API bool | PlaneSetPoint (const PlaneSet &cPlaneSet, const Vector4 &vPoint) |
Test whether a point is in the plane set. | |
static PLMATH_API bool | PlaneSetPoints (const PlaneSet &cPlaneSet, const PLCore::Array< Vector3 > &lstPoints) |
Test whether the given points are in the plane set. | |
static PLMATH_API bool | PlaneSetPoints (const PlaneSet &cPlaneSet, const PLCore::Array< Vector4 > &lstPoints) |
Test whether the given points are in the plane set. | |
static PLMATH_API bool | PlaneSetSphere (const PlaneSet &cPlaneSet, const Vector3 &vSphereOrigin, float fSphereRadius) |
Test whether a sphere is in the plane set. | |
static PLMATH_API bool | PlaneSetTriangle (const PlaneSet &cPlaneSet, const Vector3 &vV1, const Vector3 &vV2, const Vector3 &vV3) |
Test whether a triangle is in the plane set. | |
static PLMATH_API bool | PlaneSetAABox (const PlaneSet &cPlaneSet, const Vector3 &vMin, const Vector3 &vMax, PLCore::uint32 *pnOutClipMask=nullptr) |
Tests whether an axis aligned box is within the plane set or not. | |
static PLMATH_API bool | TriangleRay (const Vector3 &vV1, const Vector3 &vV2, const Vector3 &vV3, const Vector3 &vN, const Vector3 &vRayOrigin, const Vector3 &vRayDirection, Vector3 *pvIntersectionPointPos=nullptr) |
Checks if there's a triangle/ray intersection. | |
static PLMATH_API bool | TriangleRay (const Vector3 &vV1, const Vector3 &vV2, const Vector3 &vV3, const Vector3 &vN, const Ray &cRay, Vector3 *pvIntersectionPointPos=nullptr) |
Checks if there's a triangle/ray intersection. |
Static class with some useful intersection tools.
static PLMATH_API bool PLMath::Intersect::SpherePoint | ( | const Sphere & | cSphere, |
const Vector3 & | cPoint | ||
) | [static] |
Check whether there's a sphere/point intersection.
[in] | cSphere | Sphere to check |
[in] | cPoint | Point to check |
static PLMATH_API bool PLMath::Intersect::SpherePoint | ( | const Sphere & | cSphere, |
const Vector4 & | cPoint | ||
) | [static] |
static PLMATH_API float PLMath::Intersect::SphereRay | ( | const Sphere & | cSphere, |
const Vector3 & | vRayOrigin, | ||
const Vector3 & | vRayDir | ||
) | [static] |
static PLMATH_API bool PLMath::Intersect::SphereRay | ( | const Sphere & | cSphere, |
const Vector3 & | vRayOrigin, | ||
const Vector3 & | vRayDirection, | ||
Vector3 * | pvIntersect = nullptr |
||
) | [static] |
Check whether there's a sphere/ray intersection.
[in] | cSphere | Sphere to check |
[in] | vRayOrigin | Ray origin |
[in] | vRayDirection | Ray direction vector |
[out] | pvIntersect | If not a null pointer, will receive the intersection point (if there's one) |
static PLMATH_API bool PLMath::Intersect::SphereRay | ( | const Sphere & | cSphere, |
const Vector3 & | vRayOrigin, | ||
const Vector3 & | vRayDirection, | ||
float | fDistance, | ||
Vector3 * | pvIntersect = nullptr |
||
) | [static] |
Check whether there's a sphere/ray intersection.
[in] | cSphere | Sphere to check |
[in] | vRayOrigin | Ray origin |
[in] | vRayDirection | Ray direction vector |
[in] | fDistance | Ray 'length' |
[out] | pvIntersect | If not a null pointer, will receive the intersection point (if there's one) |
static PLMATH_API bool PLMath::Intersect::SphereRayInFront | ( | const Sphere & | cSphere, |
const Vector3 & | vRayOrigin, | ||
const Vector3 & | vRayDirection, | ||
Vector3 * | pvIntersect = nullptr |
||
) | [static] |
Check whether there's a sphere/ray intersection.
[in] | cSphere | Sphere to check |
[in] | vRayOrigin | Ray origin |
[in] | vRayDirection | Ray direction vector |
[out] | pvIntersect | If not a null pointer, will receive the intersection point (if there's one) |
static PLMATH_API bool PLMath::Intersect::SphereLine | ( | const Sphere & | cSphere, |
const Vector3 & | vStart, | ||
const Vector3 & | vEnd | ||
) | [static] |
static PLMATH_API bool PLMath::Intersect::SphereSphere | ( | const Sphere & | cSphere, |
const Vector3 & | vPos, | ||
float | fRadius | ||
) | [static] |
Check whether there's a sphere/sphere intersection.
[in] | cSphere | Sphere to check |
[in] | vPos | Second sphere position |
[in] | fRadius | Second sphere radius |
static PLMATH_API bool PLMath::Intersect::SphereSphere | ( | const Sphere & | cSphere, |
const Sphere & | cSphere2 | ||
) | [static] |
Check whether there's a sphere/sphere intersection.
[in] | cSphere | Sphere to check |
[in] | cSphere2 | Second sphere to check |
static PLMATH_API bool PLMath::Intersect::SphereSphere | ( | const Sphere & | cSphere, |
const Sphere & | cSphere2, | ||
const Vector3 & | vMove1, | ||
const Vector3 & | vMove2 | ||
) | [static] |
Check whether a sphere intersects with this sphere while moving.
[in] | cSphere | Sphere to check |
[in] | cSphere2 | Second sphere to test |
[in] | vMove1 | Movement vector of this sphere |
[in] | vMove2 | Movement vector of the other sphere box |
static PLMATH_API bool PLMath::Intersect::SphereAABox | ( | const Vector3 & | vSpherePos, |
float | fSphereRadius, | ||
const AABoundingBox & | cAABox | ||
) | [static] |
Check whether there's a sphere/axis aligned box intersection.
[in] | vSpherePos | Position of the sphere to check |
[in] | fSphereRadius | Radius of the sphere to check |
[in] | cAABox | Axis aligned box to check |
static PLMATH_API bool PLMath::Intersect::SphereAABox | ( | const Sphere & | cSphere, |
const AABoundingBox & | cAABox | ||
) | [static] |
Check whether there's a sphere/axis aligned box intersection.
[in] | cSphere | Sphere to check |
[in] | cAABox | Axis aligned box to check |
static PLMATH_API bool PLMath::Intersect::SphereBox | ( | const Vector3 & | vSpherePos, |
float | fSphereRadius, | ||
const BoundingBox & | cBox | ||
) | [static] |
Check whether there's a sphere/box intersection.
[in] | vSpherePos | Position of the sphere to check |
[in] | fSphereRadius | Radius of the sphere to check |
[in] | cBox | Box to check |
static PLMATH_API bool PLMath::Intersect::SphereBox | ( | const Sphere & | cSphere, |
const BoundingBox & | cBox | ||
) | [static] |
Check whether there's a sphere/box intersection.
[in] | cSphere | Sphere to check |
[in] | cBox | Box to check |
static PLMATH_API bool PLMath::Intersect::AABoxPoint | ( | const Vector3 & | vAABoxMin, |
const Vector3 & | vAABoxMax, | ||
const Vector3 & | vPos | ||
) | [static] |
Check whether a point is inside the axis aligned box.
[in] | vAABoxMin | Axis aligned box minimum position |
[in] | vAABoxMax | Axis aligned box box maximum position |
[in] | vPos | Point to test |
static PLMATH_API bool PLMath::Intersect::AABoxLine | ( | const Vector3 & | vAABoxMin, |
const Vector3 & | vAABoxMax, | ||
const Vector3 & | vStart, | ||
const Vector3 & | vEnd, | ||
float * | pfIntersection = nullptr |
||
) | [static] |
Check whether there's a axis aligned box/line intersection.
[in] | vAABoxMin | Axis aligned box minimum position |
[in] | vAABoxMax | Axis aligned box box maximum position |
[in] | vStart | Line start point |
[in] | vEnd | Line end point |
[out] | pfIntersection | Receives the intersection distance if not null, <0 if there's no intersection or when the start point is inside the axis aligned box or when the distance is just negative |
static PLMATH_API bool PLMath::Intersect::AABoxLine | ( | const Vector3 & | vAABoxMin, |
const Vector3 & | vAABoxMax, | ||
const Line & | cLine, | ||
float * | pfIntersection = nullptr |
||
) | [static] |
Check whether there's a axis aligned box/line intersection.
[in] | vAABoxMin | Axis aligned box minimum position |
[in] | vAABoxMax | Axis aligned box box maximum position |
[in] | cLine | Line to check |
[out] | pfIntersection | Receives the intersection distance if not null, <0 if there's no intersection or when the start point is inside the axis aligned box or when the distance is just negative |
static PLMATH_API bool PLMath::Intersect::AABoxSphere | ( | const Vector3 & | vAABoxMin, |
const Vector3 & | vAABoxMax, | ||
const Vector3 & | vSpherePos, | ||
float | fSphereRadius | ||
) | [static] |
Check whether there's a axis aligned box/sphere intersection.
[in] | vAABoxMin | Axis aligned box minimum position |
[in] | vAABoxMax | Axis aligned box box maximum position |
[in] | vSpherePos | Position of the sphere to check |
[in] | fSphereRadius | Radius of the sphere to check |
static PLMATH_API bool PLMath::Intersect::AABoxAABox | ( | const Vector3 & | vAABoxMin1, |
const Vector3 & | vAABoxMax1, | ||
const Vector3 & | vAABoxMin2, | ||
const Vector3 & | vAABoxMax2 | ||
) | [static] |
Check whether there's a axis aligned box/axis aligned box intersection.
[in] | vAABoxMin1 | Axis aligned box minimum position 1 |
[in] | vAABoxMax1 | Axis aligned box box maximum position 1 |
[in] | vAABoxMin2 | Axis aligned box minimum position 2 |
[in] | vAABoxMax2 | Axis aligned box box maximum position 2 |
static PLMATH_API bool PLMath::Intersect::AABoxAABox | ( | const AABoundingBox & | cBox1, |
const AABoundingBox & | cBox2 | ||
) | [static] |
Check whether there's a axis aligned box/axis aligned box intersection.
[in] | cBox1 | Axis aligned box 1 |
[in] | cBox2 | Axis aligned box 2 |
static PLMATH_API bool PLMath::Intersect::BoxPoint | ( | const BoundingBox & | cBox, |
const Vector3 & | vPos | ||
) | [static] |
Check whether a point is inside the box.
[in] | cBox | Box to check |
[in] | vPos | Point to test |
static PLMATH_API bool PLMath::Intersect::BoxLine | ( | const BoundingBox & | cBox, |
const Vector3 & | vA, | ||
const Vector3 & | vB | ||
) | [static] |
static PLMATH_API bool PLMath::Intersect::BoxBox | ( | const BoundingBox & | cBox1, |
const BoundingBox & | cBox2 | ||
) | [static] |
Check whether another box intersects with this box.
[in] | cBox1 | First box to check |
[in] | cBox2 | Second box to test |
static PLMATH_API bool PLMath::Intersect::BoxBox | ( | const BoundingBox & | cBox1, |
const BoundingBox & | cBox2, | ||
const Vector3 & | vMove1, | ||
const Vector3 & | vMove2 | ||
) | [static] |
Check whether another box intersects with this box while moving.
[in] | cBox1 | First box to check |
[in] | cBox2 | Second box to test |
[in] | vMove1 | Movement vector of first box |
[in] | vMove2 | Movement vector of second box |
static PLMATH_API bool PLMath::Intersect::BoxPlaneSet | ( | const BoundingBox & | cBox, |
const PlaneSet & | cPlaneSet | ||
) | [static] |
Check whether the box is in the plane set or not.
[in] | cBox | Box to check |
[in] | cPlaneSet | Plane set to check |
static PLMATH_API bool PLMath::Intersect::IsPlaneRay | ( | const Plane & | cPlane, |
const Vector3 & | vRayDir | ||
) | [static] |
static PLMATH_API Vector3 PLMath::Intersect::PlaneRay | ( | const Plane & | cPlane, |
const Vector3 & | vRayPos, | ||
const Vector3 & | vRayDir | ||
) | [static] |
static PLMATH_API float PLMath::Intersect::PlaneLine | ( | const Plane & | cPlane, |
const Vector3 & | vStartPos, | ||
const Vector3 & | vEndPos, | ||
Vector3 * | pvPos = nullptr |
||
) | [static] |
Checks if there's a plane/line intersection.
[in] | cPlane | Plane to check |
[in] | vStartPos | Line start position |
[in] | vEndPos | Line end direction |
[out] | pvPos | If not a null pointer this will receive the intersection point (if there is any :) |
static PLMATH_API bool PLMath::Intersect::PlanePlane | ( | const Plane & | cPlane, |
const Plane & | cPlane2 | ||
) | [static] |
Checks if there's a plane/plane intersection.
[in] | cPlane | Plane to check |
[in] | cPlane2 | Plane2 to test with |
static PLMATH_API bool PLMath::Intersect::PlanePlane | ( | const Plane & | cPlane, |
const Plane & | cPlane2, | ||
Ray & | cRay | ||
) | [static] |
Checks if there's a plane/plane intersection and calculates the intersection ray.
[in] | cPlane | Plane to check |
[in] | cPlane2 | Second plane |
[out] | cRay | Receives the intersection ray/line |
static PLMATH_API bool PLMath::Intersect::PlanePlanePlane | ( | const Plane & | cP1, |
const Plane & | cP2, | ||
const Plane & | cP3, | ||
Vector3 & | vRes | ||
) | [static] |
Checks if there's an intersection between the three planes and returns the intersection point.
[in] | cP1 | Plane to check |
[in] | cP2 | Plane to intersect with |
[in] | cP3 | Plane to intersect with |
[out] | vRes | Receives the intersection point |
static PLMATH_API bool PLMath::Intersect::PlaneSetPoint | ( | const PlaneSet & | cPlaneSet, |
const Vector3 & | vPoint | ||
) | [static] |
Test whether a point is in the plane set.
[in] | cPlaneSet | Plane set to check |
[in] | vPoint | Position of the point |
static PLMATH_API bool PLMath::Intersect::PlaneSetPoint | ( | const PlaneSet & | cPlaneSet, |
const Vector4 & | vPoint | ||
) | [static] |
Test whether a point is in the plane set.
[in] | cPlaneSet | Plane set to check |
[in] | vPoint | Position of the point |
static PLMATH_API bool PLMath::Intersect::PlaneSetPoints | ( | const PlaneSet & | cPlaneSet, |
const PLCore::Array< Vector3 > & | lstPoints | ||
) | [static] |
Test whether the given points are in the plane set.
[in] | cPlaneSet | Plane set to check |
[in] | lstPoints | Array of all points to test |
static PLMATH_API bool PLMath::Intersect::PlaneSetPoints | ( | const PlaneSet & | cPlaneSet, |
const PLCore::Array< Vector4 > & | lstPoints | ||
) | [static] |
Test whether the given points are in the plane set.
[in] | cPlaneSet | Plane set to check |
[in] | lstPoints | Array of all points to test |
static PLMATH_API bool PLMath::Intersect::PlaneSetSphere | ( | const PlaneSet & | cPlaneSet, |
const Vector3 & | vSphereOrigin, | ||
float | fSphereRadius | ||
) | [static] |
static PLMATH_API bool PLMath::Intersect::PlaneSetTriangle | ( | const PlaneSet & | cPlaneSet, |
const Vector3 & | vV1, | ||
const Vector3 & | vV2, | ||
const Vector3 & | vV3 | ||
) | [static] |
Test whether a triangle is in the plane set.
[in] | cPlaneSet | Plane set to check |
[in] | vV1 | First triangle point |
[in] | vV2 | Second triangle point |
[in] | vV3 | Third triangle point |
static PLMATH_API bool PLMath::Intersect::PlaneSetAABox | ( | const PlaneSet & | cPlaneSet, |
const Vector3 & | vMin, | ||
const Vector3 & | vMax, | ||
PLCore::uint32 * | pnOutClipMask = nullptr |
||
) | [static] |
Tests whether an axis aligned box is within the plane set or not.
[in] | cPlaneSet | Plane set to check |
[in] | vMin | Minimum position |
[in] | vMax | Maximum position |
[out] | pnOutClipMask | If not a null pointer, this clip mask will receive the intersection state of a maximum number of 32 planes if the box intersects the plane set. If this mask is 0, there was no plane intersection at all. (= complete inside/outside the plane set) |
static PLMATH_API bool PLMath::Intersect::TriangleRay | ( | const Vector3 & | vV1, |
const Vector3 & | vV2, | ||
const Vector3 & | vV3, | ||
const Vector3 & | vN, | ||
const Vector3 & | vRayOrigin, | ||
const Vector3 & | vRayDirection, | ||
Vector3 * | pvIntersectionPointPos = nullptr |
||
) | [static] |
Checks if there's a triangle/ray intersection.
[in] | vV1 | First triangle point |
[in] | vV2 | Second triangle point |
[in] | vV3 | Third triangle point |
[in] | vN | Triangle plane normal |
[in] | vRayOrigin | Ray origin |
[in] | vRayDirection | Ray direction vector |
[out] | pvIntersectionPointPos | If not a null pointer, will receive the position of the intersection point |
static PLMATH_API bool PLMath::Intersect::TriangleRay | ( | const Vector3 & | vV1, |
const Vector3 & | vV2, | ||
const Vector3 & | vV3, | ||
const Vector3 & | vN, | ||
const Ray & | cRay, | ||
Vector3 * | pvIntersectionPointPos = nullptr |
||
) | [static] |
Checks if there's a triangle/ray intersection.
[in] | vV1 | First triangle point |
[in] | vV2 | Second triangle point |
[in] | vV3 | Third triangle point |
[in] | vN | Triangle plane normal |
[in] | cRay | Ray to check |
[out] | pvIntersectionPointPos | If not a null pointer, will receive the position of the intersection point |
|