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.

WorldData.h 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*!
  2. * \file include/WorldData.h
  3. * \brief Structs and enums for the game world (model)
  4. *
  5. * \author Mongoose
  6. * \author xythobuz
  7. */
  8. #ifndef _WORLDDATA_H_
  9. #define _WORLDDATA_H_
  10. #include "math/math.h"
  11. #include "SkeletalModel.h"
  12. // Mirrors TombRaider class' room flags really
  13. typedef enum {
  14. roomFlag_underWater = 0x0001
  15. } room_flags_t;
  16. typedef enum {
  17. worldMoveType_walkNoSwim = -1,
  18. worldMoveType_walk = 0,
  19. worldMoveType_noClipping = 1,
  20. worldMoveType_fly = 2,
  21. worldMoveType_swim = 3
  22. } worldMoveType;
  23. typedef struct {
  24. vec3_t pos;
  25. } vertex_t;
  26. typedef struct {
  27. vec2_t st;
  28. } texel_t;
  29. /*! \fixme For now shaders are textures on tex objects
  30. * and materials on color objects. If -1
  31. * then it doesn't have that information yet.
  32. */
  33. typedef struct {
  34. int index[3];
  35. vec_t st[6];
  36. int texture;
  37. unsigned short transparency;
  38. } texture_tri_t;
  39. typedef struct {
  40. std::vector<texture_tri_t *> texturedTriangles;
  41. std::vector<texture_tri_t *> coloredTriangles;
  42. std::vector<texture_tri_t *> texturedRectangles;
  43. std::vector<texture_tri_t *> coloredRectangles;
  44. vec3_t center;
  45. float radius;
  46. unsigned int vertexCount;
  47. vec_t *vertices;
  48. unsigned int colorCount;
  49. vec_t *colors;
  50. unsigned int normalCount;
  51. vec_t *normals;
  52. } model_mesh_t;
  53. typedef struct entity_s {
  54. int id; //!< Unique identifier
  55. float pos[3]; //!< World position
  56. float angles[3]; //!< Euler angles (pitch, yaw, roll)
  57. int type; //!< {(0x00, item), (0x01, ai), (0x02, player)}
  58. int room; //!< Current room entity is in
  59. worldMoveType moveType; //!< Type of motion/clipping
  60. bool moving; //!< In motion?
  61. struct entity_s *master; //!< Part of entity chain?
  62. int state; //!< State of the Player, AI, or object
  63. int objectId; //!< What kind of entity?
  64. int modelId; //!< Animation model
  65. SkeletalModel *tmpHook;
  66. bool animate;
  67. /*
  68. float time, lastTime;
  69. int state, lastState;
  70. int event, lastEvent;
  71. int goal;
  72. */
  73. } entity_t;
  74. #endif