Introduction
The TargetOmega wheel script works alongside the Vehicle script.
It's designed for vehicle wheels that can rotate using llTargetOmega() to simulate motion in movement.
Construction
The wheel must be oriented relative to the root such that it has a rotation of 90 degrees (on Z) for the left side, and 270 degrees for the right. Left and right turns are of 30 degrees each way.
The script uses the wheel prim description to determine the correct rotation and omega. This description is a two-character code, the first being "L" for left-side wheels and "R" for right-side, and the second character being "Y" if the wheel is a steering wheel. Thus, the left front wheel of a standard car would have a description "LY", and a rear right wheel would be "RN".
Operation
The wheel script receives commands via link messages from the vehicle script. The following commands are recognised in the string portion of the link message:
WL - turn wheel to the left (steering wheels only)
WR - turn wheel to the right (steering wheels only)
WC - centre wheel (steering wheels only)
F - forward motion
B - reverse motion
S - stopped
The script ignores link messages whose integer portion is 1. This is for unknown legacy reasons.
Testing
A small wheel testing script is also provided, which uses a menu to send the link messages. This way, the operation of the wheels can be observed at a standstill, without the need to control the vehicle at the same time.