From 1df2ec9126bf16f270975f0cf90b98514679e2ca Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Tue, 6 Dec 2022 17:36:42 +0400 Subject: [PATCH] WIP --- game_shared/bone_setup.cpp | 50 +++++++++++++++++++++++++++++++++-- server/monsters/animating.cpp | 2 +- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/game_shared/bone_setup.cpp b/game_shared/bone_setup.cpp index 163dd376..e2ab1201 100644 --- a/game_shared/bone_setup.cpp +++ b/game_shared/bone_setup.cpp @@ -2265,10 +2265,33 @@ void CStudioBoneSetup :: CalcBoneAdj( Vector pos[], Vector4D q[], const byte con { i = pbonecontroller->index; +#if 1 if( i == STUDIO_MOUTH ) value = bound( 0.0f, ( mouthopen / 64.0f ), 1.0f ); else value = bound( 0.0f, (float)controllers[i] / 255.0f, 1.0f ); - value = (1.0f - value) * pbonecontroller->start + value * pbonecontroller->end; +#else + if (i != STUDIO_MOUTH) + { + //value = bound(0.0f, (float)controllers[i] / 255.0f, 1.0f); + //value = (1.0f - value) * pbonecontroller->start + value * pbonecontroller->end; + if (pbonecontroller->type & STUDIO_RLOOP) + { + value = controllers[j] * (360.0/256.0) + pbonecontroller->start; + } + else + { + value = controllers[j] / 255.0; + if (value < 0) value = 0; + if (value > 1.0) value = 1.0; + value = (1.0 - value) * pbonecontroller[j].start + value * pbonecontroller[j].end; + } + } + else + { + value = bound(0.0f, (mouthopen / 64.0f), 1.0f); + value = (1.0f - value) * pbonecontroller->start + value * pbonecontroller->end; + } +#endif switch( pbonecontroller->type & STUDIO_TYPES ) { @@ -2319,10 +2342,33 @@ void CStudioBoneSetup :: CalcBoneAdj( float adj[], const byte controllers[], byt { i = pbonecontroller->index; +#if 1 if( i == STUDIO_MOUTH ) value = bound( 0.0f, ( mouthopen / 64.0f ), 1.0f ); else value = bound( 0.0f, (float)controllers[i] / 255.0f, 1.0f ); - value = (1.0f - value) * pbonecontroller->start + value * pbonecontroller->end; +#else + if (i != STUDIO_MOUTH) + { + //value = bound(0.0f, (float)controllers[i] / 255.0f, 1.0f); + //value = (1.0f - value) * pbonecontroller->start + value * pbonecontroller->end; + if (pbonecontroller->type & STUDIO_RLOOP) + { + value = controllers[j] * (360.0/256.0) + pbonecontroller->start; + } + else + { + value = controllers[j] / 255.0; + if (value < 0) value = 0; + if (value > 1.0) value = 1.0; + value = (1.0 - value) * pbonecontroller[j].start + value * pbonecontroller[j].end; + } + } + else + { + value = bound(0.0f, (mouthopen / 64.0f), 1.0f); + value = (1.0f - value) * pbonecontroller->start + value * pbonecontroller->end; + } +#endif switch( pbonecontroller->type & STUDIO_TYPES ) { diff --git a/server/monsters/animating.cpp b/server/monsters/animating.cpp index abe1b099..b98a4630 100644 --- a/server/monsters/animating.cpp +++ b/server/monsters/animating.cpp @@ -164,8 +164,8 @@ float CBaseAnimating :: StudioGaitFrameAdvance( void ) pev->controller[3] = iTorsoAdjust; SetBlending( 0, (pev->angles[PITCH] * 3.0f)); - pev->angles[YAW] = m_flGaitYaw; + pev->angles[YAW] = m_flGaitYaw; if( pev->angles[YAW] < -0.0f ) pev->angles[YAW] += 360.0f;