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

GetAbsOrigin on Entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
imported_hippo
Junior Member
Join Date: Mar 2006
Old 04-26-2006 , 01:10   GetAbsOrigin on Entities
Reply With Quote #1

Is there a way to use GetAbsOrigin on CBaseEntities without getting unresolved external symbol errors?

MSVC tells me that CalcAbsolutePosition cannot be resolved, so I tried including baseentity.cpp, but that gave over 50 errors that were so wretched that there had to be a better way.

GetAbsOrigin isn't virtual so it doesn't seem to be accessible by vfuncs (which is how I access other origin, eyeposition, etc things for players / entities).

I know its possible to use IPlayerInfoManager to get player absolute origins, but there has to be an easy way to get entity origins.

I have searched on google, sourceplugins, hl2coding, and this site before asking this question. Everyone seemed to have no problems accessing GetAbsOrigin, which means that I must be doing something incredibly stupid.

Hippo
imported_hippo is offline
za_bullet
Junior Member
Join Date: Nov 2005
Old 05-01-2006 , 09:04  
Reply With Quote #2

Not sure what you want to use the vector for or for what you want to get its position, but try this instead

pEntity->GetNetworkable()->GetPVSInfo()->m_vCenter

I use that sometimes and it gets the location of what I want.

Let me know if it helps.

za.
za_bullet is offline
Send a message via AIM to za_bullet
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-01-2006 , 11:11  
Reply With Quote #3

I use:
Code:
Vector org = pEntity->GetCollideable()->GetCollisionOrigin();
L. Duke is offline
imported_hippo
Junior Member
Join Date: Mar 2006
Old 05-03-2006 , 00:28  
Reply With Quote #4

Thanks for the info. I'll try that this weekend and see if it works.

I am trying to set velocities on objects based on the current origin and the end origin. (hence the need for getting the origin of an entity)

Hippo
imported_hippo is offline
awuh0
Senior Member
Join Date: Apr 2005
Location: /dev/null
Old 05-03-2006 , 04:35  
Reply With Quote #5

You might want to get the current velocity of the entity as well and slowly increasing/decreasing to avoid making things look jerky and laggy.

you can use either
Code:
Vector velocity=pEntity->GetUnknown()->GetBaseEntity()->GetLocalVelocity();
or a vfunc
Code:
Vector velocity = GetSmoothedVelocity(pEntity->GetUnknown()->GetBaseEntity());
__________________
~The_wUh
_________________
Ph34r teh zombies!!!
find a better way to play CSS, connect to...
thewuh.servebeer.com
thecircus.servebeer.com
awuh0 is offline
Send a message via ICQ to awuh0 Send a message via AIM to awuh0 Send a message via MSN to awuh0
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 05-03-2006 , 08:07  
Reply With Quote #6

Vector velocity=pEntity->GetUnknown()->GetBaseEntity()->GetLocalVelocity();

You shouldnt use that :\
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
API
Veteran Member
Join Date: May 2006
Old 05-03-2006 , 11:39  
Reply With Quote #7

Why not GetLocalOrigin? Works fine for me.
__________________
API is offline
Send a message via AIM to API
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 05-03-2006 , 12:34  
Reply With Quote #8

Its a function inside CBaseEntity, so to be safe you shouldn't use any of them. They might work for you to test, but compile and give it to someone else, I dare ya.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
awuh0
Senior Member
Join Date: Apr 2005
Location: /dev/null
Old 05-04-2006 , 01:58  
Reply With Quote #9

thats why I use the vfunc...
__________________
~The_wUh
_________________
Ph34r teh zombies!!!
find a better way to play CSS, connect to...
thewuh.servebeer.com
thecircus.servebeer.com
awuh0 is offline
Send a message via ICQ to awuh0 Send a message via AIM to awuh0 Send a message via MSN to awuh0
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 14:14.


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