Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

StaticMesh.h 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*!
  2. * \file include/StaticMesh.h
  3. * \brief Static Model Meshes
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _STATIC_MODEL_H_
  8. #define _STATIC_MODEL_H_
  9. #include <vector>
  10. #include "math/math.h"
  11. #include "TombRaider.h"
  12. class TexturedTriangle {
  13. public:
  14. TexturedTriangle(int i[3], vec_t s[6], int tex, unsigned short trans);
  15. bool operator< (TexturedTriangle &t);
  16. void display(vec_t *vertices, vec_t *colors, vec_t *normals);
  17. private:
  18. int index[3];
  19. vec_t st[6];
  20. int texture;
  21. unsigned short transparency;
  22. };
  23. class StaticMesh {
  24. public:
  25. StaticMesh(TombRaider &tr, unsigned int index);
  26. ~StaticMesh();
  27. void display();
  28. vec_t getRadius();
  29. private:
  30. bool dontshow;
  31. vec3_t center;
  32. vec_t radius;
  33. unsigned int vertexCount;
  34. unsigned int colorCount;
  35. unsigned int normalCount;
  36. vec_t *vertices;
  37. vec_t *colors;
  38. vec_t *normals;
  39. std::vector<TexturedTriangle *> texturedTriangles;
  40. std::vector<TexturedTriangle *> coloredTriangles;
  41. std::vector<TexturedTriangle *> texturedRectangles;
  42. std::vector<TexturedTriangle *> coloredRectangles;
  43. };
  44. #endif