Compute angular velocity from linear velocity

Mind In A Box
Posts: 7
Joined: Thu Jul 15, 2010 10:42 am

Compute angular velocity from linear velocity

Post by Mind In A Box »

Hi there!

My situation is the following:

I have a ball, which I can give a kick. When it hits one of of the reflectors in our world I would like it to bounce off at the exact angle it came in. This is working pretty fine so far, but there is the problem of angular velocity.

After the ball hits a reflector it sometimes starts spinning and changes its direction. Therefore I could just set the angular velocity after hitting a reflector to zero, but since this stops the spinning completely it looks very unrealistic.

What I'm looking for now, is a solution of how to get the ball to spin into the exact direction it is reflected to.

Has someone maybe done something similar or just knows what do do here?

Help would be very appreciated. :)
Jonathan
Posts: 36
Joined: Sun Feb 10, 2013 6:52 pm

Re: Compute angular velocity from linear velocity

Post by Jonathan »

Isn't angular velocity just the radians/sec around the center point?

Could you make a new vector copying from your velocity vector, normalize the new vector, and then just set the angular velocity to that? (And then probably scale that vector up or down depending on how much spin you need?)
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Compute angular velocity from linear velocity

Post by Basroil »

Mind In A Box wrote: After the ball hits a reflector it sometimes starts spinning and changes its direction. Therefore I could just set the angular velocity after hitting a reflector to zero, but since this stops the spinning completely it looks very unrealistic.
Making it return in the same direction while spinning is also unrealistic :wink:

Why not decouple the physics from graphics? You can tell your graphics engine to rotate your texture around the ball (among other ways) while keeping physics as you have it now. Ball looks like it's spinning, you get a non-spinning simulation, win-win for everyone.
c6burns
Posts: 149
Joined: Fri May 24, 2013 6:08 am

Re: Compute angular velocity from linear velocity

Post by c6burns »

Can't you just reduce the friction of the ball, and possible couple that with some angular damping? Or does that not produce the desired effect?