Assignments Assignments

Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
Ray::Scene Class Reference

`#include <scene.h>`

Inheritance diagram for Ray::Scene:

## Public Member Functions
Util::Point3D | getColor (Util::Ray3D ray, int rDepth, Util::Point3D cLimit, unsigned int lightSamples, unsigned int tIdx)
Image::Image32 | rayTrace (int width, int height, int rLimit, double cLimit, unsigned int lightSamples, bool showProgress)
void | initOpenGL (void)
void | drawOpenGL (void) const
bool | processFirstIntersection (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
int | processAllIntersections (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
Public Member Functions inherited from Ray::SceneGeometry
void | init (void)
template<typename ParameterType >
void | setKeyFrameEvaluator (void)
void | setCurrentTime (double t, int curveFit)
std::string | name (void) const
void | init (const LocalSceneData &sceneData)
void | initOpenGL (void)
void | updateBoundingBox (void)
bool | processFirstIntersection (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
int | processAllIntersections (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
void | processOverlapping (const Filter &filter, const Kernel &kernel, ShapeProcessingInfo tInfo) const
bool | isInside (Util::Point3D p) const
void | drawOpenGL (GLSLProgram *glslProgram) const
Public Member Functions inherited from Ray::Shape
virtual | ~Shape (void)
ShapeBoundingBox | boundingBox (void) const
virtual void | init (const class LocalSceneData &data)=0
virtual void | addTrianglesOpenGL (std::vector< class TriangleIndex > &triangles)
size_t | primitiveNum (void) const

## Static Public Member Functions
static Util::Point3D | Reflect (Util::Point3D v, Util::Point3D n)
static bool | Refract (Util::Point3D v, Util::Point3D n, double ir, Util::Point3D &refract)
Static Public Member Functions inherited from Ray::Shape
static void | WriteInset (std::ostream &stream)

## Static Public Attributes
static std::string | BaseDir = "." + std::string( 1 , Util::FileSeparator )
Static Public Attributes inherited from Ray::Shape
static unsigned int | OpenGLTessellationComplexity
static unsigned int | WriteInsetSize = 0

## Private Attributes
GlobalSceneData | _globalData

## Additional Inherited Members
Public Types inherited from Ray::Shape
typedef std::function< ShapeProcessingInfo::ProcessingType(const ShapeProcessingInfo &, const Shape &) > | Filter
typedef std::function< void(const ShapeProcessingInfo &, const Shape &) > | Kernel
typedef std::function< bool(double) > | RayIntersectionFilter
typedef std::function< bool(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > | RayIntersectionKernel
Protected Attributes inherited from Ray::Shape
ShapeBoundingBox | _bBox
size_t | _primitiveNum

## Detailed Description

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

## Member Function Documentation

## ◆ drawOpenGL()

void Scene::drawOpenGL | ( | void |  | ) | const

This method calls the necessary OpenGL commands to render the primitive.

## ◆ getColor()

Point3D Scene::getColor | ( | Util::Ray3D | ray,
|  | int | rDepth,
|  | Util::Point3D | cLimit,
|  | unsigned int | lightSamples,
|  | unsigned int | tIdx )

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.

## ◆ initOpenGL()

void Scene::initOpenGL | ( | void |  | ) |
| virtual

This method should be called (once) after an OpenGL context has been created

Implements Ray::Shape.

## ◆ processAllIntersections()

int Scene::processAllIntersections | ( | const Util::Ray3D & | ray,
|  | const Util::BoundingBox1D & | range,
|  | const RayIntersectionFilter & | rFilter,
|  | const RayIntersectionKernel & | rKernel,
|  | ShapeProcessingInfo | spInfo,
|  | unsigned int | tIdx ) const
| virtual

This method processes all shapes which intersect the ray within the prescribed range and passing the rFilter test, invoking the rKernel kernel with the intersection information. The processing terminates early if the kernel returns false. The function returns the number of valid intersections.

Implements Ray::Shape.

## ◆ processFirstIntersection()

bool Scene::processFirstIntersection | ( | const Util::Ray3D & | ray,
|  | const Util::BoundingBox1D & | range,
|  | const RayIntersectionFilter & | rFilter,
|  | const RayIntersectionKernel & | rKernel,
|  | ShapeProcessingInfo | spInfo,
|  | unsigned int | tIdx ) const
| virtual

This method ray-traces the primitive

Implements Ray::Shape.

## ◆ rayTrace()

Image32 Scene::rayTrace | ( | int | width,
|  | int | height,
|  | int | rLimit,
|  | double | cLimit,
|  | unsigned int | lightSamples,
|  | bool | showProgress )

This method ray-traces the scene and returns the computed image

## ◆ Reflect()

Point3D Scene::Reflect | ( | Util::Point3D | v,
|  | Util::Point3D | n )
| static

This function reflects the vector v about the normal n.

## ◆ Refract()

bool Scene::Refract | ( | Util::Point3D | v,
|  | Util::Point3D | n,
|  | double | ir,
|  | Util::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 true is returned if the refraction succeeded (i.e. the necessary arcsin could be computed).

## Member Data Documentation

## ◆ _globalData

GlobalSceneData Ray::Scene::_globalData
| private

The global data

## ◆ BaseDir

std::string Scene::BaseDir = "." + std::string( 1 , Util::FileSeparator )
| static

The base directory

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

- Assignments/Ray/scene.h
- Assignments/Ray/scene.cpp
- Assignments/Ray/scene.todo.cpp