Back to class index
Plane[Class Summary]
normal
d
ctor (+6 overloads)
Set(v1,v2,v3) (+1 overload)
ReverseNormal()
PointOnPlane()[const]
Transform(transform) (+3 overloads)
IsInPositiveDirection(directionVector)[const]
IsOnPositiveSide(point)[const]
ExamineSide(triangle)[const]
AreOnSameSide(p1,p2)[const]
Distance(point)[const] (+3 overloads)
SignedDistance(point)[const]
OrthoProjection()[const]
Project(point)[const] (+5 overloads)
ObliqueProjection(...)[const]
ObliqueProject(...)[const]
MirrorMatrix()[const]
Mirror(point)[const]
Refract(...)[const]
ClosestPoint(point)[const] (+2 overloads)
Contains(point,epsilon)[const] (+6 overloads)
SetEquals(plane,epsilon)[const]
Equals(other,epsilon)[const]
IsParallel(plane,epsilon)[const]
DihedralAngle(plane)[const]
Intersects(...)[const] (+14 overloads)
Clip(line)[const] (+3 overloads)
PassesThroughOrigin(epsilon)[const]
GenerateCircle(...)[const]

Plane::Intersects

Syntax

bool Plane::Intersects(const Plane &plane, const Plane &plane2, Line *outLine=0, float3 *outPoint=0) const; [44 lines of code]

Computes the intersection of three planes.

This function computes the intersection of this plane, and the given two planes.

Parameters

Line *outLine [out]If the three planes are configured in such a manner that intersection is a line, this parameter receives the line of intersection. This pointer may be null.float3 *outPoint [out]If the three planes are configured in such a manner that the interesction is a point, this parameter receives the point of intersection. This pointer may be null.

Return Value

True if the intersection was a point, in which case outPoint is written to.

Performance

49.263nsecs/call ≈ 20.3M calls/second ≈ 338.32k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

See Also

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

Work in progress:

Bug: in bool Plane::Intersects(const Plane &plane, const Plane &plane2, Line *outLine=0, float3 *outPoint=0) const:
This function never outputs outLine.

Syntax

bool Plane::Intersects(const Plane &plane, Line *outLine=0) const; [24 lines of code]
bool Plane::Intersects(const Ray &ray, float *d) const; [8 lines of code]
bool Plane::Intersects(const Line &line, float *d) const; [4 lines of code]
bool Plane::Intersects(const LineSegment &lineSegment, float *d) const; [9 lines of code]
bool Plane::Intersects(const Sphere &sphere) const; [4 lines of code]
bool Plane::Intersects(const AABB &aabb) const; [11 lines of code]
bool Plane::Intersects(const OBB &obb) const; [4 lines of code]
bool Plane::Intersects(const Polygon &polygon) const; [4 lines of code]
bool Plane::Intersects(const Polyhedron &polyhedron) const; [10 lines of code]
bool Plane::Intersects(const Triangle &triangle) const; [7 lines of code]
bool Plane::Intersects(const Frustum &frustum) const; [8 lines of code]
bool Plane::Intersects(const Capsule &capsule) const; [4 lines of code]

Tests whether this plane and the given object intersect.

The Plane-AABB intersection is implemented according to Christer Ericson's Real-Time Collision Detection, p.164.

Parameters

Line *outLine [out]The intersection of two planes forms a line. If an intersection occurs, this parameter will receive the line of intersection. This pointer may be null.float *d [out]If specified, this parameter will receive the parametric distance of the intersection point along the line object. Use the GetPoint(d) function of the line class to get the actual point of intersection. This pointer may be null.

Return Value

True if the given object intersects with this plane.

Performance

bool Plane::Intersects(const Plane &plane, Line *outLine=0) const

41.053nsecs/call ≈ 24.36M calls/second ≈ 405.98k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const Ray &ray, float *d) const

12.316nsecs/call ≈ 81.2M calls/second ≈ 1.35M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const Line &line, float *d) const

8.21nsecs/call ≈ 121.8M calls/second ≈ 2.03M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const LineSegment &lineSegment, float *d) const

0.053μsecs/call ≈ 18.74M calls/second ≈ 312.3k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const Sphere &sphere) const

8.21nsecs/call ≈ 121.8M calls/second ≈ 2.03M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const AABB &aabb) const

16.421nsecs/call ≈ 60.9M calls/second ≈ 1.01M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const OBB &obb) const

16.421nsecs/call ≈ 60.9M calls/second ≈ 1.01M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const Polygon &polygon) const

3.584μsecs/call ≈ 279.03k calls/second ≈ 4.65k calls/frame (@ 60fps).
This function allocates 8 bytes (1 blocks) of temporary work memory.

bool Plane::Intersects(const Polyhedron &polyhedron) const

This function could not be profiled. Either the function body is too small, or appropriate function parameters could not be generated.
This function allocates 16 bytes (2 blocks) of temporary work memory.

bool Plane::Intersects(const Triangle &triangle) const

8.21nsecs/call ≈ 121.8M calls/second ≈ 2.03M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const Frustum &frustum) const

11.207μsecs/call ≈ 89.23k calls/second ≈ 1.49k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Plane::Intersects(const Capsule &capsule) const

12.316nsecs/call ≈ 81.2M calls/second ≈ 1.35M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

Work in progress:

Todo: in bool Plane::Intersects(const Triangle &triangle) const:
Add a version of Plane-Triangle intersection which returns the line segment of intersection.

Syntax

int Plane::Intersects(const Circle &circle, float3 *pt1, float3 *pt2) const; [21 lines of code]
int Plane::Intersects(const Circle &circle) const; [4 lines of code]

Tests if this plane intersects with the given circle.

Parameters

float3 *pt1 [out]If specified, receives the first point of intersection. This pointer may be null.float3 *pt2 [out]If specified, receives the second point of intersection. This pointer may be null.

Return Value

The number of intersections that occurred: 0, 1 or 2.

Performance

int Plane::Intersects(const Circle &circle, float3 *pt1, float3 *pt2) const

0.099μsecs/call ≈ 10.15M calls/second ≈ 169.16k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

int Plane::Intersects(const Circle &circle) const

0.103μsecs/call ≈ 9.74M calls/second ≈ 162.39k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

Leave a Comment

Name:
Comments:
Captcha:captcha image Type in the black symbols:
Back to class index