Intersection math structs and functions

Intersection math structs and functions

Namespace: dmIntersection
Include: #include <dmsdk/dlib/intersection.h>
TYPES
Plane Plane struct (currently an alias for dmVMath::Vect...
STRUCTS
struct Frustum frustum
FUNCTIONS
dmIntersection::Frustum& CreateFrustumFromMatrix(dmVMath::Matrix4& m, bool normalize) Constructs a dmIntersection::Frustum from a View*P...
float DistanceToPlane(dmIntersection::Plane plane, dmVMath::Point3 pos) Returns the closest distance between a plane and a...
bool TestFrustumOBB(dmIntersection::Frustum& frustum, dmVMath::Matrix4& world, dmVMath::Vector3& aabb_min, dmVMath::Vector3& aabb_max, bool skip_near_far) Tests intersection between a frustum and an orient...
bool TestFrustumPoint(dmIntersection::Frustum& frustum, dmVMath::Point3& pos, bool skip_near_far) Tests intersection between a frustum and a point
bool TestFrustumSphere(dmIntersection::Frustum& frustum, dmVMath::Point3& pos, float radius, bool skip_near_far) Tests intersection between a frustum and a sphere
bool TestFrustumSphere(dmIntersection::Frustum& frustum, dmVMath::Vector4& pos, float radius, bool skip_near_far) Tests intersection between a frustum and a sphere
bool TestFrustumSphereSq(dmIntersection::Frustum& frustum, dmVMath::Point3& pos, float radius_sq, bool skip_near_far) Tests intersection between a frustum and a sphere
bool TestFrustumSphereSq(dmIntersection::Frustum& frustum, dmVMath::Vector4& pos, float radius_sq, bool skip_near_far) Tests intersection between a frustum and a sphere

Functions

CreateFrustumFromMatrix

dmIntersection::Frustum& CreateFrustumFromMatrix(dmVMath::Matrix4& m, bool normalize)

Constructs a dmIntersection::Frustum from a View*Projection matrix

PARAMETERS

dmVMath::Matrix4& m The matrix. Usually a "ViewProj" matrix
bool normalize true if the normals should be normalized

RETURNS

dmIntersection::Frustum& the frustum output

DistanceToPlane

float DistanceToPlane(dmIntersection::Plane plane, dmVMath::Point3 pos)

Returns the closest distance between a plane and a position

PARAMETERS

dmIntersection::Plane plane plane equation
dmVMath::Point3 pos position

RETURNS

float closest distance between plane and position

TestFrustumOBB

bool TestFrustumOBB(dmIntersection::Frustum& frustum, dmVMath::Matrix4& world, dmVMath::Vector3& aabb_min, dmVMath::Vector3& aabb_max, bool skip_near_far)

Tests intersection between a frustum and an oriented bounding box (OBB)

PARAMETERS

dmIntersection::Frustum& frustum the frustum
dmVMath::Matrix4& world The world transform of the OBB
dmVMath::Vector3& aabb_min the minimum corner of the object. In local space.
dmVMath::Vector3& aabb_max the maximum corner of the object. In local space.
bool skip_near_far if true, the near+far planes of the frustum are ignored

RETURNS

bool Returns true if the objects intersect

TestFrustumPoint

bool TestFrustumPoint(dmIntersection::Frustum& frustum, dmVMath::Point3& pos, bool skip_near_far)

Tests intersection between a frustum and a point

PARAMETERS

dmIntersection::Frustum& frustum the frustum
dmVMath::Point3& pos the position
bool skip_near_far if true, the near+far planes of the frustum are ignored

RETURNS

bool Returns true if the objects intersect

TestFrustumSphere

bool TestFrustumSphere(dmIntersection::Frustum& frustum, dmVMath::Point3& pos, float radius, bool skip_near_far)

Tests intersection between a frustum and a sphere

PARAMETERS

dmIntersection::Frustum& frustum the frustum
dmVMath::Point3& pos the center position of the sphere
float radius the radius of the sphere
bool skip_near_far if true, the near+far planes of the frustum are ignored

RETURNS

bool Returns true if the objects intersect

TestFrustumSphere

bool TestFrustumSphere(dmIntersection::Frustum& frustum, dmVMath::Vector4& pos, float radius, bool skip_near_far)

Tests intersection between a frustum and a sphere

PARAMETERS

dmIntersection::Frustum& frustum the frustum
dmVMath::Vector4& pos the center position of the sphere. The w component must be 1.
float radius the radius of the sphere
bool skip_near_far if true, the near+far planes of the frustum are ignored

RETURNS

bool Returns true if the objects intersect

TestFrustumSphereSq

bool TestFrustumSphereSq(dmIntersection::Frustum& frustum, dmVMath::Point3& pos, float radius_sq, bool skip_near_far)

Tests intersection between a frustum and a sphere

PARAMETERS

dmIntersection::Frustum& frustum the frustum
dmVMath::Point3& pos the center position of the sphere
float radius_sq the squared radius of the sphere
bool skip_near_far if true, the near+far planes of the frustum are ignored

RETURNS

bool Returns true if the objects intersect

TestFrustumSphereSq

bool TestFrustumSphereSq(dmIntersection::Frustum& frustum, dmVMath::Vector4& pos, float radius_sq, bool skip_near_far)

Tests intersection between a frustum and a sphere

PARAMETERS

dmIntersection::Frustum& frustum the frustum
dmVMath::Vector4& pos the center position of the sphere. The w component must be 1.
float radius_sq the squared radius of the sphere
bool skip_near_far if true, the near+far planes of the frustum are ignored

RETURNS

bool Returns true if the objects intersect

Structs

Frustum

TYPE

struct Frustum

Frustum

MEMBERS

dmIntersection::Plane[6 m_Planes ] plane equations: // left, right, bottom, top, near, far


Types

Plane

Plane struct (currently an alias for dmVMath::Vector4)