ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:getgravityg

This is an old revision of the document!


GetGravityG

fixed GetGravityG()

Description

Reads sv_gravity and returns current gravity in standard acceleration units instead of sv_gravity units.

Default gravity is 1.0.

This function handles extremely large sv_gravity units by using IntDiv when sv_gravity is greater than SHORT_MAX, and using FixedDiv otherwise to preserve precision.

Not all values returned by GetGravityG can be used as parameters to SetGravityG. Some may be too large for SetGravity's fixed-point argument once multiplied by 800.
functions/getgravityg.1499610772.txt.gz · Last modified: 2017/07/09 17:32 by korshun