.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 2 SDK
Half-Life 2 SDK For developments focused around the Half-Life 2 engine Half-Life 2

Reply
 
Thread Tools
get at player's view angles ?
Old
  (#1)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default get at player's view angles ? - 26-05-2005

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 ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 27-05-2005 at 01:42..
  
Reply With Quote
Re: get at player's view angles ?
Old
  (#2)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: get at player's view angles ? - 27-05-2005

well you can get eye angles from a bot by using the bot controller e.g.

g_pBotManager->GetBotController(m_pEdict)->GetLocalAngles()
  
Reply With Quote
Re: get at player's view angles ?
Old
  (#3)
DrEvil
Member
 
DrEvil's Avatar
 
Status: Offline
Posts: 142
Join Date: Jan 2004
Location: Los Angeles, CA
Default Re: get at player's view angles ? - 27-05-2005

IPlayerInfo *pPlayerInfo = g_pPlayerInfoManager->GetPlayerInfo(pEnt);
CBotCmd lastCmd = pPlayerInfo->GetLastUserCommand();
lastCmd.viewangles

This seems to be valid for humans and bots alike.


Omni-bot AI framework
http://www.omni-bot.com

Foxbot - for Team Fortress Classic
http://www.foxbot.net


  
Reply With Quote
Re: get at player's view angles ?
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: get at player's view angles ? - 28-05-2005

Neat stuff, thanks!



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: get at player's view angles ?
Old
  (#5)
pinworm
Member
 
Status: Offline
Posts: 3
Join Date: Jul 2007
Default Re: get at player's view angles ? - 11-07-2007

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
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com