• Create Account

### #ActualNypyren

Posted 17 July 2013 - 02:24 PM

Here's how people typically make the curve smooth instead of applying changes once per second:

float dt = (time between last frame and this frame measured in seconds);
acceleration = 9.8f; // NOT +=
velocity += acceleration * dt;
position += velocity * dt;

If you want to force your physics to use 60 FPS, you can hardcode:

const float dt = 1.0f / 60;


If an object is on the ground, you have (at least) two choices:
- Disable the gravity code so that the object isn't pulled through the ground
- Resolve the collision with the ground every frame. The object will bounce if you have restitution > 0 or "stick" if you have restitution == 0.

### #4Nypyren

Posted 17 July 2013 - 02:21 PM

Here's how people typically make the curve smooth instead of applying changes once per second:

float dt = (time between last frame and this frame measured in seconds);
acceleration = 9.8f; // NOT +=
velocity += acceleration * dt;
position += velocity * dt;

If you want to force your physics to use 60 FPS, you can hardcode:

const float dt = 1.0f / 60;


### #3Nypyren

Posted 17 July 2013 - 02:20 PM

Here's how people typically make the curve smooth instead of applying changes once per second:

float dt = (time between last frame and this frame);
acceleration = 9.8f; // NOT +=
velocity += acceleration * dt;
position += velocity * dt;

If you want to force your physics to use 60 FPS, you can hardcode:

const float dt = 1.0f / 60;


### #2Nypyren

Posted 17 July 2013 - 02:19 PM

Here's how people typically make the curve smooth instead of applying changes once per second:

float dt = (time between last frame and this frame);
velocity += acceleration * dt;
position += velocity * dt;

If you want to force your physics to use 60 FPS, you can hardcode:

const float dt = 1.0f / 60;


### #1Nypyren

Posted 17 July 2013 - 02:18 PM

Here's how people typically make the curve smooth instead of applying changes once per second:

float dt = (time between last frame and this frame);
velocity += acceleration * dt;
position += velocity * dt;


PARTNERS