44 lines
1.6 KiB
C++
44 lines
1.6 KiB
C++
//
|
|
// Created by sebastian on 07.02.26.
|
|
//
|
|
|
|
#ifndef ENTITY_H
|
|
#define ENTITY_H
|
|
#include <memory>
|
|
#include <utility>
|
|
|
|
#include "../../renderer/model/TexturedModel.h"
|
|
#include "glm/vec3.hpp"
|
|
|
|
class Entity {
|
|
private:
|
|
|
|
std::shared_ptr<TexturedModel> model;
|
|
glm::vec3 position;
|
|
float rotX, rotY, rotZ;
|
|
float scale;
|
|
|
|
public:
|
|
std::string modelName;
|
|
Entity(std::shared_ptr<TexturedModel> model, const glm::vec3 position, const float rotX, const float rotY, const float rotZ, const float scale, std::string modelname="") : modelName(std::move(modelname)), model(std::move(model)), position(position), rotX(rotX), rotY(rotY), rotZ(rotZ), scale(scale) {};
|
|
|
|
void increasePosition(const float dx, const float dy, const float dz) {position += glm::vec3(dx, dy, dz);} //( dx, dy, dz
|
|
void increaseRotation(const float dx, const float dy, const float dz) {rotX += dx; rotY += dy; rotZ += dz;}
|
|
|
|
[[nodiscard]] const std::shared_ptr<TexturedModel> getModel() const {return model;}
|
|
[[nodiscard]] const glm::vec3 getPosition() const {return position;}
|
|
[[nodiscard]] float getRotX() const {return rotX;}
|
|
[[nodiscard]] float getRotY() const {return rotY;}
|
|
[[nodiscard]] float getRotZ() const {return rotZ;}
|
|
[[nodiscard]] float getScale() const {return scale;}
|
|
void setPosition(glm::vec3 position) {this->position = position;}
|
|
void setRotX(float rotX) {this->rotX = rotX;}
|
|
void setRotY(float rotY) {this->rotY = rotY;}
|
|
void setRotZ(float rotZ) {this->rotZ = rotZ;}
|
|
void setScale(float scale) {this->scale = scale;}
|
|
};
|
|
|
|
|
|
|
|
#endif //ENTITY_H
|