DigitalSpaces::DIOGREStaticGeometry Struct Reference
[Ogre]

#include <OGREInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Public Member Functions

const char * getName ()
 Get the name of this object.
void addEntity (DIOGREEntity *iEnt, in_Vector3f *position, in_Quaternionf *orientation, in_Vector3f *scale)
 Adds an Entity to the static geometry.
void addSceneNode (DIOGRESceneNode *node)
 Adds all the Entity objects attached to a SceneNode and all it's children to the static geometry.
void build ()
 Build the geometry.
void destroy ()
 Destroys all the built geometry state (reverse of build).
void reset ()
 Clears any of the entities / nodes added to this geometry and destroys anything which has already been built.
void setRenderingDistance (float dist)
 Sets the distance at which batches are no longer rendered.
float getRenderingDistance ()
 Gets the distance at which batches are no longer rendered.
float getSquaredRenderingDistance ()
 Gets the squared distance at which batches are no longer rendered.
void setVisible (bool visible)
 Hides or shows all the batches.
bool isVisible ()
 Are the batches visible?
void setCastShadows (bool castShadows)
 Sets whether this geometry should cast shadows.
bool getCastShadows ()
 Will the geometry from this object cast shadows?
void setRegionDimensions (in_Vector3f *size)
 Sets the size of a single region of geometry.
void getRegionDimensions (out_Vector3f *size)
 Gets the size of a single batch of geometry.
void setOrigin (in_Vector3f *origin)
 Sets the origin of the geometry.
void getOrigin (out_Vector3f *origin)
 Gets the origin of this geometry.
void setRenderQueueGroup (int queueID)
 Sets the render queue group this object will be rendered through.
int getRenderQueueGroup ()
 Gets the queue group for this entity, see setRenderQueueGroup for full details.
void dump (const char *filename)
 Iterator for iterating over contained regions.

Member Function Documentation

const char* DigitalSpaces::DIOGREStaticGeometry::getName (  ) 

Get the name of this object.

void DigitalSpaces::DIOGREStaticGeometry::addEntity ( DIOGREEntity iEnt,
in_Vector3f position,
in_Quaternionf orientation,
in_Vector3f scale 
)

Adds an Entity to the static geometry.

Remarks:
This method takes an existing Entity and adds its details to the list of elements to include when building. Note that the Entity itself is not copied or referenced in this method; an Entity is passed simply so that you can change the materials of attached SubEntity objects if you want. You can add the same Entity instance multiple times with different material settings completely safely, and destroy the Entity before destroying this StaticGeometry if you like. The Entity passed in is simply used as a definition.
Note:
Must be called before 'build'.
Parameters:
ent The Entity to use as a definition (the Mesh and Materials referenced will be recorded for the build call).
position The world position at which to add this Entity
orientation The world orientation at which to add this Entity
scale The scale at which to add this entity

void DigitalSpaces::DIOGREStaticGeometry::addSceneNode ( DIOGRESceneNode node  ) 

Adds all the Entity objects attached to a SceneNode and all it's children to the static geometry.

Remarks:
This method performs just like addEntity, except it adds all the entities attached to an entire sub-tree to the geometry. The position / orientation / scale parameters are taken from the node structure instead of being specified manually.
Note:
The SceneNode you pass in will not be automatically detached from it's parent, so if you have this node already attached to the scene graph, you will need to remove it if you wish to avoid the overhead of rendering both the original objects and their new static versions! We don't do this for you incase you are preparing this in advance and so don't want the originals detached yet.

Must be called before 'build'.

Parameters:
node Pointer to the node to use to provide a set of Entity templates

void DigitalSpaces::DIOGREStaticGeometry::build (  ) 

Build the geometry.

Remarks:
Based on all the entities which have been added, and the batching options which have been set, this method constructs the batched geometry structures required. The batches are added to the scene and will be rendered unless you specifically hide them.
Note:
Once you have called this method, you can no longer add any more entities.

void DigitalSpaces::DIOGREStaticGeometry::destroy (  ) 

Destroys all the built geometry state (reverse of build).

Remarks:
You can call build() again after this and it will pick up all the same entities / nodes you queued last time.

void DigitalSpaces::DIOGREStaticGeometry::reset (  ) 

Clears any of the entities / nodes added to this geometry and destroys anything which has already been built.

