Crystal Space: csDIntersect3 Class Reference (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csDIntersect3 Class Reference
[Geometry utilities]

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

`#include <csgeom/math3d_d.h>`

List of all members.

## Static Public Member Functions
static bool | Plane (const csDVector3 &u, const csDVector3 &v, const csDPlane &p, csDVector3 &isect, double &dist)
| Intersect a 3D segment with a plane.
static bool | Plane (const csDVector3 &u, const csDVector3 &v, double A, double B, double C, double D, csDVector3 &isect, double &dist)
| Intersect a 3D segment with a plane.
static void | Plane (const csDVector3 &u, const csDVector3 &v, const csDVector3 &normal, const csDVector3 &a, csDVector3 &isect)
| Intersect a 3D segment with a plane.
static bool | Planes (const csDPlane &p1, const csDPlane &p2, const csDPlane &p3, csDVector3 &isect)
| Intersect 3 planes, to get the point that is part of all three planes.
static double | XFrustum (double A, const csDVector3 &u, const csDVector3 &v, csDVector3 &isect)
| Intersect a 3D segment with the frustum plane Ax + z = 0.
static double | YFrustum (double B, const csDVector3 &u, const csDVector3 &v, csDVector3 &isect)
| Intersect a 3D segment with the frustum plane By + z = 0.
static double | Z0Plane (const csDVector3 &u, const csDVector3 &v, csDVector3 &isect)
| Intersect a 3D segment with the z = 0 plane.
static double | ZPlane (double zval, const csDVector3 &u, const csDVector3 &v, csDVector3 &isect)
| Intersect a 3D segment with the plane z = zval.

## Detailed Description

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

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

Definition at line 599 of file math3d_d.h.

## Member Function Documentation

static bool csDIntersect3::Plane | ( | const csDVector3 & | u,
|  | const csDVector3 & | v,
|  | const csDPlane & | p,
|  | csDVector3 & | isect,
|  | double & | dist |
| ) |  |  | `[static]`

Intersect a 3D 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.

static bool csDIntersect3::Plane | ( | const csDVector3 & | u,
|  | const csDVector3 & | v,
|  | double | A,
|  | double | B,
|  | double | C,
|  | double | D,
|  | csDVector3 & | isect,
|  | double & | dist |
| ) |  |  | `[static]`

Intersect a 3D 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.

static void csDIntersect3::Plane | ( | const csDVector3 & | u,
|  | const csDVector3 & | v,
|  | const csDVector3 & | normal,
|  | const csDVector3 & | a,
|  | csDVector3 & | isect |
| ) |  |  | `[static]`

Intersect a 3D segment with a plane.

Returns true if there is an intersection, with the intersection point returned in isect.

static bool csDIntersect3::Planes | ( | const csDPlane & | p1,
|  | const csDPlane & | p2,
|  | const csDPlane & | p3,
|  | csDVector3 & | isect |
| ) |  |  | `[static]`

Intersect 3 planes, to get the point that is part of all three planes.

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

static double csDIntersect3::XFrustum | ( | double | A,
|  | const csDVector3 & | u,
|  | const csDVector3 & | v,
|  | csDVector3 & | isect |
| ) |  |  | `[static]`

Intersect a 3D segment with the frustum plane Ax + z = 0.

Assumes an intersection, and returns the intersection point in isect.

static double csDIntersect3::YFrustum | ( | double | B,
|  | const csDVector3 & | u,
|  | const csDVector3 & | v,
|  | csDVector3 & | isect |
| ) |  |  | `[static]`

Intersect a 3D segment with the frustum plane By + z = 0.

Assumes an intersection, and returns the intersection point in isect.

static double csDIntersect3::Z0Plane | ( | const csDVector3 & | u,
|  | const csDVector3 & | v,
|  | csDVector3 & | isect |
| ) |  |  | `[static]`

Intersect a 3D segment with the z = 0 plane.

Assumes that there is an intersection (fails if the segment is parallel to the plane), and returns the distance from u to the intersection point. The intersection point is returned in isect.

static double csDIntersect3::ZPlane | ( | double | zval,
|  | const csDVector3 & | u,
|  | const csDVector3 & | v,
|  | csDVector3 & | isect |
| ) |  |  | `[static]`

Intersect a 3D segment with the plane z = zval.

Assumes that there is an intersection (fails if the segment is parallel to the plane), and returns the distance from u to the intersection point. The intersection point is returned in isect.

The documentation for this class was generated from the following file:

- csgeom/math3d_d.h