maint: add quakeIII constants

This commit is contained in:
Diavolo 2023-01-11 12:21:45 +01:00
parent aa102174c4
commit cec72268b0
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
2 changed files with 7 additions and 2 deletions

View File

@ -282,6 +282,11 @@ namespace game
constexpr auto MAX_QPATH = 64; constexpr auto MAX_QPATH = 64;
constexpr auto MAX_OSPATH = 256; constexpr auto MAX_OSPATH = 256;
// Angle indexes
constexpr auto PITCH = 0; // up / down
constexpr auto YAW = 1; // left / right
constexpr auto ROLL = 2; // fall over
// From Quake III, to match game's assembly // From Quake III, to match game's assembly
template <typename T, typename R> template <typename T, typename R>
constexpr auto VectorScale(T v, R s, T out) { out[0] = v[0] * s; out[1] = v[1] * s; out[2] = v[2] * s; } constexpr auto VectorScale(T v, R s, T out) { out[0] = v[0] * s; out[1] = v[1] * s; out[2] = v[2] * s; }

View File

@ -130,12 +130,12 @@ private:
if (params.size() > 4) if (params.size() > 4)
{ {
angles[1] = std::strtof(params.get(4), nullptr); // Yaw angles[game::native::YAW] = std::strtof(params.get(4), nullptr); // Yaw
} }
if (params.size() == 6) if (params.size() == 6)
{ {
angles[0] = std::strtof(params.get(5), nullptr); // Pitch angles[game::native::PITCH] = std::strtof(params.get(5), nullptr); // Pitch
} }
game::native::TeleportPlayer(ent, origin, angles); game::native::TeleportPlayer(ent, origin, angles);