UniformGrid Class Reference

Uniform grid builder. More...

#include <UniformGrid.h>

List of all members.

Public Member Functions

 UniformGrid (Scene &scene, int minimalSideSize=-1)
bool prepareCudaTexture (float3 &minimum, float3 &maximum, float &cellSize, uint3 &dim, cudaArray *&cudaGrid, uint4 *&triangles, cudaArray *&vertices, cudaArray *&normalsOut)
 Prepare grid for use in CUDA.

Public Attributes

int dimX
 Number of cells in x dimension.
int dimY
 Number of cells in y dimension.
int dimZ
 Number of cells in z dimension.
float cuCellSize
 Size of one cell in world space. The size is the same in all dimensions.
float3 cuMinimum
 Minimum extent of the grid, prepared for CUDA.
float3 cuMaximum
 Maximum extent of the grid, prepared for CUDA.
unsigned totalPoly
 Total number of faces of objects included in the grid.
unsigned totalVertex
 Total number of vertices of objects included in the grid.
Cell * grid
 Cells of the grid.
Vertex * transformed
 Vertices of objects in grid, transformed into world space.
Vertex * normals
 Normals associated with vertices. Has one normal for each vertex.
Triangle * cellTriangles
 Faces of the grid.
bool videoAllocated
 True if video memory is allocated.
cudaArray * savedGrid
 Saved pointer for video memory dealocation.
uint4 * savedTriangles
 Saved pointer for video memory dealocation.
cudaArray * savedVertices
 Saved pointer for video memory dealocation.
cudaArray * savedNormals
 Saved pointer for video memory dealocation.


Detailed Description

Uniform grid builder.

Member Function Documentation

bool UniformGrid::prepareCudaTexture ( float3 &  minimum,
float3 &  maximum,
float &  cellSize,
uint3 &  dim,
cudaArray *&  cudaGrid,
uint4 *&  triangles,
cudaArray *&  vertices,
cudaArray *&  normalsOut 
)

Prepare grid for use in CUDA.

Copy the grid data to video card's linear memory. Uses texture to store the cells,vertices,normals and linear memory to store triangles.

Parameters:
minimum Returns minimum extent of the grid.
maximum Returns maximum extent of the grid.
cellSize Returns size of the cell
dim Returns size of grid
cudaGrid Pointer to cells in video memory
triangles Pointer to triangles in video memory
vertices Pointer to vertices in video memory
normalsOut Pointer to normals in video memory
Returns:
true if succesfull, false if out of memory


Member Data Documentation

Faces of the grid.

Referenced from grid cells. Has size of total number of triangles referenced in cells. This can be several time the number in totalPoly.


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

Generated on Fri Jan 23 00:21:49 2009 for Raytracer by  doxygen 1.5.7.1