ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:vectortoangles

Table of Contents

VectorToAngles

Description

Converts a 3D vector to a pair of angles (yaw and pitch).

Examples

Make the player look along the vector:

VectorToAngles(1.0, 2.0, 3.0);
int angle = r1;
int pitch = r2;

SetActorAngle(tid, angle);
SetActorPitch(tid, -pitch); // Note that actor pitch is inverted in ZDoom.
Use LookAtPoint instead of the example code above.
functions/vectortoangles.txt · Last modified: 2019/04/20 23:56 by korshun