public override bool FrameRenderingQueued( FrameEventArgs evt )
{
// shoot a ray from the cursor to the plane
Ray ray = TrayManager.GetCursorRay( Camera );
mCursorQuery.Ray = ray;
IList<RaySceneQueryResultEntry> result = mCursorQuery.Execute();
if ( result.Count != 0 )
{
// using the point of intersection, find the corresponding texel on our texture
Vector3 pt = ray.GetPoint( result[ result.Count - 1].Distance );
mBrushPos = ( ( new Vector2( pt.x, -pt.y ) ) * ( 1.0f / mPlaneSize ) + ( new Vector2( 0.5, 0.5 ) ) ) * TEXTURE_SIZE;
}
byte freezeAmount = 0;
mTimeSinceLastFreeze += evt.TimeSinceLastFrame;
// find out how much to freeze the plane based on time passed
while ( mTimeSinceLastFreeze >= 0.1 )
{
mTimeSinceLastFreeze -= 0.1;
freezeAmount += 0x04;
}
UpdateTexture( freezeAmount ); // rebuild texture contents
mPenguinAnimState.AddTime( evt.TimeSinceLastFrame ); // increment penguin idle animation time
mPenguinNode.Yaw( (Real)( new Radian( (Real)evt.TimeSinceLastFrame ) ) ); // spin the penguin around
return base.FrameRenderingQueued( evt ); // don't forget the parent class updates!
}