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?
Steering to move characters
Steering to move characters
- Attachments
-
steering.love
- Steering example
- (20.27 KiB) Downloaded 207 times
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Steering to move characters
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
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
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
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Steering to move characters
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:
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
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
when it turns correct I'll upload here
Thanks to all and good programming
arggggggg the steering makes me crazy
- Attachments
-
steering2.love
- (30.11 KiB) Downloaded 177 times
Who is online
Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Bing [Bot] and 1 guest