Archived

This topic is now archived and is closed to further replies.

DBX

Towing caravans

Recommended Posts

Do you remember the 8bit game Thrust? You had control of a ship which could rotate and thrust forward. You would then pick up a mass which you towed behind the ship. The motion of the mass would then affect the motion of the ship. I want to do something similar, although it''s on the ground and more like a car towing a caravan. I only want an approximation, and not an accurate simulation, and it is in 2D. I have the control for the vehicle on it own done perfectly using some very simple physics but when I want to add a trailer being towed, I have no idea where to start. I''ve tried to read up on the physics of motion but am getting nowhere. Could someone please explain what I need to do to get the motion of the trailer ''appear'' correct, and how this affects the motion of the vehicle. Thank you

Share this post


Link to post
Share on other sites
I would think...
That you just treat them as two different masses, with different speed and inertia. When going straight forward, the car influences the trailer, adding a forward force on it, while the trailer adds a backwards force because of it''s inertia and weight. When you turn the car, the trailer will try to move forward, so it tried to pull the car in that direction aswell. Just stick some simple physics onto both objects, and let the forces made by one influence the other.

--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.

Share this post


Link to post
Share on other sites
Well, the trouble is that if the vehicle is pointing in a different direction to the trailer (say 30 degrees), then the trailer would also rotate as the vehicle moved. This is where is gets really confusing as I can see no way to calculate all of this.
It gets worse if you imagine them going very fast in a straight line, and then the vehicle turns sharply, the trailer should swing wildly out and pull on the car, if it is massive enough they would probably orbit each other for a while. Trying to work this out makes my head explode.

Share this post


Link to post
Share on other sites
You probably want to look into rigid body physics (do a search on google), which simulates just this sort of thing. You probably don''t want all the collision detection stuff that goes into a fully-blown rigid-body simulation, but it''s an interesting topic, and in the right direction for you.


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
Thats the problem, I have looked up rigid body physics but it might as well be all written in chinese. I can understand the basic stuff like F=ma and how to resolve a vector into it''s two components, but the rest is just mumbo jumbo.

Can anyone supply just the basic stuff I need to apply, it''s just vehicle pulls caravan, caravan rotates and pulls on vehicle kind of thing.

Share this post


Link to post
Share on other sites