Skip to main content

History: VolumeHowTo

Source of version: 1

Copy to clipboard
            !Inclusion
The project must link against the OgreVolume.lib and must find the header-files inside <OGRE HOME>/Components/Volume/include.

The following headers must be included, depending on which features you want to use:
{CODE(wrap="1", colors="c++")}#include "OgreVolumeChunk.h"
#include "OgreVolumeCSGSource.h"
#include "OgreVolumeCacheSource.h"
#include "OgreVolumeTextureSource.h"{CODE}

!Scene creation via configuration file

Here is an example loading the volume scene from a configuration file. The configuration file must be findable by the resource system of course.
{CODE(wrap="1", colors="c++")}Chunk *volumeRoot = OGRE_NEW Chunk();
SceneNode *volumeRootNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("VolumeParent");
volumeRoot->load(volumeRootNode, mSceneMgr, "volumeTerrain.cfg");{CODE}
The first line creates the volume chunk which is the MovableObject holding the Volume-Root. Next, a SceneNode is created where the volume(-tree) is attached to. And lastly, the volume is loaded from the configuration file "volumeTerrain.cfg".
mSceneMgr is the SceneManager who should show the volume. Later, when you don't need it anymore, you have to free the volumeRoot Chunk via OGRE_DELETE.
        

History

Information Version
Sun 16 of Dec, 2012 17:00 GMT-0000 philiplb 3
Tue 27 of Nov, 2012 21:57 GMT-0000 philiplb 2
Tue 27 of Nov, 2012 21:42 GMT-0000 philiplb 1