Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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;
    }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
            }
        }