Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gravity
Venom Fox Offline
Junior Member

Posts: 32
Threads: 9
Joined: Mar 2016
Reputation: 0
#8
RE: Gravity

(08-03-2016, 06:34 PM)MrBehemoth Wrote: There are a couple of things wrong. First off, the function is:
void Player_SetGravity(const cVector3f &in avGravity)
So that means the argument you give it is a 3d vector, not just a single float value. (So you could have sideways gravity, if that was what you wanted.)

Secondly, this is the actual acceleration due to gravity in metres per second per second, not just a 0-1 multiplier. Normal acceleration due to gravity is about 9.8ms^2 on Earth.

So:
Player_SetGravity(cVector3f(0.0f, -9.8f, 0.0f)); // Normal downward gravity
Player_SetGravity(cVector3f(0.0f, -4.41f, 0.0f)); // 45% downward gravity

Player_SetGravity(-0.45f); // this is the same as
Player_SetGravity(cVector3f(-0.45f, -0.45f, -0.45f)); // very light, diagonal sideways gravity

I haven't tested it, but I'm fairly sure the first line above will do what you want.

That helped a lot, thanks! And downwards gravity is what I wanted all along, just didn't know how to do it Tongue Danke!
08-03-2016, 06:38 PM
Find


Messages In This Thread
Gravity - by Venom Fox - 08-03-2016, 03:05 PM
RE: Gravity - by Darkfire - 08-03-2016, 03:20 PM
RE: Gravity - by Venom Fox - 08-03-2016, 03:47 PM
RE: Gravity - by Darkfire - 08-03-2016, 03:53 PM
RE: Gravity - by Romulator - 08-03-2016, 04:59 PM
RE: Gravity - by Venom Fox - 08-03-2016, 05:58 PM
RE: Gravity - by MrBehemoth - 08-03-2016, 06:34 PM
RE: Gravity - by Venom Fox - 08-03-2016, 06:38 PM
RE: Gravity - by Darkfire - 08-03-2016, 08:58 PM



Users browsing this thread: 1 Guest(s)