Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::RenderOperation Class Reference

Class describing a rendering operation like how to draw a triangle. More...

#include <OgreRenderOperation.h>

List of all members.

Public Types

enum  OpType {
  OT_POINT_LIST, OT_LINE_LIST, OT_LINE_STRIP, OT_TRIANGLE_LIST,
  OT_TRIANGLE_STRIP, OT_TRIANGLE_FAN
}
enum  VertexOptions {
  VO_NORMALS = 1, VO_TEXTURE_COORDS = 2, VO_DIFFUSE_COLOURS = 4, VO_SPECULAR_COLOURS = 8,
  VO_BLEND_WEIGHTS = 16
}
 Vertex options - which elements to include. More...


Public Methods

 RenderOperation ()

Public Attributes

bool useIndexes
unsigned int numVertices
 Number of vertices (applies to all components). More...

unsigned short numBlendWeightsPerVertex
 The number of vertex blending weights per vertex, only applicable if VO_BLEND_WEIGHTS supplied. More...

RealpVertices
 Pointer to list of vertices (float {x, y z} * numVertices). More...

unsigned short vertexStride
 The 'Stride' between sets of vertex data. 0 indicates data is packed with no gaps. More...

RealpNormals
 Optional vertex normals for vertices (float {x, y, z} * numVertices). More...

unsigned short normalStride
 The 'Stride' between sets of normal data. 0 indicates data is packed with no gaps. More...

RealpTexCoords [OGRE_MAX_TEXTURE_COORD_SETS]
 Optional texture coordinates for vertices (float {u, [v], [w]} * numVertices). More...

unsigned short texCoordStride [OGRE_MAX_TEXTURE_COORD_SETS]
 The 'Stride' between each set of texture data. 0 indicates data is packed with no gaps. More...

int numTextureCoordSets
 Number of groups of u,[v],[w]. More...

int numTextureDimensions [OGRE_MAX_TEXTURE_COORD_SETS]
 Number of dimensions in each corresponding texture coordinate set. More...

RGBApDiffuseColour
 Optional pointer to a list of diffuse vertex colours (32-bit RGBA * numVertices). More...

unsigned short diffuseStride
 The 'Stride' between sets of diffuse colour data. 0 indicates data is packed with no gaps. More...

RGBApSpecularColour
 Optional pointer to a list of specular vertex colours (32-bit RGBA * numVertices). More...

unsigned short specularStride
 The 'Stride' between sets of specular colour data. 0 indicates data is packed with no gaps. More...

VertexBlendDatapBlendingWeights
 Optional pointer to a list of vertex blending details, organised in vertex order. More...

unsigned short * pIndexes
 Pointer to a list of vertex indexes describing faces (only used if useIndexes is true). More...

unsigned int numIndexes
 The number of vertex indexes (must be a multiple of 3). More...

int vertexOptions
 Flags indicating vertex types. More...

OpType operationType
 The type of rendering operation. More...


Detailed Description

Class describing a rendering operation like how to draw a triangle.

Remarks:
This class encapsulates the description of a rendering operation, including the type (single triangle, list of triangles, triangle strip, etc), the vertex format (e.g. whether vertex colours, texture co-ords are present).

Render options like filtering, z-buffer options etc are not provided here, but via, various 'set' methods of the RenderSystem class, since render state changes are typically expensive, so the assumption is that render states will remain fairly constant between rendering operations if possible.

Notes on indexed triangle lists: Vertices are not duplicated in the rendering pipeline where they are shared by multiple triangles. Be aware, however, that when sharing vertices ALL aspects are shared, including the vertex normal and texture coordinates which is not always appropriate (e.g. if you want a 'hard' edge to a join, or at the seam of a texture). You should pre-duplicate the vertices where this is a problem with the separate texture and normal values. The Ogre library does this automatically with imported models.

In all cases, remember that Ogre uses a right-handed world co-ordinate system, (hold your right-hand flat in the X-axis direction and curl your fingers toward the Y-Axis: your thumb points in the positive Z-axis direction). Note that in screen space this gets flipped so higher Z is into the screen. This is a standard system as used by most maths texts and modelling tools (and OpenGL, but not D3D). In addition, the FRONT of triangles is deemed to be the side where the vertices are in counter-clockwise in RH co-ords as viewed from the camera.


Member Enumeration Documentation

enum Ogre::RenderOperation::OpType
 

