Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Public Attributes | List of all members
om::math::Ray2D< T > Class Template Reference

A class that represents a ray in 2D space. More...

#include <omRay2D.h>

Public Member Functions

 Ray2D ()
 Create a ray starting at the origin pointing in the positive Y direction. More...
 
 Ray2D (const VectorND< T, 2 > &newOrigin, const VectorND< T, 2 > &newDirection)
 Create a ray with the specified origin and direction. More...
 
VectorND< T, 2 > getPositionAt (T parameter) const
 Get the position along the ray at the specified parameter value. More...
 
VectorND< T, 2 > normalize () const
 Return a new ray with a unit-length direction vector. More...
 

Public Attributes

VectorND< T, 2 > origin
 The origin of the ray in 2D space;. More...
 
VectorND< T, 2 > direction
 The direction of the ray in 2D space. More...
 

Detailed Description

template<typename T>
class om::math::Ray2D< T >

A class that represents a ray in 2D space.

This class contains two data members: origin and direction. Origin represents the starting position of the ray and direction represents the positively parameterized direction along the ray.

Constructor & Destructor Documentation

template<typename T >
om::math::Ray2D< T >::Ray2D ( )
inline

Create a ray starting at the origin pointing in the positive Y direction.

template<typename T >
om::math::Ray2D< T >::Ray2D ( const VectorND< T, 2 > &  newOrigin,
const VectorND< T, 2 > &  newDirection 
)
inline

Create a ray with the specified origin and direction.

Member Function Documentation

template<typename T >
VectorND<T,2> om::math::Ray2D< T >::getPositionAt ( parameter) const
inline

Get the position along the ray at the specified parameter value.

This position is calculated using the equation: position = origin + parameter*direction.

template<typename T >
VectorND<T,2> om::math::Ray2D< T >::normalize ( ) const
inline

Return a new ray with a unit-length direction vector.

Member Data Documentation

template<typename T >
VectorND<T,2> om::math::Ray2D< T >::origin

The origin of the ray in 2D space;.

template<typename T >
VectorND<T,2> om::math::Ray2D< T >::direction

The direction of the ray in 2D space.


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