-
Автор темы
- #1
Смотрите, есть вот такой вариант из snazzy
Но помоему он как-то кривовато работает (ОН СУКА НЕ РАБОТАЕТ ВОООБЩЕ)
Еще есть вариант такой:
Этот я не тестировал но думаю тоже калл.
И еще маленький вопросик, что делают эти строки?
Код:
/* externs */
Vector src3D, dst3D, forward, right, up, src, dst;
float back_two, right_two, left_two;
CGameTrace tr;
CTraceFilter filter;
/* angle vectors */
math::angle_vectors(Vector(0, get_backward_side(e), 0), &forward, &right, &up);
/* filtering */
filter.SetPassEntity(e);
src3D = e->get_shoot_position();
dst3D = src3D + (forward * 384);
/* back engine tracers */
m_trace()->TraceRay(Ray_t(src3D, dst3D), MASK_SHOT, &filter, &tr);
back_two = (tr.endpos - tr.startpos).Length();
/* right engine tracers */
m_trace()->TraceRay(Ray_t(src3D + right * 35, dst3D + right * 35), MASK_SHOT, &filter, &tr);
right_two = (tr.endpos - tr.startpos).Length();
/* left engine tracers */
m_trace()->TraceRay(Ray_t(src3D - right * 35, dst3D - right * 35), MASK_SHOT, &filter, &tr);
left_two = (tr.endpos - tr.startpos).Length();
/* side detection */
if (left_two > right_two) {
side = -1;
}
else if (right_two > left_two) {
side = 1;
}
else
side = 0;
Еще есть вариант такой:
Код:
/* if (eyegoalfeetdelta < 0.0f || (*(float*)((DWORD)animstate + 0x330)) == 0.0f)
{
if ((*(float*)((DWORD)animstate + 0x330)) != 0.0f)
new_body_yaw = (eyegoalfeetdelta / (*(float*)((DWORD)animstate + 0x330))) * -58.0f;
}
else
{
new_body_yaw = (eyegoalfeetdelta / (*(float*)((DWORD)animstate + 0x334))) * 58.0f;
}
if (new_body_yaw > 11.f)
side = 1;
else if (new_body_yaw < -11.f)
side = -1;
else
side = 0;*/
И еще маленький вопросик, что делают эти строки?
Код:
if (e->m_vecVelocity().Length2D() <= 0.1)
{
if (server_animlayers[ANIMATION_LAYER_ADJUST].m_flWeight == 0.0
&& server_animlayers[ANIMATION_LAYER_ADJUST].m_flCycle == 0.0)
{
side = 2 * (math::angle_diff(animstate->m_flEyeYaw, animstate->m_flGoalFeetYaw) <= 0.0) - 1;
}
}
else if (!(server_animlayers[ANIMATION_LAYER_LEAN].m_flWeight * 1000.0) && (server_animlayers[ANIMATION_LAYER_MOVEMENT_MOVE].m_flWeight * 1000.0) == (previous_animlayers[ANIMATION_LAYER_MOVEMENT_MOVE].m_flWeight * 1000.0)) //the shit was 1000 iirc u can double check if u want
{
auto first_delta = abs(server_animlayers[ANIMATION_LAYER_MOVEMENT_MOVE].m_flPlaybackRate - resolver_animlayers[ANIMATION_LAYER_AIMMATRIX][ANIMATION_LAYER_MOVEMENT_MOVE].m_flPlaybackRate);
auto second_delta = abs(server_animlayers[ANIMATION_LAYER_MOVEMENT_MOVE].m_flPlaybackRate - resolver_animlayers[ANIMATION_LAYER_WEAPON_ACTION_RECROUCH][ANIMATION_LAYER_MOVEMENT_MOVE].m_flPlaybackRate);
auto third_delta = abs(server_animlayers[ANIMATION_LAYER_MOVEMENT_MOVE].m_flPlaybackRate - resolver_animlayers[ANIMATION_LAYER_WEAPON_ACTION][ANIMATION_LAYER_MOVEMENT_MOVE].m_flPlaybackRate);
if (first_delta < second_delta || third_delta <= second_delta || (second_delta * 1000.0))
{
if (first_delta >= third_delta && second_delta > third_delta && !(third_delta * 1000.0))
{
side = 1;
}
}
else
{
side = -1;
}
}