Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
SNMetamorph committed Feb 29, 2024
1 parent 4f112dc commit 1df2ec9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
50 changes: 48 additions & 2 deletions game_shared/bone_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion server/monsters/animating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1df2ec9

Please sign in to comment.