I would like to dynamically change orientation of my Physical Constraint.
Lets give an example:
Upper cube is “body”, constraint origin is same as wheel, and two constrained bodies are “wheel” and “body”.
Constraint have free Z motion (for suspension travel), and Swing 2 that let wheel to rotate (roll).
Both have physics enabled, and everything works fine here.
But I would like to turn this wheel left-right (just like wheel in cars can be turned by steering wheel) dynamically.
I tried few approaches, but so far nothing works:
-
enable “swing 1” motion and turn wheel by physical forces (or angular motor), but when wheel both turning and rotating wheel starts to wobble (rotation axis of combined roll and turn is no longer wheel axle) - for separate turning or rotating it works.
-
set world rotation for constraint (and/or wheel) - nothing happens because it is still constrained in same orientation
-
I found that I can turn a wheel by setting Angular Rotation Offset roll, but it works only at start - changing this parameter dynamically (it is available from C++) do nothing, and I found no way to update is dynamically
-
I did few experiments with Set Constrained Reference Orientation - it was promising, but eventually I didn’t find this useful. I tried to rotate front and right vectors as car wheel should turn, but wheel behaved in different way I expected.
Any other ideas? Suggestions? Questions?