2
ベクトルを回転させる
一人称視点のカメラで、視線方向をd1からd2にスムーズに変更したい。後者の方向は、目標位置t2によって示される。 これまでのところ、正常に機能する回転を実装しましたが、回転の速度は、現在の方向が目的の方向に近づくほど遅くなります。これは避けたいものです。 これまでに作成した2つの非常に単純なメソッドを次に示します。 // this method initiates the direction change and sets the parameter public void LookAt(Vector3 target) { _desiredDirection = target - _cameraPosition; _desiredDirection.Normalize(); _rotation = new Matrix(); _rotationAxis = Vector3.Cross(Direction, _desiredDirection); _isLooking = true; } // this method gets execute by the Update()-method if _isLooking flag is up. …