Created
May 23, 2018 03:20
-
-
Save lyokato/b62089f3dfdfc6d74c7999d6c58cd2c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Quaternion GetVector() | |
{ | |
Quaternion q = Quaternion.AngleAxis( 90.0f, Vector3.right ); | |
Vector3 v1 = q * new Vector3(j_b.x, i_b.x, k_b.x); | |
Vector3 v2 = q * -(new Vector3(j_b.z, i_b.z, k_b.z)); | |
if (v2 != Vector3.zero){ | |
return Quaternion.LookRotation(v1, v2); | |
}else{ | |
return Quaternion.identity; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment