Back to class index
| Polyhedron::IntersectsSyntaxbool Polyhedron::Intersects(const LineSegment &lineSegment) const; [16 lines of code]bool Polyhedron::Intersects(const Line &line) const; [8 lines of code] bool Polyhedron::Intersects(const Ray &ray) const; [8 lines of code] bool Polyhedron::Intersects(const Plane &plane) const; [4 lines of code] bool Polyhedron::Intersects(const Polyhedron &polyhedron) const; [52 lines of code] bool Polyhedron::Intersects(const AABB &aabb) const; [4 lines of code] bool Polyhedron::Intersects(const OBB &obb) const; [4 lines of code] bool Polyhedron::Intersects(const Triangle &triangle) const; [4 lines of code] bool Polyhedron::Intersects(const Polygon &polygon) const; [4 lines of code] bool Polyhedron::Intersects(const Frustum &frustum) const; [4 lines of code] bool Polyhedron::Intersects(const Sphere &sphere) const; [5 lines of code] bool Polyhedron::Intersects(const Capsule &capsule) const; [6 lines of code] Tests whether this polyhedron 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 polyhedron, or this polyhedron is contained inside a sphere, etc.) Note This function assumes that this polyhedron is closed and the edges are not self-intersecting. The algorithm for Polyhedron-Polyhedron intersection is from Christer Ericson's Real-Time Collision Detection, p. 384. As noted by the author, the algorithm is very naive (and here unoptimized), and better methods exist. Return ValueTrue if an intersection occurs or one of the objects is contained inside the other, false otherwise. See AlsoWork in progress:Todo: in bool Polyhedron::Intersects(const LineSegment &lineSegment) const: Add Intersects(Circle/Disc). |