• Advertisement

Archived

This topic is now archived and is closed to further replies.

Repelling Force ?

This topic is 5131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys, I''m trying to make a robust repelling force in my dodgeball-like game. I apply the force in the direction from the force point to the object, which causes acceleration in that direction; pretty basic stuff. It doesn''t work that great though. If the moving object is approaching it slowly it bounces off like it hit an invisible rubber bumper, and if it''s moving quickly it can pass right though. If I apply less force (acceleration) the slow objects repell nicely but the fast objects aren''t really affected, and if I apply a stronger force to repell the faster objects the slower ones bounce off abruptly. Maybe I should apply a force proportional to the incoming velocity of the object ? Then would it matter if the object is heading towards or away from the force ? I experimented a lot and can''t get it right. Any ideas ? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Tou could make the force dependent on distance, like 1/x or something.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sounds like what your talking about is elastic collisions.

Basically, the object which is travelling along...has a certain amount of energy ( Im sure you know this already. Its probably me just wanting to explain things ). When it hits something, the collision is gonna decrease the ammount of energy it has right?

When the object hits something, most of its kenetic energy goes into deforming its shape ( the squish ) and is stored up, kinda like stretching an elastic band. There is a little bit of energy however lost through sound and heat ( this is important ). When the object is no longer moving, the energy it has stored up by changing shape is then converted back into kenetic energy (let go of said elastic band), in the direction off the wall it hit for example, and it flies off to have more bouncing fun.

Its the energy thats lost, that makes the object bounce less and less the more collisions it has.

Er.........Yea :D

Hope that helped a little.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You can try reflecting the velocity about the normal of the surface that it is hitting.

Share this post


Link to post
Share on other sites

  • Advertisement