Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. // We want the rotation, but we've got multiple rotations, so combine them
  2. let pre_rotation = Quaternion::from(Euler::new(
  3. Deg(properties.pre_rotation[0]), Deg(properties.pre_rotation[1]), Deg(properties.pre_rotation[2])
  4. ));
  5. let rotation = Quaternion::from(Euler::new(
  6. Deg(properties.rotation[0]), Deg(properties.rotation[1]), Deg(properties.rotation[2])
  7. ));
  8. let post_rotation = Quaternion::from(Euler::new(
  9. Deg(properties.post_rotation[0]), Deg(properties.post_rotation[1]), Deg(properties.post_rotation[2])
  10. ));
  11.  
  12. let total_rotation = Euler::from(post_rotation * rotation * pre_rotation);
  13. let rotation = Vector3::new(
  14. total_rotation.x.0,
  15. total_rotation.y.0,
  16. total_rotation.z.0,
  17. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement