ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:rotatevector

This is an old revision of the document!


Table of Contents

RotateVector

fixed, fixed RotateVector(fixed x, fixed y, angle angle)

angle - a fixed-point ZDoom angle (not degrees or radians)

Description

Returns the vector rotated by angle.

Examples

RotateVector(x, y, angle);
int newX = r1;
int newY = r2;

Rotate a point around the origin

RotateVector(x - originX, y - originY, angle);
int newX = r1 + originX;
int newY = r2 + originY;
Use RotatePoint instead of the example code above.
functions/rotatevector.1489766473.txt.gz · Last modified: 2017/03/17 18:01 by korshun