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.

Sprite.h 965B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*!
  2. * \file include/Sprite.h
  3. * \brief 2D Billboard Collection
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _SPRITE_H_
  8. #define _SPRITE_H_
  9. #include <vector>
  10. #include "BoundingSphere.h"
  11. class Sprite {
  12. public:
  13. Sprite(int tile, int x, int y, int width, int height);
  14. void display(glm::mat4 MVP);
  15. int getTexture() { return texture; }
  16. glm::vec4 getUVs() { return uv2D; }
  17. BoundingSphere& getBoundingSphere() { return boundingSphere; }
  18. private:
  19. int texture;
  20. std::vector<glm::vec3> vertexBuff;
  21. std::vector<glm::vec2> uvBuff;
  22. glm::vec4 uv2D;
  23. BoundingSphere boundingSphere;
  24. };
  25. class SpriteSequence {
  26. public:
  27. SpriteSequence(int objectID, int offset, int size)
  28. : id(objectID), start(offset), length(size) { }
  29. void display(glm::mat4 MVP, int index);
  30. int getID() { return id; }
  31. int getStart() { return start; }
  32. int size() { return length; }
  33. private:
  34. int id;
  35. int start;
  36. int length;
  37. };
  38. #endif