Turned the Transform namespace into TransformSystem so it would be able to subscribe to EntityDeleted and clean up after itself

This commit is contained in:
2016-03-13 00:55:53 +01:00
parent f6113b9d9c
commit a1fda82d3a
31 changed files with 311 additions and 128 deletions
+3 -3
View File
@@ -76,9 +76,9 @@ EntityWrapper SpawnerSystem::Spawn(EntityWrapper spawner, EntityWrapper parent /
void SpawnerSystem::transformEntityToSpawnPoint(EntityWrapper spawnedEntity, EntityWrapper spawnPoint)
{
// Set its position and orientation to that of the SpawnPoint
spawnedEntity["Transform"]["Position"] = Transform::AbsolutePosition(spawnPoint.World, spawnPoint.ID);
spawnedEntity["Transform"]["Position"] = TransformSystem::AbsolutePosition(spawnPoint.World, spawnPoint.ID);
// TODO: Quaternions, bitch
spawnedEntity["Transform"]["Orientation"] = glm::eulerAngles(Transform::AbsoluteOrientation(spawnPoint));
spawnedEntity["Transform"]["Orientation"] = glm::eulerAngles(TransformSystem::AbsoluteOrientation(spawnPoint));
}
bool SpawnerSystem::spawnedEntityIsColliding(EntityWrapper spawnedEntity, EntityWrapper spawnPoint, const std::string& dontCollideComponent)
@@ -113,7 +113,7 @@ bool SpawnerSystem::spawnedEntityIsColliding(EntityWrapper spawnedEntity, Entity
spawnedBox,
model->Vertices(),
model->m_Indices,
Transform::ModelMatrix(otherEntity))) {
TransformSystem::ModelMatrix(otherEntity))) {
return true;
}
}