Collision with shapes like pinball ramp?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
noob87
Posts: 2
Joined: Tue May 07, 2013 9:36 am

Collision with shapes like pinball ramp?

Post by noob87 »

Hi, is there a way to detect and do the collison for shapes like pinball ramp? Right now i could have the collision working for the external shape of the ramp, but i could like the pinball to be able to enter the ramp but instead it is currently block outside..i am using the mobile mesh codings provided by another post.

viewtopic.php?f=4&t=1325

Thanks alot to vectoroO for providing the codings :D

Hopefully someone will be able to guide me along...thanks!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Collision with shapes like pinball ramp?

Post by Norbo »

First, I would recommend checking out the BEPUphysicsDemos (contained in the main source download) for a bunch of examples.

For a static pinball ramp, a common approach would be to model it as a mesh and create a StaticMesh object from it. Check the StaticMeshDemo for an example of its usage. Only if it is a moving mesh should you use a MobileMesh, and even then, it's generally faster to use an approximation composed of simpler primitives (perhaps bound together in a compound shape).

If you find that the mesh detects collisions from one direction but not the other, then the sidedness of the mesh needs to be changed. A StaticMesh has a Sidedness property (and MobileMeshes accept a sidedness/solidity in their constructor). Try switching it to the opposite setting, or, if needed, set it to double sided.
Post Reply