Thread: Hearing sounds
View Single Post
Re: Hearing sounds
Old
  (#8)
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: Hearing sounds - 13-01-2004

No problem, Michael, this is exactly what I am doing:
Code:
pBotEar->noises[selected_index].direction = BotEstimateDirection (pBot, v_origin);
BotEstimateDirection translates a vector location in a general direction from the following ones:
- rather in front of the bot
- rather ahead on the left
- rather on the left
- rather behind on the left
- rather behind it
- rather behind on the right
- rather on the right
- rather in front on the right
Code:
// relative directions
#define DIRECTION_NONE 0
#define DIRECTION_FRONT (1 << 0)
#define DIRECTION_BACK (1 << 1)
#define DIRECTION_LEFT (1 << 2)
#define DIRECTION_RIGHT (1 << 3)
these are bitmasked

Distance is not taken in account, it's only the angle at which the sound comes to the bot. I believe it's more natural that way than to inflict (yet another) arbitrary randomization, what do you think ?



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; 13-01-2004 at 00:30..
  
Reply With Quote