Physics (Gravity)

I am trying to simulate an object falling according to gravity. I have most of the simulation working, using Box2D, Bullet, etc. My problem is I want to incorporate all relevant laws of physics and there’s one I cannot find any code for. Say a character goes over the edge of something (a table top or a cliff) it’s well known (O’Donnell et al) that the descent does not start until the character looks down. So, in pseudo code I have something like:

suspend in air while looking down == NOT
on lookDown then fall

Is there any code for this?

1 Like

Hello,

I had to look that up!

That is cartoon physics:

Have fun!

:)

3 Likes

Hi @paulstgeorge ,

What is tricky is that you use some rigid body physics libraries that are meant to be physically accurate and modifying the rules might cause troubles and be hard to implement.

Just for fun I found a paper showing a technique to simulate cartoon animation :

https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.16.1844&rep=rep1&type=pdf

4 Likes

You could try putting an invisible box collider underneath the player, then and remove/disable the collider when they do finally look down.

That paper is brilliant! Thank you.

1 Like

That’s exactly it! Thank you.

1 Like