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
curved ball movement
Re: curved ball movement
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:
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.
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.