OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::Volume::Chunk Class Reference

A single volume chunk mesh. More...

#include <OgreVolumeChunk.h>

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

Public Types

typedef vector< const Chunk * >::type VecChunk
 A list of Chunks. More...
 

Public Member Functions

 Chunk ()
 Constructor. More...
 
virtual ~Chunk ()
 Destructor. More...
 
virtual ChunkcreateInstance ()
 Overridable factory method. More...
 
virtual bool frameEnded (const FrameEvent &evt)
 Called just after a frame has been rendered. More...
 
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. More...
 
virtual bool frameStarted (const FrameEvent &evt)
 Overridden from FrameListener. More...
 
virtual Real getBoundingRadius () const
 Overridden from MovableObject. More...
 
ChunkParametersgetChunkParameters ()
 Gets the parameters with which the chunktree got loaded. More...
 
virtual void getChunksOfLevel (const size_t level, VecChunk &result) const
 Gathers all visible chunks (containing triangles) of a specific LOD level. More...
 
virtual bool getDualGridVisible () const
 Gets whether the debug visualization entity of the dualgrid is visible. More...
 
virtual const StringgetMovableType () const
 Overridden from MovableObject. More...
 
virtual bool getOctreeVisible () const
 Gets whether the debug visualization entity of the octree is visible. More...
 
virtual Real getSquaredViewDepth (const Camera *camera) const
 Overridden from Renderable. More...
 
virtual bool getVolumeVisible () const
 Gets whether the volume mesh is visible. More...
 
virtual void load (SceneNode *parent, const Vector3 &from, const Vector3 &to, size_t level, const ChunkParameters *parameters)
 Loads the volume mesh with all LODs. More...
 
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. More...
 
virtual void setDualGridVisible (const bool visible)
 Shows the debug visualization entity of the dualgrid. More...
 
virtual void setMaterial (const String &matName)
 Overridden from SimpleRenderable. More...
 
virtual void setMaterialOfLevel (size_t level, const String &matName)
 Sets the material of all chunks of a specific level in the tree. More...
 
virtual void setOctreeVisible (const bool visible)
 Shows the debug visualization entity of the octree. More...
 
virtual void setVolumeVisible (const bool visible)
 Sets whether the volume mesh is visible. More...
 

Static Public Attributes

static const String MOVABLE_TYPE_NAME
 The type name. More...
 

Friends

class ChunkHandler
 So the actual loading functions can be called. More...
 

Detailed Description

A single volume chunk mesh.

Member Typedef Documentation

◆ VecChunk

typedef vector<const Chunk*>::type Ogre::Volume::Chunk::VecChunk

A list of Chunks.

Constructor & Destructor Documentation

◆ Chunk()

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

Constructor.

◆ ~Chunk()

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

Destructor.

Member Function Documentation

◆ createInstance()

virtual Chunk* Ogre::Volume::Chunk::createInstance ( )
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 ( )

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 ( ) 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 ( ) const
virtual

Overridden from MovableObject.

◆ getOctreeVisible()

virtual bool Ogre::Volume::Chunk::getOctreeVisible ( ) 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 ( ) 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 Function Documentation

◆ ChunkHandler

friend class ChunkHandler
friend

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: