Beispiel #1
0
        /// <summary>
        /// Recalculates the ViewerAngle property based on a viewer's position.
        /// </summary>
        /// <param name="ViewerPosition"></param>
        public void UpdateViewerAngle(V2 ViewerPosition)
        {
            V2 direction = TargetObject.Position2D - Position2D;

            direction.Normalize();

            ushort angle = MathUtil.GetAngleForDirection(direction);

            // update viewer angle
            ViewerAngle = MathUtil.GetAngle(ViewerPosition, Position2D, angle);

            // mark for possible appearance change
            appearanceChanged = true;
        }