![]() |
get at player's view angles ?
Hi lads,
Does any of you know how to get at a player's VIEW angles in HL2 ? (not only bots, but players in general). I've tried GetCollideable->GetCollisionAngles () on the edict but it always returns me a null vector (though GetCollisionOrigin () works, weird). And if you know how to get to any angle at all (i.e. body angles too) I'm interested to know as well. I'm writing, er... trying to write, the RACC interface for HL2. *edit* Har! found it in the HPB_bot2 source code. playerinfomanager->GetPlayerInfo (pPlayerEdict)->GetAbsAngles () this is for the view angles. Now for the body angles, I'm still asking... *edit* after some testing it appears GetAbsAngles () get at the BODY angles, not the view angles. When the player is standing on his feet, the pitch is always zero (no matter whether he looks up or down). The yaw is correct though. Now I still want the view angles. Any ideas or do I need to re-subscribe to HLCoders ? |
Re: get at player's view angles ?
well you can get eye angles from a bot by using the bot controller e.g.
g_pBotManager->GetBotController(m_pEdict)->GetLocalAngles() |
Re: get at player's view angles ?
IPlayerInfo *pPlayerInfo = g_pPlayerInfoManager->GetPlayerInfo(pEnt);
CBotCmd lastCmd = pPlayerInfo->GetLastUserCommand(); lastCmd.viewangles This seems to be valid for humans and bots alike. |
Re: get at player's view angles ?
Neat stuff, thanks!
|
Re: get at player's view angles ?
im wondering if there is a way to modify player position and view angles from a plugin. theres a nice botmanager class that allows you to put bots in the server and modify them, there is no equivalent playermanager class to modify players in the game. ive found though engine->SetView(edict_t,edict_t) that you can call every game frame will set a client view to a bot view.
i dont know if this is a good method of doing this though |
All times are GMT +2. The time now is 02:24. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.