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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
TYPE
struct Frustum
Frustum
MEMBERS
dmIntersection::Plane[6 |
m_Planes |
] plane equations: // left, right, bottom, top, near, far |
Plane struct (currently an alias for dmVMath::Vector4)