Page 1 of 1

Conveyor Belt

Posted: Thu Dec 15, 2011 2:29 pm
by greengiant83
How would I go about settings up a conveyor belt? Basically i want to have a surface that when objects are on it they moved along at a constant speed in a specific direction.

Re: Conveyor Belt

Posted: Thu Dec 15, 2011 8:45 pm
by Norbo
One option would be to remove friction between the objects, as in your other thread (http://www.bepu-games.com/forum/viewtop ... f=4&t=1488), or by using an event handler to remove the friction as in the BEPUphysicsDemos CharacterController.

Once the friction is gone, you have full control over motion tangential to the surface. You could then push objects around which are touching the conveyor belt's surface. The sideways motion would have to be stopped manually though.

Another easier (but arguably hackier) option is to take advantage of friction to do the work for you. If the belt is a kinematic entity, you can set its velocity to move in the direction you'd like the conveyor belt to push. After every time step, you'll need to set the position of the conveyor back to its original location to prevent it from flying through your map. The end effect will be that any objects placed on the top of the conveyor will be pushed in the direction of the velocity. Note that bumping up against any other surface of the object will do the exact same thing. If you use this method, avoid allowing objects to come into contact with the sides or bottom of the conveyor belt.

Re: Conveyor Belt

Posted: Thu Dec 15, 2011 10:36 pm
by greengiant83
Thanks for the quick response, Norbo. Your second suggestion is intriguing. I will give that a shot.

Re: Conveyor Belt

Posted: Fri Dec 16, 2011 5:26 am
by greengiant83
That works like a charm. I can't tell you how awesome I think bepu is (sans the name, i think the name is a little weird)

Re: Conveyor Belt

Posted: Fri Dec 16, 2011 5:42 am
by Norbo
I can't tell you how awesome I think bepu is (sans the name, i think the name is a little weird)
:D

Re: Conveyor Belt

Posted: Fri Dec 16, 2011 6:45 am
by Fe_Yoshi
name is best part bEST pART