   Hinge basics and car collisions
  Howdy,First off: I''m a total n00b when it comes to physics, and it''s the one thing I haven''t got my mind round... So I would desparately like some help.My idea to learn how to use ODE was to make a top down (albeit in 3d) road, with an intersection where cars pass all the time, the cars are simple squares, so collision detection is a cinch, and I''m not having the cars flip over yet, so this is simple stuff.What _I''ve_ figured so far (save your laughs) is that the cars have four wheels, these four wheels each have friction, and the car has momentum etc, but all the cars on the road are just moving in one direction at one speed, constant, but as soon as a collision occurs, start calculating the friction of the four wheels so that if you hit the car at an angle, it will spin around the wheels realistically...?But now what I don''t have a clue about, is how to tell the physics engine how to do that? And more importantly, when to tell it to stop doing it.I know that hinges hold wheels on to the car as suspension, I''ve been through some samples, but I don''t really understand how the whole linked-thing works.All I want is a block moving in one direction at a constant speed (A), and when you push another block against it (B) at any speed or angle, so if you T-bone (A), but slightly towards the front, the car will shift around the back tires and eventually be parallel to (B), thus hitting (B) etc. (pictures drawn at request)And the first person to write "google" as an answer, gets it.I''d love to know the theory, but I learn from code just as well, anyone who could help me, I''d be really greatful.Thanks. 
  For the friction, you should always be calculating friction. Friction on a rolling cylinder (moving forward) is much less than on a sliding cylinder (moving sideways). However, you could just say that your acceleration perfectly counteracts your rolling friction. All you are left with now is sliding friction, which only occurs when the wheel is moving sideways (which can occur if the car is spinning or has been pushed sideways, as in the case of a T-bone).   --------------------------------------I am the master of stories.....If only I could just write them down... ;  As always: thanks for your reply and taking the time.Yeah, cool, that's kinda what I meant with the friction not really having to be calculated until the moment of impact, and that you've then got 4 entities with friction of which you have to rotate around...I've got the general idea of what the vague real world physics would be, but I have NO idea what they are in eg: ODE terms...The wheels are objects, the car is an object, somehow you've got to link them and make them react with each other... I know it's kind of asking "please code it for me"... but I swear it's not, I would just like to know what classes and how they link to each other, and how you make the engine work it out or get results from it...Is it a case of PhysicsEngine.Claculate(world), or is it a more step by step... how do you know when it stops...?I _swear_ I've tried coding some stuff, but you know when something just _doesn't_ make sense at all...? I get network programming, I get OpenGL... but physics, man... if someone could even point me to a good link that describes it well, I've tried those that came up on google, but I really don't want to know engine speeds and stuff like that yet.Thanks again.EDIT: I've been looking at Tokamak, and it's got stuff like SetInertiaTensor and all, and I would like to know if I must create my physics-affected objects _through_ the physics engine, like ask it to give me a box, and then rotate it or whatever and use its vertices to draw in eg: OpenGL, or do I make them and somehow pass them to the engine? And yes, the Tokamak sample has 10 cars that you can bash into each other in 3D, and they can flip and have acceleration and all, but man, I. Don't. Get. It./EDIT   [edited by - MoreOn on February 13, 2004 4:44:30 AM];  ok, i''ve not even come as far as physics engines yet, but i''ll try my best.why dont you just drop the hinges for the time beeing. just keep track of the direction the wheels are pointing to, in respect to the cars movement direction. to start out just asume that the wheels are locked in position, and will alway point in the direction the car points (but not neccessarily the direction it moves). also, to start out asume each wheel is pressed towards the ground by 1/4th of the car mass. next you''ll need the point of contact, and the direction of the "collision force". if the collision occurs along a line (as it likely will with your cars), just take the middle of it as collision point.you then need to find out where your wheels are placed, and how much of the force is acting on each of the wheels and in which direction.you''ll need to find out how wheel friction "behaves" with respect to their orientation, and if you want to get it really realistic, their speed also.then aply the force for the wheel along the direction that it is working along and take the friction for this angle into account, and calculate how much it can move the car.THEN you can start to think about hinges and unlocking the wheels, by letting the force affect the wheel position etc too.for the exact numbers on wheel friction etc., search google and you''d just HAVE to find something usefull. 