2021-09-13 15:53:43 +03:00
|
|
|
//
|
|
|
|
// Created by Иван Ильин on 15.03.2021.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ENGINE_OBJECT_H
|
|
|
|
#define ENGINE_OBJECT_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include "utils/Point4D.h"
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
class Object {
|
|
|
|
protected:
|
2021-09-19 11:25:10 +03:00
|
|
|
std::vector<std::shared_ptr<Object>> _attachedObjects;
|
2021-09-13 15:53:43 +03:00
|
|
|
|
2021-09-19 11:25:10 +03:00
|
|
|
Point4D _position;
|
|
|
|
Point4D _angle;
|
2021-09-13 15:53:43 +03:00
|
|
|
public:
|
|
|
|
Object() = default;
|
|
|
|
|
|
|
|
virtual void translate(const Point4D& dv) {}
|
|
|
|
virtual void rotate(const Point4D& r) {}
|
|
|
|
virtual void rotateRelativePoint(const Point4D& point4D, const Point4D& r) {}
|
|
|
|
virtual void rotate(const Point4D& v, double rv) {}
|
|
|
|
virtual void rotateRelativePoint(const Point4D& s, const Point4D& v, double r) {}
|
|
|
|
|
2021-09-19 11:25:10 +03:00
|
|
|
[[nodiscard]] Point4D position() const { return _position; }
|
|
|
|
[[nodiscard]] Point4D angle() const { return _angle; }
|
2021-09-13 15:53:43 +03:00
|
|
|
|
2021-09-14 13:47:53 +03:00
|
|
|
void attach(std::shared_ptr<Object> object) {
|
2021-09-19 11:25:10 +03:00
|
|
|
_attachedObjects.push_back(object);
|
2021-09-13 15:53:43 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //MINECRAFT_3DZAVR_OBJECT_H
|