mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
mrs_lib::geometry::Ray Class Reference

geometric representation of a ray. Instantiate it by two input Vector3. Use static methods for from-to raycast, or a point-direction raycast. More...

#include <shapes.h>

Public Member Functions

 Ray ()
 constructor without initialization of internal variables
 
 ~Ray ()
 destructor
 
 Ray (Eigen::Vector3d p1, Eigen::Vector3d p2)
 default constructor More...
 
const Eigen::Vector3d p1 () const
 get the origin point More...
 
const Eigen::Vector3d p2 () const
 get the end point More...
 
const Eigen::Vector3d direction () const
 get the direction of ray (normalized) More...
 

Static Public Member Functions

static Ray twopointCast (Eigen::Vector3d pointFrom, Eigen::Vector3d pointTo)
 static method for generating new rays by raycasting from-to More...
 
static Ray directionCast (Eigen::Vector3d origin, Eigen::Vector3d direction)
 static method for generating new rays by raycasting origin-direction More...
 

Detailed Description

geometric representation of a ray. Instantiate it by two input Vector3. Use static methods for from-to raycast, or a point-direction raycast.

Constructor & Destructor Documentation

◆ Ray()

mrs_lib::geometry::Ray::Ray ( Eigen::Vector3d  p1,
Eigen::Vector3d  p2 
)

default constructor

Parameters
p1origin of the ray
p2endpoint of the ray

Member Function Documentation

◆ direction()

const Eigen::Vector3d mrs_lib::geometry::Ray::direction ( ) const

get the direction of ray (normalized)

Returns
direction (normalized)

◆ directionCast()

Ray mrs_lib::geometry::Ray::directionCast ( Eigen::Vector3d  origin,
Eigen::Vector3d  direction 
)
static

static method for generating new rays by raycasting origin-direction

Parameters
originorigin of the ray
directionof the ray
Returns
new Ray instance created by raycasting

◆ p1()

const Eigen::Vector3d mrs_lib::geometry::Ray::p1 ( ) const

get the origin point

Returns
ray origin point

◆ p2()

const Eigen::Vector3d mrs_lib::geometry::Ray::p2 ( ) const

get the end point

Returns
ray end point

◆ twopointCast()

Ray mrs_lib::geometry::Ray::twopointCast ( Eigen::Vector3d  pointFrom,
Eigen::Vector3d  pointTo 
)
static

static method for generating new rays by raycasting from-to

Parameters
pointFromorigin of the ray
pointToendpoint of the ray
Returns
new Ray instance created by raycasting

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