Completed Transform System
This commit is contained in:
parent
0db7392eed
commit
415e47780c
|
@ -21,8 +21,46 @@ namespace SHADE
|
||||||
|
|
||||||
SHTransformComponent::SHTransformComponent() noexcept
|
SHTransformComponent::SHTransformComponent() noexcept
|
||||||
: SHComponent {}
|
: 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 */
|
/* Getter Function Definitions */
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -37,15 +37,18 @@ namespace SHADE
|
||||||
/* Constructors & Destructor */
|
/* 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;
|
/* Operator Overloads */
|
||||||
SHTransformComponent (SHTransformComponent&&) = delete;
|
/*---------------------------------------------------------------------------------*/
|
||||||
SHTransformComponent& operator=(const SHTransformComponent&) = delete;
|
|
||||||
SHTransformComponent& operator=(SHTransformComponent&&) = delete;
|
SHTransformComponent& operator=(const SHTransformComponent& rhs) noexcept;
|
||||||
|
SHTransformComponent& operator=(SHTransformComponent&& rhs) noexcept;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* Getter Functions */
|
/* Getter Functions */
|
||||||
|
|
|
@ -37,8 +37,6 @@ namespace SHADE
|
||||||
// Get the current scene graph to traverse and update
|
// Get the current scene graph to traverse and update
|
||||||
auto& sceneGraph = SHSceneManager::GetCurrentSceneGraph();
|
auto& sceneGraph = SHSceneManager::GetCurrentSceneGraph();
|
||||||
UpdateEntity(sceneGraph.GetRoot());
|
UpdateEntity(sceneGraph.GetRoot());
|
||||||
|
|
||||||
// Clear all dirty flags
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
@ -62,6 +60,8 @@ namespace SHADE
|
||||||
UpdateTransform(*childTransform, NODE_TRANSFORM);
|
UpdateTransform(*childTransform, NODE_TRANSFORM);
|
||||||
|
|
||||||
UpdateEntity(child);
|
UpdateEntity(child);
|
||||||
|
|
||||||
|
childTransform->dirty = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@ namespace SHADE
|
||||||
SHTransformSystem (const SHTransformSystem&) = delete;
|
SHTransformSystem (const SHTransformSystem&) = delete;
|
||||||
SHTransformSystem (SHTransformSystem&&) = delete;
|
SHTransformSystem (SHTransformSystem&&) = delete;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
/* Operator Overloads */
|
||||||
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
SHTransformSystem& operator= (const SHTransformSystem&) = delete;
|
SHTransformSystem& operator= (const SHTransformSystem&) = delete;
|
||||||
SHTransformSystem& operator= (SHTransformSystem&&) = delete;
|
SHTransformSystem& operator= (SHTransformSystem&&) = delete;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue