PhotoGENius V1.0.0
A basic library for generating photorealistic images, developed for the course Numerical techniques for photorealistic image generation.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PGENLib.Ray Struct Reference

Public Member Functions

 Ray ()
 Empty constructor.
 
 Ray (Point origin, Vec dir)
 Constructor to create a Ray.
 
 Ray (Point origin, Vec dir, float tmin, float tmax=float.PositiveInfinity, int depth=0)
 Constructor to create a Ray.
 
Point get_Origin ()
 
Vec get_Dir ()
 
Point At (float t)
 
Ray Transform (Transformation tr)
 This method returns a new ray whose origin and direction are the transformation of the original ray. More...
 

Static Public Member Functions

static bool are_close (Ray a, Ray b)
 Check if two rays are similar enough to be considered equal. More...
 

Public Attributes

Point Origin
 
Vec Dir
 
float Tmin
 
float Tmax
 
int Depth
 

Detailed Description

The class contains the following members:

Origin the 3D Point where the ray originated
Dir the 3D direction (Vec) along which this ray propagates
Tmin the minimum float distance travelled by the ray is this number times dir
Tmax the maximum distance travelled by the ray is this number times dir
Depth int number of times this ray was reflected/refracted

Member Function Documentation

◆ are_close()

static bool PGENLib.Ray.are_close ( Ray  a,
Ray  b 
)
static

Check if two rays are similar enough to be considered equal.

Parameters
a
b
Returns

◆ Transform()

Ray PGENLib.Ray.Transform ( Transformation  tr)

This method returns a new ray whose origin and direction are the transformation of the original ray.

Parameters
tr
Returns

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