NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::Scene Class Reference

Class holding 3d scene. More...

#include <Scene.hpp>

Public Member Functions

 Scene (const MeshBase &mesh)
 Constructor. More...
 
 ~Scene (void)
 Destructor. More...
 
int getNumTriangles (void) const
 
int getNumVertices (void) const
 
int getNumEmissive (void) const
 
BuffergetTriVtxIndexBuffer (void)
 Returns buffer of triangle's vertex indieces. More...
 
BuffergetTriNormalBuffer (void)
 Returns triangle normal buffer. More...
 
BuffergetTriMaterialColorBuffer (void)
 Returns material color buffer. More...
 
BuffergetTriShadedColorBuffer (void)
 Returns shaded color buffer. More...
 
BuffergetVtxPosBuffer (void)
 Returns vertex position buffer. More...
 
BuffergetVtxNormalBuffer (void)
 Returns vertex normal buffer. More...
 
BuffergetVtxTexCoordBuffer (void)
 Returns vertex texture coordinate buffer. More...
 
BuffergetTextureAtlasInfo (void)
 Returns texture atlas information buffer. More...
 
BuffergetMaterialIds (void)
 Returns material id buffer. More...
 
BuffergetEmissiveTris (void)
 Returns buffer of emissive triangles. More...
 
BuffergetMaterialInfo (void)
 Returns material info buffer. More...
 
TextureAtlasgetTextureAtlas (void)
 Returns texture atlas holding scene's textures. More...
 
U32 hash (void)
 
void getBBox (Vec3f &lo, Vec3f &hi) const
 Gets scene AABB's minimum and maximum vector. More...
 

Detailed Description

Class holding 3d scene.

Definition at line 44 of file Scene.hpp.

Constructor & Destructor Documentation

Scene::Scene ( const MeshBase mesh)

Constructor.

Parameters
[in]meshSource mesh.

Definition at line 34 of file Scene.cpp.

Scene::~Scene ( void  )

Destructor.

Definition at line 168 of file Scene.cpp.

Member Function Documentation

void FW::Scene::getBBox ( Vec3f lo,
Vec3f hi 
) const
inline

Gets scene AABB's minimum and maximum vector.

Parameters
[out]loMinimum vector.
[out]hiMaximum vector.

Definition at line 163 of file Scene.hpp.

Buffer& FW::Scene::getEmissiveTris ( void  )
inline

Returns buffer of emissive triangles.

For each emissive triangle there are three vertex indices saved in this buffer.

Returns
Emissive triangle buffer.

Definition at line 138 of file Scene.hpp.

Buffer& FW::Scene::getMaterialIds ( void  )
inline

Returns material id buffer.

Material id of each vertex is saved in this buffer.

Returns
Material id buffer.

Definition at line 131 of file Scene.hpp.

Buffer& FW::Scene::getMaterialInfo ( void  )
inline

Returns material info buffer.

Buffer contains material information (emissivity, reflectivity, refractivity, texture) for each matId.

Returns
Material info buffer.

Definition at line 145 of file Scene.hpp.

int FW::Scene::getNumEmissive ( void  ) const
inline

Definition at line 68 of file Scene.hpp.

int FW::Scene::getNumTriangles ( void  ) const
inline
Returns
Number of triangles in the scene.

Definition at line 61 of file Scene.hpp.

int FW::Scene::getNumVertices ( void  ) const
inline
Returns
Number of vertices in the scene.

Definition at line 66 of file Scene.hpp.

TextureAtlas* FW::Scene::getTextureAtlas ( void  )
inline

Returns texture atlas holding scene's textures.

Returns
Texture atlas.

Definition at line 151 of file Scene.hpp.

Buffer& FW::Scene::getTextureAtlasInfo ( void  )
inline

Returns texture atlas information buffer.

Buffer contains texture atlas information (xy contains offset, zw contains size).

Returns
Vertex atlas information buffer.

Definition at line 124 of file Scene.hpp.

Buffer& FW::Scene::getTriMaterialColorBuffer ( void  )
inline

Returns material color buffer.

Color of each triangle's material is saved in this buffer.

Returns
Material color buffer.

Definition at line 89 of file Scene.hpp.

Buffer& FW::Scene::getTriNormalBuffer ( void  )
inline

Returns triangle normal buffer.

For each triangle there is a normal vector saved in this buffer.

Returns
Triangle normal buffer.

Definition at line 82 of file Scene.hpp.

Buffer& FW::Scene::getTriShadedColorBuffer ( void  )
inline

Returns shaded color buffer.

Shaded color of each triangle is saved in this buffer.

Returns
Shaded color buffer.

Definition at line 96 of file Scene.hpp.

Buffer& FW::Scene::getTriVtxIndexBuffer ( void  )
inline

Returns buffer of triangle's vertex indieces.

For each triangle, three vertex indices are saved in this buffer.

Returns
Buffer of triangle's vertex indices.

Definition at line 75 of file Scene.hpp.

Buffer& FW::Scene::getVtxNormalBuffer ( void  )
inline

Returns vertex normal buffer.

Normal vector of each vertex is saved in this buffer.

Returns
Vertex normal buffer.

Definition at line 110 of file Scene.hpp.

Buffer& FW::Scene::getVtxPosBuffer ( void  )
inline

Returns vertex position buffer.

Position of each vertex is saved in this buffer.

Returns
Vertex position buffer.

Definition at line 103 of file Scene.hpp.

Buffer& FW::Scene::getVtxTexCoordBuffer ( void  )
inline

Returns vertex texture coordinate buffer.

Texture coordinates of each vertex is saved in this buffer.

Returns
Vertex texture coordinates buffer.

Definition at line 117 of file Scene.hpp.

U32 Scene::hash ( void  )
Returns
Hash of the scene.

Definition at line 174 of file Scene.cpp.


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