YaLTeR / OpenAG

An open-source reimplementation of Adrenaline Gamer's client library.
https://j.mp/OpenAG
Other
131 stars 39 forks source link

Fix viewmodel attachment positions #111

Closed tmp64 closed 3 years ago

tmp64 commented 3 years ago

Fixes incorrect weapon effect positions (sprites and beams) when viewmodel FOV is different from default. It uses code from Source SDK (c_baseviewmodel.cpp, ::FormatViewModelAttachment) to reproject on-screen position from main view FOV to viewmodel FOV.

I used global variables to save view position and direction vectors since they are not available outside of V_CalcRefDef.

Demo: https://www.youtube.com/watch?v=9_10Oms73Fg

YaLTeR commented 3 years ago

Thanks!