Вопрос World To Minimap

Начинающий
Статус
Оффлайн
Регистрация
16 Авг 2022
Сообщения
36
Реакции[?]
4
Поинты[?]
4K
Hi.
Is there any function like worldtoscreen but for minimap?
in general. what should I look for for converting world position to minimap position and drawing over minimap?
 
Shitcode lord 💩
Забаненный
Статус
Оффлайн
Регистрация
25 Ноя 2020
Сообщения
272
Реакции[?]
84
Поинты[?]
8K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
ImVec2 Draw::WorldToMinimap(Vector EntityPos) {
    auto MinimapSize = vmt.MinimapRenderer->GetMinimapSize();
    auto MinimapBounds = vmt.MinimapRenderer->GetMinimapBounds();

    // Actual Minimap is 94% from MinimapSize above (bc of borders i guess)
    auto ActualMinimapSize = static_cast<float>(MinimapSize.x * 0.94);
    auto MinimapPosMin = Vector2D(0, static_cast<float>(GameData.ScreenSize.y - ActualMinimapSize));

    if (GameData.IsHUDFlipped) {
        float offset = GameData.ScreenSize.x - ActualMinimapSize;
        MinimapPosMin.x = MinimapPosMin.x + offset;
    }

    ImVec2 Scaler;
    Scaler.x = MinimapBounds.x / ActualMinimapSize * 2;
    Scaler.y = MinimapBounds.y / ActualMinimapSize * 2;

    ImVec2 PosOnMinimap;
    PosOnMinimap.x = (MinimapPosMin.x + (MinimapBounds.x / Scaler.x) + -(EntityPos.x / Scaler.x));
    PosOnMinimap.y = (MinimapPosMin.y + (MinimapBounds.y / Scaler.y) + -(EntityPos.y / Scaler.y));

    return PosOnMinimap;
}

//

class CDOTAPanoramaMinimapRenderer {
public:
    char pad_0000[16]; //0x0000
    float MinimapBoundsX; //0x0010
    float MinimapBoundsY; //0x0014
    char pad_0018[148]; //0x0018
    int32_t MinimapSizeX; //0x00AC
    int32_t MinimapSizeY; //0x00B0

    Vector GetMinimapBounds() {
        float BoundsX = this->MinimapBoundsX;
        float BoundsY = this->MinimapBoundsY;

        return Vector(BoundsX, BoundsY, 0);
    }

    Vec2 GetMinimapSize() {
        int SizeX = this->MinimapSizeX;
        int SizeY = this->MinimapSizeY;

        return Vec2(SizeX, SizeY);
    }
};
 
Новичок
Статус
Оффлайн
Регистрация
24 Дек 2022
Сообщения
1
Реакции[?]
0
Поинты[?]
0
C++:
ImVec2 Draw::WorldToMinimap(Vector EntityPos) {
    auto MinimapSize = vmt.MinimapRenderer->GetMinimapSize();
    auto MinimapBounds = vmt.MinimapRenderer->GetMinimapBounds();

    // Actual Minimap is 94% from MinimapSize above (bc of borders i guess)
    auto ActualMinimapSize = static_cast<float>(MinimapSize.x * 0.94);
    auto MinimapPosMin = Vector2D(0, static_cast<float>(GameData.ScreenSize.y - ActualMinimapSize));

    if (GameData.IsHUDFlipped) {
        float offset = GameData.ScreenSize.x - ActualMinimapSize;
        MinimapPosMin.x = MinimapPosMin.x + offset;
    }

    ImVec2 Scaler;
    Scaler.x = MinimapBounds.x / ActualMinimapSize * 2;
    Scaler.y = MinimapBounds.y / ActualMinimapSize * 2;

    ImVec2 PosOnMinimap;
    PosOnMinimap.x = (MinimapPosMin.x + (MinimapBounds.x / Scaler.x) + -(EntityPos.x / Scaler.x));
    PosOnMinimap.y = (MinimapPosMin.y + (MinimapBounds.y / Scaler.y) + -(EntityPos.y / Scaler.y));

    return PosOnMinimap;
}

//

class CDOTAPanoramaMinimapRenderer {
public:
    char pad_0000[16]; //0x0000
    float MinimapBoundsX; //0x0010
    float MinimapBoundsY; //0x0014
    char pad_0018[148]; //0x0018
    int32_t MinimapSizeX; //0x00AC
    int32_t MinimapSizeY; //0x00B0

    Vector GetMinimapBounds() {
        float BoundsX = this->MinimapBoundsX;
        float BoundsY = this->MinimapBoundsY;

        return Vector(BoundsX, BoundsY, 0);
    }

    Vec2 GetMinimapSize() {
        int SizeX = this->MinimapSizeX;
        int SizeY = this->MinimapSizeY;

        return Vec2(SizeX, SizeY);
    }
};
ty for code
 
Сверху Снизу