GClasses
|
Represents a scene that you can ray-trace.
#include <GRayTrace.h>
Public Types |
Public Member Functions | |
GRayTraceScene (GRand *pRand) | |
GRayTraceScene (GDomNode *pNode, GRand *pRand) | |
~GRayTraceScene () | |
void | activateDistanceMap () |
void | addLight (GRayTraceLight *pLight) |
void | addMaterial (GRayTraceMaterial *pMaterial) |
void | addMesh (GRayTraceTriMesh *pMesh) |
void | addObject (GRayTraceObject *pObject) |
GRayTraceColor * | ambientLight () |
GRayTraceColor * | backgroundColor () |
GRayTraceBoundingBoxBase * | boundingBoxTree () |
GRayTraceCamera * | camera () |
G3DReal * | distanceMap () |
void | drawWireFrame () |
This draws a wire frame of the scene. This is a fast way to ensure your camera is looking where you think it is looking before you perform a long render. More... | |
void | flushObjects () |
Deletes all the materials and objects. (Leaves the lights and camera as they are.) More... | |
GImage * | image () |
Returns the rendered image (or partially rendered image). Returns NULL if Render() or RenderBegin() has not been called yet. More... | |
GRayTraceLight * | light (size_t n) |
size_t | lightCount () |
GRayTraceMaterial * | material (size_t n) |
size_t | materialCount () |
size_t | materialIndex (GRayTraceMaterial *pMaterial) const |
std::vector< GRayTraceMaterial * > & | materials () |
GRayTraceTriMesh * | mesh (size_t n) |
size_t | meshCount () |
size_t | meshIndex (GRayTraceTriMesh *pMesh) const |
GRayTraceObject * | object (size_t n) |
size_t | objectCount () |
size_t | objectIndex (GRayTraceObject *pObj) const |
GRand * | rand () |
GImage * | releaseImage () |
void | render () |
This method calls RenderBegin, then calls RenderLine until the whole image has been rendered. More... | |
void | renderBegin () |
Call this before calling RenderLine(). It resets the image and computes values necessary for rendering. More... | |
bool | renderLine () |
Call this to render a singe horizontal line of the image. Returns true if there's still more rendering to do. Returns false if it's done. You must call RenderBegin() once before you start calling this method. More... | |
unsigned int | renderPixel (GRayTraceRay *pRay, G3DVector *pScreenPoint, G3DReal *pDistance) |
unsigned int | renderPixelAntiAliassed (GRayTraceRay *pRay, G3DVector *pScreenPoint, G3DReal *pDistance) |
unsigned int | renderPixelPathTrace (GRayTraceRay *pRay, G3DVector *pScreenPoint) |
unsigned int | renderSinglePixel (int x, int y) |
This calls RenderBegine and then renders a single pixel. It's not efficient to call this method for every pixel. The only purpose for this method is to make debugging the ray tracer easier. Pick a pixel that isn't rendered the way you want and step through the ray tracing process to see why. More... | |
GDomNode * | serialize (GDom *pDoc) const |
Marshal this object into a DOM, which can then be converted to a variety of serial formats. More... | |
void | setAmbientLight (G3DReal r, G3DReal g, G3DReal b) |
void | setBackgroundColor (G3DReal a, G3DReal r, G3DReal g, G3DReal b) |
void | setRenderMode (RenderMode eMode) |
Specify whether to emphasize quality or speed. More... | |
void | setToneMappingConstant (G3DReal c) |
void | swapObjects (GRayTraceScene *pOther) |
Swap all matrials, meshes and objects with the other scene. (Leaves the camera and lights as they are.) More... | |
Protected Attributes | |
GRayTraceColor | m_ambientLight |
GRayTraceColor | m_backgroundColor |
RenderMode | m_eMode |
Rendering values. More... | |
std::vector< GRayTraceLight * > | m_lights |
std::vector< GRayTraceMaterial * > | m_materials |
std::vector< GRayTraceTriMesh * > | m_meshes |
int | m_nY |
std::vector< GRayTraceObject * > | m_objects |
GRayTraceBoundingBoxBase * | m_pBoundingBoxTree |
GRayTraceCamera * | m_pCamera |
G3DReal * | m_pDistanceMap |
GImage * | m_pImage |
G3DVector | m_pixDX |
G3DVector | m_pixDY |
G3DVector | m_pixSide |
GRand * | m_pRand |
G3DReal | m_toneMappingConstant |
GClasses::GRayTraceScene::GRayTraceScene | ( | GRand * | pRand | ) |
GClasses::GRayTraceScene::~GRayTraceScene | ( | ) |
void GClasses::GRayTraceScene::activateDistanceMap | ( | ) |
void GClasses::GRayTraceScene::addLight | ( | GRayTraceLight * | pLight | ) |
void GClasses::GRayTraceScene::addMaterial | ( | GRayTraceMaterial * | pMaterial | ) |
void GClasses::GRayTraceScene::addMesh | ( | GRayTraceTriMesh * | pMesh | ) |
void GClasses::GRayTraceScene::addObject | ( | GRayTraceObject * | pObject | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void GClasses::GRayTraceScene::drawWireFrame | ( | ) |
This draws a wire frame of the scene. This is a fast way to ensure your camera is looking where you think it is looking before you perform a long render.
void GClasses::GRayTraceScene::flushObjects | ( | ) |
Deletes all the materials and objects. (Leaves the lights and camera as they are.)
|
inline |
Returns the rendered image (or partially rendered image). Returns NULL if Render() or RenderBegin() has not been called yet.
GRayTraceLight* GClasses::GRayTraceScene::light | ( | size_t | n | ) |
size_t GClasses::GRayTraceScene::lightCount | ( | ) |
GRayTraceMaterial* GClasses::GRayTraceScene::material | ( | size_t | n | ) |
size_t GClasses::GRayTraceScene::materialCount | ( | ) |
size_t GClasses::GRayTraceScene::materialIndex | ( | GRayTraceMaterial * | pMaterial | ) | const |
|
inline |
GRayTraceTriMesh* GClasses::GRayTraceScene::mesh | ( | size_t | n | ) |
size_t GClasses::GRayTraceScene::meshCount | ( | ) |
size_t GClasses::GRayTraceScene::meshIndex | ( | GRayTraceTriMesh * | pMesh | ) | const |
GRayTraceObject* GClasses::GRayTraceScene::object | ( | size_t | n | ) |
size_t GClasses::GRayTraceScene::objectCount | ( | ) |
size_t GClasses::GRayTraceScene::objectIndex | ( | GRayTraceObject * | pObj | ) | const |
|
inline |
|
inline |
void GClasses::GRayTraceScene::render | ( | ) |
This method calls RenderBegin, then calls RenderLine until the whole image has been rendered.
void GClasses::GRayTraceScene::renderBegin | ( | ) |
Call this before calling RenderLine(). It resets the image and computes values necessary for rendering.
bool GClasses::GRayTraceScene::renderLine | ( | ) |
Call this to render a singe horizontal line of the image. Returns true if there's still more rendering to do. Returns false if it's done. You must call RenderBegin() once before you start calling this method.
unsigned int GClasses::GRayTraceScene::renderPixel | ( | GRayTraceRay * | pRay, |
G3DVector * | pScreenPoint, | ||
G3DReal * | pDistance | ||
) |
unsigned int GClasses::GRayTraceScene::renderPixelAntiAliassed | ( | GRayTraceRay * | pRay, |
G3DVector * | pScreenPoint, | ||
G3DReal * | pDistance | ||
) |
unsigned int GClasses::GRayTraceScene::renderPixelPathTrace | ( | GRayTraceRay * | pRay, |
G3DVector * | pScreenPoint | ||
) |
unsigned int GClasses::GRayTraceScene::renderSinglePixel | ( | int | x, |
int | y | ||
) |
This calls RenderBegine and then renders a single pixel. It's not efficient to call this method for every pixel. The only purpose for this method is to make debugging the ray tracer easier. Pick a pixel that isn't rendered the way you want and step through the ray tracing process to see why.
Marshal this object into a DOM, which can then be converted to a variety of serial formats.
|
inline |
|
inline |
Specify whether to emphasize quality or speed.
|
inline |
void GClasses::GRayTraceScene::swapObjects | ( | GRayTraceScene * | pOther | ) |
Swap all matrials, meshes and objects with the other scene. (Leaves the camera and lights as they are.)
|
protected |
|
protected |
|
protected |
Rendering values.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |