Intersection structs and functions

Intersection math structs and functions

Plane

Plane struct (currently an alias for dmVMath::Vect...

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


DistanceToPlane(plane, pos)

Returns the closest distance between a plane and a...

Returns the closest distance between a plane and a position

PARAMETERS

plane - plane equation

pos - position

RETURN

distance - closest distance between plane and position


Frustum()

frustum

Frustum

MEMBERS

m_Planes - ] plane equations: // left, right, bottom, top, near, far


CreateFrustumFromMatrix(m, normalize)

Constructs a dmIntersection::Frustum from a View*P...

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

PARAMETERS

m - The matrix. Usually a "ViewProj" matrix

normalize - true if the normals should be normalized

RETURN

frustum - the frustum output


TestFrustumPoint(frustum, pos, skip_near_far)

Tests intersection between a frustum and a point

Tests intersection between a frustum and a point

PARAMETERS

frustum - the frustum

pos - the position

skip_near_far - if true, the near+far planes of the frustum are ignored

RETURN

intersects - Returns true if the objects intersect


TestFrustumSphere(frustum, pos, radius, skip_near_far)

Tests intersection between a frustum and a sphere

Tests intersection between a frustum and a sphere

PARAMETERS

frustum - the frustum

pos - the center position of the sphere

radius - the radius of the sphere

skip_near_far - if true, the near+far planes of the frustum are ignored

RETURN

intersects - Returns true if the objects intersect


TestFrustumSphere(frustum, pos, radius, skip_near_far)

Tests intersection between a frustum and a sphere

Tests intersection between a frustum and a sphere

PARAMETERS

frustum - the frustum

pos - the center position of the sphere. The w component must be 1.

radius - the radius of the sphere

skip_near_far - if true, the near+far planes of the frustum are ignored

RETURN

intersects - Returns true if the objects intersect


TestFrustumSphereSq(frustum, pos, radius_sq, skip_near_far)

Tests intersection between a frustum and a sphere

Tests intersection between a frustum and a sphere

PARAMETERS

frustum - the frustum

pos - the center position of the sphere

radius_sq - the squared radius of the sphere

skip_near_far - if true, the near+far planes of the frustum are ignored

RETURN

intersects - Returns true if the objects intersect


TestFrustumSphereSq(frustum, pos, radius_sq, skip_near_far)

Tests intersection between a frustum and a sphere

Tests intersection between a frustum and a sphere

PARAMETERS

frustum - the frustum

pos - the center position of the sphere. The w component must be 1.

radius_sq - the squared radius of the sphere

skip_near_far - if true, the near+far planes of the frustum are ignored

RETURN

intersects - Returns true if the objects intersect


TestFrustumOBB(frustum, world, aabb_min, aabb_max, skip_near_far)

Tests intersection between a frustum and an orient...

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

PARAMETERS

frustum - the frustum

world - The world transform of the OBB

aabb_min - the minimum corner of the object. In local space.

aabb_max - the maximum corner of the object. In local space.

skip_near_far - if true, the near+far planes of the frustum are ignored

RETURN

intersects - Returns true if the objects intersect