Axiom.Overlays.Overlay.AddElement C# (CSharp) Метод

AddElement() публичный Метод

Adds a node capable of holding 3D objects to the overlay.
Although overlays are traditionally associated with 2D elements, there are reasons why you might want to attach 3D elements to the overlay too. For example, if you wanted to have a 3D cockpit, which was overlaid with a HUD, then you would create 2 overlays, one with a 3D object attached for the cockpit, and one with the HUD elements attached (the zorder of the HUD overlay would be higher than the cockpit to ensure it was always on top).

A SceneNode can have any number of 3D objects attached to it. SceneNodes are created using SceneManager.CreateSceneNode, and are normally attached (directly or indirectly) to the root node of the scene. By attaching them to an overlay, you indicate that:

  1. You want the contents of this node to only appear when the overlay is active
  2. You want the node to inherit a coordinate space relative to the camera, rather than relative to the root scene node
  3. You want these objects to be rendered after the contents of the main scene to ensure they are rendered on top
One major consideration when using 3D objects in overlays is the behavior of the depth buffer. Overlays are rendered with depth checking off, to ensure that their contents are always displayed on top of the main scene (to do otherwise would result in objects 'poking through' the overlay). The problem with using 3D objects is that if they are concave, or self-overlap, then you can get artifacts because of the lack of depth buffer checking. So you should ensure that any 3D objects you us in the overlay are convex and don't overlap each other. If they must overlap, split them up and put them in 2 overlays.
public AddElement ( SceneNode node ) : void
node Axiom.Core.SceneNode
Результат void
		public void AddElement( SceneNode node )
		{
			// add the scene node as a child of the root node
			rootNode.AddChild( node );
		}

Same methods

Overlay::AddElement ( OverlayElementContainer element ) : void

Usage Example

Пример #1
0
		public void CreateScene()
		{
			TextureUtil.CreateDynamicTextureAndMaterial(
				"OBDynamicTexture",
				"OBDynamicMaterial",
				_browserWidth,
				_browserHeight,
				out _texture,
				out _material);



			
			_panel = (OverlayElementContainer)OverlayManager.Instance.Elements.CreateElement("Panel", "Panels");
			_panel.SetPosition(1, 1);
			_panel.SetDimensions(_browserWidth, _browserHeight);
			_panel.MaterialName = "OBDynamicMaterial";


			_overlay = OverlayManager.Instance.Create("OverlayBrowser");
			_overlay.AddElement(_panel);
			_overlay.Show();

			Core.BrowserManager.BrowserRenderEvent += BrowserManager_BrowserRenderEvent;
			_browserId = Core.BrowserManager.CreateBrowser("http://www.google.com.au", _browserWidth, _browserHeight);
		}
All Usage Examples Of Axiom.Overlays.Overlay::AddElement