Axiom.Demos.SkeletalAnimation.CreateScene C# (CSharp) Method

CreateScene() public method

public CreateScene ( ) : void
return void
		public override void CreateScene()
		{
			// set some ambient light
			scene.TargetRenderSystem.LightingEnabled = true;
			scene.AmbientLight = ColorEx.Gray;

			Entity entity = null;

			// create the robot entity
			for ( int i = 0; i < NumRobots; i++ )
			{
				string robotName = string.Format( "Robot{0}", i );
				entity = scene.CreateEntity( robotName, "robot.mesh" );
				SceneNode node = scene.RootSceneNode.CreateChildSceneNode(
					new Vector3( 0, 0, ( i * 50 ) - ( NumRobots * 50 / 2 ) ) );
				node.AttachObject( entity );
				animState[ i ] = entity.GetAnimationState( "Walk" );
				animState[ i ].IsEnabled = true;
				animationSpeed[ i ] = Utility.RangeRandom( 0.5f, 1.5f );
			}

			Light light = scene.CreateLight( "BlueLight" );
			light.Position = new Vector3( -200, -80, -100 );
			light.Diffuse = new ColorEx( 1.0f, .5f, .5f, 1.0f );

			light = scene.CreateLight( "GreenLight" );
			light.Position = new Vector3( 0, 0, -100 );
			light.Diffuse = new ColorEx( 1.0f, 0.5f, 1.0f, 0.5f );

			// setup the camera for a nice view of the robot
			camera.Position = new Vector3( 100, 50, 100 );
			camera.LookAt( new Vector3( 0, 50, 0 ) );

			Technique t = entity.GetSubEntity( 0 ).Material.GetBestTechnique();
			Pass p = t.GetPass( 0 );

			if ( p.HasVertexProgram && p.VertexProgram.IsSkeletalAnimationIncluded )
			{
				debugText = "Hardware skinning is enabled.";
			}
			else
			{
				debugText = "Software skinning is enabled.";
			}
		}