Collisions when rotating a kinematic

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
j_tobey
Posts: 2
Joined: Fri Feb 12, 2010 2:35 am

Collisions when rotating a kinematic

Post by j_tobey »

I am trying to write a simple pinball game and I have everything loaded in, finally got my paddle within a simple box, but now when I rotate it, it doesn't have the desired effect on the balls. It will swing right through them or cause them to do some pretty interesting things, but it won't send them flying away like I would expect. I am using the rotate function and I am limiting the paddle to a 60 degree arc. If anyone could offer me some advice on this I would appreciate it. I have been digging through the old Q&A threads and trying a variety of things, but nothing seems to be working.

Thanks

Jason
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Collisions when rotating a kinematic

Post by Norbo »

That particular method is pretty much deprecated and has misleading documentation. It isn't smoothly moving the entity, and it doesn't use a velocity to do it. It's equivalent to changing the orientation matrix directly, which is like 'teleporting' the entity. The entity will detect collisions, but since is has no angular velocity, the collision response will only apply a little position correction impulse (to try and resolve the penetration). That penetration resolution impulse is spongy and won't provide rigid collisions.

In order for it to work as expected, the entity needs a velocity. Try setting the entity's angular velocity instead. To limit the range, you'll have to add a little logic to monitor its current angle and change the velocity as needed.

A convenience system to provide velocity-based 'keyframing' where you can assign positions/orientations and the engine reaches them dynamically are in the to-do, but they'll need to wait until after v0.11.0.
j_tobey
Posts: 2
Joined: Fri Feb 12, 2010 2:35 am

Re: Collisions when rotating a kinematic

Post by j_tobey »

Awesome...At least I know where I need to head now. Thanks, I thought I was going to pull out every hair on my head trying to make this work.
Post Reply