Пример #1
0
        /// <summary>
        /// Updates all the values caluclated from the State.Position.
        /// Re-calculates the Matrices property the re-calculates the Rectangle property
        /// from that.
        /// </summary>
        public void ApplyPosition()
        {
            MathHelper.ClampAngle(ref state.Position.Angular);
            Matrix2x3 matrix;

            ALVector2D.ToMatrix2x3(ref state.Position, out matrix);
            Matrix2x3.Multiply(ref matrix, ref transformation, out matrix);
            matrices.SetToWorld(ref matrix);
            shape.CalcBoundingRectangle(ref matrix, out rectangle);
            if (engine == null || !engine.inUpdate)
            {
                OnPositionChanged();
            }
        }