Удалил UType::object_ptr и заменил его на комбинацию из std::shared_ptr и std::weak_ptr из-за ужасной реализации.

This commit is contained in:
2026-05-31 20:38:30 +07:00
parent fa3e987e93
commit 6389e6b25f
14 changed files with 67 additions and 311 deletions
+3 -4
View File
@@ -7,7 +7,6 @@
#include "Game/SaveMap/ISave.h"
#include "Delegate/Delegate.h"
#include "Math/Vector.hpp"
#include "Types/object_ptr.hpp"
class World;
GENERATE_META(Actor)
@@ -17,7 +16,7 @@ class Actor : public ISave, public IRTTI
World* world_;
std::string name_;
UType::object_ptr<Vector3D> loc_, rot_, scale_;
std::shared_ptr<Vector3D> loc_, rot_, scale_;
std::list<std::string> tags;
@@ -42,14 +41,14 @@ public:
* Вызывает делегат OnSetActorLocate
*/
void SetActorLocate(const Vector3D& loc) noexcept;
inline const UType::object_ptr<Vector3D> GetActorLocate() const { return loc_; }
inline Vector3D GetActorLocate() const { return *loc_; }
/*
* Изменяет ориентацию в пространстве
* Вызывает делегат OnSetActorRotate
*/
void SetActorRotate(const Vector3D& rot) noexcept;
inline const UType::object_ptr<Vector3D> GetActorRotate() const { return rot_; }
inline Vector3D GetActorRotate() const { return *rot_; }
void AddTag(const std::string& tag) noexcept;
void RemoveTag(const std::string& tag) noexcept;