Back to class index
| Plane::IntersectsSyntaxbool 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. ParametersLine *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 ValueTrue if the intersection was a point, in which case outPoint is written to. Performance49.263nsecs/call ≈ 20.3M calls/second ≈ 338.32k calls/frame (@ 60fps). See AlsoWork 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. Syntaxbool 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. ParametersLine *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 ValueTrue if the given object intersects with this plane. Performancebool Plane::Intersects(const Plane &plane, Line *outLine=0) const41.053nsecs/call ≈ 24.36M calls/second ≈ 405.98k calls/frame (@ 60fps). 12.316nsecs/call ≈ 81.2M calls/second ≈ 1.35M calls/frame (@ 60fps). 8.21nsecs/call ≈ 121.8M calls/second ≈ 2.03M calls/frame (@ 60fps). 0.053μsecs/call ≈ 18.74M calls/second ≈ 312.3k calls/frame (@ 60fps). 8.21nsecs/call ≈ 121.8M calls/second ≈ 2.03M calls/frame (@ 60fps). 16.421nsecs/call ≈ 60.9M calls/second ≈ 1.01M calls/frame (@ 60fps). 16.421nsecs/call ≈ 60.9M calls/second ≈ 1.01M calls/frame (@ 60fps). 3.584μsecs/call ≈ 279.03k calls/second ≈ 4.65k calls/frame (@ 60fps). This function could not be profiled. Either the function body is too small, or appropriate function parameters could not be generated. 8.21nsecs/call ≈ 121.8M calls/second ≈ 2.03M calls/frame (@ 60fps). 11.207μsecs/call ≈ 89.23k calls/second ≈ 1.49k calls/frame (@ 60fps). 12.316nsecs/call ≈ 81.2M calls/second ≈ 1.35M calls/frame (@ 60fps). 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. Syntaxint 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. Parametersfloat3 *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 ValueThe number of intersections that occurred: 0, 1 or 2. Performanceint Plane::Intersects(const Circle &circle, float3 *pt1, float3 *pt2) const0.099μsecs/call ≈ 10.15M calls/second ≈ 169.16k calls/frame (@ 60fps). 0.103μsecs/call ≈ 9.74M calls/second ≈ 162.39k calls/frame (@ 60fps). Leave a Comment |