My Project
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
RayScene Class Reference

#include <rayScene.h>

Public Member Functions

RayMaterialgetMaterial (int index)
 
int read (char *fileName, int transformType=RayKeyData::MATRIX)
 
int read (FILE *fp, int transformType)
 
int write (char *fileName)
 
int write (FILE *fp=stdout)
 
int RayTrace (const int &width, const int &height, const int &rLimit, const double &cLimit, Image32 &img)
 
Point3D GetColor (Ray3D ray, int rDepth, Point3D cLimit)
 
void RayView (const int &width, const int &height, const int &cplx, const int &factor=RayKeyData::MATRIX)
 
void drawOpenGL (void)
 
void setUpOpenGL (int cplx)
 
void setCurrentTime (double t, int curveFit=LINEAR)
 

Static Public Member Functions

static Point3D Reflect (Point3D v, Point3D n)
 
static int Refract (Point3D v, Point3D n, double ir, Point3D &refract)
 
static Ray3D GetRay (RayCamera *camera, int i, int j, int width, int height)
 

Public Attributes

Point3D ambient
 
Point3D background
 
RayCameracamera
 
class RayLight ** lights
 
int lightNum
 
class StaticRayGroupgroup
 

Detailed Description

This class stores all of the information read out from a .ray file.

Member Function Documentation

void RayScene::drawOpenGL ( void  )

This method calls the OpenGL commands for drawing the scene.

Point3D RayScene::GetColor ( Ray3D  ray,
int  rDepth,
Point3D  cLimit 
)

This is the function responsible for the recursive ray-tracing returning the color obtained by shooting a ray into the scene and recursing until either the recursion depth has been reached or the contribution from subsequent bounces is guaranteed to be less than the cut-off.

RayMaterial * RayScene::getMaterial ( int  index)

This method returns the material with the specified index.

Ray3D RayScene::GetRay ( RayCamera camera,
int  i,
int  j,
int  width,
int  height 
)
static

This function returns that leaves the camera and goes through pixel (i,j) of the view plane

int RayScene::read ( char *  fileName,
int  transformType = RayKeyData::MATRIX 
)

This method reads in the scene-graph from a .ray file.

int RayScene::read ( FILE *  fp,
int  transformType 
)

This method reads in the scene-graph from a .ray file.

Point3D RayScene::Reflect ( Point3D  v,
Point3D  n 
)
static

This function will reflect the vector v about the normal n

int RayScene::Refract ( Point3D  v,
Point3D  n,
double  ir,
Point3D refract 
)
static

This function will refract the vector about the normal using the provided indices of refraction The refracted vector is written into refract and a value of 1 is returned if the refraction succeeded (i.e. the necessary arcsin could be computed)

void RayScene::setCurrentTime ( double  t,
int  curveFit = LINEAR 
)

This method updates the current time, changing the parameter values as needed

void RayScene::setUpOpenGL ( int  cplx)

This method class the OpenGL commands to set up everything that needs to be set up prior to rendering

int RayScene::write ( char *  fileName)

This method writes out the scene-graph to a .ray file.

int RayScene::write ( FILE *  fp = stdout)

This method writes out the scene-graph to a .ray file. If no file is specified the scene-graph is written out stdout.

Member Data Documentation

Point3D RayScene::ambient

The ambient light in the scene

Point3D RayScene::background

The color of the background

RayCamera* RayScene::camera

The camera

class StaticRayGroup* RayScene::group

The root of the scene-graph

int RayScene::lightNum

The number of lights in the scene

class RayLight** RayScene::lights

The list of lights in the scene


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