Namespace: dmIntersection
Language: C++
Type: Defold C++
File: intersection.h
Source: engine/dlib/src/dmsdk/dlib/intersection.h
Include: dmsdk/dlib/intersection.h
Intersection math structs and functions
Type: FUNCTION Constructs a dmIntersection::Frustum from a View*Projection matrix
Parameters
m (dmVMath::Matrix4&) - The matrix. Usually a “ViewProj” matrixnormalize (bool) - true if the normals should be normalizedReturns
frustum (dmIntersection::Frustum&) - the frustum outputType: FUNCTION Returns the closest distance between a plane and a position
Parameters
plane (dmIntersection::Plane) - plane equationpos (dmVMath::Point3) - positionReturns
distance (float) - closest distance between plane and positionType: STRUCT Frustum
Notes
Members
m_Planes (dmIntersection::Plane[6) - ] plane equations: // left, right, bottom, top, near, farType: TYPEDEF Plane struct (currently an alias for dmVMath::Vector4)
Type: FUNCTION Tests intersection between a frustum and an oriented bounding box (OBB)
Parameters
frustum (dmIntersection::Frustum&) - the frustumworld (dmVMath::Matrix4&) - The world transform of the OBBaabb_min (dmVMath::Vector3&) - the minimum corner of the object. In local space.aabb_max (dmVMath::Vector3&) - the maximum corner of the object. In local space.skip_near_far (bool) - if true, the near+far planes of the frustum are ignoredReturns
intersects (bool) - Returns true if the objects intersectType: FUNCTION Tests intersection between a frustum and a point
Parameters
frustum (dmIntersection::Frustum&) - the frustumpos (dmVMath::Point3&) - the positionskip_near_far (bool) - if true, the near+far planes of the frustum are ignoredReturns
intersects (bool) - Returns true if the objects intersectType: FUNCTION Tests intersection between a frustum and a sphere
Parameters
frustum (dmIntersection::Frustum&) - the frustumpos (dmVMath::Point3&) - the center position of the sphereradius (float) - the radius of the sphereskip_near_far (bool) - if true, the near+far planes of the frustum are ignoredReturns
intersects (bool) - Returns true if the objects intersectType: FUNCTION Tests intersection between a frustum and a sphere
Parameters
frustum (dmIntersection::Frustum&) - the frustumpos (dmVMath::Vector4&) - the center position of the sphere. The w component must be 1.radius (float) - the radius of the sphereskip_near_far (bool) - if true, the near+far planes of the frustum are ignoredReturns
intersects (bool) - Returns true if the objects intersectType: FUNCTION Tests intersection between a frustum and a sphere
Parameters
frustum (dmIntersection::Frustum&) - the frustumpos (dmVMath::Point3&) - the center position of the sphereradius_sq (float) - the squared radius of the sphereskip_near_far (bool) - if true, the near+far planes of the frustum are ignoredReturns
intersects (bool) - Returns true if the objects intersectType: FUNCTION Tests intersection between a frustum and a sphere
Parameters
frustum (dmIntersection::Frustum&) - the frustumpos (dmVMath::Vector4&) - the center position of the sphere. The w component must be 1.radius_sq (float) - the squared radius of the sphereskip_near_far (bool) - if true, the near+far planes of the frustum are ignoredReturns
intersects (bool) - Returns true if the objects intersect