Axiom.Demos.OffsetMapping.OnFrameStarted C# (CSharp) Method

OnFrameStarted() protected method

protected OnFrameStarted ( object source, FrameEventArgs evt ) : void
source object
evt FrameEventArgs
return void
		protected override void OnFrameStarted( object source, FrameEventArgs evt )
		{
			base.OnFrameStarted( source, evt );
			if ( evt.StopRendering )
				return;

			if ( timeDelay > 0.0f )
			{
				timeDelay -= evt.TimeSinceLastFrame;
			}
			else
			{
				if ( input.IsKeyPressed( KeyCodes.O ) )
				{
					entities[ currentEntity ].IsVisible = false;
					currentEntity = ( ++currentEntity ) % entityMeshes.Length;
					entities[ currentEntity ].IsVisible = true;
					entities[ currentEntity ].MaterialName = materialNames[ currentMaterial ];
				}

				if ( input.IsKeyPressed( KeyCodes.M ) )
				{
					currentMaterial = ( ++currentMaterial ) % materialNames.Length;
					entities[ currentEntity ].MaterialName = materialNames[ currentMaterial ];
				}

				if ( input.IsKeyPressed( KeyCodes.D1 ) )
				{
					FlipLightState( 0 );
				}

				if ( input.IsKeyPressed( KeyCodes.D2 ) )
				{
					FlipLightState( 1 );
				}

				if ( input.IsKeyPressed( KeyCodes.D3 ) )
				{
					FlipLightState( 2 );
				}

				timeDelay = 0.1f;
			}

			// animate the lights
			for ( int i = 0; i < NUM_LIGHTS; i++ )
			{
				lightPivots[ i ].Rotate( Vector3.UnitZ, lightSpeeds[ i ] * evt.TimeSinceLastFrame );
			}
		}