diff --git a/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp b/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp index 8ddbbcc9..45f236f3 100644 --- a/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp +++ b/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp @@ -21,6 +21,13 @@ #include "Input/SHInputManager.h" +/*-------------------------------------------------------------------------------------*/ +/* Local Functions */ +/*-------------------------------------------------------------------------------------*/ + +void testFunction(); + +///////////////////////////////////////////////////////////////////////////////////////// namespace SHADE { @@ -135,7 +142,7 @@ namespace SHADE const double FIXED_DT = physicsSystem->fixedDT; accumulatedTime += dt; - testFunction(); + //testFunction(); int count = 0; while (accumulatedTime > FIXED_DT) @@ -359,5 +366,32 @@ namespace SHADE } } // namespace SHADE +///////////////////////////////////////////////////////////////////////////////////////// +void testFunction() +{ + using namespace SHADE; + // Test movement + const float forceModifier = 25.0f; + EntityID eid = 65538; + + if (SHEntityManager::IsValidEID(eid)) + { + auto* rb = SHComponentManager::GetComponent_s(eid); + if (rb) + { + if (SHInputManager::GetKey(SHInputManager::SH_KEYCODE::W)) + rb->AddForce(-SHVec3::UnitZ * forceModifier); + + if (SHInputManager::GetKey(SHInputManager::SH_KEYCODE::A)) + rb->AddForce(-SHVec3::UnitX * forceModifier); + + if (SHInputManager::GetKey(SHInputManager::SH_KEYCODE::S)) + rb->AddForce(SHVec3::UnitZ * forceModifier); + + if (SHInputManager::GetKey(SHInputManager::SH_KEYCODE::D)) + rb->AddForce(SHVec3::UnitX * forceModifier); + } + } +}