quote:
Originally posted by ventilator:
i still don't know what the spring/damper constant specifies?

Those two values are the same parameters as the ones set in ph_setcorrections.
quote:
Sets global correction factors for the physis simulation. ERP stands for Error Reduction Parameter and defines how quickly misaligned constraints get adjusted. Setting ERP to 0 will have constrained objects drift apart after some time because errors get not corrected. With ERP set to its maximum value any constrained objects that get forced into an unacceptable position/orientation will be corrected within a single frame. This however can cause overshooting and it is thus recommended to use smaller values instead. Constraint Force Mixing on the other hand determines how much a constraint is allowed to be violated. Setting CFM to 0 results in very stiff joints (this will lead to errors though- do not do it). Setting CFM to its maximum value makes constrained objects act as though limited by rubber bands
If you want spring-like connections you can set the CFM value to something a little above 0.1, or the ERP value to a little less than 0.9. Try setting a keyboard shortcut for changing these values, as getting them just right takes a lot of trial and error.

Here's a formula for converting spring/damper coefficients (s, d) to ERP/CFM values corrected for the time value (I prefer using trial and error, though ;] )
CFM= 1/ (time*s+d)
ERP= time*s * CFM

quote:
if i want to have shocks / suspension, do i have to use an additional slider constraint for each wheel? and how would i set this constrain up so that it works like a spring? just set a motor for the slider which is active all the time?
You could soften up the wheel constraint by altering CFM/ERP, or use a slider attached to the wheel. Try setting the slider motor to a desired velocity of 0, with some margin in its max/min limits. If this does not work then use the technique described below: query the slider position and apply a positive/negative motor velocity depending on whether the position is <0 or >0. Make sure to time-correct this value or else you will have a "lowrider" if the framerate drops and the slider overshoots. [Wink]

quote:
how could i force the front wheels to stay parallel?
a) Well, in real cars, you have a beam connected to both wheels. So one idea would be to attach a limited/motorized slider to the front end of the front wheels.
b) The other way is to query the axis1 orientation of both front wheels (phcon_getposition) and then apply motor values (scaled by time) in order to rotate them to the desired position. Both methods have their advantages and disadvantages, please try both to see which gives you best performance and stability.
I just realized that the manual only refers to axis2 motors for PH_WHEEL. It should read:
quote:
Motor1: Set desired angular velocity around axis1 and the maximum torque allowed to achieve this velocity, e.g. (10, 50,0) will set a desired angular velocity of 10 Hz and a maximum torque of 50,000 Nm
Motor2: Set desired angular velocity around axis2 and the maximum torque allowed to achieve this velocity, e.g. (10, 50,0) will set a desired angular velocity of 10 Hz and a maximum torque of 50,000 Nm

quote:
would the cylinder hull work better (less slip) for the wheels because it has more ground contact area than a sphere?
The physics engine is not using surface patches, so in a way there is no "area". Instead, contact points are used, which in the case of spheres result in a single contact point underneath its center. Cylinders would yield more accurate collision results in that a number of contact points will be generated along the top and bottom cylinder caps. However, each contact adds an inequality(read: slow) constraint to the system. If these contacts differ only slightly you will probably run into problems of bouncing. (This is why PH_POLY collision often causes bouncing- a number of redundant contacts are created along the colliding edges. I am working on a fix for that right now). I have not tried creating a car with cylinders because they don't collide with level geometry. Cylinders or boxes are always slower than spheres, but they might yield better stability. Again, I urge you to try it out and see what works best for you.