Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGUI on viewmodel doesn't properly find cursor position #35

Open
vaqxai opened this issue Sep 22, 2021 · 3 comments · May be fixed by #42
Open

ImGUI on viewmodel doesn't properly find cursor position #35

vaqxai opened this issue Sep 22, 2021 · 3 comments · May be fixed by #42
Labels
bug Something isn't working

Comments

@vaqxai
Copy link

vaqxai commented Sep 22, 2021

**
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?

@wyozi
Copy link
Contributor

wyozi commented Sep 23, 2021

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 wyozi added the bug Something isn't working label Sep 23, 2021
@dhkatz
Copy link

dhkatz commented Oct 29, 2023

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
Copy link

dhkatz commented Oct 29, 2023

I've created what I believe to be a fix for this #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants