Page 1 of 1

IrrNewton: movement of physical objects

Posted: Wed Jul 11, 2012 8:30 am
by DimonSE
Hi all!

I need help with IrrNewton (it's irrlicht wrapper for newton dynamic).
So, I write air-hockey game and use newton physic (just for get skills). In my code I have a plane, two mallets and air-hockey puck, and I need move mallet in some point on plane.

I've tried use newton::IBody->setPosition() but then we don't have reactions with another physics object (air-hockey puck for instance)

I've tried use newton::IBody->setForce() or newton::IBody->addImpulse() for move mallet, but then mallet run around cursor (as the earth around the sun) because I've recount force direction and power in the game loop.

So, any ideas, how just move mallet to some position on plane?

Re: IrrNewton: movement of physical objects

Posted: Wed Jul 11, 2012 8:32 am
by randomMesh
"how hard do I push it to get it where it needs to be"

This is an ODE snippet, but i am sure it's easy to adapt to Newton.

And yes, setting the position manually is a bad idea, you should only apply forces, torques or impulses.

Re: IrrNewton: movement of physical objects

Posted: Wed Jul 11, 2012 11:39 am
by nespa
Try with joint kinematic controller.