Raised This Month: $51 Target: $400
 12% 

m_vecOrigin [offset] vs. m_vecAbsOrigin [coordinate]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-04-2022 , 07:39   m_vecOrigin [offset] vs. m_vecAbsOrigin [coordinate]
Reply With Quote #1

Here quick tip about these two.

m_vecOrigin (Prop_Send, Prop_Data)
- Think this as "offset".
When entity has no parent (attached to anything), it give "offset" values from world coordinate 0.0, 0.0, 0.0
When entity is attached to another entity, it give "offset" values from parent entity origin (or parent attachment point).
- It is not world "coordinates".
"Offset" zero point is either center of world 0.0, 0.0, 0.0 or from parent entity origin (or parent attachment point).


m_vecAbsOrigin (Prop_Data)
- This give entity "coordinates" from world.






I learned today... harder way... by troubleshooting problem with bumpmines.
Bacardi is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 03-04-2022 , 08:29   Re: m_vecOrigin [offset] vs. m_vecAbsOrigin [coordinate]
Reply With Quote #2

I didn't know about this either until now. Thanks!
__________________
Psyk0tik is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 03-05-2022 , 23:41   Re: m_vecOrigin [offset] vs. m_vecAbsOrigin [coordinate]
Reply With Quote #3

some plugin uses GetClientEyePosition() to get player vector, is that good solution?
__________________
NoroHime is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-06-2022 , 06:08   Re: m_vecOrigin [offset] vs. m_vecAbsOrigin [coordinate]
Reply With Quote #4

Yes, it's correct. It's player view coordinates.

I mentioned about m_vecOrigin, because if you use it, your vector math could be suddenly wrong, if entity is attached to else entity.

Example if parent entity location in the world is 900.0, 900.0, -500.
The target entity you are looking is currently child, m_vecOrigin give you values like 25.0, 5.0, 0.0.

When target entity (child) is unattached from parent entity, target entity m_vecOrigin give you values like 890.0, 920.0, -499.0

You need understan this behaviour, why vector values changed to odd values suddenly.
__________________
Do not Private Message @me
Bacardi is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-27-2022 , 12:11   Re: m_vecOrigin [offset] vs. m_vecAbsOrigin [coordinate]
Reply With Quote #5

Thanks! Very useful info!
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode