-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Good Luck
Пожалуйста, авторизуйтесь для просмотра ссылки.
Код:
ICollideable* coll = pEntity->GetCollideable();
Vector min = coll->OBBMins();
Vector max = coll->OBBMaxs();
Vector corners[8] =
{
Vector(min.x,min.y,min.z),
Vector(min.x,max.y,min.z),
Vector(max.x,max.y,min.z),
Vector(max.x,min.y,min.z),
Vector(min.x,min.y,max.z),
Vector(min.x,max.y,max.z),
Vector(max.x,max.y,max.z),
Vector(max.x,min.y,max.z)
};
float ang = (*(Angle*)((DWORD)pEntity + offsets.m_angEyeAngles)).y;
for (int i = 0; i <= 7; i++)
corners[i].Rotate2D(ang);
Vector _corners[8];
for (int i = 0; i <= 7; i++)
Draw::WorldToScreen(pos + corners[i], _corners[i]);
int x1 = iScreenWidth * 2, y1 = iScreenHeight * 2, x2 = -iScreenWidth, y2 = -iScreenHeight;
for (int i = 0; i <= 7; i++)
{
x1 = (int)(min(x1, _corners[i].x));
y1 = (int)(min(y1, _corners[i].y));
x2 = (int)(max(x2, _corners[i].x));
y2 = (int)(max(y2, _corners[i].y));
}
int diff = x2 - x1;
int diff2 = y2 - y1;
static Color col;
if (pEntity->GetTeam() == G::LocalPlayer->GetTeam())
col = Color(40, 120, 250);
else
col = Color(250, 120, 40);
for (int i = 1; i <= 4; i++)
{
Draw::DrawLine((int)(_corners[i - 1].x), (int)(_corners[i - 1].y), (int)(_corners[i % 4].x), (int)(_corners[i % 4].y), col);
Draw::DrawLine((int)(_corners[i - 1].x), (int)(_corners[i - 1].y), (int)(_corners[i + 3].x), (int)(_corners[i + 3].y), col);
Draw::DrawLine((int)(_corners[i + 3].x), (int)(_corners[i + 3].y), (int)(_corners[i % 4 + 4].x), (int)(_corners[i % 4 + 4].y), col);
}
Код:
inline void Vector::Rotate2D(const float &f)
{
float _x, _y;
float s, c;
SinCos(Deg2Rad(f), s, c);
_x = x;
_y = y;
x = (_x * c) - (_y * s);
y = (_x * s) + (_y * c);
}