05-06-2007 21:54
As described in the wiki (http://rpgstats.com/wiki/index.php?title=TutorialVehicle#11.15._Reference_Frame), the VEHICLE_REFERENCE_FRAME is used to rotate the direction of travel for vehicles. Ordinarily, an objects reference frame is set to the local coordinates of the root prim. When you have a vehicle that uses rotated and odd shaped objects, the coordinates of a vehicle don't align and your vehicle's direction of travel will be at weird angles relative to how the vehicle is supposed to face.

There doesn't seem to be a whole lot of documentation on how to figure out the correct values for the rational.

Here's the code with no rotation: llSetVehicleRotationParam(VEHICLE_REFERENCE_FRAME, <0,0,0,1>;);

With this code, no rotation, my vehicle has the following rotation: <90, 58.7, 180.05>

If I edit the position/rotation of the object so that the object is rotated correctly, the object's rotation is <270.85,40.35,358.75>

I don't know if I should set the reference frame to the difference between the objects initial rotation and what it should be rotated to or add it.

Also, in the examples, the rotations are like PI*2 and PI/2 ... so .. I'm not even sure if rotations expressed at 360 degrees or i need some eurler rotation. Also, what's with the S value? as in <x,y,z,s>?

Isn't there, or shouldn't there be, some script or function I could use to calculate the correct rotation? Like you would rez the vehicle, put the vehicle script in it, then rotate the object to that it is orientated the right way in relation to the llSetVehicleRotationParam, then the script says what the right reference frame is when you touch the vehicle. Could someone make something like this please?