protected override void CleanupContent() { DestroyCurrentGeomOpt(); this.mTimer = null; base.CleanupContent(); }
/// <summary> /// </summary> protected override void SetupContent() { // Set ambient light SceneManager.AmbientLight = new ColorEx( 0.2f, 0.2f, 0.2f ); Light l = SceneManager.CreateLight( "MainLight" ); //add a skybox SceneManager.SetSkyBox( true, "Examples/MorningSkyBox", 1000 ); //setup the light l.Type = LightType.Directional; l.Direction = new Vector3( -0.5f, -0.5f, 0f ); Camera.Position = new Vector3( 500f, 500f, 1500f ); Camera.LookAt( new Vector3( 0f, 0f, 0f ) ); DragLook = true; Plane plane; plane.Normal = Vector3.UnitY; plane.D = 100; MeshManager.Instance.CreatePlane( "Myplane", ResourceGroupManager.DefaultResourceGroupName, plane, 1500, 1500, 20, 20, true, 1, 5, 5, Vector3.UnitZ ); Entity pPlaneEnt = SceneManager.CreateEntity( "plane", "Myplane" ); pPlaneEnt.MaterialName = "Examples/Rockwall"; pPlaneEnt.CastShadows = false; SceneManager.RootSceneNode.CreateChildSceneNode().AttachObject( pPlaneEnt ); CompositorManager.Instance.AddCompositor( Viewport, "Bloom" ); SetupControls(); ICollection<string> syntaxCodes = GpuProgramManager.Instance.SupportedSyntaxes; foreach ( string syntax in syntaxCodes ) { LogManager.Instance.Write( "supported syntax : ", syntax ); } this.mNumMeshes = 160; this.mNumRendered = 0; this.mSelectedMesh = 0; this.mBurnAmount = 0; this.mCurrentGeomOpt = CurrentGeomOpt.ENTITY_OPT; CreateCurrentGeomOpt(); this.mTimer = new Timer(); this.mLastTime = this.mTimer.Microseconds/1000000.0f; }