예제 #1
0
 public MainForm()
 {
     InitializeComponent();
     p = new Player();
     Application.Idle += InvalidateRenderer;
     this.MouseWheel += HandleMouseWheel;
 }
예제 #2
0
 void BtnCompileClick( object sender, EventArgs e )
 {
     IPlayer p = ModelParser.MakeFrom( rtfCode.Text );
     if( p != null ) {
         this.p = p;
         p.Initalise();
     }
 }
        protected override void DrawPlayerModel( IPlayer p )
        {
            graphics.Texturing = true;
            graphics.BindTexture( texId );
            ModelSet model = Set;

            DrawRotate( 0, 24/16f, 0, -p.PitchRadians, 0, 0, model.Head );
            DrawPart( model.Torso );
            DrawRotate( 0, 12/16f, 0, p.leftLegXRot, 0, 0, model.LeftLeg );
            DrawRotate( 0, 12/16f, 0, p.rightLegXRot, 0, 0, model.RightLeg );
            DrawRotate( -6/16f, 22/16f, 0, p.leftArmXRot, 0, p.leftArmZRot, model.LeftArm );
            DrawRotate( 6/16f, 22/16f, 0, p.rightArmXRot, 0, p.rightArmZRot, model.RightArm );

            graphics.AlphaTest = true;
            DrawRotate( 0, 24f/16f, 0, -p.PitchRadians, 0, 0, model.Hat );
        }
예제 #4
0
 protected abstract void DrawPlayerModel( IPlayer p );
예제 #5
0
 /// <summary> Renders the model based on the given entity's position and orientation. </summary>
 public void RenderModel( IPlayer p )
 {
     index = 0;
     pos = p.Position;
     cosA = (float)Math.Cos( p.YawRadians );
     sinA = (float)Math.Sin( p.YawRadians );
     DrawPlayerModel( p );
 }