ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:grav2accel

Table of Contents

grav2accel

fixed grav2accel(fixed sv_gravity)

Description

Converts sv_gravity units to acceleration (mapunits^2 per tic).

800 sv_gravity units = 1 mapunit^2 per tic
This function accepts fixed-point numbers, not integers. Use GetCVarFixed to get the value of sv_gravity.

Examples

grav2accel(800.0) -> 1.0;
grav2accel(0) -> 0.0;
grav2accel(1600.0) -> 2.0;
functions/grav2accel.txt · Last modified: 2017/04/17 14:51 by korshun