Character controller working better

Moved ECS systems to separate folders
better raycast normal result
This commit is contained in:
Antoine Pilote
2021-06-18 16:44:54 -04:00
parent 8f238cd4ca
commit 5b56e2ff9a
73 changed files with 1179 additions and 489 deletions

View File

@@ -27,6 +27,7 @@ WrenScript::WrenScript(const std::string& path, const std::string& mod, bool isE
// Create handles to the instance methods.
this->m_OnInitHandle = wrenMakeCallHandle(vm, "init()");
this->m_OnUpdateHandle = wrenMakeCallHandle(vm, "update(_)");
this->m_OnFixedUpdateHandle = wrenMakeCallHandle(vm, "fixedUpdate(_)");
this->m_OnExitHandle = wrenMakeCallHandle(vm, "exit()");
if (isEntity)
@@ -49,6 +50,15 @@ void WrenScript::CallUpdate(float timestep)
WrenInterpretResult result = wrenCall(vm, this->m_OnUpdateHandle);
}
void WrenScript::CallFixedUpdate(float timestep)
{
WrenVM* vm = ScriptingEngine::GetWrenVM();
wrenEnsureSlots(vm, 2);
wrenSetSlotHandle(vm, 0, this->m_Instance);
wrenSetSlotDouble(vm, 1, timestep);
WrenInterpretResult result = wrenCall(vm, this->m_OnFixedUpdateHandle);
}
void WrenScript::CallExit()
{
WrenVM* vm = ScriptingEngine::GetWrenVM();