Eidolon
Public Types | Public Member Functions | Public Attributes | List of all members
OgreRenderScene Class Reference

#include <OgreRenderTypes.h>

Inheritance diagram for OgreRenderScene:
Inheritance graph
Collaboration diagram for OgreRenderScene:
Collaboration graph

Public Types

typedef std::map< std::string, Ogre::SceneNode * > nodemap
 

Public Member Functions

 OgreRenderScene (OgreRenderAdapter *adapt)
 
virtual ~OgreRenderScene ()
 
virtual CameracreateCamera (const char *name, real left=0.0f, real top=0.0f, real width=1.0f, real height=1.0f) throw (RenderException)
 
virtual void setAmbientLight (const color &c)
 Set the scene ambient light to the given color value. More...
 
virtual void addResourceDir (const char *dir)
 Add a directory to search for resources in. More...
 
virtual void initializeResources ()
 Onces all resource directories are added, initialize the internal resource system. More...
 
virtual MaterialcreateMaterial (const char *name) throw (RenderException)
 Create a material object of the given name. More...
 
virtual FigurecreateFigure (const char *name, const char *mat, FigureType type) throw (RenderException)
 Create a figure of the given name, with material named by `mat', and type `type'. More...
 
virtual LightcreateLight () throw (RenderException)
 Create a light object. More...
 
virtual ImageloadImageFile (const std::string &filename) throw (RenderException)
 Load an image from the given filename. More...
 
virtual TexturecreateTexture (const char *name, sval width, sval height, sval depth, TextureFormat format) throw (RenderException)
 Create a 3D texture with the given name, dimensions, and format. Textures are always 3D but a `depth' value of 1 produces the equivalent of a 2D texture. More...
 
virtual TextureloadTextureFile (const char *name, const char *absFilename) throw (RenderException)
 Load a texture of the given name from the image absolute path filename. More...
 
virtual GPUProgramcreateGPUProgram (const char *name, ProgramType ptype, const char *language) throw (RenderException)
 Load a GPU program (shader) of the given name, type, and language (ie. Cg). More...
 
virtual void saveScreenshot (const char *filename, Camera *c=NULL, int width=0, int height=0, real stereoOffset=0.0, TextureFormat tf=TF_RGB24) throw (RenderException)
 Save a screenshot to the given filename taken from the given camera, or of the whole 3D window if this isn't provided. More...
 
virtual ConfiggetConfig () const
 Returns the Config object used to define properties for the scene. More...
 
virtual void applyResourceOps ()
 Iterate over all queued ResourceOp objects, calling their op() method, deleting them, and clearing the queue. More...
 
virtual void addResourceOp (ResourceOp *op)
 Add the resource operation to the queue, this assigns responsibility to delete `op' to the OgreRenderScene object. More...
 
virtual void removeResourceOp (std::string parentname)
 Remove operations with the given parent name from the queue. More...
 
virtual void logMessage (const char *msg)
 Log a message to the renderer log file. More...
 
virtual void setBGObject (color col, bool enabled)
 Set the background skybox to the given color if `enabled' is true, otherwise disable it. More...
 
virtual Ogre::SceneNode * createNode (const std::string &name)
 
virtual Ogre::SceneNode * getNode (Figure *fig)
 
virtual void destroyNode (Ogre::SceneNode *node) throw (Ogre::InternalErrorException)
 
std::string getUniqueEntityName (const std::string &name)
 
std::string getUniqueFigureName (const std::string &name)
 
std::string getUniqueResourceName (const std::string &name, Ogre::ResourceManager &rmgr) throw (Ogre::InternalErrorException)
 
- Public Member Functions inherited from RenderScene
 RenderScene ()
 
virtual ~RenderScene ()
 
void setRenderHighQuality (bool val)
 Set whether rendering should be done using high quality passes or not. More...
 
void setAlwaysHighQuality (bool val)
 Set whether to force high quality rendering. More...
 
bool getRenderHighQuality () const
 Returns whether the next render operation will be in high quality mode. More...
 
bool getAlwaysHighQuality () const
 Returns whether to always render in high quality mode. More...
 

Public Attributes

Ogre::Root * root
 
Ogre::SceneManager * mgr
 
Ogre::RenderWindow * win
 
Configconfig
 
std::string resGroupName
 
Ogre::MaterialPtr background
 
nodemap nmap
 Maps Figure objects to SceneNode objects created for them. More...
 
u32 cameraCount
 Counts how many cameras have been created and assigns a unique number to each (up to 31) More...
 
u32 assetCount
 
std::vector< ResourceOp * > pendingOps
 
Mutex sceneMutex
 

Member Typedef Documentation

◆ nodemap

typedef std::map<std::string,Ogre::SceneNode*> nodemap

Constructor & Destructor Documentation

◆ OgreRenderScene()

OgreRenderScene ( OgreRenderAdapter adapt)
inline

◆ ~OgreRenderScene()

virtual ~OgreRenderScene ( )
inlinevirtual
Here is the call graph for this function:

Member Function Documentation

◆ addResourceDir()

void addResourceDir ( const char *  dir)
virtual

Add a directory to search for resources in.

Reimplemented from RenderScene.

◆ addResourceOp()

virtual void addResourceOp ( ResourceOp op)
inlinevirtual

Add the resource operation to the queue, this assigns responsibility to delete `op' to the OgreRenderScene object.

