Page 1 of 1

Steering to move characters

Posted: Sun Aug 02, 2009 10:09 pm
by paclito
I'm trying to create a car that moves with the formulas of steering, the car seems to move without a problem but I am not able to turn the face of the car like the direction of move. I have read several solutions and one of them was to create a 'joint distance' and apply the steer vector to the form that is in front of car

car --- little shape
O----o

I aply the steer vector to the little shape...

... but the car behaves as if it were connected to a spring.

Someone can help me, there is a way to 'connect' two bodies rigidly?

Someone interested in implementing the rest of formulas opensteer?

Re: Steering to move characters

Posted: Mon Aug 03, 2009 1:11 am
by TechnoCat
You don't connect two bodies together rigidly. You can join them together with a joint. You can however create two shapes and apply them to the same body. Then they will be one rigid body.

Re: Steering to move characters

Posted: Mon Aug 03, 2009 9:05 pm
by paclito
Ok I've see how to attach bodies...... but the center of mass not displaces, it's ever on the center of the object
snif snif :....-)

I'm thinking in move the car like a 'horses car' , i'll put a 'horse' in front of the car and two 'threads' or 'rope' to move the car ahead....... I'll post tthe results...... or I'll turn crazy

Re: Steering to move characters

Posted: Mon Aug 03, 2009 9:16 pm
by TechnoCat
You can automatically determine the center of mass of a body with multiple shapes by using setMassFromShapes()
You can see it being used in the physics example at the bottom.

This is taken directly from the tutorial:

Code: Select all

-- Calculate the mass of the body based on attatched shapes. 
-- This gives realistic simulations. 
body:setMassFromShapes()

Re: Steering to move characters

Posted: Tue Aug 04, 2009 9:52 pm
by paclito
I've tried this but without succes, my horses car goes crazy...... jejejeje :-)

when it turns correct I'll upload here

Thanks to all and good programming

arggggggg the steering makes me crazy