INFO804 Introduction à l'informatique graphique
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
rt::Ray Struct Reference

#include <Ray.h>

Public Member Functions

 Ray ()
 Default constructor.
 
 Ray (const Point3 &o, const Vector3 &dir, int d=1)
 Constructor from origin and vector. The vector may not be unitary.
 

Public Attributes

Point3 origin
 origin of the ray.
 
Vector3 direction
 unit direction of the ray.
 
int depth
 depth of the ray, i.e. the number of times it can bounce on an object.
 

Detailed Description

This structure stores a ray having an origin and a direction. It also stores its depth.

Definition at line 18 of file Ray.h.

Constructor & Destructor Documentation

◆ Ray() [1/2]

rt::Ray::Ray ( )
inline

Default constructor.

Definition at line 27 of file Ray.h.

27{}

◆ Ray() [2/2]

rt::Ray::Ray ( const Point3 o,
const Vector3 dir,
int  d = 1 
)
inline

Constructor from origin and vector. The vector may not be unitary.

Definition at line 30 of file Ray.h.

31 : origin( o ), direction( dir ), depth( d )
32 {
33 Real l = direction.norm();
34 if ( l != 1.0f ) direction /= l;
35 }
float Real
the type for representing a real number.
Point3 origin
origin of the ray.
Definition Ray.h:20
int depth
depth of the ray, i.e. the number of times it can bounce on an object.
Definition Ray.h:24
Vector3 direction
unit direction of the ray.
Definition Ray.h:22

Member Data Documentation

◆ depth

int rt::Ray::depth

depth of the ray, i.e. the number of times it can bounce on an object.

Definition at line 24 of file Ray.h.

◆ direction

Vector3 rt::Ray::direction

unit direction of the ray.

Definition at line 22 of file Ray.h.

◆ origin

Point3 rt::Ray::origin

origin of the ray.

Definition at line 20 of file Ray.h.


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