Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Capturing a change in rotation?

Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
04-30-2008 20:36
The changed event can capture all sorts of changes like scale and shape etc. It doesn't seem to be able to capture a change of rotation made by the user via the editor. Does anyone know how to capture this change?
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-30-2008 20:47
With a timer and a global variable, remembering the last rotation value and either testing for equality or testing for difference using something like:

CODE

float EPSILON = 0.01;
integer dirDiff(vector n1, vector n2)
{
return (1.0 - n1*n2) >= EPSILON;
}
integer rotDiff(rotation r1, rotation r2)
{
if (dirDiff(llRot2Fwd(r1), llRot2Fwd(r2)))
{
return TRUE;
}
if (dirDiff(llRot2Left(r1), llRot2Left(r2)))
{
return TRUE;
}
if (dirDiff(llRot2Up(r1), llRot2Up(r2)))
{
return TRUE;
}
return FALSE;
}
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
04-30-2008 20:48
Yeah I was afraid I'd have to do something like that. Thanks for the pointer.