コード例 #1
0
 public void ChangeForward(FPVector toForward)
 {
     //  Debug.Log("this.rotation____before____before____before:::" + this.rotation.ToQuaternion() + ","+ this.forward.ToVector() +  " ,::"+ toForward.ToVector());
     this.rotation *= FPQuaternion.FromToRotation(this.forward, toForward);
     //   Debug.Log("this.rotation____late____late___late:::" + this.rotation.ToQuaternion());
     this.UpdateRotation();
     //  this.UpdateForward();
 }
コード例 #2
0
        public void SetFromToRotation(FPVector fromDirection, FPVector toDirection)
        {
            FPQuaternion targetRotation = FPQuaternion.FromToRotation(fromDirection, toDirection);

            this.Set(targetRotation.x, targetRotation.y, targetRotation.z, targetRotation.w);
        }