imgui icon indicating copy to clipboard operation
imgui copied to clipboard

ImGUI on viewmodel doesn't properly find cursor position

Open vaqxai opened this issue 2 years ago • 3 comments

** image **

the white crosss is imgui.CursorPos as reported by imgui, the mouse is the actual cursor pos the imgui panel is attached to the player's viewmodel at screen middle they're the same

i'm thinking this might be an issue with EyePos being too close to the viewmodel?

vaqxai avatar Sep 22 '21 11:09 vaqxai

Yeah, viewmodel tends to be a bit difficult to map the mouse position of. I'm not sure what would be the best approach here, but if you figure out something it would be an amazing addition to the library

wyozi avatar Sep 23 '21 06:09 wyozi

I've been trying to figure this out lately. When the weapon's view model FOV matches the player's FOV then the cursors line up as expected. When they are different is when the positions diverge.

I've been trying to figure out the math to transform/scale different parts of the hit position in imgui.Start3D2D but no luck so far.

The only workaround I know now is to just force the player's FOV to be the weapon's FOV (or the other way around). But ideally we should figure out a way to automatically handle FOV differences (perhaps in a function like imgui.Weapon3D2D)

dhkatz avatar Oct 29 '23 11:10 dhkatz

I've created what I believe to be a fix for this https://github.com/wyozi-gmod/imgui/pull/42

dhkatz avatar Oct 29 '23 22:10 dhkatz