コード例 #1
0
        public Tuple4 Rotation(ReferenceFrame referenceFrame)
        {
            var up      = Vector3.up;
            var right   = InternalBody.GetRelSurfacePosition(0, 0, 1).normalized;
            var forward = Vector3.Cross(right, up);

            Vector3.OrthoNormalize(ref forward, ref up);
            var rotation = Quaternion.LookRotation(forward, up);

            return(referenceFrame.RotationFromWorldSpace(rotation).ToTuple());
        }
コード例 #2
0
ファイル: CelestialBody.cs プロジェクト: key50/My_kRPC
 public Tuple4 Rotation (ReferenceFrame referenceFrame)
 {
     if (ReferenceEquals (referenceFrame, null))
         throw new ArgumentNullException (nameof (referenceFrame));
     var up = Vector3.up;
     var right = InternalBody.GetRelSurfacePosition (0, 0, 1).normalized;
     var forward = Vector3.Cross (right, up);
     Vector3.OrthoNormalize (ref forward, ref up);
     var rotation = Quaternion.LookRotation (forward, up);
     return referenceFrame.RotationFromWorldSpace (rotation).ToTuple ();
 }