PDA

View Full Version : Question Local Origin vs Abs Origin



darkcat
06-09-2011, 09:08 AM
I've read the post over here:

http://developer.valvesoftware.com/wiki/GetAbsOrigin%28%29

then does Local Origin set it's parent's Abs Origin as (0,0,0)?

I've grabbed the netvar offset for local origin by "m_vecOrigin".
Everything's good but except the values in the vector are way to big if my assumption above is true.

Explanation anyone?

syntroniks
06-09-2011, 06:39 PM
Look at the SDK or disassemble Those getabs... functions and see what 'calculations' if any they do. I know another forum member had to look at these functions in the process of creating his projectile weapon solvers.

darkcat
06-09-2011, 09:31 PM
Look at the SDK or disassemble Those getabs... functions and see what 'calculations' if any they do. I know another forum member had to look at these functions in the process of creating his projectile weapon solvers.

For client side, GetLocalOrigin() func is nothing more than return m_vecOrigin;
and on the server project of the SDK, there's not much but Set & Get functions.
I'll search around more thou.

EDIT: Still not getting it. If anyone can help me, please leave a post. I'll be very happy. :)

Casual_Hacker
06-11-2011, 01:24 PM
because m_vecOrigin isn't always updated.

GetAbsOrigin() basically checks for a 'dirty' flag and if so, recomputes the local origin by interpolating between 2 origins it received from the server. (in C_BaseEntity these are stored in m_iv_vecOrigin).

darkcat
06-11-2011, 08:24 PM
I love you. :)

Casual_Hacker
06-12-2011, 08:14 AM
There's another interesting concept about this. GetAbsOrigin is context sensitive (similar to pGlobals->curtime).
During CreateMove etc this value is exactly as you'd expect it.

However if you're doing things async (drawing in EndScene with multi-core rendering enabled in Source Engine games or doing it external) you might want to read the value directly from m_iv_vecOrigins. Otherwise your ESP starts skipping around :(