AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved What is the unit of sv_gravity? (https://forums.alliedmods.net/showthread.php?t=317244)

Natsheh 07-04-2019 17:37

What is the unit of sv_gravity?
 
Most people know that sv_gravity default value is equal to 800 but what I surely dont know is what is the type of value is this?

edon1337 07-04-2019 18:06

Re: What is the unit of sv_gravity?
 
I think it's a made-up "unit".

Natsheh 07-04-2019 18:27

Re: What is the unit of sv_gravity?
 
I can understand it's 800 unit per sec squared

But how is that related to the earth gravity?

fysiks 07-05-2019 01:05

Re: What is the unit of sv_gravity?
 
The actual units is mostly irrelevant in the game unless your trying to calculate a position or velocity based on free fall. 800 = 100% of "normal" gravity. So, if you set it to 400, it's 50% of normal.

Gravity is a unit of acceleration which is distance divided by time square. On earth, gravity is approximately 9.81 m/s^2. If we assume that 800 is earth gravity (which assumes the original developers also made this assumption) then 800 units is equal to 9.81 m/s^2.

Natsheh 07-05-2019 04:18

Re: What is the unit of sv_gravity?
 
I just transfered 800 units to meters and earth gravity in game is 20.32 meters/s2

thEsp 07-05-2019 04:44

Re: What is the unit of sv_gravity?
 
@Natsheh what algorithm are you using to convert units to meters (in-game) ?

Natsheh 07-05-2019 05:27

Re: What is the unit of sv_gravity?
 
Quote:

Originally Posted by thEsp (Post 2657810)
@Natsheh what algorithm are you using to convert units to meters (in-game) ?


I found it on the site.
#define UnitsToMeters(%1) (%1 * 0.0254)

I don't know how they got these digits

edon1337 07-05-2019 07:24

Re: What is the unit of sv_gravity?
 
I don't think 800 is by any means a logical value related to real life gravity, it's simply a made up value.
You can't transfer "units" to meters, because meter itself is an unit,
Quote:

A unit of measurement is a definite magnitude of a quantity, defined and adopted by convention or by law, that is used as a standard for measurement of the same kind of quantity.
By the way, you can't logically convert m/s^2 to meters, but this isn't a logical game, so okay.

I don't know if this could help you, but let's say we have an unit called OurUnit whose value is 800, and 800 is 9.81 m/s^2 in real life, you can do this:
PHP Code:

#define OurUnitToMeters(%1) (%1 * 0.0122625) 

800 * 0.0122625 = 9.81

thEsp 07-05-2019 07:46

Re: What is the unit of sv_gravity?
 
800 * 0.122625 = 98.1
If this applied to the rule of earth gravity, we wouldn't be able to even stand up.

edon1337 07-05-2019 07:47

Re: What is the unit of sv_gravity?
 
Quote:

Originally Posted by thEsp (Post 2657850)
800 * 0.122625 = 98.1
If this applied to the rule of earth gravity, we wouldn't be able to even stand up.

My bad, it should be 0.0122625


All times are GMT -4. The time now is 17:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.