ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


new:units

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
new:units [2018/02/15 20:59] korshunnew:units [2018/02/17 03:53] korshun
Line 1: Line 1:
 ====== Unit conversion ====== ====== Unit conversion ======
  
-**All** unit conversion function operate on fixed-point numbers, even if ZDoom only uses integers for some of these units.+ACSUtils provides a range of functions to convert various commonly used units. **All** unit conversion function operate **only** on fixed-point numbers, even if ZDoom only uses integers for some of these units
 + 
 +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 ===== ===== Angle units =====
 +
 +The following angle units are commonly used in ZDoom:
  
   * ZDoom fixed-point angles [0, 1]   * ZDoom fixed-point angles [0, 1]
Line 22: Line 26:
 ===== Gravity units ===== ===== Gravity units =====
  
-  * acceleration (default gravity is 1.0) +There are two gravity units in ZDoom:
-  * ''sv_gravity'' units (default gravity is 800)+
  
-ZDoom uses ''sv_gravity'' units exclusively, but acceleration is the recommended unit, as it can be used in physical calculations without conversion.+  * acceleration -- mapunits/tic (default gravity is 1.0) 
 +  * ''sv_gravity'' units -- acceleration*800 (default gravity is 800) 
 + 
 +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: Gravity units can be converted using the following functions:
Line 38: Line 44:
  
 ===== Jump height ===== ===== Jump height =====
 +
 +Decorate JumpZ is not the actual jump height of the actor, but a much lower non-linearly related value.
  
   * ''fixed jumpz2height(fixed jumpz)'' -- converts decorate JumpZ to actual resulting jump height   * ''fixed jumpz2height(fixed jumpz)'' -- converts decorate JumpZ to actual resulting jump height
   * ''fixed height2jumpz(fixed height)'' -- calculates JumpZ from actual jump height   * ''fixed height2jumpz(fixed height)'' -- calculates JumpZ from actual jump height
  
new/units.txt · Last modified: 2018/02/17 14:06 by korshun