Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::Ray< PointT > Class Template Reference

A class representing a ray in n-dimensional space. The class is parameterized by a PointConcept, which must provide the DIM constant and the [] operator for accessing the point coordinates. More...

#include <vclib/space/core/ray.h>

Public Types

using PointType = PointT
 The type of point used to represent the origin and direction of the ray.
 
using ScalarType = PointT::ScalarType
 The scalar type of the ray.
 

Public Member Functions

PointT & direction ()
 Returns the direction of the ray.
 
const PointT & direction () const
 Returns the direction of the ray.
 
PointT normalizedDirection () const
 
bool operator!= (const Ray< PointT > &s) const =default
 
bool operator== (const Ray< PointT > &s) const =default
 
PointT & origin ()
 Returns the origin of the ray.
 
const PointT & origin () const
 Returns the origin of the ray.
 
 Ray ()
 Default constructor. Creates an invalid Ray at the origin (direction is zero).
 
 Ray (const PointT &origin, const PointT &direction)
 Creates a ray with the given origin and direction.
 

Static Public Attributes

static const uint DIM = PointT::DIM
 The dimensionality of the ray.
 

Private Attributes

PointT mDirection
 
PointT mOrigin
 

Detailed Description

template<PointConcept PointT>
class vcl::Ray< PointT >

A class representing a ray in n-dimensional space. The class is parameterized by a PointConcept, which must provide the DIM constant and the [] operator for accessing the point coordinates.

Template Parameters
PointTThe type of the two endpoint points of the ray.

Constructor & Destructor Documentation

◆ Ray()

template<PointConcept PointT>
vcl::Ray< PointT >::Ray ( const PointT &  origin,
const PointT &  direction 
)
inline

Creates a ray with the given origin and direction.

Parameters
[in]originThe origin of the ray.
[in]directionThe direction of the ray.

Member Function Documentation

◆ direction() [1/2]

template<PointConcept PointT>
PointT & vcl::Ray< PointT >::direction ( )
inline

Returns the direction of the ray.

Returns
A reference to the direction of the ray.

◆ direction() [2/2]

template<PointConcept PointT>
const PointT & vcl::Ray< PointT >::direction ( ) const
inline

Returns the direction of the ray.

Returns
A reference to the direction of the ray.

◆ origin() [1/2]

template<PointConcept PointT>
PointT & vcl::Ray< PointT >::origin ( )
inline

Returns the origin of the ray.

Returns
A reference to the origin of the ray.

◆ origin() [2/2]

template<PointConcept PointT>
const PointT & vcl::Ray< PointT >::origin ( ) const
inline

Returns the origin of the ray.

Returns
A const reference to the origin of the ray.

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