curved ball movement

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
quaikohc
Posts: 2
Joined: Mon Nov 14, 2011 4:36 pm

curved ball movement

Post by quaikohc »

hi
what would be the best way to implement this kind of befaviour http://www.youtube.com/watch?v=uWPIcDgbyZI using bepu? i mean curved movement of a ball when it was hit by fast moving block
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: curved ball movement

Post by Norbo »

If you mean the ball curving in midair, then what you're looking for is the Magnus effect.

Basically, each frame, you could do something like this:

Code: Select all

ball.LinearMomentum += (dt * curvingCoefficient) * Vector3.Cross(ball.AngularVelocity, ball.LinearVelocity);


If you find that an impact does not generate sufficient angular velocity to trigger the effect to your satisfaction, you can impart a greater angular impulse using a collision event or something along those lines. You could also fake the effect by getting the 'angular velocity' value from somewhere other than the ball's true angular velocity.
Post Reply