Completed Transform System

This commit is contained in:
Diren D Bharwani 2022-09-21 14:54:57 +08:00
parent 0db7392eed
commit 415e47780c
4 changed files with 54 additions and 9 deletions

View File

@ -21,8 +21,46 @@ namespace SHADE
SHTransformComponent::SHTransformComponent() noexcept
: SHComponent {}
, dirty { true }
{}
SHTransformComponent::SHTransformComponent(const SHTransformComponent& rhs) noexcept
: SHComponent {}
, dirty { true }
, local { rhs.local }
, world { rhs.world }
{}
SHTransformComponent::SHTransformComponent(SHTransformComponent&& rhs) noexcept
: SHComponent {}
, dirty { true }
, local { std::move(rhs.local) }
, world { std::move(rhs.world) }
{}
/*-----------------------------------------------------------------------------------*/
/* Operator Overload Definitions */
/*-----------------------------------------------------------------------------------*/
SHTransformComponent& SHTransformComponent::operator=(const SHTransformComponent& rhs) noexcept
{
dirty = true;
local = rhs.local;
world = rhs.world;
return *this;
}
SHTransformComponent& SHTransformComponent::operator=(SHTransformComponent&& rhs) noexcept
{
dirty = true;
local = std::move(rhs.local);
world = std::move(rhs.world);
return *this;
}
/*-----------------------------------------------------------------------------------*/
/* Getter Function Definitions */
/*-----------------------------------------------------------------------------------*/

View File

@ -37,15 +37,18 @@ namespace SHADE
/* Constructors & Destructor */
/*---------------------------------------------------------------------------------*/
~SHTransformComponent () override = default;
~SHTransformComponent () override = default;
SHTransformComponent () noexcept;
SHTransformComponent () noexcept;
SHTransformComponent (const SHTransformComponent& rhs) noexcept;
SHTransformComponent (SHTransformComponent&& rhs) noexcept;
// TODO(Diren): Do I implement these in a specific manner or delete?
SHTransformComponent (const SHTransformComponent&) = delete;
SHTransformComponent (SHTransformComponent&&) = delete;
SHTransformComponent& operator=(const SHTransformComponent&) = delete;
SHTransformComponent& operator=(SHTransformComponent&&) = delete;
/*---------------------------------------------------------------------------------*/
/* Operator Overloads */
/*---------------------------------------------------------------------------------*/
SHTransformComponent& operator=(const SHTransformComponent& rhs) noexcept;
SHTransformComponent& operator=(SHTransformComponent&& rhs) noexcept;
/*---------------------------------------------------------------------------------*/
/* Getter Functions */

View File

@ -37,8 +37,6 @@ namespace SHADE
// Get the current scene graph to traverse and update
auto& sceneGraph = SHSceneManager::GetCurrentSceneGraph();
UpdateEntity(sceneGraph.GetRoot());
// Clear all dirty flags
}
/*-----------------------------------------------------------------------------------*/
@ -62,6 +60,8 @@ namespace SHADE
UpdateTransform(*childTransform, NODE_TRANSFORM);
UpdateEntity(child);
childTransform->dirty = false;
}
}

View File

@ -35,6 +35,10 @@ namespace SHADE
SHTransformSystem (const SHTransformSystem&) = delete;
SHTransformSystem (SHTransformSystem&&) = delete;
/*---------------------------------------------------------------------------------*/
/* Operator Overloads */
/*---------------------------------------------------------------------------------*/
SHTransformSystem& operator= (const SHTransformSystem&) = delete;
SHTransformSystem& operator= (SHTransformSystem&&) = delete;