-
1 Attachment(s)
Towing a trailer
Hi
Wondering if someone can help with the beginnings of my lorry-towing-truck game engine.
I'm using some inverse kinematic code at the moment - just to calculate the distance and rotations.
Take a look at the attached swf and pretty soon you'll see what im trying to do. (arrow keys to move)
Problem is that it looks wierd with the trailer sliding around. Does anyone know of a url/resource/approach i can use to make this look more believable? Like adding in constraints, mass ...or anything! Ive tweaked around some figures but its all been guesswork.
Cheers,
B
-
Looks like you are only using 1 point for the trailer, where it is connected to the car. What you could try is to use 2 points at both ends of the trailer so its end wont turn like mad. So first point keeps distance to the car and second point keeps distance to first point.
-
of course! - cheers dude. Im sure that'll fix it
-
1 Attachment(s)
Can anyone point me to a decent tute - or perhaps explain how they would approach adding angular restraints. Ive attached the latest version.
I did hack a version together that looked at the angle of the trailer and the truck.. if the difference was greater than 90 degrees stop turning... but it was a bit primitive.. using +360 and Math.abs if this difference went over 180 degrees..... quite messy. I'm betting theres a much cleaner solution.
Cheers
B