Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

46 linhas
998 B

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-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://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. //
  11. // The Matrix classes
  12. // ------------------
  13. //
  14. #if !defined __DH_MATRIX_H__
  15. #define __DH_MATRIX_H__
  16. template <typename T> struct Vector2
  17. {
  18. Vector2() { x = y = 0; }
  19. Vector2(T _x, T _y) { x = _x; y = _y; }
  20. union { T x; T a; T i; };
  21. union { T y; T b; T j; };
  22. };
  23. typedef Vector2<float> Float2;
  24. typedef Vector2<int> Int2;
  25. template <typename T> struct Vector3
  26. {
  27. Vector3() { x = y = z = 0; }
  28. Vector3(T _x, T _y, T _z) { x = _x; y = _y; z = _z; }
  29. union { T x; T a; T i; };
  30. union { T y; T b; T j; };
  31. union { T z; T c; T k; };
  32. };
  33. typedef Vector3<float> Float3;
  34. typedef Vector3<int> Int3;
  35. #endif // __DH_MATRIX_H__