Exemplo n.º 1
0
        protected virtual void RenderAbove(Graphics graphics, Camera camera)
        {
            if (EntryFlame != null)
            {
                EntryFlame.Draw(graphics, camera);
            }

            // Only show the vectors when it's requested and the craft is not parented
            if (_showDisplayVectors && Parent == null)
            {
                // The length of the vector is based on the width of the camera bounds
                float lengthFactor = (float)(camera.Bounds.Width * 0.1);

                PointF start = RenderUtils.WorldToScreen(Position, camera.Bounds);

                DVector2 relativeVelocity = GetRelativeVelocity();

                // Only draw the velocity vector when it can be normalized
                if (relativeVelocity.Length() > 0)
                {
                    relativeVelocity.Normalize();

                    PointF velocityEnd = RenderUtils.WorldToScreen(Position + relativeVelocity * lengthFactor, camera.Bounds);

                    graphics.DrawLine(Pens.White, start, velocityEnd);
                }

                DVector2 pitchVector = DVector2.FromAngle(Pitch);
                pitchVector.Normalize();

                PointF pitchEnd = RenderUtils.WorldToScreen(Position + pitchVector * lengthFactor, camera.Bounds);

                graphics.DrawLine(Pens.Red, start, pitchEnd);
            }
        }
Exemplo n.º 2
0
        protected virtual void RenderAnimations(Graphics graphics, RectangleD cameraBounds)
        {
            foreach (IEngine engine in Engines)
            {
                engine.Draw(graphics, cameraBounds);
            }

            if (EntryFlame != null)
            {
                EntryFlame.Draw(graphics, cameraBounds);
            }
        }