protected override void CleanupBounds()
        {
            _Top = default(Single);
            _Bottom = default(Single);
            _Left = default(Single);
            _Right = default(Single);

            _Bounds = default(RectangularArea2);
        }
Beispiel #2
0
 public void AddDebugInfoLine(String name, RectangularArea2 data)
 {
     DebugInfoBuilder.Append(name);
     DebugInfoBuilder.Append(DebugInfoSeparator);
     DebugInfoBuilder.Append(data.ToString());
     DebugInfoBuilder.AppendLine();
 }
Beispiel #3
0
        protected override void RecalcBounds()
        {
            //TODO: support coordinatesystemmode here.
            if (Rotation == DefaultRotation)
                Bounds = new RectangularArea2(Position.X, Position.Y, Position.X + Width, Position.Y + Height);
            else
            {

                //Bounds = new RectangularArea2();
            }
        }
Beispiel #4
0
        protected override void RecalcProjectionMatrixHelper()
        {
            _Width = DrawEngine2d.FrameBufferWidthAsSingle;
            _Height = DrawEngine2d.FrameBufferHeightAsSingle;

            if(Zoom != DefaultZoom)
            {
                _Width *= Zoom;
                _Height *= Zoom;
            }

            _Left = Center.X - (_Width / 2);
            _Right = _Left + _Width;

            switch(DrawEngine2d.CoordinateSystemMode)
            {
                case(CoordinateSystemMode.OriginAtUpperLeft):
                    _Top = Center.Y - (_Height / 2);
                    _Bottom = _Top + _Height;
                    break;
                case(CoordinateSystemMode.OriginAtLowerLeft):
                    _Bottom = Center.Y - (_Height / 2);
                    _Top = _Bottom + _Height;
                    break;
                default:
                    throw new NotSupportedException();
            }

            _Bounds = new RectangularArea2(_Left, _Top, _Right, _Bottom);

            ProjectionMatrix = Matrix4.Ortho(Left, Right, Bottom, Top, Near, Far);

            if(Rotation != DefaultRotation)
            {
                if(RotationPoint != DefaultRotationPoint)
                    throw new NotImplementedException();

                ProjectionMatrix *= Matrix4.RotationZ(Rotation.Radian);
            }
        }
Beispiel #5
0
 public void SetCenterToPointWithinBounds(Coordinate2 point, RectangularArea2 bounds)
 {
     //TODO
     throw new NotImplementedException();
 }
        private void RecalcBounds()
        {
            switch(DrawEngine2d.CoordinateSystemMode)
            {
                case(CoordinateSystemMode.OriginAtUpperLeft):
                    _Top = 0.0f;
                    _Bottom = DrawEngine2d.FrameBufferHeightAsSingle;
                    break;
                case(CoordinateSystemMode.OriginAtLowerLeft):
                    _Top = DrawEngine2d.FrameBufferHeightAsSingle;
                    _Bottom = 0.0f;
                    break;
                default:
                    throw new NotSupportedException();
            }

            _Left = 0.0f;
            _Right = DrawEngine2d.FrameBufferWidthAsSingle;

            _Bounds = new RectangularArea2(_Left, _Top, _Right, _Bottom);

            SetRecalcRequired();
        }