Raised This Month: $ Target: $400
 0% 

angle_vector


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-05-2006 , 12:06   Re: angle_vector
Reply With Quote #4

Given an array of angles around each axis (this is how the HL engine represents rotation, for example of players), it gives you a normalized vector pointing to that direction.

For example if you want to move the player 20 units to the direction where he is looking, you'd do:

1) get his "angles" entvar (or was it v_angle? no idea) using some function.
2) use anglevectors with the returned angles as a parameter to get the "forward vector"
3) multiply that vector by 20.0
4) add that vector to the player's origin

And you're done.

Anglevectors is capable of giving you the "forward" vector, the "up" vector, and the "right" vector. This way you can also implement strafe-like movements and such.
__________________
hello, i am pm
PM is offline
 



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 08:02.


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