Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtRay
[Math Tools]


Functions

RwReal  RtLineTriangleIntersectionTest (RwLine *line, RwV3d *normal, RwV3d *v0, RwV3d *v1, RwV3d *v2)
RwBool  RtLineSphereIntersectionTest (RwLine *line, RwSphere *sphere, RwReal *centerDist)
RwLine RtLineClipPlane (RwLine *line, RwPlane *plane)
RwLine RtLineClipBBox (RwLine *line, RwBBox *box)

Detailed Description

Line Toolkit for RenderWare.

RtRay Toolkit Overview

Requirements

Overview

This toolkit provides some functions for operations on lines (which may be used to represent rays fired through a scene).

These functions test for intersections with lines:-

and these functions clip a line to a plane or bounding box:-

Function Documentation

RwLine* RtLineClipBBox RwLine   line,
RwBBox   box
 

RtLineClipBBox clips a line against a bounding box such that the resultant line lies * entirely within the box.

Note that the header file rtray.h must be included, and the program should be linked to rtray.lib.

Parameters:
line  Line to clip against the box
box  Bounding box to clip against
Returns:
Returns one of the following values:
  • line - On success and there is some line left
  • NULL - On failure or if no line remains after clipping
See also:
RtLineTriangleIntersectionTest , RtLineSphereIntersectionTest , RtLineClipPlane
RwLine* RtLineClipPlane RwLine   line,
RwPlane *    plane
 

RtLineClipPlane clips a line against a plane such that the line lies entirely inside the plane. The inside of the plane is defined by the normal (which points outside).

Note that the header file rtray.h must be included, and the program should be linked to rtray.lib.

Parameters:
line  Line to clip against the plane
plane  Plane to clip against
Returns:
Returns one of the following values:
  • line - On success and there is some line left
  • NULL - On failure or if no line remains after clipping
See also:
RtLineTriangleIntersectionTest , RtLineSphereIntersectionTest , RtLineClipBBox
RwBool RtLineSphereIntersectionTest RwLine   line,
RwSphere   sphere,
RwReal   centerDist
 

RtLineSphereIntersectionTest tests for the intersection of a line with a sphere, and returns a distance parameter.

Note:
The centerDist parameter is NOT the distance to the surface of the sphere.
Parameters:
line  Line to intersect with the sphere
sphere  Sphere to intersect the line with
centerDist  The relative position of the sphere's center projected onto the line as a fraction of the lines length. This will usually be a value between zero and one, but can in some cases take values outside this range. Negative values can result when the line starts inside the sphere, and points away from the center.
Returns:
Returns TRUE if an intersection is found.
See also:
RtLineTriangleIntersectionTest , RtLineClipPlane , RtLineClipBBox
RwReal RtLineTriangleIntersectionTest RwLine   line,
RwV3d   normal,
RwV3d   v0,
RwV3d   v1,
RwV3d   v2
 

OBSOLETE: Use RtIntersectionLineTriangle from the rtintsec toolkit.

RtLineTriangleIntersectionTest intersects a line with a triangle and return the parametric distance along the line of intersection.

Note that the header file rtray.h must be included, and the program should be linked to rtray.lib.

Parameters:
line  Line to intersect with the triangle
normal  Surface normal of the triangle
v0  Vertex 1 of the triangle
v1  Vertex 2 of the triangle
v2  Vertex 3 of the triangle
Returns:
Returns one of the following values:
  • positive - Parametric position of intersection along the line with the triangle
  • -1 - On failure or if no intersection was found
See also:
RtLineSphereIntersectionTest , RtLineClipPlane , RtLineClipBBox

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:47:00 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)