Open Source Tomb Raider Engine
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.

WorldData.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. typedef enum {
  13. worldMoveType_walkNoSwim = -1,
  14. worldMoveType_walk = 0,
  15. worldMoveType_noClipping = 1,
  16. worldMoveType_fly = 2,
  17. worldMoveType_swim = 3
  18. } worldMoveType;
  19. /*! \fixme For now shaders are textures on tex objects
  20. * and materials on color objects. If -1
  21. * then it doesn't have that information yet.
  22. */
  23. typedef struct {
  24. int index[3];
  25. vec_t st[6];
  26. int texture;
  27. unsigned short transparency;
  28. } texture_tri_t;
  29. typedef struct {
  30. std::vector<texture_tri_t *> texturedTriangles;
  31. std::vector<texture_tri_t *> coloredTriangles;
  32. std::vector<texture_tri_t *> texturedRectangles;
  33. std::vector<texture_tri_t *> coloredRectangles;
  34. vec3_t center;
  35. float radius;
  36. unsigned int vertexCount;
  37. vec_t *vertices;
  38. unsigned int colorCount;
  39. vec_t *colors;
  40. unsigned int normalCount;
  41. vec_t *normals;
  42. } model_mesh_t;
  43. typedef struct {
  44. int id; //!< Unique identifier
  45. float pos[3]; //!< World position
  46. float angles[3]; //!< Euler angles (pitch, yaw, roll)
  47. int room; //!< Current room entity is in
  48. worldMoveType moveType; //!< Type of motion/clipping
  49. int state; //!< State of the Player, AI, or object
  50. int objectId; //!< What kind of entity?
  51. int modelId; //!< Animation model
  52. SkeletalModel *tmpHook;
  53. bool animate;
  54. } entity_t;
  55. #endif