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
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#7
RE: Gravity

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.

08-03-2016, 06:34 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: 2 Guest(s)