Non Addititive forces in the Physics Engine & Move to & Accellerate to Functions

1 reply [Last post]
amigoni
User offline. Last seen 23 weeks 4 days ago. Offline
Joined: 12 Aug 2010

Currently forces are additive in the Physics engine. It would be nice to have an option to make it not so. Instead of making the body static and then applying the new force.

Replies

evank
User offline. Last seen 1 year 4 weeks ago. Offline
Joined: 16 Sep 2009

Forces are additive in Box2D because they are additive in reality :)

However, if you're going for more of an "arcade" effect, you should be able to simulate non-additive motion by zeroing out the current motion before applying your next force:

1
2
object:setLinearVelocity( 0, 0 )
object.angularVelocity = 0

For example, "SimplePool" does this to stop the cueball whenever the player is trying to shoot it again.

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.