OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::Volume::Chunk Class Reference

A single volume chunk mesh. More...

#include <OgreVolumeChunk.h>

+ Inheritance diagram for Ogre::Volume::Chunk:

Public Types

typedef vector< constChunk * >::type VecChunk
 A list of Chunks.
 

Public Member Functions

 Chunk (void)
 Constructor.
 
virtual ~Chunk (void)
 Destructor.
 
virtual ChunkcreateInstance (void)
 Overridable factory method.
 
virtual bool frameEnded (const FrameEvent &evt)
 Called just after a frame has been rendered.
 
virtual bool frameRenderingQueued (const FrameEvent &evt)
 Called after all render targets have had their rendering commands issued, but before render windows have been asked to flip their buffers over.
 
virtual bool frameStarted (const FrameEvent &evt)
 Overridden from FrameListener.
 
virtual Real getBoundingRadius () const
 Overridden from MovableObject.
 
ChunkParametersgetChunkParameters (void)
 Gets the parameters with which the chunktree got loaded.
 
virtual void getChunksOfLevel (const size_t level, VecChunk &result) const
 Gathers all visible chunks (containing triangles) of a specific LOD level.
 
virtual bool getDualGridVisible (void) const
 Gets whether the debug visualization entity of the dualgrid is visible.
 
virtual const StringgetMovableType (void) const
 Overridden from MovableObject.
 
virtual bool getOctreeVisible (void) const
 Gets whether the debug visualization entity of the octree is visible.
 
virtual Real getSquaredViewDepth (const Camera *camera) const
 Overridden from Renderable.
 
virtual bool getVolumeVisible (void) const
 Gets whether the volume mesh is visible.
 
virtual void load (SceneNode *parent, const Vector3 &from, const Vector3 &to, size_t level, const ChunkParameters *parameters)
 Loads the volume mesh with all LODs.
 
virtual void load (SceneNode *parent, SceneManager *sceneManager, const String &filename, bool validSourceResult=false, MeshBuilderCallback *lodCallback=0, const String &resourceGroup=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
 Loads a TextureSource volume scene from a config file.
 
virtual void setDualGridVisible (const bool visible)
 Shows the debug visualization entity of the dualgrid.
 
virtual void setMaterial (const String &matName)
 Overridden from SimpleRenderable.
 
virtual void setMaterialOfLevel (size_t level, const String &matName)
 Sets the material of all chunks of a specific level in the tree.
 
virtual void setOctreeVisible (const bool visible)
 Shows the debug visualization entity of the octree.
 
virtual void setVolumeVisible (const bool visible)
 Sets whether the volume mesh is visible.
 

Static Public Attributes

static const String MOVABLE_TYPE_NAME
 The type name.
 

Friends

class ChunkHandler
 So the actual loading functions can be called.
 

Detailed Description

A single volume chunk mesh.

Member Typedef Documentation

◆ VecChunk

Constructor & Destructor Documentation

◆ Chunk()

Ogre::Volume::Chunk::Chunk ( void  )

Constructor.

◆ ~Chunk()

virtual Ogre::Volume::Chunk::~Chunk ( void  )
virtual

Destructor.

Member Function Documentation

◆ createInstance()

virtual Chunk * Ogre::Volume::Chunk::createInstance ( void  )
virtual

Overridable factory method.

Returns
The created chunk.

◆ frameEnded()

virtual bool Ogre::FrameListener::frameEnded ( const FrameEvent evt)
inlinevirtualinherited

Called just after a frame has been rendered.

Remarks
This event happens after all render targets have been fully updated and the buffers switched.
Returns
True to continue with the next frame, false to drop out of the rendering loop.

Reimplemented in Ogre::FrameTimeControllerValue.

◆ frameRenderingQueued()

virtual bool Ogre::FrameListener::frameRenderingQueued ( const FrameEvent evt)
inlinevirtualinherited

Called after all render targets have had their rendering commands issued, but before render windows have been asked to flip their buffers over.

Remarks
The usefulness of this event comes from the fact that rendering commands are queued for the GPU to process. These can take a little while to finish, and so while that is happening the CPU can be doing useful things. Once the request to 'flip buffers' happens, the thread requesting it will block until the GPU is ready, which can waste CPU cycles. Therefore, it is often a good idea to use this callback to perform per-frame processing. Of course because the frame's rendering commands have already been issued, any changes you make will only take effect from the next frame, but in most cases that's not noticeable.
Returns
True to continue rendering, false to drop out of the rendering loop.

◆ frameStarted()

virtual bool Ogre::Volume::Chunk::frameStarted ( const FrameEvent evt)
virtual

Overridden from FrameListener.

Reimplemented from Ogre::FrameListener.

◆ getBoundingRadius()

virtual Real Ogre::Volume::Chunk::getBoundingRadius ( ) const
virtual

Overridden from MovableObject.

◆ getChunkParameters()

ChunkParameters * Ogre::Volume::Chunk::getChunkParameters ( void  )

Gets the parameters with which the chunktree got loaded.

Returns
The parameters.

◆ getChunksOfLevel()

virtual void Ogre::Volume::Chunk::getChunksOfLevel ( const size_t  level,
VecChunk result 
) const
virtual

Gathers all visible chunks (containing triangles) of a specific LOD level.

Parameters
levelThe desired chunk level, 0 based. 0 means the chunk with the lowest level of detail. If the chunks are loaded with a level amount of 5, valid values here are 0-4.
resultVector where the chunks will be added to.

◆ getDualGridVisible()

virtual bool Ogre::Volume::Chunk::getDualGridVisible ( void  ) const
virtual

Gets whether the debug visualization entity of the dualgrid is visible.

Returns
true if visible.

◆ getMovableType()

virtual const String & Ogre::Volume::Chunk::getMovableType ( void  ) const
virtual

Overridden from MovableObject.

◆ getOctreeVisible()

virtual bool Ogre::Volume::Chunk::getOctreeVisible ( void  ) const
virtual

Gets whether the debug visualization entity of the octree is visible.

Returns
true if visible.

◆ getSquaredViewDepth()

virtual Real Ogre::Volume::Chunk::getSquaredViewDepth ( const Camera camera) const
virtual

Overridden from Renderable.

◆ getVolumeVisible()

virtual bool Ogre::Volume::Chunk::getVolumeVisible ( void  ) const
virtual

Gets whether the volume mesh is visible.

Returns
true if visible

◆ load() [1/2]

virtual void Ogre::Volume::Chunk::load ( SceneNode parent,
const Vector3 from,
const Vector3 to,
size_t  level,
const ChunkParameters parameters 
)
virtual

Loads the volume mesh with all LODs.

Parameters
parentThe parent scene node for the volume
fromThe back lower left corner of the cell.
toThe front upper right corner of the cell.
levelThe amount of LOD level.
parametersThe parameters to use while loading.

◆ load() [2/2]

virtual void Ogre::Volume::Chunk::load ( SceneNode parent,
SceneManager sceneManager,
const String filename,
bool  validSourceResult = false,
MeshBuilderCallback lodCallback = 0,
const String resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME 
)
virtual

Loads a TextureSource volume scene from a config file.

Parameters
parentThe parent scene node for the volume.
sceneManagerThe scenemanager to construct the entity with.
filenameThe filename of the configuration file.
validSourceResultIf you want to use the loaded source afterwards of the parameters, set this to true. Beware, that you will have to delete the pointer on your own then! On false here, it internally frees the memory for you
lodCallbackCallback for a specific LOD level.
resourceGroupThe resource group where to search for the configuration file.

◆ setDualGridVisible()

virtual void Ogre::Volume::Chunk::setDualGridVisible ( const bool  visible)
virtual

Shows the debug visualization entity of the dualgrid.

Parameters
visibleWhether the grid should be visible.

◆ setMaterial()

virtual void Ogre::Volume::Chunk::setMaterial ( const String matName)
virtual

Overridden from SimpleRenderable.

Sets the material of this chunk and all of his children.

◆ setMaterialOfLevel()

virtual void Ogre::Volume::Chunk::setMaterialOfLevel ( size_t  level,
const String matName 
)
virtual

Sets the material of all chunks of a specific level in the tree.

This allows LODs where the lower levels (== less detail and more far away) have simpler materials.

Parameters
levelThe tree level getting the material, 0 based. 0 means the chunk with the lowest level of detail.
matNameThe material name to set.

◆ setOctreeVisible()

virtual void Ogre::Volume::Chunk::setOctreeVisible ( const bool  visible)
virtual

Shows the debug visualization entity of the octree.

Parameters
visibleWhether the octree should be visible.

◆ setVolumeVisible()

virtual void Ogre::Volume::Chunk::setVolumeVisible ( const bool  visible)
virtual

Sets whether the volume mesh is visible.

Parameters
visibletrue if visible

Friends And Related Symbol Documentation

◆ ChunkHandler

So the actual loading functions can be called.

Member Data Documentation

◆ MOVABLE_TYPE_NAME

const String Ogre::Volume::Chunk::MOVABLE_TYPE_NAME
static

The type name.


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