예제 #1
0
        public override void Rotate(float SIN, float COS)
        {
            if (OnRotateStart != null)
            {
                if (!OnRotateStart.Invoke(this, SIN, COS))
                {
                    return;
                }
            }

            if (OnRotating != null)
            {
                OnRotating.Invoke(this, SIN, COS);
            }

            foreach (GlFigure F in this.figuresAmount)
            {
                F.Rotate(SIN, COS);
            }

            if (OnRotated != null)
            {
                OnRotated.Invoke(this, SIN, COS);
            }
        }
예제 #2
0
        public override void Rotate(float SIN, float COS)
        {
            float oldX = this.Center.X;
            float oldY = this.Center.Y;

            if (OnRotateStart != null)
            {
                if (!OnRotateStart.Invoke(this, SIN, COS))
                {
                    return;
                }
            }

            if (OnRotating != null)
            {
                OnRotating.Invoke(this, SIN, COS);
            }

            this.directVector = this.directVector.getRotatedVector(-SIN, COS);
            updatePointsPosition();

            if (OnRotated != null)
            {
                OnRotated.Invoke(this, SIN, COS);
            }
        }
예제 #3
0
        public override void Rotate(float SIN, float COS)
        {
            if (OnRotateStart != null)
            {
                if (!OnRotateStart.Invoke(this, SIN, COS))
                {
                    return;
                }
            }

            if (OnRotating != null)
            {
                OnRotating.Invoke(this, SIN, COS);
            }

            for (int i = 0; i < vertexes.Length; i++)
            {
                vertexes[i] = new GlVectorR2(vertexes[i].X - polyCenter.X, vertexes[i].Y - polyCenter.Y).getRotatedVector(-SIN, COS).fromPointToPoint(polyCenter);
            }

            if (OnRotated != null)
            {
                OnRotated.Invoke(this, SIN, COS);
            }
        }
예제 #4
0
    private void Update()
    {
        Vector3 destination   = player.position - lastPos;
        float   rotatingAngle = player.rotation.eulerAngles.y - lastRotatingAngle;

        if (destination.magnitude != 0)
        {
            OnTracking?.Invoke(destination);
        }

        if (rotatingAngle != 0)
        {
            OnRotating?.Invoke(player.rotation.eulerAngles.y);
        }

        lastPos           = player.position;
        lastRotatingAngle = player.rotation.eulerAngles.y;
    }
예제 #5
0
        /// <summary>
        /// Rotates the point around itself
        /// </summary>
        /// <param name="SIN">sin of counter-wise rotation angle</param>
        /// <param name="COS">cos of counter-wise rotation angle</param>
        public override void Rotate(float SIN, float COS)
        {
            if (OnRotateStart != null)
            {
                if (!OnRotateStart.Invoke(this, SIN, COS))
                {
                    return;
                }
            }

            if (OnRotating != null)
            {
                OnRotating.Invoke(this, SIN, COS);
            }

            if (OnRotated != null)
            {
                OnRotated.Invoke(this, SIN, COS);
            }

            return;
        }
예제 #6
0
        public override void Rotate(float SIN, float COS)
        {
            if (OnRotateStart != null)
            {
                if (!OnRotateStart.Invoke(this, SIN, COS))
                {
                    return;
                }
            }

            if (OnRotating != null)
            {
                OnRotating.Invoke(this, SIN, COS);
            }

            this.directVector = this.DirectVector.getRotatedVector(-SIN, COS);

            if (OnRotated != null)
            {
                OnRotated.Invoke(this, SIN, COS);
            }
        }