#define IM_PI 3.14159265358979323846f
#define IM_PI 3.14159265358979323846f #define RAD2DEG(x) ((float)(x) * (float)(180.f / IM_PI)) #define DEG2RAD(x) ((float)(x) * (float)(IM_PI / 180.f)) void VectorAnglesRadar(Vector3 & forward, FVector & angles) { if (forward.X == 0.f && forward.Y == 0.f) { angles.X = forward.Z > 0.f ? -90.f : 90.f; angles.Y = 0.f; } else { angles.X = RAD2DEG(atan2(-forward.Z, forward.Magnitude(forward))); angles.Y = RAD2DEG(atan2(forward.Y, forward.X)); } angles.Z = 0.f; } void RotateTriangle(std::array<Vector3, 3> & points, float rotation) { const auto points_center = (points.at(0) + points.at(1) + points.at(2)) / 3; for (auto & point : points) { point = point - points_center; const auto temp_x = point.X; const auto temp_y = point.Y; const auto theta = DEG2RAD(rotation); const auto c = cosf(theta); const auto s = sinf(theta); point.X = temp_x * c - temp_y * s; point.Y = temp_x * s + temp_y * c; point = point + points_center; } } bool shit = false; FVector MyPosition, EnemyPosition; ASTExtraVehicleBase * CurrentVehiclea = Player->CurrentVehicle; if (CurrentVehiclea) { MyPosition = CurrentVehiclea->RootComponent->RelativeLocation; } else { MyPosition = Player->RootComponent->RelativeLocation; } ASTExtraVehicleBase * CurrentVehicle = localPlayer->CurrentVehicle; if (CurrentVehicle) { EnemyPosition = CurrentVehicle->RootComponent->RelativeLocation; } else { EnemyPosition = localPlayer->RootComponent->RelativeLocation; } FVector EntityPos = WorldToRadar(localController->PlayerCameraManager->CameraCache.POV.Rotation.Yaw, MyPosition, EnemyPosition, NULL, NULL, Vector3(glWidth, glHeight, 0), shit); FVector angle = FVector(); Vector3 forward = Vector3((float)(glWidth / 2) - EntityPos.X, (float)(glHeight / 2) - EntityPos.Y, 0.0f); VectorAnglesRadar(forward, angle); const auto angle_yaw_rad = DEG2RAD(angle.Y + 180.f); const auto new_point_x = (glWidth / 2) + (55/*alert dist from me*/) / 2 * 8 * cosf(angle_yaw_rad); const auto new_point_y = (glHeight / 2) + (55/*alert dist from me*/) / 2 * 8 * sinf(angle_yaw_rad); std::array<Vector3, 3> points { Vector3(new_point_x - ((90) / 4 + 3.5f) / 2, new_point_y - ((55) / 4 + 3.5f) / 2, 0.f), Vector3(new_point_x + ((90) / 4 + 3.5f) / 4, new_point_y, 0.f), Vector3(new_point_x - ((90) / 4 + 3.5f) / 2, new_point_y + ((55) / 4 + 3.5f) / 2, 0.f)}; RotateTriangle(points, angle.Y + 180.f); draw->AddTriangle(ImVec2(points.at(0).X, points.at(0).Y), ImVec2(points.at(1).X, points.at(1).Y), ImVec2(points.at(2).X, points.at(2).Y), PlayerBoxClrCf, 1.5f); draw->AddTriangleFilled(ImVec2(points.at(0).X, points.at(0).Y), ImVec2(points.at(1).X, points.at(1).Y), ImVec2(points.at(2).X, points.at(2).Y), PlayerBoxClrCf2);
在Telegram中查看相关推荐

🔍 发送关键词来寻找群组、频道或视频。
启动SOSO机器人