-
Автор темы
- #1
некоторые парты не используются лень удалять было
aim.cpp get_points():
std::vector <scan_point> aim::get_points(adjust_data* record, int hitbox, bool from_aim)
{
//start declaring some variables
std::vector <scan_point> points;
auto model = record->player->GetModel();
if (!model)
return points;
auto hdr = m_modelinfo()->GetStudioModel(model);
if (!hdr)
return points;
auto set = hdr->pHitboxSet(record->player->m_nHitboxSet());
if (!set)
return points;
auto bbox = set->pHitbox(hitbox);
if (!bbox)
return points;
Vector m_vecStartPosition = g_ctx.local()->get_shoot_position();
//end declaring some variables
float_t flModifier = fmaxf(bbox->radius, 0.f);
Vector vecMax;
Vector vecMin;
math::vector_transform(Vector(bbox->bbmax.x + flModifier, bbox->bbmax.y + flModifier, bbox->bbmax.z + flModifier), record->matrixes_data.main[bbox->bone], vecMax);
math::vector_transform(Vector(bbox->bbmin.x - flModifier, bbox->bbmin.y - flModifier, bbox->bbmin.z - flModifier), record->matrixes_data.main[bbox->bone], vecMin);
Vector vecCenter = (vecMin + vecMax) * 0.5f;
QAngle angAngle = math::CalcAngle(m_vecStartPosition, vecCenter);
Vector vecForward;
math::AngleVectors(angAngle, vecForward);
Vector vecRight = vecForward.Cross(Vector(0, 0, 2.33f));
Vector vecLeft = Vector(-vecRight.x, -vecRight.y, vecRight.z);
Vector vecTop = Vector(0, 0, 3.25f);
Vector vecBottom = Vector(0, 0, -3.25f);
int32_t iAngleToPlayer = (int32_t)(fabsf(math::NormalizeAngle(math::NormalizeAngle(math::NormalizeAngle(record->player->m_angEyeAngles().y) - math::NormalizeAngle(math::CalcAngle(m_vecStartPosition, record->player->GetAbsOrigin()).yaw + 180.0f)))));
int32_t iDistanceToPlayer = (int32_t)(g_ctx.local()->GetAbsOrigin().DistTo(record->player->m_vecOrigin()));
//scale calculation
auto flScale = 0.0f;
if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].static_point_scale)
{
auto transformed_center = vecCenter;
math::vector_transform(transformed_center, record->matrixes_data.main[bbox->bone], transformed_center);
auto spread = g_ctx.globals.spread + g_ctx.globals.inaccuracy;
auto distance = transformed_center.DistTo(g_ctx.globals.eye_pos);
distance /= math::fast_sin(DEG2RAD(90.0f - RAD2DEG(spread)));
spread = math::fast_sin(spread);
auto radius = max(bbox->radius - distance * spread, 0.0f);
flScale = math::clamp(radius / bbox->radius, 0.0f, 1.0f);
}
//end scale calculation
if (hitbox == HITBOX_HEAD)
{
points.emplace_back(scan_point(Vector(vecCenter),hitbox,true));//center
points.emplace_back(scan_point(vecCenter + ((vecTop + vecRight) * (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].head_scale / 0.75f)),hitbox, true));
points.emplace_back(scan_point(vecCenter + ((vecTop + vecLeft) * (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].head_scale / 0.750f)),hitbox, true));
}
else if (hitbox == HITBOX_CHEST)
{
float_t flModifier = 3.05f * (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].body_scale / 0.80f);
if (iAngleToPlayer < 140 && iAngleToPlayer > 30)
flModifier = 2.0f * (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].body_scale / 0.80f);
points.emplace_back(scan_point(vecCenter + Vector(0, 0, 3),hitbox,true));
points.emplace_back(scan_point(vecCenter + vecRight * flModifier + Vector(0, 0, 3), hitbox, true));
points.emplace_back(scan_point(vecCenter + vecLeft * flModifier + Vector(0, 0, 3), hitbox, true));
}
else if (hitbox == HITBOX_STOMACH)
{
float_t flModifier = g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].body_scale / 0.33f;
if (iAngleToPlayer < 120 && iAngleToPlayer > 60)
flModifier = (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].body_scale / 0.33f) - 0.001f;
points.emplace_back(scan_point(Vector(vecCenter + Vector(0, 0, 3.0f)), hitbox, true));
points.emplace_back(scan_point(Vector(vecCenter + vecRight * flModifier + Vector(0.0f, 0.0f, 3.0f)), hitbox, true));
points.emplace_back(scan_point(Vector(vecCenter + vecLeft * flModifier + Vector(0.0f, 0.0f, 3.0f)), hitbox, true));
}
else if (hitbox == HITBOX_PELVIS)
{
float_t flModifier = g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].body_scale / 0.33f;
if (iAngleToPlayer < 120 && iAngleToPlayer > 60)
flModifier = (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].body_scale / 0.33f) - 0.001f;
points.emplace_back(scan_point(Vector(vecCenter - Vector(0.0f, 0.0f, 2.0f)), hitbox, true));
points.emplace_back(scan_point(Vector(vecCenter + vecRight * flModifier - Vector(0.0f, 0.0f, 2.0f)), hitbox, true));
points.emplace_back(scan_point(Vector(vecCenter + vecLeft * flModifier - Vector(0.0f, 0.0f, 2.0f)), hitbox, true));
}
else if (hitbox == HITBOX_LEFT_FOOT || hitbox == HITBOX_RIGHT_FOOT || hitbox == HITBOX_LEFT_THIGH || hitbox == HITBOX_RIGHT_THIGH)
{
Vector vecAddition = vecLeft;
if (hitbox == HITBOX_LEFT_FOOT || hitbox == HITBOX_LEFT_THIGH)
vecAddition = vecRight;
else if (hitbox == HITBOX_RIGHT_FOOT || hitbox == HITBOX_RIGHT_THIGH)
vecAddition = vecLeft;
if (hitbox == HITBOX_LEFT_THIGH || hitbox == HITBOX_RIGHT_THIGH)
vecCenter -= Vector(0.0f, 0.0f, 2.5f);
points.emplace_back(scan_point(Vector(vecCenter - (vecAddition * 0.0090f)), hitbox, true));
}
else if (hitbox == HITBOX_LEFT_FOREARM || hitbox == HITBOX_RIGHT_FOREARM)
points.emplace_back(scan_point(Vector(vecCenter - (hitbox == HITBOX_LEFT_FOREARM ? vecLeft : -vecLeft)), hitbox, true));
return points;
}