Exemple #1
0
        protected override void CleanupContent()
        {
            if (this.chara != null)
            {
                this.chara = null;
            }

            MeshManager.Instance.Remove("floor");
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        protected override void SetupContent()
        {
            // set background and some fog
            Viewport.BackgroundColor = new ColorEx(1.0f, 1.0f, 0.8f);
            SceneManager.SetFog(FogMode.Linear, new ColorEx(1.0f, 1.0f, 1.0f), 0, 15, 100);

            // set shadow properties
            SceneManager.ShadowTechnique    = ShadowTechnique.TextureModulative;
            SceneManager.ShadowColor        = new ColorEx(0.5f, 0.5f, 0.5f);
            SceneManager.ShadowTextureSize  = 1024;
            SceneManager.ShadowTextureCount = 1;

            // disable default camera control so the character can do its own
            CameraManager.setStyle(CameraStyle.Manual);

            // use a small amount of ambient lighting
            SceneManager.AmbientLight = new ColorEx(0.3f, 0.3f, 0.3f);

            // add a bright light above the scene
            Light light = SceneManager.CreateLight("CharacterLight");

            light.Type     = LightType.Point;
            light.Position = new Vector3(-10, 40, 20);
            light.Specular = ColorEx.White;

            MeshManager.Instance.CreatePlane("floor", ResourceGroupManager.DefaultResourceGroupName,
                                             new Plane(Vector3.UnitY, 0), 100, 100, 10, 10, true, 1, 10, 10, Vector3.UnitZ);

            // create a floor entity, give it a material, and place it at the origin
            Entity floor = SceneManager.CreateEntity("Floor", "floor");

            floor.MaterialName = "Examples/Rockwall";
            floor.CastShadows  = false;
            SceneManager.RootSceneNode.AttachObject(floor);


            // create our character controller
            this.chara = new SinbadCharacterController(Camera);

            TrayManager.ToggleAdvancedFrameStats();

            var items = new List <string>();

            items.Add("Help");
            ParamsPanel help = TrayManager.CreateParamsPanel(TrayLocation.TopLeft, "HelpMessage", 100, items);

            help.SetParamValue("Help", " H / F1");
        }
		protected override void CleanupContent()
		{
			if ( this.chara != null )
			{
				this.chara = null;
			}

			MeshManager.Instance.Remove( "floor" );
		}
		/// <summary>
		/// 
		/// </summary>
		protected override void SetupContent()
		{
			// set background and some fog
			Viewport.BackgroundColor = new ColorEx( 1.0f, 1.0f, 0.8f );
			SceneManager.SetFog( FogMode.Linear, new ColorEx( 1.0f, 1.0f, 1.0f ), 0, 15, 100 );

			// set shadow properties
			SceneManager.ShadowTechnique = ShadowTechnique.TextureModulative;
			SceneManager.ShadowColor = new ColorEx( 0.5f, 0.5f, 0.5f );
			SceneManager.ShadowTextureSize = 1024;
			SceneManager.ShadowTextureCount = 1;

			// disable default camera control so the character can do its own
			CameraManager.setStyle( CameraStyle.Manual );

			// use a small amount of ambient lighting
			SceneManager.AmbientLight = new ColorEx( 0.3f, 0.3f, 0.3f );

			// add a bright light above the scene
			Light light = SceneManager.CreateLight( "CharacterLight" );
			light.Type = LightType.Point;
			light.Position = new Vector3( -10, 40, 20 );
			light.Specular = ColorEx.White;

			MeshManager.Instance.CreatePlane( "floor", ResourceGroupManager.DefaultResourceGroupName,
			                                  new Plane( Vector3.UnitY, 0 ), 100, 100, 10, 10, true, 1, 10, 10, Vector3.UnitZ );

			// create a floor entity, give it a material, and place it at the origin
			Entity floor = SceneManager.CreateEntity( "Floor", "floor" );
			floor.MaterialName = "Examples/Rockwall";
			floor.CastShadows = false;
			SceneManager.RootSceneNode.AttachObject( floor );


			// create our character controller
			this.chara = new SinbadCharacterController( Camera );

			TrayManager.ToggleAdvancedFrameStats();

			var items = new List<string>();
			items.Add( "Help" );
			ParamsPanel help = TrayManager.CreateParamsPanel( TrayLocation.TopLeft, "HelpMessage", 100, items );
			help.SetParamValue( "Help", " H / F1" );
		}