LevelObject.cpp 487 B

12345678910111213141516171819202122
  1. #include "LevelObject.h"
  2. #include "Model.h"
  3. LevelObject::LevelObject(const std::string &fileName, const Vec3f &position, const Vec3f &rotation, const float &scale, const bool &hasCollision)
  4. {
  5. model = Model::load(fileName);
  6. this->position = position;
  7. this->position.x -= model->center.x;
  8. this->position.z -= model->center.z;
  9. this->rotation = rotation;
  10. this->scale = scale;
  11. this->canCollide = hasCollision;
  12. }
  13. LevelObject::~LevelObject()
  14. {
  15. if (model)
  16. Model::unload(model);
  17. }