Visual.cpp 609 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // Created by jovian on 18/07/17.
  3. //
  4. #include "Visual.h"
  5. Visual::Visual(unsigned int imgId, const b2Vec2 &relPos, float angle)
  6. : m_imgId(imgId), m_relPos(relPos), m_angle(angle) {}
  7. unsigned int Visual::getImgId() const {
  8. return m_imgId;
  9. }
  10. const b2Vec2 &Visual::getPos() const {
  11. return m_relPos;
  12. }
  13. float Visual::getAngle() const {
  14. return m_angle;
  15. }
  16. void clearVisuals(std::vector<Visual *> &scope) {
  17. while (!scope.empty()) {
  18. if (scope.back() != nullptr) {
  19. delete scope.back();
  20. scope.back() = nullptr;
  21. }
  22. scope.pop_back();
  23. }
  24. }