UTIL ScaleForGravity: Difference between revisions
Jump to navigation
Jump to search

m (Category.) |
No edit summary |
||
Line 1: | Line 1: | ||
{{lang|UTIL ScaleForGravity|title=<code>UTIL_ScaleForGravity</code>}} | |||
{{ent|UTIL_ScaleForGravity}} is a [[UTIL]] function that returns the passed gravity in relation to the world gravity; the formula used is <code>desiredGravity / {{ent|sv_gravity}}</code>, or for {{game name|tf2|name=Team Fortress 2}} the formula is <code>desiredGravity / ({{ent|sv_gravity}} * TFGameRules()->GetGravityMultiplier())</code>. | |||
== | ==Declaration== | ||
<source lang=cpp> | <source lang=cpp> | ||
float UTIL_ScaleForGravity( float desiredGravity ) | float UTIL_ScaleForGravity( float desiredGravity ); | ||
</source> | </source> | ||
Line 9: | Line 10: | ||
{{todo|Add examples.}} | {{todo|Add examples.}} | ||
[[Category:Programming]] | |||
[[Category:UTIL]] | [[Category:UTIL]] |
Revision as of 18:23, 3 November 2021


UTIL_ScaleForGravity is a UTIL function that returns the passed gravity in relation to the world gravity; the formula used is desiredGravity / sv_gravity
, or for Template:Game name the formula is desiredGravity / (sv_gravity * TFGameRules()->GetGravityMultiplier())
.
Declaration
float UTIL_ScaleForGravity( float desiredGravity );
Examples
Todo: Add examples.