Hi everyone,
I try to determine a vec3 position from a minimap marker.
I just need to get a pos relative to my minimap position (so the center of the minimap)
What I found so far :
Code:
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi, Size = 0x114)]
public struct MinimapMarker
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)]
public char[] markerNameRaw; //0x0
public Vec2 Position; //0x100
public uint unk1; //0x108
public uint unk2; //0x10C
public uint unk3; //0x110
}
and my method to fetch markers :
Code:
public static MinimapMarker[] GetMinimapMarkers()
{
var ui = GetUi(UiElementHash.MinimapMain);
var count = D3Memory.ReadMemoryAsInt(ui.Ofs + 0x120AC);
var markers = new MinimapMarker[count];
for (uint i = 0; i < count; i++)
{
var currentMarker = D3Memory.ReadMemory<MinimapMarker>(ui.Ofs + 0xCAC + (i * (uint)Marshal.SizeOf(typeof(MinimapMarker))));
markers[i] = currentMarker;
}
return markers;
}
note that UiElementHash.MinimapMain correspond to "Root.NormalLayer.minimap_dialog_backgroundScreen.minimap_dialog_pve.minimap_pve _main" UI.
Hi have some weird Y coords for minimap center, for example :
I teleport to a map, so I am on the center of the waypoint, and the waypoint marker is perfectly in the minimap center.
But if I get UI center (without ratio transform) I get this :
Code:
WayPoint Position :
x: 1665.60071
y: 212.0
minimapCenter (from UI)
{X: 1665,601, Y: 230}
x: 1665.60071
y: 230.0
X is perferctly the same, but Y not.
If someone have a clue about this, it will help me a lot
Thanks