Rolling a ball along a path on a surface

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
alomgirmiah
Posts: 6
Joined: Fri Jan 10, 2014 4:57 am

Rolling a ball along a path on a surface

Post 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
Last edited by alomgirmiah on Tue Feb 25, 2014 2:05 am, edited 1 time in total.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Rolling a ball along a path on a surface

Post 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.
alomgirmiah
Posts: 6
Joined: Fri Jan 10, 2014 4:57 am

Re: Rolling a ball along a path on a surface

Post by alomgirmiah »

Thanks.
Post Reply