Axiom.Core.SceneNode.AttachObject C# (CSharp) Method

AttachObject() public method

Attaches a MovableObject to this scene node.
A MovableObject will not show up in the scene until it is attached to a SceneNode.
public AttachObject ( Axiom.Core.MovableObject obj ) : void
obj Axiom.Core.MovableObject
return void
		public virtual void AttachObject( MovableObject obj )
		{
			Debug.Assert( obj != null, "obj != null" );

			objectList.Add( obj );

			// notify the object that it was attached to us
			obj.NotifyAttached( this );

			// make sure bounds get updated
			NeedUpdate();
		}

Usage Example

        protected override void CreateScene()
        {
            viewport.BackgroundColor = ColorEx.White;

            scene.AmbientLight = new ColorEx(0.5f, 0.5f, 0.5f);

            Light light = scene.CreateLight("MainLight");
            light.Position = new Vector3(20, 80, 50);
            light.Diffuse = ColorEx.Blue;

            scene.LoadWorldGeometry("Terrain.xml");

            scene.SetFog(FogMode.Exp2, ColorEx.White, .008f, 0, 250);

            // water plane setup
            Plane waterPlane = new Plane(Vector3.UnitY, 1.5f);

            MeshManager.Instance.CreatePlane(
                "WaterPlane",
                waterPlane,
                2800, 2800,
                20, 20,
                true, 1,
                10, 10,
                Vector3.UnitZ);

            Entity waterEntity  = scene.CreateEntity("Water", "WaterPlane");
            waterEntity.MaterialName = "Terrain/WaterPlane";

            waterNode = scene.RootSceneNode.CreateChildSceneNode("WaterNode");
            waterNode.AttachObject(waterEntity);
            waterNode.Translate(new Vector3(1000, 0, 1000));
        }
All Usage Examples Of Axiom.Core.SceneNode::AttachObject