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.
 
 
 

48 lines
1.0 KiB

  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 "core.h"
  15. using namespace lol;
  16. using namespace std;
  17. mat4 multiply_copy(mat4 m1, mat4 m2, mat4 m3)
  18. {
  19. return m1 * m2 * m3;
  20. }
  21. mat4 multiply_ref(mat4 const &m1, mat4 const &m2, mat4 const &m3)
  22. {
  23. return m1 * m2 * m3;
  24. }
  25. int main(int argc, char **argv)
  26. {
  27. UNUSED(argc, argv);
  28. mat4 a = mat4::rotate(0.1f, vec3(1.f, 1.f, 0.f));
  29. mat4 b = mat4::rotate(0.1f, vec3(0.f, 0.f, 1.f));
  30. mat4 m = mat4(1.f);
  31. for (int i = 0; i < 40000000; ++i)
  32. //m = multiply_copy(a, m, b);
  33. m = multiply_ref(a, m, b);
  34. m.printf();
  35. return EXIT_SUCCESS;
  36. }