That said, I doubt that is what you want for your vehicle. What you probably want is to use the 'vertical attactor' behavior, which tries to keep the Z-axis axis of the vehicle pointing toward the sky. If that is the case, don't mess with STATUS_ROTATE_XYZ. Instead, play with the VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY and VEHICLE_VERTICAL_ATTRACTION_TIMESCALE parameters.
Well... Actually, it's not a vehicle at all, but rather some A*Life fish.
I'm using the vehicle scripting because the VEHICLE_LINEAR_FRICTION_TIMESCALE and VEHICLE_ANGULAR_DEFLECTION_TIMESCALE greatly simplifies my scripting as well as does a wonderful job of generally smoothing out the fishes movement.
For the most part I have been using VEHICLE_VERTICAL_ATTRACTION_TIMESCALE with a setting of zero to clamp the fish vertically, and only allow rotation around the Z axis. I also removed VEHICLE_FLAG_LIMIT_ROLL_ONLY.
As the complexity of their behavior has grown, I now need the ability to pitch the fish forward, so that I can "eat" food off the ocean floor -- or inversely pitch the fish up, so that eat can eat food floating on the surface of the water.
I first tried using VEHICLE_FLAG_LIMIT_ROLL_ONLY, but that meant the fish would no longer "right" themselves and they ended up perpetually angled up or down, or spinning around on the local Y axis.
Then I removed that flag, and switched VEHICLE_VERTICAL_ATTRACTION_TIMESCALE to a non-zero value. This now corrects the fish, righting it after some time. Additionally I set VEHICLE_ANGULAR_FRICTION_TIMESCALE, <0, 4, 4> -- in hopes that it would prevent rotation around the X axis. However sometimes, usually as a result of a collision or a particularly large linear impulse, the fish will rotate around it's X axis. Which looks completely absurd.
So at this point, the behavior I'm seeing is the expected behavior, and if I want the ability to clamp the X rotation, so that it *never ever ever ever* happens, then that is a feature request? Or should the ROTATION_X_STATUS flag correctly clamp X rotation even when using physics and vehicle flags?
Thanks!!!