Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

detect when car is upside down

RacerX Gullwing
Magic Rabbit
Join date: 18 Jun 2004
Posts: 371
05-05-2009 01:02
I want to make this car be able to crash and burn it gets flipped over.
but how do you detect if the top is below the bottom or the main prim is top side down?
I want to put this detector in the main prim of the car. Please help me.
_____________________
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
05-05-2009 01:36
Suppose your vehicle has normal axis: X forward, Y left and Z up, then:
if ( (llRot2Up(llGetRot())*< 0.0, 0.0, 1.0 >;) >= 0.0 ) llOwnerSay( "Not upside down" );
else llOwnerSay( "Upside down" );
_____________________
From Studio Dora
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
05-05-2009 11:46
vector test = llRot2Fwd( llGetRot );
if (test.z < 0){
//-- we're rolling over
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
RacerX Gullwing
Magic Rabbit
Join date: 18 Jun 2004
Posts: 371
05-05-2009 12:35
Very cool thank you Dora Gustafson. that works great.
_____________________