Исходник DebugOverlay

Участник
Статус
Оффлайн
Регистрация
19 Апр 2020
Сообщения
1,178
Реакции[?]
314
Поинты[?]
152K
1688138795783.png
Код:
    Quaternion Math::AngleQuaternion(const QAngle& angles) {
        float sin_yaw = std::sin(angles.yaw);
        float cos_yaw = std::cos(angles.yaw);
        float sin_roll = std::sin(angles.roll);
        float cos_roll = std::cos(angles.roll);
        float sin_pitch = std::sin(angles.pitch);
        float cos_pitch = std::cos(angles.pitch);
    
        float x = sin_yaw * (cos_roll * cos_pitch) - cos_yaw * (sin_roll * sin_pitch);
        float y = sin_yaw * (cos_pitch * sin_roll) + cos_yaw * (cos_roll * sin_pitch);
        float z = cos_yaw * (cos_roll * sin_pitch) + sin_yaw * (cos_pitch * sin_roll);
        float w = cos_yaw * (cos_roll * cos_pitch) - sin_yaw * (sin_roll * sin_pitch);
    
        return Quaternion(x, y, z, w);
    }
    
    class CDebugOverlayGameSystem {
    public:
        static CDebugOverlayGameSystem* get() {
            static auto g_debug_overlay = *reinterpret_cast<CDebugOverlayGameSystem**>(Memory->ToAbsolute(Utils->PatternScan("client.dll", "48 8B 3D ? ? ? ? 48 8D 4D 07") + 3));
    
            return g_debug_overlay;
        }
    
        void AddLineOverlay(const Vector& origin, const Vector& dest, const Color& color, bool noDethTest, float duration) {
            auto fn = reinterpret_cast<void(__thiscall*)(CDebugOverlayGameSystem*, const Vector&, const Vector&, const Color&, bool, double)>(get_vfunction(this, 12));
    
            fn(this, origin, dest, color, noDethTest, static_cast<double>(duration));
        }
    
        void AddBoxEdgesOverlay(const Vector& origin, const Vector& mins, const Vector& maxs, const QAngle& rotation, const Color& color, float duration) {
            auto fn = reinterpret_cast<void(__thiscall*)(CDebugOverlayGameSystem*, const Vector&, const Vector&, const Vector&, const Quaternion&, const Color&, bool, double)>(get_vfunction(this, 14));
    
            fn(this, origin, mins, maxs, Math::AngleQuaternion(rotation), color, true, static_cast<double>(duration));
        }
    
        void AddBoxFacesOverlay(const Vector& origin, const Vector& mins, const Vector& maxs, const QAngle& rotation, const Color& color, float duration) {
            auto fn = reinterpret_cast<void(__thiscall*)(CDebugOverlayGameSystem*, const Vector&, const Vector&, const Vector&, const Quaternion&, const Color&, bool, double)>(get_vfunction(this, 15));
    
            fn(this, origin, mins, maxs, Math::AngleQuaternion(rotation), color, true, static_cast<double>(duration));
        }
    
        void AddBoxOverlay(const Vector& origin, const Vector& mins, const Vector& maxs, const QAngle& rotation, const Color& color, float duration) {
            auto fn = reinterpret_cast<void(__thiscall*)(CDebugOverlayGameSystem*, const Vector&, const Vector&, const Vector&, const QAngle&, int, int, int, int, double)>(get_vfunction(this, 47));
    
            fn(this, origin, mins, maxs, rotation, color.r, color.g, color.b, color.a, static_cast<double>(duration));
        }
    
        void AddBoxOverlay2(const Vector& origin, const Vector& mins, const Vector& maxs, const QAngle& rotation, const Color& faceColor, const Color& edgeColor, float duration) {
            auto fn = reinterpret_cast<void(__thiscall*)(CDebugOverlayGameSystem*, const Vector&, const Vector&, const Vector&, const QAngle&, const Color&, const Color&, double)>(get_vfunction(this, 48));
    
            fn(this, origin, mins, maxs, rotation, faceColor, edgeColor, static_cast<double>(duration));
        }
    
        void AddTextOverlay(const Vector& origin, float duration, const char* text, ...) {
            auto fn = reinterpret_cast<void(__fastcall*)(CDebugOverlayGameSystem*, const Vector&, double, const char*, ...)>(get_vfunction(this, 58));
    
            fn(this, origin, duration, text);
        }
    
        void AddTextOverlay(const Vector& origin, float duration, int line_offset, const char* text, ...) {
            auto fn = reinterpret_cast<void(__fastcall*)(CDebugOverlayGameSystem*, const Vector&, int, double, const char*, ...)>(get_vfunction(this, 57));
            
            fn(this, origin, line_offset, duration, text);
        }
    
        void AddTextOverlay(const Vector& origin, float duration, int line_offset, const Color& color, const char* text...) {
            auto fn = reinterpret_cast<void(__fastcall*)(CDebugOverlayGameSystem*, const Vector&, int, double, char, char, char, char, const char*, ...)>(get_vfunction(this, 59));
    
            fn(this, origin, duration, line_offset, color.r, color.g, color.b, color.a, text);
        }
    };
 
Похожие темы
Сверху Снизу