How to remove unnecessary angular velocities/moments?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
DreamWeaver
Posts: 13
Joined: Wed Aug 31, 2011 9:47 pm

How to remove unnecessary angular velocities/moments?

Post by DreamWeaver » Mon Feb 10, 2014 10:25 pm

Hello,

In my example there is a Ball which rolls on the ground, hitting different obstacles.
Usually after a strong collision it spins very fast around some axis.

Because of this strong rotation the ball movement is not linear (after collision it moves linear few seconds, but then turns in some unpredictable direction).
I played around with "AngularDamping" property. If it is set to a value around "1" then it solves the problem. But this solution doesn't suit me, because the Ball stops very fast (but it should rolls further).

Any ideas how to solve this?
I need the following: a ball should rolls freely long time on the surface; after strong collision the ball should just change it's direction once (at the moment of collision) and it should rolls straight to the next obstacle.

Thanks.

Norbo
Site Admin
Posts: 4707
Joined: Tue Jul 04, 2006 4:45 am

Re: How to remove unnecessary angular velocities/moments?

Post by Norbo » Mon Feb 10, 2014 11:01 pm

Try setting the ball's LocalInertiaTensorInverse to all zeroes. The ball will no longer be able to rotate due to having effectively infinite rotational mass. This is a bit like setting AngularDamping to 1, except it totally disallows rotation.

Friction will need to be tuned down to allow it to slide more easily.

Since it isn't rotating at all anymore, any graphical appearance of rotation will need to be faked.

DreamWeaver
Posts: 13
Joined: Wed Aug 31, 2011 9:47 pm

Re: How to remove unnecessary angular velocities/moments?

Post by DreamWeaver » Sun Feb 16, 2014 11:45 pm

Thanks a lot. It works awesome.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests