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

makevectors

From Quake Wiki

void makevectors(vector angs)

Usage[edit]

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:

  • 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 vectoangles() 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.

Parameters[edit]

  • angs
The angles that will be used to generate the axes as (pitch, yaw, roll).

Example[edit]

// Get the axes in the direction the player is looking
makevectors(player.v_angle);

// Offset 1024 map units in the direction the player is looking
traceline(player.origin, player.origin + v_forward*1024, 0, player);