ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:jumpz2height

jumpz2height

fixed jumpz2height(fixed height, fixed gravity)

Description

Converts JumpZ to jump height, assuming specified gravity.

Gravity is specified as acceleration, not as sv_gravity units.

Default gravity is 1.0. Use GetGravityG to retrieve current gravity.

Conversion formula

jumpz = sqrt(2 * height * gravity)

Examples

int height = jumpz2height(8.0, 1.0);
print(s:"JumpZ of 8 will let you jump ", f:height, s:" mapunits high in normal gravity");
functions/jumpz2height.txt · Last modified: 2017/07/09 17:41 by korshun