AngleVectors()

From Valve Developer Community
Revision as of 17:29, 7 December 2009 by TomEdwards (talk | contribs) (Created page with ''''<code>AngleVectors()</code>''' converts a <code>QAngle</code> into either one or three normalised <code>Vector</code>s. * If there is only one Vector, it points i…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

AngleVectors() converts a QAngle into either one or three normalised Vectors.

  • If there is only one Vector, it points in the same direction as the QAngle ("forward").
  • If there are three Vectors, they point forward, right and up respectively.

VectorAngles() converts a single Vector into a QAngle. You can also pass a pseudoup Vector (

Todo: explain

).

Note.pngNote:None of the functions return values; instead, you must declare all the variables you need beforehand. AngleVectors() requires you to pass pointers while VectorAngles() does not.

Example

Vector fwd, rt, up;
AngleVectors( myAngle, &fwd, &rt, &up);
QAngle angles;
VectorAngles( myVector, angles );