Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Editing makevectors

From Quake Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:
  
 
== Usage ==
 
== Usage ==
Takes the passed angles and converts them into its three local axes i.e. its 3D rotation matrix. This is useful if you need to offset relative to an angle e.g. in the direction an entity is facing. Sets the following globals:
+
Takes the passed angles and converts them into its three local axes i.e. its 3D rotation matrix. These axes are stored in the '''v_forward''', '''v_right''', and '''v_up''' globals. '''v_forward''' points in the direction of the angles, '''v_right''' points 90 degrees to the right of '''v_forward''', and '''v_up''' points 90 degrees above '''v_forward'''. This is useful if you need to offset relative to an angle e.g. in the direction an entity is facing.
*'''v_forward'''
 
:The facing direction of the passed angles.
 
*'''v_up'''
 
:The direction pointing 90 degrees up from the facing direction of the passed angles.
 
*'''v_right'''
 
:The direction pointing 90 degrees to the right of the facing direction of the passed angles.
 
  
 
'''Warning:''' A bug exists with <code>vectoangles()</code> where the pitch is not negated correctly. If you pass the results of this function or the '''angles''' field of an entity, the pitch (the x value) must be negated first.
 
'''Warning:''' A bug exists with <code>vectoangles()</code> where the pitch is not negated correctly. If you pass the results of this function or the '''angles''' field of an entity, the pitch (the x value) must be negated first.

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)