fixed some small bugs and updated version to 0.1.3

This commit is contained in:
2026-01-25 10:55:06 +01:00
parent 11e8d343af
commit bf4189bba0
9 changed files with 57 additions and 10 deletions

View File

@@ -15,10 +15,10 @@ namespace TSE
objectEntries[id] = this;
}
Transformable::Transformable(uuids::uuid id)
: id(id), position(0, 0, 0), scale(1, 1, 1), rotation(), name("")
Transformable::Transformable(uuids::uuid _id)
: id(_id), position(0, 0, 0), scale(1, 1, 1), rotation(), name("")
{
objectEntries[id] = this;
objectEntries[_id] = this;
}
Transformable::Transformable(const string &name)
@@ -28,10 +28,10 @@ namespace TSE
objectEntries[id] = this;
}
Transformable::Transformable(const string &name, uuids::uuid id)
: id(id), position(0, 0, 0), scale(1, 1, 1), rotation(), name(name)
Transformable::Transformable(const string &name, uuids::uuid _id)
: id(_id), position(0, 0, 0), scale(1, 1, 1), rotation(), name(name)
{
objectEntries[id] = this;
objectEntries[_id] = this;
}
Transformable::~Transformable()
@@ -370,10 +370,13 @@ namespace TSE
{
//deleting children
if(!onlyThis)
{
for(auto child : t->children)
{
HardDelete(child, onlyThis);
}
t->children.clear();
}
//deleting atteched scripts
for (auto& [_, script] : t->components)
@@ -449,6 +452,19 @@ namespace TSE
return objectEntries.size();
}
Transformable *Transformable::GetTansformableAt(int i)
{
int x = 0;
for(auto obj : objectEntries)
{
if(i == x++)
{
return obj.second;
}
}
return nullptr;
}
Transformable *Transformable::Find(string name)
{
for(auto obj : objectEntries)

View File

@@ -100,6 +100,7 @@ namespace TSE
public:
static int GetTansformableCount();
static Transformable* GetTansformableAt(int i);
static Transformable* Find(string name);
static Transformable* Find(uuids::uuid id);
};