UTIL ScaleForGravity: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page.)
 
m (Replaced deprecated {{Game name}} template with {{Software}} counterpart. Action performed by bot)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A [[UTIL]] function that returns the passed gravity in relation to the world gravity (more specifically <code lang=cpp>desiredGravity / ({{ent|sv_gravity}} * TFGameRules()->GetGravityMultiplier()<sup>{{only|{{tf2}}}}</sup>)</code>.
{{lang|UTIL ScaleForGravity|title=<code>UTIL_ScaleForGravity</code>}}{{stub}}
{{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 {{Team Fortress 2|4}} the formula is <code>desiredGravity / ({{ent|sv_gravity}} * TFGameRules()->GetGravityMultiplier())</code>.


==Usage==
==Declaration==
<source lang=cpp>
<source lang=cpp>
float UTIL_ScaleForGravity( float desiredGravity )
float UTIL_ScaleForGravity( float desiredGravity );
</source>
</source>


==Examples==
==Examples==
{{todo|Add examples.}}
{{todo|Add examples.}}
[[Category:Programming]]
[[Category:UTIL]]

Latest revision as of 07:37, 31 May 2024

English (en)Translate (Translate)

Stub

This article or section is a stub. You can help by expanding it.

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 Team Fortress 2 Team Fortress 2 the formula is desiredGravity / (sv_gravity * TFGameRules()->GetGravityMultiplier()).

Declaration

float UTIL_ScaleForGravity( float desiredGravity );

Examples

Todo: Add examples.