.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 2 SDK (http://forums.bots-united.com/forumdisplay.php?f=62)
-   -   get at player's view angles ? (http://forums.bots-united.com/showthread.php?t=4022)

Pierre-Marie Baty 26-05-2005 22:44

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 ?

Cheeseh 27-05-2005 01:35

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()

DrEvil 27-05-2005 13:22

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.

Pierre-Marie Baty 28-05-2005 17:19

Re: get at player's view angles ?
 
Neat stuff, thanks!

pinworm 11-07-2007 17:23

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.