2
\$\begingroup\$

I'm working on a 2D game engine using C, SDL and OpenGL. Have worked out basic graphics, physics, and broad phase collision detection. I am trying to realistically simulate "pushing" objects around. I have gotten halfway there, but it doesn't feel right. I've implemented the impulse calculation found here to change linear and angular velocity. I want the blocks to have weight to them, and to slow the player down.

Consider this video. The leftmost block is player controlled. This is how my simulation feels right now.

Is there a relevant mathematical formula for this?

\$\endgroup\$
2
\$\begingroup\$

Looks perfectly fine to me (ignoring some jumping back/forth). To actually get the feeling of weight impulse isn't enough. You'll have to implement friction to slow things down based on their weight. Without friction you won't feel weight once an object is in motion (i.e. after applying an impulse).

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.