Crystal.cpp 568 B

123456789101112131415161718192021222324252627282930313233
  1. #include "Crystal.h"
  2. #include "Model.h"
  3. Crystal::Crystal(const std::string & filled, const std::string & empty, const Vec3f & position, Vec3f & rotation, const float & scale)
  4. {
  5. this->filled = filled;
  6. this->empty = empty;
  7. model = Model::load(this->filled);
  8. this->position = position;
  9. this->rotation = rotation;
  10. this->scale = scale;
  11. this->canCollide = true;
  12. isFilled = true;
  13. }
  14. Crystal::~Crystal()
  15. {
  16. if (model)
  17. Model::unload(model);
  18. }
  19. void Crystal::draw()
  20. {
  21. Entity::draw();
  22. }
  23. void Crystal::pickUp()
  24. {
  25. isFilled = false;
  26. model = Model::load(empty);
  27. }