コード例 #1
0
        private void _StartTurn(Vector2d targetRot)
        {
            long tempCheck;

            if (targetRot.NotZero() &&
                (((tempCheck = Agent.Body._rotation.Cross(targetRot.x, targetRot.y)) != 0) ||
                 (Agent.Body._rotation.Dot(targetRot.x, targetRot.y) < 0))
                )
            {
                if (tempCheck.AbsLessThan(turnSin) && Agent.Body._rotation.Dot(targetRot.x, targetRot.y) > 0)
                {
                    targetRotation = targetRot;
                    Arrive();
                }
                else
                {
                    cachedBeginCheck = tempCheck;
                    targetRotation   = targetRot;
                    targetReached    = false;
                }
            }
            else
            {
            }
        }
コード例 #2
0
ファイル: Turn.cs プロジェクト: GladFox/Lockstep-Framework
        private void _StartTurn(Vector2d targetRot)
        {
            long tempCheck;

            if (targetRot.NotZero() && (tempCheck = cachedBody._rotation.Cross(targetRot.x, targetRot.y)) != 0)
            {
                if (tempCheck.AbsMoreThan(turnSin) == false && cachedBody._rotation.Dot(targetRot.x, targetRot.y) > 0)
                {
                    targetRotation = targetRot;
                    Arrive();
                }
                else
                {
                    cachedBeginCheck = tempCheck;
                    targetRotation   = targetRot;
                    targetReached    = false;
                }
            }
            else
            {
            }
        }
コード例 #3
0
        private void _StartTurn(Vector2d targetRot)
        {
            long tempCheck;
            if (targetRot.NotZero () && (tempCheck = cachedBody.Rotation.Cross (targetRot.x, targetRot.y)) != 0) {
                if (tempCheck.AbsMoreThan (turnSin) == false && cachedBody.Rotation.Dot (targetRot.x,targetRot.y) > 0)
                {
                    targetRotation = targetRot;
                    Arrive ();
                }
                else {
                    cachedBeginCheck = tempCheck;
                    targetRotation = targetRot;
                    targetReached = false;
                }
            } else {

            }
        }