Table of Contents

Unit conversion

ACSUtils provides a range of functions to convert various commonly used units. All unit conversion functions operate only on fixed-point numbers, even if ZDoom only uses integers for some of these units. The only exception is byte angle conversion functions, because byte angles are always integers.

Using the same units everywhere in your mod is a good practice that reduces potential for errors. ACSUtils uses the same units in all its functions. When calling ZDoom functions that don't use your preferred units, use these unit conversion functions to convert them in place.

Angle units

The following angle units are commonly used in ZDoom:

ZDoom fixed-point angles are the recommended angle unit in ZDoom, used by almost all ZDoom functions, and used by all ACSUtils functions.

Angle units can be converted using the following functions (ang = ZDoom fixed-point angles, deg = Degrees, rad = Radians):

ZDoom byte angles can also be converted to ZDoom fixed-point angles this way:

Or using bit shifts:

Gravity units

There are two gravity units in ZDoom:

ZDoom uses sv_gravity units exclusively, but acceleration is the recommended unit, as it can be used in physics calculations without conversion.

Gravity units can be converted using the following functions:

ACSUtils also provides utility functions for manipulating gravity:

Jump height

Decorate JumpZ is not the actual jump height of the actor, but a much lower non-linearly related value.