You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

poly.cpp 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // Lol Engine - Sample math program: chek trigonometric functions
  3. //
  4. // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://www.wtfpl.net/ for more details.
  9. //
  10. #if defined HAVE_CONFIG_H
  11. # include "config.h"
  12. #endif
  13. #include <cstdio>
  14. #include <lol/main.h>
  15. using namespace lol;
  16. mat4 multiply_copy(mat4 m1, mat4 m2, mat4 m3)
  17. {
  18. return m1 * m2 * m3;
  19. }
  20. mat4 multiply_ref(mat4 const &m1, mat4 const &m2, mat4 const &m3)
  21. {
  22. return m1 * m2 * m3;
  23. }
  24. int main(int argc, char **argv)
  25. {
  26. UNUSED(argc, argv);
  27. mat4 a = mat4::rotate(0.1f, vec3(1.f, 1.f, 0.f));
  28. mat4 b = mat4::rotate(0.1f, vec3(0.f, 0.f, 1.f));
  29. mat4 m = mat4(1.f);
  30. for (int i = 0; i < 40000000; ++i)
  31. //m = multiply_copy(a, m, b);
  32. m = multiply_ref(a, m, b);
  33. m.printf();
  34. return EXIT_SUCCESS;
  35. }