Visual.cpp 694 B

1234567891011121314151617181920212223242526272829303132333435
  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, float scale)
  6. : m_imgId(imgId), m_relPos(relPos), m_angle(angle), m_scale(scale) {}
  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. float Visual::getScale() const {
  17. return m_scale;
  18. }
  19. void clearVisuals(std::vector<Visual *> &scope) {
  20. while (!scope.empty()) {
  21. if (scope.back() != nullptr) {
  22. delete scope.back();
  23. scope.back() = nullptr;
  24. }
  25. scope.pop_back();
  26. }
  27. }