void DigitalSpaces::DIOGREStaticGeometry::setRenderingDistance ( float  dist  ) 

Sets the distance at which batches are no longer rendered.

Remarks:
This lets you turn off batches at a given distance. This can be useful for things like detail meshes (grass, foliage etc) and could be combined with a shader which fades the geometry out beforehand to lessen the effect.
Parameters:
dist Distance beyond which the batches will not be rendered (the default is 0, which means batches are always rendered).

float DigitalSpaces::DIOGREStaticGeometry::getRenderingDistance (  ) 

Gets the distance at which batches are no longer rendered.

float DigitalSpaces::DIOGREStaticGeometry::getSquaredRenderingDistance (  ) 

Gets the squared distance at which batches are no longer rendered.

void DigitalSpaces::DIOGREStaticGeometry::setVisible ( bool  visible  ) 

Hides or shows all the batches.

bool DigitalSpaces::DIOGREStaticGeometry::isVisible (  ) 

Are the batches visible?

void DigitalSpaces::DIOGREStaticGeometry::setCastShadows ( bool  castShadows  ) 

Sets whether this geometry should cast shadows.

Remarks:
No matter what the settings on the original entities, the StaticGeometry class defaults to not casting shadows. This is because, being static, unless you have moving lights you'd be better to use precalculated shadows of some sort. However, if you need them, you can enable them using this method. If the SceneManager is set up to use stencil shadows, edge lists will be copied from the underlying meshes on build. It is essential that all meshes support stencil shadows in this case.
Note:
If you intend to use stencil shadows, you must set this to true before calling 'build' as well as making sure you set the scene's shadow type (that should always be the first thing you do anyway). You can turn shadows off temporarily but they can never be turned on if they were not at the time of the build.

bool DigitalSpaces::DIOGREStaticGeometry::getCastShadows (  ) 

Will the geometry from this object cast shadows?

void DigitalSpaces::DIOGREStaticGeometry::setRegionDimensions ( in_Vector3f size  ) 

Sets the size of a single region of geometry.

Remarks:
This method allows you to configure the physical world size of each region, so you can balance culling against batch size. Entities will be fitted within the batch they most closely fit, and the eventual bounds of each batch may well be slightly larger than this if they overlap a little. The default is Vector3(1000, 1000, 1000).
Note:
Must be called before 'build'.
Parameters:
size Vector3 expressing the 3D size of each region.

void DigitalSpaces::DIOGREStaticGeometry::getRegionDimensions ( out_Vector3f size  ) 

Gets the size of a single batch of geometry.

void DigitalSpaces::DIOGREStaticGeometry::setOrigin ( in_Vector3f origin  ) 

Sets the origin of the geometry.

Remarks:
This method allows you to configure the world centre of the geometry, thus the place which all regions surround. You probably don't need to mess with this unless you have a seriously large world, since the default set up can handle an area 1024 * mRegionDimensions, and the sparseness of population is no issue when it comes to rendering. The default is Vector3(0,0,0).
Note:
Must be called before 'build'.
Parameters:
size Vector3 expressing the 3D origin of the geometry.

void DigitalSpaces::DIOGREStaticGeometry::getOrigin ( out_Vector3f origin  ) 

Gets the origin of this geometry.

void DigitalSpaces::DIOGREStaticGeometry::setRenderQueueGroup ( int  queueID  ) 

Sets the render queue group this object will be rendered through.

Remarks:
Render queues are grouped to allow you to more tightly control the ordering of rendered objects. If you do not call this method, all objects default to the default queue (RenderQueue::getDefaultQueueGroup), which is fine for most objects. You may want to alter this if you want to perform more complex rendering.
See RenderQueue for more details.
Parameters:
queueID Enumerated value of the queue group to use.

int DigitalSpaces::DIOGREStaticGeometry::getRenderQueueGroup (  ) 

Gets the queue group for this entity, see setRenderQueueGroup for full details.

void DigitalSpaces::DIOGREStaticGeometry::dump ( const char *  filename  ) 

Iterator for iterating over contained regions.

Get an iterator over the regions in this geometry Dump the contents of this StaticGeometry to a file for diagnostic purposes.


The documentation for this struct was generated from the following file:

Generated on Sun Aug 31 17:46:32 2008 for Digital Spaces by  doxygen 1.5.6