コード例 #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
ファイル: GlCurve.cs プロジェクト: Cesar18102/GeometryDLL
        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
ファイル: PlayerEventHandler.cs プロジェクト: Craft-Kids/Test
    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);
            }
        }