Enumeration values:
OT_POINT_LIST 
OT_LINE_LIST 
OT_LINE_STRIP 
OT_TRIANGLE_LIST 
OT_TRIANGLE_STRIP 
OT_TRIANGLE_FAN 

enum Ogre::RenderOperation::VertexOptions
 

Vertex options - which elements to include.

Remarks:
Vertices must include their elements in the following order: position, normal, texture co-ords (1-3 dimensions, 1-4 sets), diffuse colour, specular colour. Only position is mandatory, although at least ONE OF the following should be specified, even if ambient light on flat coloured objects only is being used.
Enumeration values:
VO_NORMALS  vertex normals included (for lighting).
VO_TEXTURE_COORDS  at least one set of texture coords (exact number specified in class).
VO_DIFFUSE_COLOURS  Vertex colours - diffuse.
VO_SPECULAR_COLOURS  Vertex colours - specular.
VO_BLEND_WEIGHTS  Vertex blend weights.


Constructor & Destructor Documentation

Ogre::RenderOperation::RenderOperation   [inline]
 


Member Data Documentation

unsigned short Ogre::RenderOperation::diffuseStride
 

The 'Stride' between sets of diffuse colour data. 0 indicates data is packed with no gaps.

unsigned short Ogre::RenderOperation::normalStride
 

The 'Stride' between sets of normal data. 0 indicates data is packed with no gaps.

unsigned short Ogre::RenderOperation::numBlendWeightsPerVertex
 

The number of vertex blending weights per vertex, only applicable if VO_BLEND_WEIGHTS supplied.

unsigned int Ogre::RenderOperation::numIndexes
 

The number of vertex indexes (must be a multiple of 3).

int Ogre::RenderOperation::numTextureCoordSets
 

Number of groups of u,[v],[w].

int Ogre::RenderOperation::numTextureDimensions[OGRE_MAX_TEXTURE_COORD_SETS]
 

Number of dimensions in each corresponding texture coordinate set.

Note:
There should be 1-4 dimensions on each set.

unsigned int Ogre::RenderOperation::numVertices
 

Number of vertices (applies to all components).

OpType Ogre::RenderOperation::operationType
 

The type of rendering operation.

VertexBlendData* Ogre::RenderOperation::pBlendingWeights
 

Optional pointer to a list of vertex blending details, organised in vertex order.

The number of weights per vertex is recorded in numBlendWeightsPerVertex - there must be this many for every vertex: set the weight to 0 for those vertices that don't use all the entries (if some vertices have more than others)

RGBA* Ogre::RenderOperation::pDiffuseColour
 

Optional pointer to a list of diffuse vertex colours (32-bit RGBA * numVertices).

unsigned short* Ogre::RenderOperation::pIndexes
 

Pointer to a list of vertex indexes describing faces (only used if useIndexes is true).

Note:
Each group of 3 describes a face (anticlockwise winding order).

Real* Ogre::RenderOperation::pNormals
 

Optional vertex normals for vertices (float {x, y, z} * numVertices).

RGBA* Ogre::RenderOperation::pSpecularColour
 

Optional pointer to a list of specular vertex colours (32-bit RGBA * numVertices).

Real* Ogre::RenderOperation::pTexCoords[OGRE_MAX_TEXTURE_COORD_SETS]
 

Optional texture coordinates for vertices (float {u, [v], [w]} * numVertices).

Remarks:
There can be up to 8 sets of texture coordinates, and the number of components per vertex depends on the number of texture dimensions (2 is most common).

Real* Ogre::RenderOperation::pVertices
 

Pointer to list of vertices (float {x, y z} * numVertices).

Remarks:
If useIndexes is false each group of 3 vertices describes a face (anticlockwise winding) in trianglelist mode.

unsigned short Ogre::RenderOperation::specularStride
 

The 'Stride' between sets of specular colour data. 0 indicates data is packed with no gaps.

unsigned short Ogre::RenderOperation::texCoordStride[OGRE_MAX_TEXTURE_COORD_SETS]
 

The 'Stride' between each set of texture data. 0 indicates data is packed with no gaps.

bool Ogre::RenderOperation::useIndexes
 

int Ogre::RenderOperation::vertexOptions
 

Flags indicating vertex types.

unsigned short Ogre::RenderOperation::vertexStride
 

The 'Stride' between sets of vertex data. 0 indicates data is packed with no gaps.

Copyright © 2002 by The OGRE Team