Here is the caller graph for this function:

◆ applyResourceOps()

virtual void applyResourceOps ( )
inlinevirtual

Iterate over all queued ResourceOp objects, calling their op() method, deleting them, and clearing the queue.

Here is the caller graph for this function:

◆ createCamera()

Camera * createCamera ( const char *  name,
real  left = 0.0f,
real  top = 0.0f,
real  width = 1.0f,
real  height = 1.0f 
)
throw (RenderException
)
virtual

Create a camera object with the given name covering the proportionate area of the 3D window. The top left corner of the 3D window is (0.0,0.0) and its dimensions are (1.0,1.0), which are the default values of the left, top, width, and height arguments.

Reimplemented from RenderScene.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createFigure()

Figure * createFigure ( const char *  name,
const char *  mat,
FigureType  type 
)
throw (RenderException
)
virtual

Create a figure of the given name, with material named by `mat', and type `type'.

Reimplemented from RenderScene.

Here is the call graph for this function:

◆ createGPUProgram()

GPUProgram * createGPUProgram ( const char *  name,
ProgramType  ptype,
const char *  language 
)
throw (RenderException
)
virtual

Load a GPU program (shader) of the given name, type, and language (ie. Cg).

Reimplemented from RenderScene.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createLight()

Light * createLight ( )
throw (RenderException
)
virtual

Create a light object.

Reimplemented from RenderScene.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMaterial()

Material * createMaterial ( const char *  name)
throw (RenderException
)
virtual

Create a material object of the given name.

Reimplemented from RenderScene.

Here is the caller graph for this function:

◆ createNode()

virtual Ogre::SceneNode* createNode ( const std::string &  name)
inlinevirtual

◆ createTexture()

Texture * createTexture ( const char *  name,
sval  width,
sval  height,
sval  depth,
TextureFormat  format 
)
throw (RenderException
)
virtual

Create a 3D texture with the given name, dimensions, and format. Textures are always 3D but a `depth' value of 1 produces the equivalent of a 2D texture.

Reimplemented from RenderScene.

Here is the call graph for this function:

◆ destroyNode()

virtual void destroyNode ( Ogre::SceneNode *  node)
throw (Ogre::InternalErrorException
)
inlinevirtual
Here is the caller graph for this function:

◆ getConfig()

virtual Config* getConfig ( ) const
inlinevirtual

Returns the Config object used to define properties for the scene.

Reimplemented from RenderScene.

◆ getNode()

virtual Ogre::SceneNode* getNode ( Figure fig)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUniqueEntityName()

std::string getUniqueEntityName ( const std::string &  name)

◆ getUniqueFigureName()

std::string getUniqueFigureName ( const std::string &  name)

◆ getUniqueResourceName()

std::string getUniqueResourceName ( const std::string &  name,
Ogre::ResourceManager &  rmgr 
)
throw (Ogre::InternalErrorException
)
Here is the caller graph for this function:

◆ initializeResources()

void initializeResources ( )
virtual

Onces all resource directories are added, initialize the internal resource system.

Reimplemented from RenderScene.

◆ loadImageFile()

Image * loadImageFile ( const std::string &  filename)
throw (RenderException
)
virtual

Load an image from the given filename.

Reimplemented from RenderScene.

◆ loadTextureFile()

Texture * loadTextureFile ( const char *  name,
const char *  absFilename 
)
throw (RenderException
)
virtual

Load a texture of the given name from the image absolute path filename.

Reimplemented from RenderScene.

Here is the caller graph for this function:

◆ logMessage()

virtual void logMessage ( const char *  msg)
inlinevirtual

Log a message to the renderer log file.

Reimplemented from RenderScene.

◆ removeResourceOp()

virtual void removeResourceOp ( std::string  parentname)
inlinevirtual

Remove operations with the given parent name from the queue.

Here is the caller graph for this function:

◆ saveScreenshot()

void saveScreenshot ( const char *  filename,
Camera c = NULL,
int  width = 0,
int  height = 0,
real  stereoOffset = 0.0,
TextureFormat  tf = TF_RGB24 
)
throw (RenderException
)
virtual

Save a screenshot to the given filename taken from the given camera, or of the whole 3D window if this isn't provided.

Reimplemented from RenderScene.

Here is the caller graph for this function:

◆ setAmbientLight()

void setAmbientLight ( const color c)
virtual

Set the scene ambient light to the given color value.

Reimplemented from RenderScene.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBGObject()

virtual void setBGObject ( color  col,
bool  enabled 
)
inlinevirtual

Set the background skybox to the given color if `enabled' is true, otherwise disable it.

Reimplemented from RenderScene.

Here is the call graph for this function:

Member Data Documentation

◆ assetCount

u32 assetCount

◆ background

Ogre::MaterialPtr background

◆ cameraCount

u32 cameraCount

Counts how many cameras have been created and assigns a unique number to each (up to 31)

◆ config

Config* config

◆ mgr

Ogre::SceneManager* mgr

◆ nmap

nodemap nmap

Maps Figure objects to SceneNode objects created for them.

◆ pendingOps

std::vector<ResourceOp*> pendingOps

◆ resGroupName

std::string resGroupName

◆ root

Ogre::Root* root

◆ sceneMutex

Mutex sceneMutex

◆ win

Ogre::RenderWindow* win

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