CSGO: Recreated player eye position for visuals
Welcome to my first thread fellow autists
Since the m_vecViewOffset netvar is not giving proper results whren it comes to other players I finally decided to do something against it for the sake of more proper aimtracers/bullettracers.
I am however not sure if something like this or even a more proper implementation has been posted yet, so i am sorry if all the kool kidz already have this sorted out
DISCLAIMER: I didnt reverse any binaries for this so the term recreated is really more of a clickbait than the truth, sorry folks.
This function is placed inside my player entity class:
Vector GetRecreatedEyePos()
{
const float flViewOffDucked = 46.044968f;
const float flViewOffStand = 64.062561f;
float flRecreatedViewOffset = flViewOffStand - ((flViewOffStand - flViewOffDucked) * GetPoseParameters()[8]);
Vector pos = GetAbsOrigin();
pos.z += flRecreatedViewOffset;
return pos;
}
and here is a shorter implementation of this inaccurate stuff:
Vector GetRecreatedEyePos()
{
Vector pos = GetAbsOrigin();
pos.z += 64.062561f - (18.017593f * GetPoseParameters()[8]);
return pos;
}
As you can see its not perfect i guess, but whatever, i recorded this with host_timescale 0.2 so you can notice it /shrug
(also dont hate me for the ugly ass aimtracers, they are 2 years old)
Credits:
drew1ind#8957 for being appreciated during the whole process and thus giving me the mental strength to achieve this within about 5 minutes <3
@wlan for analyzing more ayyware "based" binaries than healthy
my lack of motivation to fix stuff i personally dont use for delaying this for about a year
Stay anime free.
|