help for conveyor

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
xuan08dv
Posts: 1
Joined: Sat Sep 14, 2013 7:51 am

help for conveyor

Post by xuan08dv »

i am new in BepuPhysics. and i want to create the conveyor like to follow image.i'll design models in Blender,3DSMax or SolidWork and then load its into my game. anyone give me the solution or existing tutorials for this problem
sorry cause my low level english. thanks to much! :D :D
Image[/img]
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: help for conveyor

Post by Norbo »

The soft belt would probably be easiest to implement as a simple constant velocity push for objects that are touching the conveyor.

First, set the conveyorEntity.Material's friction coefficients to zero to allow the conveyor force to shove things around unimpeded.

Checking the conveyorEntity.CollisionInformation.Pairs for some pair where pair.Colliding is true would tell you which objects are colliding with the conveyor. You could then check the pair.EntityA/EntityB properties to determine which entity it was. Careful; one of those entities will be the conveyor itself (or null if the conveyor isn't an entity).

Once the entity is identified, apply a force to it. The simplest way to do this is to just set add a value to the entity.LinearMomentum. Don't apply more force than needed to reach a certain velocity, though. Measure the velocity first, for example:

Code: Select all

currentVelocityAlongConveyor = Vector3.Dot(entity.LinearVelocity, conveyorDirection);
The impulse you apply should be no greater than the impulse required to accelerate the entity from currentVelocityAlongConveyor to targetVelocityAlongConveyor.

A more correct/difficult approach would use the contact points reported by the collision pairs to determine exactly where to measure and apply force. It could even take into account the normal force to include a friction component.

For a solid belt, it sounds like you want actual physical links forming the belt. In that case, you'll need to use constraints. In this case, a BallSocketJoint and RevoluteAngularJoint together would do the trick (a RevoluteJoint is a combo-joint which includes both of those, plus a motor and limit should you need them). For information about using constraints, check out the joints and constraints documentation and the BEPUphysicsDemos. The BridgeDemo in particular is pretty close to what you want.

You may also need some extra constraints to keep the links aligned with the conveyor. While it might be realistic, it would be annoying to deal with tracks that keep falling off :) A PointOnPlaneJoint for each link would work.
Post Reply