CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csIntersect2 Class Reference
[Geometry utilities]

Some functions to perform various intersection calculations with 2D line segments. More...

#include <csgeom/math2d.h>

List of all members.

Static Public Member Functions

bool PlanePolygon (const csPlane2 &plane, csPoly2D *poly, csSegment2 &segment)
 Intersect a plane with a 2D polygon and return the line segment corresponding with this intersection.
bool SegmentSegment (const csSegment2 &a, const csSegment2 &b, csVector2 &isect, float &dist)
 Compute the intersection of the 2D segments.
bool SegmentLine (const csSegment2 &a, const csSegment2 &b, csVector2 &isect, float &dist)
 Compute the intersection of a 2D segment and a line.
bool LineLine (const csSegment2 &a, const csSegment2 &b, csVector2 &isect)
 Compute the intersection of 2D lines.
bool SegmentPlane (const csVector2 &u, const csVector2 &v, const csPlane2 &p, csVector2 &isect, float &dist)
 Intersect a 2D segment with a plane.
bool SegmentPlane (const csSegment2 &uv, const csPlane2 &p, csVector2 &isect, float &dist)
 Intersect a 2D segment with a plane.
void SegmentPlaneNoTest (const csVector2 &u, const csVector2 &v, const csPlane2 &p, csVector2 &isect, float &dist)
 Return the intersection point.
void SegmentPlaneNoTest (const csSegment2 &uv, const csPlane2 &p, csVector2 &isect, float &dist)
 Return the intersection point.
bool PlanePlane (const csPlane2 &p1, const csPlane2 &p2, csVector2 &isect)
 Intersect 2 planes to get the point that is part of all two planes.


Detailed Description

Some functions to perform various intersection calculations with 2D line segments.

This is a static class and contains only static member functions.

Definition at line 163 of file math2d.h.


Member Function Documentation

bool csIntersect2::LineLine const csSegment2 a,
const csSegment2 b,
csVector2 isect
[static]
 

Compute the intersection of 2D lines.

Return true if they intersect, with the intersection point returned in isect.

bool csIntersect2::PlanePlane const csPlane2 p1,
const csPlane2 p2,
csVector2 isect
[static]
 

Intersect 2 planes to get the point that is part of all two planes.

Returns true, if there is a single point that fits. If the planes are parallel, then it will return false.

bool csIntersect2::PlanePolygon const csPlane2 plane,
csPoly2D poly,
csSegment2 segment
[static]
 

Intersect a plane with a 2D polygon and return the line segment corresponding with this intersection.

Returns true if there is an intersection. If false then 'segment' will not be valid.

bool csIntersect2::SegmentLine const csSegment2 a,
const csSegment2 b,
csVector2 isect,
float &  dist
[static]
 

Compute the intersection of a 2D segment and a line.

Return true if they intersect, with the intersection point returned in isect, and the distance from a1 of the intersection in dist.

bool csIntersect2::SegmentPlane const csSegment2 uv,
const csPlane2 p,
csVector2 isect,
float &  dist
[inline, static]
 

Intersect a 2D segment with a plane.

Returns true if there is an intersection, with the intersection point returned in isect. The distance from u to the intersection point is returned in dist. The distance that is returned is a normalized distance with respect to the given input vector. i.e. a distance of 0.5 means that the intersection point is halfway u and v.

Definition at line 225 of file math2d.h.

References csSegment2::End(), SegmentPlane(), and csSegment2::Start().

bool csIntersect2::SegmentPlane const csVector2 u,
const csVector2 v,
const csPlane2 p,
csVector2 isect,
float &  dist
[static]
 

Intersect a 2D segment with a plane.

Returns true if there is an intersection, with the intersection point returned in isect. The distance from u to the intersection point is returned in dist. The distance that is returned is a normalized distance with respect to the given input vector. i.e. a distance of 0.5 means that the intersection point is halfway u and v.

Referenced by SegmentPlane().

void csIntersect2::SegmentPlaneNoTest const csSegment2 uv,
const csPlane2 p,
csVector2 isect,
float &  dist
[inline, static]
 

Return the intersection point.

This version does not test if there really is an intersection. It just assumes there is one.

Definition at line 252 of file math2d.h.

References csSegment2::End(), SegmentPlaneNoTest(), and csSegment2::Start().

void csIntersect2::SegmentPlaneNoTest const csVector2 u,
const csVector2 v,
const csPlane2 p,
csVector2 isect,
float &  dist
[inline, static]
 

Return the intersection point.

This version does not test if there really is an intersection. It just assumes there is one.

Definition at line 238 of file math2d.h.

References csPlane2::CC, csPlane2::norm, csVector2::x, and csVector2::y.

Referenced by SegmentPlaneNoTest().

bool csIntersect2::SegmentSegment const csSegment2 a,
const csSegment2 b,
csVector2 isect,
float &  dist
[static]
 

Compute the intersection of the 2D segments.

Return true if they intersect, with the intersection point returned in isect, and the distance from a1 of the intersection in dist.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1