You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're losing linear velocity when it gets converted to angular velocity. Though, there is a problem because this doesn't look to be conserved very well at all (eventually the circle both spins slowly and travels slowly), so I should probably look at that.
In your case though, an easy solution is to set inertia to Infinity so that the body can't rotate. This seems to make it bounce at speed for far longer:
var boxA = Bodies.circle(400, 200, 80, { inertia: Infinity });
Even still though this may not last forever or it may fluctuate a bit, I'm not sure. If this is a problem or you need rotation, I think your best option is to just artificially maintain velocity by checking it every step and adding or subtracting the magnitude difference from your target velocity (so maintaining direction).
Also make sure you're using the latest master build.
I wanted to create a system in which once the force to ball is applied, it keeps on moving forever without stopping, or reduction in speed.
I set restitution to 1,
set friction and frictionAir to 0 and
zeroed the gravity,
still the ball loses velocity over time. What am i missing?
Here's the code -
The text was updated successfully, but these errors were encountered: