Page 1 of 1

Rolling a ball along a path on a surface

Posted: Mon Feb 24, 2014 9:44 pm
by alomgirmiah
Hi,

First of all congrats on the great work.

I am using BEPUPhysics for a game with infinite tunnel with a ball rolling on a specified path and it has to dodge some obstacles. All has gone well so far. Only issue is, I want to roll the ball in a predefined path. I was able to do it with EntityMover, however the ball does not roll as such. Can you please guide me here?

Thanks again,
Alomgir A Miah

Re: Rolling a ball along a path on a surface

Posted: Mon Feb 24, 2014 10:25 pm
by Norbo
If the ball's position follows a specific path that isn't based on actual dynamic behavior, the angular motion must be induced somehow. The simplest approach would be to just set the AngularVelocity directly to match the linear motion.

If you want the ball's behavior to be dynamic in nature- that is, it responds to collisions correctly and attempts to physically accelerate to its goal position- then set the AngularVelocity (and perhaps LinearVelocity too) to make it move.

In the first approach, the angular velocity is just a faked 'explanation' for the motion that's happening. In the second approach, the angular velocity is what actually makes the ball move towards its goal.

Re: Rolling a ball along a path on a surface

Posted: Mon Feb 24, 2014 10:52 pm
by alomgirmiah
Thanks.