Back to class index
Line[Class Summary]
pos
dir
ctor (+3 overloads)
IsFinite()[const]
GetPoint(distance)[const]
Translate(offset)
Transform(transform) (+3 overloads)
Contains(...)[const] (+2 overloads)
Equals(line,epsilon)[const]
BitEquals(other)[const]
Distance(point)[const] (+12 overloads)
ClosestPoint(targetPoint)[const] (+13 overloads)
Intersects(...)[const] (+10 overloads)
IntersectsDisc(disc)[const]
ToRay()[const]
ToLineSegment(d)[const] (+1 overload)
ProjectToAxis(...)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
AreCollinear(p1,p2,p3,epsilon)[static]
ClosestPointLineLine(...)[static]
FromString(str,outEndStr)[static] (+1 overload)

Line::Intersects

Syntax

bool Line::Intersects(const Triangle &triangle, float *d, float4 *intersectionPoint) const; [4 lines of code]
bool Line::Intersects(const Plane &plane, float *d) const; [4 lines of code]
bool Line::Intersects(const Sphere &s, float4 *intersectionPoint=0, float4 *intersectionNormal=0, float *d=0) const; [4 lines of code]
bool Line::Intersects(const AABB &aabb, float &dNear, float &dFar) const; [4 lines of code]
bool Line::Intersects(const AABB &aabb) const; [4 lines of code]
bool Line::Intersects(const OBB &obb, float &dNear, float &dFar) const; [4 lines of code]
bool Line::Intersects(const OBB &obb) const; [4 lines of code]
bool Line::Intersects(const Capsule &capsule) const; [4 lines of code]
bool Line::Intersects(const Polygon &polygon) const; [4 lines of code]
bool Line::Intersects(const Frustum &frustum) const; [4 lines of code]
bool Line::Intersects(const Polyhedron &polyhedron) const; [4 lines of code]

Tests whether this line and the given object intersect.

Both objects are treated as "solid", meaning that if one of the objects is fully contained inside another, this function still returns true.

Parameters

float *d [out]If specified, this parameter will receive the parametric distance of the intersection point along this object. Use the GetPoint(d) function to get the actual point of intersection. This pointer may be null.float4 *intersectionPoint [out]If specified, receives the actual point of intersection. This pointer may be null.float4 *intersectionNormal [out]If specified, receives the surface normal of the other object at the point of intersection. This pointer may be null.float &dNear [out]If specified, receives the distance along this line to where the line enters the bounding box.float &dFar [out]If specified, receives the distance along this line to where the line exits the bounding box.

Return Value

True if an intersection occurs or one of the objects is contained inside the other, false otherwise.

See Also

Contains(), Distance(), ClosestPoint(), GetPoint().