Completed Transform System
This commit is contained in:
parent
0db7392eed
commit
415e47780c
|
@ -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 */
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
|
|
@ -40,12 +40,15 @@ namespace SHADE
|
|||
~SHTransformComponent () override = default;
|
||||
|
||||
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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,10 @@ namespace SHADE
|
|||
SHTransformSystem (const SHTransformSystem&) = delete;
|
||||
SHTransformSystem (SHTransformSystem&&) = delete;
|
||||
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* Operator Overloads */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
SHTransformSystem& operator= (const SHTransformSystem&) = delete;
|
||||
SHTransformSystem& operator= (SHTransformSystem&&) = delete;
|
||||
|
||||
|
|
Loading…
Reference in New Issue