Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Vector3 forward = ???;
  2. Vector3 rotation(forward.z, forward.y, -forward.x);
  3. Vector3 up = Normalize(Cross(forward, rotation));
  4.  
  5. Matrix4 matrix =
  6. {
  7. rotation.x, rotation.y, rotation.z, 0.0f,
  8. up.x, up.y, up.z, 0.0f,
  9. forward.x, forward.y, forward.z, 0.0f,
  10. 0.0f, 0.0f, 0.0f, 1.0f
  11. };
  12.  
  13. *(Matrix4*)&mw::myRBD->Rotation = matrix;
  14. Matrix4ToQuaternion(&matrix, &mw::myRBD->Orientation);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement