Back to class index
OBB[Class Summary]
pos
r
axis
ctor (+2 overloads)
SetNegativeInfinity()
SetFrom(aabb) (+5 overloads)
ToPolyhedron()[const]
ToPBVolume()[const]
MinimalEnclosingAABB()[const]
MinimalEnclosingSphere()[const]
MaximalContainedSphere()[const]
Size()[const]
HalfSize()[const]
Diagonal()[const]
HalfDiagonal()[const]
WorldToLocal()[const]
LocalToWorld()[const]
IsFinite()[const]
IsDegenerate()[const]
CenterPoint()[const]
Centroid()[const]
AnyPointFast()[const]
Volume()[const]
SurfaceArea()[const]
PointInside(x,y,z)[const]
Edge(edgeIndex)[const]
CornerPoint(cornerIndex)[const]
ExtremePoint(direction)[const] (+1 overload)
ProjectToAxis(...)[const]
UniqueFaceNormals(out)[const]
UniqueEdgeDirections(out)[const]
PointOnEdge(edgeIndex,u)[const]
FaceCenterPoint(faceIndex)[const]
FacePoint(faceIndex,u,v)[const]
FacePlane(faceIndex)[const]
GetCornerPoints(outPointArray)[const]
GetFacePlanes(outPlaneArray)[const]
RandomPointInside(rng)[const]
RandomPointOnSurface(rng)[const]
RandomPointOnEdge(rng)[const]
RandomCornerPoint(rng)[const]
Translate(offset)
Scale(...) (+1 overload)
Transform(transform) (+3 overloads)
ClosestPoint(point)[const]
Distance(point)[const] (+1 overload)
Contains(point)[const] (+7 overloads)
Intersects(obb,epsilon)[const] (+14 overloads)
Enclose(point)
Triangulate(...)[const]
ToEdgeList(outPos)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
Equals(rhs,epsilon)[const]
BitEquals(other)[const]
NumFaces()[static]
NumEdges()[static]
NumVertices()[static]
ExtremePointsAlongDirection(...)[static]
OptimalEnclosingOBB(...)[static]
NumVerticesInTriangulation(...)[static]
NumVerticesInEdgeList()[static]
FromString(str,outEndStr)[static] (+1 overload)

OBB::Intersects

Syntax

bool OBB::Intersects(const OBB &obb, float epsilon=1e-3f) const; [183 lines of code]
bool OBB::Intersects(const AABB &aabb) const; [4 lines of code]
bool OBB::Intersects(const Plane &plane) const; [10 lines of code]
bool OBB::Intersects(const Ray &ray, float &dNear, float &dFar) const; [6 lines of code]
bool OBB::Intersects(const Ray &ray) const; [6 lines of code]
bool OBB::Intersects(const Line &line, float &dNear, float &dFar) const; [6 lines of code]
bool OBB::Intersects(const Line &line) const; [6 lines of code]
bool OBB::Intersects(const LineSegment &lineSegment, float &dNear, float &dFar) const; [6 lines of code]
bool OBB::Intersects(const LineSegment &lineSegment) const; [6 lines of code]
bool OBB::Intersects(const Sphere &sphere, float4 *closestPointOnOBB=0) const; [11 lines of code]
bool OBB::Intersects(const Capsule &capsule) const; [4 lines of code]
bool OBB::Intersects(const Triangle &triangle) const; [6 lines of code]
bool OBB::Intersects(const Polygon &polygon) const; [4 lines of code]
bool OBB::Intersects(const Frustum &frustum) const; [4 lines of code]
bool OBB::Intersects(const Polyhedron &polyhedron) const; [4 lines of code]

Tests whether this OBB 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. (e.g. in case a line segment is contained inside this OBB, or this OBB is contained inside a Sphere, etc.) The first parameter of this function specifies the other object to test against. The OBB-OBB intersection test is from Christer Ericson's book Real-Time Collision Detection, p. 101-106. See http://realtimecollisiondetection.net/

The implementation of OBB-Plane intersection test follows Christer Ericson's Real-Time Collision Detection, p. 163.

The implementation of the OBB-Sphere intersection test follows Christer Ericson's Real-Time Collision Detection, p. 166.

Parameters

const OBB &obbThe other oriented bounding box to test intersection with. floatepsilonThe OBB-OBB test utilizes a SAT test to detect the intersection. A robust implementation requires an epsilon threshold to test that the used axes are not degenerate. float &dNear [out]If specified, receives the parametric distance along the line denoting where the line entered this OBB.float &dFar [out]If specified, receives the parametric distance along the line denoting where the line exited this OBB.float4 *closestPointOnOBB [out]If specified, receives the closest point on this OBB To the given sphere. This pointer may be null.

See Also

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

Work in progress:

Todo: in bool OBB::Intersects(const OBB &obb, float epsilon=1e-3f) const:
Add Intersects(Circle/Disc).