Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vehicle_reference_frame?

Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
02-27-2005 22:42
Does anyone have experience with designing a vehicle where the VEHICLE_REFERENCE_FRAME parameter is not aligned to the vehicle coordinate axis? How do you handle situations like rotating around the global Z axis when the vehicle "up" axis is skewed at an angle?
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
02-28-2005 06:26
From: Carnildo Greenacre
Does anyone have experience with designing a vehicle where the VEHICLE_REFERENCE_FRAME parameter is not aligned to the vehicle coordinate axis? How do you handle situations like rotating around the global Z axis when the vehicle "up" axis is skewed at an angle?


Luck!

:)

Honestly, I got it to work once, then swore off ever doing it again.

In general, I used this line right out of the LSL docs:

rotation rot = llEuler2Rot(<-90, 0, 0> * DEG_TO_RAD);
llSetVehicleRotationParam(VEHICLE_REFERENCE_FRAME, rot);

Worked for me. Fiddle with the values as needed.
_____________________
I am myself indifferent honest; but yet I could accuse me of such things that it were better my mother had not borne me: I am very proud, revengeful, ambitious, with more offenses at my beck than I have thoughts to put them in, imagination to give them shape, or time to act them in. What should such fellows as I do crawling between earth and heaven? We are arrant knaves, all; believe none of us.
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
03-01-2005 09:41
What Rei said is correct on the VEHICLE_REFERENCE_FRAME aspect.

Once you have set this value, all VEHICLE parameters that rely on rotation will use the vehicle object's rotation plus (minus?) the VEHICLE_REFERENCE_FRAME value to define their behaviors.

All other rotation-based information / operations will continue to use the object's standard rotation so if you are doing anything beyond a very simple vehicle, you will probably end up having to use two different rotations to define the overall vehicle behavior.

This means that if you want to add informational pieces like heading, angle of attack, etc you must modify the values you come up with by the opposite of your VEHICLE_REFERENCE_FRAME in order to end up with the correct values. It can be quite frustrating, or a lot of fun if you like numbers.
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.