Instantiated Transform System & Update Routine

This commit is contained in:
Diren D Bharwani 2022-09-22 20:25:23 +08:00
parent f03a0d4be7
commit 0250687e06
3 changed files with 29 additions and 7 deletions

View File

@ -22,6 +22,7 @@
#include "ECS_Base/Managers/SHEntityManager.h"
#include "Graphics/MiddleEnd/Interface/SHRenderable.h"
#include "Scene/SHSceneManager.h"
#include "Math/Transform/SHTransformSystem.h"
#include "Scenes/SBTestScene.h"
@ -45,8 +46,10 @@ namespace Sandbox
window.Create(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
// Create Systems
SHADE::SHSystemManager::CreateSystem<SHADE::SHGraphicsSystem>();
SHADE::SHSystemManager::CreateSystem<SHADE::SHScriptEngine>();
// TODO(Diren): Create Physics System here
SHADE::SHSystemManager::CreateSystem<SHADE::SHTransformSystem>();
SHADE::SHSystemManager::CreateSystem<SHADE::SHGraphicsSystem>();
SHADE::SHGraphicsSystem* graphicsSystem = static_cast<SHADE::SHGraphicsSystem*>(SHADE::SHSystemManager::GetSystem<SHADE::SHGraphicsSystem>());
// Create Routines
@ -54,6 +57,12 @@ namespace Sandbox
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHScriptEngine, SHADE::SHScriptEngine::UpdateRoutine>();
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHScriptEngine, SHADE::SHScriptEngine::LateUpdateRoutine>();
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHScriptEngine, SHADE::SHScriptEngine::FrameCleanUpRoutine>();
// TODO(Diren): Register Physics System & Routines here
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHTransformSystem, SHADE::SHTransformSystem::TransformUpdateRoutine>();
SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHTransformComponent>();
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHGraphicsSystem, SHADE::SHGraphicsSystem::BatcherDispatcherRoutine>();
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHGraphicsSystem, SHADE::SHGraphicsSystem::BeginRoutine>();
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHGraphicsSystem, SHADE::SHGraphicsSystem::RenderRoutine>();

View File

@ -25,8 +25,6 @@ namespace SHADE
/* Static Data Member Definitions */
/*-----------------------------------------------------------------------------------*/
//SHTransformSystem::TransformUpdateRoutine SHTransformSystem::UpdateRoutine;
/*-----------------------------------------------------------------------------------*/
/* Constructors & Destructor Definitions */
/*-----------------------------------------------------------------------------------*/
@ -47,6 +45,16 @@ namespace SHADE
UpdateEntity(SCENE_GRAPH.GetRoot());
}
void SHTransformSystem::Init()
{
}
void SHTransformSystem::Exit()
{
}
/*-----------------------------------------------------------------------------------*/
/* Private Function Member Definitions */
/*-----------------------------------------------------------------------------------*/

View File

@ -21,7 +21,7 @@ namespace SHADE
/* Type Definitions */
/*-----------------------------------------------------------------------------------*/
class SH_API SHTransformSystem : public SHSystem
class SH_API SHTransformSystem final : public SHSystem
{
public:
/*---------------------------------------------------------------------------------*/
@ -29,7 +29,7 @@ namespace SHADE
/*---------------------------------------------------------------------------------*/
SHTransformSystem () = default;
~SHTransformSystem () = default;
~SHTransformSystem () override = default;
SHTransformSystem (const SHTransformSystem&) = delete;
SHTransformSystem (SHTransformSystem&&) = delete;
@ -45,7 +45,7 @@ namespace SHADE
/* System Routines */
/*---------------------------------------------------------------------------------*/
class TransformUpdateRoutine : public SHSystemRoutine
class SH_API TransformUpdateRoutine final: public SHSystemRoutine
{
public:
/*-------------------------------------------------------------------------------*/
@ -72,7 +72,12 @@ namespace SHADE
void Execute(double dt) noexcept override;
};
//static TransformUpdateRoutine UpdateRoutine;
/*---------------------------------------------------------------------------------*/
/* Function Members */
/*---------------------------------------------------------------------------------*/
void Init () override;
void Exit () override;
private:
/*---------------------------------------------------------------------------------*/