Skip to content

Commit

Permalink
some wip stuff i forgot
Browse files Browse the repository at this point in the history
  • Loading branch information
wootguy committed Oct 16, 2023
1 parent 1323556 commit f97e432
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ msvc
/release
/imgui
/qhull
/imgui_177
/imgui_178
/merge
28 changes: 23 additions & 5 deletions src/editor/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit f97e432

Please sign in to comment.