Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Defined behavior

Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
06-29-2006 12:56
Can someone "in the know" -- please let me know what the defined behavior is supposed to be between the interaction of llSetStatus(STATUS_ROTATE_X, FALSE) and vehicle scripts?

I need to lock only the one axis of rotation, but otherwise use everything vehicles provide. But the llSetStatus() seems to only effect part of the vehicle scripting.

It *does not* prevent rotation around the X axis, from what appears to be interaction from VEHICLE_ANGULAR_DEFLECTION and VEHICLE_LINEAR_DEFLECTION.

But it *does prevent* VEHICLE_VERTICAL_ATTRACTION from righting the object.


Is this the expected behavior? Or is this a bug?

Thanks!
Torley Linden
Enlightenment!
Join date: 15 Sep 2004
Posts: 16,530
06-30-2006 13:41
Asking about this...
_____________________
Andrew Linden
Linden staff
Join date: 18 Nov 2002
Posts: 692
07-01-2006 15:21
It never makes sense to lock only one axis of rotation. Instead, you always want to lock two axes and leave one open.

The reason for this is that in general rotations do not commute. That is Rotation1 * Rotation2 != Rotation2 * Rotation1. If you lock only one axis then the only way to rotate the object is by mixing rotations about two axes, which alwasy gives non-intuitive results. You will be able to achieve any rotation you want, but the path to get there will be very unobvious.

If you limit rotations to a single axis then all rotations about that axis will commute, and you will get very predictable behavior. Namely, the object will only be able to spin about a single axis.

That said, I doubt that is what you want for your vehicle. What you probably want is to use the 'vertical attactor' behavior, which tries to keep the Z-axis axis of the vehicle pointing toward the sky. If that is the case, don't mess with STATUS_ROTATE_XYZ. Instead, play with the VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY and VEHICLE_VERTICAL_ATTRACTION_TIMESCALE parameters.

Based on your belief that you want to "allow rotations about two axes only" I'm guessing that you might want to use the 'vertical attactor' with the VEHICLE_FLAG_LIMIT_ROLL_ONLY bit set. This allows the vehicle to 'pitch' but limits 'roll'. Note, if you give the vertical attactor a very weak strength (long timescale) then you'll probably get odd behavior at extreme pitch (pointing straight down or straight up).

If this sounds like what you want, you might try getting your hands on an example motorcycle or simple airplane and try modifying that.

For more information check out the LSL wiki:

http://secondlife.com/badgeo/wakka.php?wakka=vehicles

http://secondlife.com/badgeo/wakka.php?wakka=llSetVehicleFlags