Начинающий
-
Автор темы
- #1
Lowerbody resolver i used to use. BTW it has anti pasta.
else if (resolve == 5)
{
float LowerYaw = ent-> GetLowerYaw ();
float simTime_since_lby_update = ent-> GetSimulationTime () - time_at_update [index];
if (OldLowerBodyYawsX [index]! = LowerYaw)
{
OldYawDeltasX [index] = LowerYaw - OldLowerBodyYawsX [index];
OldLowerBodyYawsX [index] = LowerYaw;
time_at_update [index] = ent-> GetSimulationTime ();
if (ent-> GetVelocity (). Length2D ()> 0.1f && iFlags [index] & FL_ONGROUND)
{
flTemp [index] = LowerYaw;
OldLowerBodyYawsX [index] = LowerYaw;
}
else
{
flTemp [index] = OldLowerBodyYawsX [index];
}
}
else
{
flTemp [index] = LowerYaw - OldYawDeltasX [index];
}
float FixedResolve = flTemp [index];
NormalizeAngle (FixedResolve);
if (simTime_since_lby_update> 1.125f)
{
flYaw = FixedResolve;
}
else
{
if (simTime_since_lby_update <= 0.57f) // if it wasnt long ago that lby updated, just check nearby
{
resolved_yaw [index] = FixedResolve + RandomFloat (-35, 35); // -35.0 - 35.0
}
else // if its getting old info, check in a wider area
{
resolved_yaw [index] = FixedResolve + RandomFloat (-90, 90);
}
flYaw = resolved_yaw [index];
}
}
if (IsResolveYTarget (index) == 1)
{
float LowerYaw = ent-> GetLowerYaw ();
iFlags [index] = ent-> GetFlags ();
if (OldLowerBodyYawsX [index]! = LowerYaw)
{
OldYawDeltasX [index] = LowerYaw - OldLowerBodyYawsX [index];
if (ent-> GetVelocity (). Length2D ()> 0.1f && iFlags [index] & FL_ONGROUND)
{
flTemp [index] = LowerYaw;
OldLowerBodyYawsX [index] = LowerYaw;
}
else
{
flTemp [index] = OldLowerBodyYawsX [index];
}
}
else
{
flTemp [index] = LowerYaw - OldYawDeltasX [index];
}
float yClamped = flTemp [index];
NormalizeAngle (yClamped);
flYaw = yClamped;
else if (resolve == 5)
{
float LowerYaw = ent-> GetLowerYaw ();
float simTime_since_lby_update = ent-> GetSimulationTime () - time_at_update [index];
if (OldLowerBodyYawsX [index]! = LowerYaw)
{
OldYawDeltasX [index] = LowerYaw - OldLowerBodyYawsX [index];
OldLowerBodyYawsX [index] = LowerYaw;
time_at_update [index] = ent-> GetSimulationTime ();
if (ent-> GetVelocity (). Length2D ()> 0.1f && iFlags [index] & FL_ONGROUND)
{
flTemp [index] = LowerYaw;
OldLowerBodyYawsX [index] = LowerYaw;
}
else
{
flTemp [index] = OldLowerBodyYawsX [index];
}
}
else
{
flTemp [index] = LowerYaw - OldYawDeltasX [index];
}
float FixedResolve = flTemp [index];
NormalizeAngle (FixedResolve);
if (simTime_since_lby_update> 1.125f)
{
flYaw = FixedResolve;
}
else
{
if (simTime_since_lby_update <= 0.57f) // if it wasnt long ago that lby updated, just check nearby
{
resolved_yaw [index] = FixedResolve + RandomFloat (-35, 35); // -35.0 - 35.0
}
else // if its getting old info, check in a wider area
{
resolved_yaw [index] = FixedResolve + RandomFloat (-90, 90);
}
flYaw = resolved_yaw [index];
}
}
if (IsResolveYTarget (index) == 1)
{
float LowerYaw = ent-> GetLowerYaw ();
iFlags [index] = ent-> GetFlags ();
if (OldLowerBodyYawsX [index]! = LowerYaw)
{
OldYawDeltasX [index] = LowerYaw - OldLowerBodyYawsX [index];
if (ent-> GetVelocity (). Length2D ()> 0.1f && iFlags [index] & FL_ONGROUND)
{
flTemp [index] = LowerYaw;
OldLowerBodyYawsX [index] = LowerYaw;
}
else
{
flTemp [index] = OldLowerBodyYawsX [index];
}
}
else
{
flTemp [index] = LowerYaw - OldYawDeltasX [index];
}
float yClamped = flTemp [index];
NormalizeAngle (yClamped);
flYaw = yClamped;
Последнее редактирование: