From f97e432fb7a6de096ca4d55f146e286ffe34999b Mon Sep 17 00:00:00 2001 From: wootguy Date: Mon, 16 Oct 2023 14:28:29 -0700 Subject: [PATCH] some wip stuff i forgot --- .gitignore | 3 +++ src/editor/Renderer.cpp | 28 +++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d5c0de24..0c1fa26b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ msvc /release /imgui /qhull +/imgui_177 +/imgui_178 +/merge diff --git a/src/editor/Renderer.cpp b/src/editor/Renderer.cpp index f58ada54..0996a64e 100644 --- a/src/editor/Renderer.cpp +++ b/src/editor/Renderer.cpp @@ -340,8 +340,8 @@ Renderer::Renderer() { //MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/vtuber_kizuna_ld_v3/vtuber_kizuna_ld_v3.mdl"); //MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/al_nagato_ld/al_nagato_ld.mdl"); - //MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/helmet/helmet.mdl"); - MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/lord_shino1/lord_shino1.mdl"); + MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/helmet/helmet.mdl"); + //MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/lord_shino1/lord_shino1.mdl"); //MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/arknights_lappland/arknights_lappland.mdl"); //MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/kizuna_xmas/kizuna_xmas.mdl"); //MdlRenderer* testMdl = new MdlRenderer(mdlShader, "models/player/counterx2/counterx2.mdl"); @@ -3114,10 +3114,23 @@ void Renderer::renderSvenTvEdicts() { float pitch = normalizeRangef(angles.x, -180.0f, 180.0f); int8_t b = 127 + pitch; - // TODO: need to rotate entire model a bit after a certain point + mdlRenderers[mdlIdx]->iBlender[0] = b; angles.x = 0; + // TODO: need to rotate entire model a bit after a certain point + /* + if (pitch > 35) { + ent->v.angles.x = (pitch - 35) * 0.5f; + } + else if (pitch < -45) { + ent->v.angles.x = (pitch - -45) * 0.5f; + } + else { + ent->v.angles.x = 0; + } + */ + float dt = (now - lastTime); float dtScale = 1.0f / dt; vec3 gaitspeed = vec3(ed.velocity[0], 0, -ed.velocity[1]) * sventv->updateRate; @@ -3183,7 +3196,6 @@ void Renderer::renderSvenTvEdicts() { gaitseq = ed.gaitsequence; float movespeed = gaitspeed.length() * (reverseGait ? -1.0f : 1.0f); - //logf("GAITSPEED %f %d\n", movespeed, gaitseq); // TODO: maybe transfer velocity over network becuase it can be very wrong // i think it was off by 50% at 1000 speed with 100 updateRate @@ -3201,10 +3213,16 @@ void Renderer::renderSvenTvEdicts() { gaitseq = seq; } gaitframe = frame; + } //gaitframe += frameTimeScale*0.01f; - + gaitframe = normalizeRangef(gaitframe, 0, 1.0f); + if (frame == 1.0f) { + gaitframe = 1.0f; + } + + //logf("GAITSPEED %f %d %f\n", movespeed, gaitseq, gaitframe); mdlRenderers[mdlIdx]->SetUpBones(angles, seq, frame, gaitseq, gaitframe); mdlRenderers[mdlIdx]->draw(origin, cameraOrigin, cameraRight);