protected override void SetupContent()
{
SceneManager.SetSkyBox( true, "Examples/StormySkyBox", 5000 ); // add a skybox
// setup some basic lighting for our scene
SceneManager.AmbientLight = new ColorEx( 0.5f, 0.5f, 0.5f );
SceneManager.CreateLight( "DynTexLight1" ).Position = new Vector3( 20, 80, 50 );
// set initial camera position
CameraManager.setStyle( CameraStyle.Manual );
Camera.Position = new Vector3( 0, 0, 200 );
TrayManager.ShowCursor();
// create our dynamic texture with 8-bit luminance texels
Texture tex = TextureManager.Instance.CreateManual( "thaw", ResourceGroupManager.DefaultResourceGroupName, TextureType.TwoD, TEXTURE_SIZE, TEXTURE_SIZE, 0, PixelFormat.L8, TextureUsage.DynamicWriteOnly );
mTexBuf = tex.GetBuffer(); // save off the texture buffer
// initialise the texture to have full luminance
mTexBuf.Lock( BufferLocking.Discard );
Memory.Set( mTexBuf.CurrentLock.Data, 0xff, mTexBuf.Size );
mTexBuf.Unlock();
// create a penguin and attach him to our penguin node
Entity penguin = SceneManager.CreateEntity( "Penguin", "penguin.mesh" );
mPenguinNode = SceneManager.RootSceneNode.CreateChildSceneNode();
mPenguinNode.AttachObject( penguin );
// get and enable the penguin idle animation
mPenguinAnimState = penguin.GetAnimationState( "amuse" );
mPenguinAnimState.IsEnabled = true;
// create a snowstorm over the scene, and fast forward it a little
ParticleSystem ps = ParticleSystemManager.Instance.CreateSystem( "Snow", "Examples/Snow" );
SceneManager.RootSceneNode.AttachObject( ps );
ps.FastForward( 30 );
// create a frosted screen in front of the camera, using our dynamic texture to "thaw" certain areas
Entity ent = SceneManager.CreateEntity( "Plane", PrefabEntity.Plane );
ent.MaterialName = "Examples/Frost";
SceneNode node = SceneManager.RootSceneNode.CreateChildSceneNode();
node.Position = new Vector3( 0, 0, 50 );
node.AttachObject( ent );
mPlaneSize = ent.BoundingBox.Size.x; // remember the size of the plane
mCursorQuery = SceneManager.CreateRayQuery( new Ray() ); // create a ray scene query for the cursor
mTimeSinceLastFreeze = 0;
mWiping = false;
}