Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

gmtl::Ray Class Template Reference

Describes a ray. More...

#include <Ray.h>

Inheritance diagram for gmtl::Ray:

Inheritance graph
[legend]
Collaboration diagram for gmtl::Ray:

Collaboration graph
[legend]
List of all members.

Public Methods

 Ray ()
 Constructs a ray at the origin with a zero vector. More...

 Ray (const Point< DATA_TYPE, 3 > &origin, const Vec< DATA_TYPE, 3 > &dir)
 Constructs a ray with the given origin and vector. More...

 Ray (const Ray &lineseg)
 Constructs an exact duplicate of the given ray. More...

const Point< DATA_TYPE, 3 > & getOrigin () const
 Gets the origin of the ray. More...

void setOrigin (const Point< DATA_TYPE, 3 > &origin)
 Sets the origin point for this ray. More...

const Vec< DATA_TYPE, 3 > & getDir () const
 Gets the vector describing the direction and length of the ray. More...

void setDir (const Vec< DATA_TYPE, 3 > &dir)
 Sets the vector describing the direction and length of the ray. More...


Public Attributes

Point< DATA_TYPE, 3 > mOrigin
 The origin of the ray. More...

Vec< DATA_TYPE, 3 > mDir
 The vector along which the ray lies. More...


Detailed Description

template<class DATA_TYPE>
class gmtl::Ray< DATA_TYPE >

Describes a ray.

This is represented by a point origin O and a normalized vector direction. Any point on the ray can be described as

P(s) = O + Vs

where 0 <= s <= 1

Parameters:
DATA_TYPE  the internal type used for the point and vector

Definition at line 55 of file Ray.h.


Constructor & Destructor Documentation

template<class DATA_TYPE>
gmtl::Ray< DATA_TYPE >::Ray   [inline]
 

Constructs a ray at the origin with a zero vector.

Definition at line 61 of file Ray.h.

Referenced by gmtl::LineSeg::LineSeg, and Ray.

00062    {}

template<class DATA_TYPE>
gmtl::Ray< DATA_TYPE >::Ray const Point< DATA_TYPE, 3 > &    origin,
const Vec< DATA_TYPE, 3 > &    dir
[inline]
 

Constructs a ray with the given origin and vector.

Parameters:
origin  the point at which the ray starts
dir  the vector describing the direction and length of the ray starting at origin

Definition at line 71 of file Ray.h.

References mDir, and mOrigin.

00072       : mOrigin( origin ), mDir( dir )
00073    {}

template<class DATA_TYPE>
gmtl::Ray< DATA_TYPE >::Ray const Ray< DATA_TYPE > &    lineseg [inline]
 

Constructs an exact duplicate of the given ray.

Parameters:
lineseg  the ray to copy

Definition at line 82 of file Ray.h.

References mDir, mOrigin, and Ray.

00083    {
00084       mOrigin = lineseg.mOrigin;
00085       mDir = lineseg.mDir;
00086    }


Member Function Documentation

template<class DATA_TYPE>
const Vec<DATA_TYPE, 3>& gmtl::Ray< DATA_TYPE >::getDir   const [inline]
 

Gets the vector describing the direction and length of the ray.

Returns:
the ray's vector

Definition at line 113 of file Ray.h.

References mDir.

00114    {
00115       return mDir;
00116    }

template<class DATA_TYPE>
const Point<DATA_TYPE, 3>& gmtl::Ray< DATA_TYPE >::getOrigin   const [inline]
 

Gets the origin of the ray.

Returns:
the point at the beginning of the line

Definition at line 93 of file Ray.h.

References mOrigin.

00094    {
00095       return mOrigin;
00096    }

template<class DATA_TYPE>
void gmtl::Ray< DATA_TYPE >::setDir const Vec< DATA_TYPE, 3 > &    dir [inline]
 

Sets the vector describing the direction and length of the ray.

Parameters:
dir  the ray's vector

Definition at line 123 of file Ray.h.

References mDir.

00124    {
00125       mDir = dir;
00126    }

template<class DATA_TYPE>
void gmtl::Ray< DATA_TYPE >::setOrigin const Point< DATA_TYPE, 3 > &    origin [inline]
 

Sets the origin point for this ray.

Parameters:
origin  the point at which the ray starts

Definition at line 103 of file Ray.h.

References mOrigin.

00104    {
00105       mOrigin = origin;
00106    }


Member Data Documentation

template<class DATA_TYPE>
Vec<DATA_TYPE, 3> gmtl::Ray::mDir
 

The vector along which the ray lies.

Definition at line 137 of file Ray.h.

Referenced by getDir, gmtl::LineSeg::LineSeg, Ray, and setDir.

template<class DATA_TYPE>
Point<DATA_TYPE, 3> gmtl::Ray::mOrigin
 

The origin of the ray.

Definition at line 132 of file Ray.h.

Referenced by getOrigin, gmtl::LineSeg::LineSeg, Ray, and setOrigin.


The documentation for this class was generated from the following file:
Generated on Mon Apr 7 15:29:31 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002