Specialisation of the SceneManager class to deal with indoor scenes based on a BSP tree.
This class refines the behaviour of the default SceneManager to manage a scene whose bulk of geometry is made up of an indoor environment which is organised by a Binary Space Partition (BSP) tree.

A BSP tree progressively subdivides the space using planes which are the nodes of the tree. At some point we stop subdividing and everything in the remaining space is part of a 'leaf' which contains a number of polygons. Typically we traverse the tree to locate the leaf in which a point in space is (say the camera origin) and work from there. A second structure, the Potentially Visible Set, tells us which other leaves can been seen from this leaf, and we test their bounding boxes against the camera frustum to see which we need to draw. Leaves are also a good place to start for collision detection since they divide the level into discrete areas for testing.

This BSP and PVS technique has been made famous by engines such as Quake and Unreal. Ogre provides support for loading Quake3 level files to populate your world through this class, by calling the BspSceneManager.LoadWorldGeometry. Note that this interface is made available at the top level of the SceneManager class so you don't have to write your code specifically for this class - just call Root::getSceneManager passing a SceneType of ST_INDOOR and in the current implementation you will get a BspSceneManager silently disguised as a standard SceneManager.

Inheritance: Axiom.Core.SceneManager
 /// <summary>
 ///		Normal constructor. Should not be called directly, but rather the SceneManager.CreateLight method should be used.
 /// </summary>
 /// <param name="name"></param>
 public TextureLight(string name, BspSceneManager creator)
     : base(name)
 {
     this.creator = creator;
     isTextureLight = true;
     diffuse = ColorEx.White;
     textureColor = ColorEx.White;
     intensity = LightIntensity.Normal;
     priority = 100;
 }
        public void TestChildSceneNodeRemoval()
        {
            SceneManager sceneManager = new BspSceneManager( "Manager under test" );
            SceneNode node = sceneManager.CreateSceneNode( "testNode" );
            SceneNode childNode = node.CreateChildSceneNode( "childNode" );

            Assert.IsTrue( ManagerContainsNode( sceneManager, childNode ), "A child node was created but not added to the scene graph." );

            node.RemoveChild( childNode.Name );

            Assert.IsTrue( ManagerContainsNode( sceneManager, childNode ), "A child node was removed from its parent but also incorrectly removed from the scene graph." );
        }
        public void TestChildSceneNodeDestruction()
        {
            SceneManager sceneManager = new BspSceneManager( "Manager under test" );
            SceneNode node = sceneManager.CreateSceneNode( "testNode" );
            SceneNode childNode = node.CreateChildSceneNode( "childNode" );

            Assert.IsTrue( ManagerContainsNode( sceneManager, childNode ), "A child node was created but not added to the scene graph." );

            node.RemoveAndDestroyChild( childNode.Name );

            Assert.IsFalse( ManagerContainsNode( sceneManager, childNode ), "A child node was destroryed but not removed from the scene graph." );
        }
Exemplo n.º 4
0
		/// <summary>
		///		Default constructor.
		/// </summary>
		public TextureLight( BspSceneManager creator )
			: this( "", creator )
		{
		}