Don't click here unless you want to be banned.

LSL Wiki : LindenVehicleTutorial

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
Note: What follows is the unedited vehicle section of the Linden-provided LSL manual. Please do NOT edit this page to improve upon it, as this is meant to preserve precisely what the Lindens wrote. Go here for the version of these pages that can, should be, and is actively maintained.

Note to the reader, some of the information in the "Constants" section is contraditory to "Vehicles", the information in "Vehicles" is more accurate then that of "Constants"

11. Vehicles
11.1. Overview
11.2. Warnings
11.3. Definitions
11.4. Setting the Vehicle Type
11.5. Linear and Angular Deflection
11.6. Moving and Steering the Vehicle
11.7. The Linear Motor
11.8. The Angular Motor
11.9. Using the Camera to Steer
11.10. The Vertical Attractor
11.11. Banking
11.12. Friction Timescales
11.13. Buoyancy
11.14. Hover
11.15. Reference Frame
C. Constants
C.24. Vehicle Parameters
C.25. Vehicle Flags
C.26. Vehicle Types

Chapter 11. Vehicles

Custom Vehicles can be constructed and controlled using the LSL. This chapter will cover the basics of how vehicles work, the terms used when describing vehicles, and a more thorough examination of the api available.

There are several ways to make scripted objects move themselves around. One way is to turn the object into a "vehicle". This feature is versatile enough to make things that slide, hover, fly, and float. Some of the behaviors that can be enabled are:


11.1. Overview

Each scripted object can have one vehicle behavior that is configurable through the llSetVehicleType, llSetVehicleFloatParam, llSetVehicleVectorParam, llSetVehicleRotationParam, llSetVehicleFlags, and llRemoveVehicleFlags library calls.

These script calls are described in more detail below, but the important thing to notice here is that the vehicle behavior has several parameters that can be adjusted to change how the vehicle handles. Depending on the values chosen the vehicle can veer like a boat in water, or ride like a sled on rails.

Setting the vehicle flags allow you to make exceptions to some default behaviors. Some of these flags only have an effect when certain behaviors are enabled. For example, the VEHICLE_FLAG_HOVER_WATER_ONLY will make the vehicle ignore the height of the terrain, however it only makes a difference if the vehicle is hovering.


11.2. Warnings

Vehicles are a work in progress and will likely experience changes in future versions of Second Life. Some of the details of vehicle behavior may be changed as necessary to ensure stability and user safety. In particular, many of the limits and defaults described in the appendices will probably change and should not be relied upon in the long term.

It is not recommended that you mix vehicle behavior with some of the other script calls that provide impulse and forces to the object, especially llSetBuoyancy, llSetForce, llSetTorque, and llSetHoverHeight.

While the following methods probably don't cause any instabilities, their behavior may conflict with vehicles and cause undesired and/or inconsistent results, so use llLookAt, llRotLookAt, llMoveToTarget, and llTargetOmega at your own risk.

If you think you have found a bug relating to how vehicle's work, one way to submit the problem is to give a copy of the vehicle and script to Andrew Linden with comments or a notecard describing the problem. Please name all submissions "Bugged Vehicle XX" where XX are your Second Life initials. The vehicle and script will be examined at the earliest convenience.


11.3. Definitions

The terms "roll", "pitch", and "yaw" are often used to describe the modes of rotations that can happen to a airplane or boat. They correspond to rotations about the local x-, y-, and z-axis respectively.

        z-axis  .
      yaw-axis /|\
                |     __. y-axis
   ._        ___|      /| pitch-axis
  _||\       \\ |\.   /
  \|| \_______\_|__\_/_______
   | _ _   o o o o o o o    |\_  ______\ x-axis
   // ./_______,----,__________)       / roll-axis
  /_,/        //  ./
             /__,/ 
	

The right-hand-rule, often introduced in beginning physics courses, is used to define the direction of positive rotation about any axis. As an example of how to use the right hand rule, consider a positive rotation about the roll axis. To help visualize how such a rotation would move the airplane, place your right thumb parallel to the plane's roll-axis such that the thumb points in the positive x-direction, then curl the four fingers into a fist. Your fingers will be pointing in the direction that the plane will spin.

    .-.--.--.--.              __
   / /  /  /  _ \            /  \
  (-(- (- (- (   | _________|______\ axis of
   \.\._\._\._)  |          |      / rotation
    |           \:__,---.  \|/
    |                    |  + positive
     \           .,_.___.'    rotation
      \_ ^ `.__,/ 
      |      / 
      |      | 
	

Many of the parameters that control a vehicle's behavior are of the form: VEHICLE_BEHAVIOR_TIMESCALE. A behavior's "timescale" can usually be understood as the time for the behavior to push, twist, or otherwise affect the vehicle such that the difference between what it is doing, and what it is supposed to be doing, has been reduced to 1/e of what it was, where "e" is the natural exponent (approximately 2.718281828). In other words, it is the timescale for exponential decay toward full compliance to the desired behavior. When you want the vehicle to be very responsive use a short timescale of one second or less, and if you want to disable a behavior then set the timescale to a very large number like 300 (5 minutes) or more. Note, for stability reasons, there is usually a limit to how small a timescale is allowed to be, and is usually on the order of a tenth of a second. Setting a timescale to zero is safe and is always equivalent to setting it to its minimum. Any feature with a timescale can be effectively disabled by setting the timescale so large that it would take them all day to have any effect.


11.4. Setting the Vehicle Type

Before any vehicle parameters can be set the vehicle behavior must first be enabled. It is enabled by calling llSetVehicleType with any VEHICLE_TYPE_*, except VEHICLE_TYPE_NONE which will disable the vehicle. See the vehicle type constants section for currently available types. More types will be available soon.

Setting the vehicle type is necessary for enabling the vehicle behavior and sets all of the parameters to its default values. For each vehicle type listed we provide the corresponding equivalent code in long format. Is is important to realize that the defaults are not the optimal settings for any of these vehicle types and that they will definitely be changed in the future. Do not rely on these values to be constant until specified.

Should you want to make a unique or experimental vehicle you will still have to enable the vehicle behavior with one of the default types first, after which you will be able to change any of the parameters or flags within the allowed ranges.

Setting the vehicle type does not automatically take controls or otherwise move the object. However should you enable the vehicle behavior while the object is free to move and parked on a hill then it may start to slide away.

We're looking for new and better default vehicle types. If you think you've found a set of parameters that make a better car, boat, or any other default type of vehicle then you may submit your proposed list of settings to Andrew Linden via a script or notecard.


11.5. Linear and Angular Deflection

A common feature of real vehicles is their tendency to move along "preferred axes of motion". That is, due to their wheels, wings, shape, or method of propulsion they tend to push or redirect themselves along axes that are static in the vehicle's local frame. This general feature defines a class of vehicles and included in this category a common dart is a "vehicle": it has fins in the back such that if it were to tumble in the air it would eventually align itself to move point-forward -- we'll call this alignment effect angular deflection.

A wheeled craft exhibits a different effect: when a skateboard is pushed in some direction it will tend to redirect the resultant motion along that which it is free to roll -- we'll call this effect linear deflection.

So a typical Second Life vehicle is an object that exhibits linear and/or angular deflection along the "preferential axes of motion". The default preferential axes of motion are the local x- (at), y- (left), and z- (up) axes of the local frame of the vehicle's root primitive. The deflection behaviors relate to the x-axis (at): linear deflection will tend to rotate its velocity until it points along it's positive local x-axis while the angular deflection will tend to reorient the vehicle such that it's x-axis points in the direction that it is moving. The other axes are relevant to vehicle behaviors that are described later, such as the vertical attractor which tries to keep a vehicle's local z-axis pointed toward the world z-axis (up). The vehicle axes can be rotated relative to the object's actual local axes by using the VEHICLE_REFERENCE_FRAME parameter, however that is an advanced feature and is covered in detail in a later section of these documents.

Depending on the vehicle it might be desirable to have lots of linear and/or angular deflection or not. The speed of the deflections are controlled by setting the relevant parameters using the llSetVehicleFloatParam script call. Each variety of deflection has a "timescale" parameter that determines how quickly a full deflection happens. Basically the timescale it the time coefficient for exponential decay toward full deflection. So, a vehicle that deflects quickly should have a small timescale. For instance, a typical dart might have a angular deflection timescale of a couple of seconds but a linear deflection of several seconds; it will tend to reorient itself before it changes direction. To set the deflection timescales of a dart you might use the lines below:


llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 2.0);
llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 6.0);
	

Each variety of deflection has an "efficiency" parameter that is a slider between 0.0 and 1.0. Unlike the other efficiency parameters of other vehicle behaviors, the deflection efficiencies do not slide between "bouncy" and "damped", but instead slide from "no deflection whatsoever" (0.0) to "maximum deflection" (1.0). That is, they behave much like the deflection timescales, however they are normalized to the range between 0.0 and 1.0.


11.6. Moving and Steering the Vehicle

Once enabled, a vehicle can be pushed and rotated by external forces and/or from script calls such as llApplyImpulse, however linear and angular motors have been built in to make motion smoother and easier to control. Their directions can be set using the llSetVehicleVectorParam call. For example, to make the vehicle try to move at 5 meters/second along its local x-axis (the default look-at direction) you would put the following line in your script:

llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <5, 0, 0>);
	

The motor strength is not the full story, since you can also control how fast the motor engages (VEHICLE_LINEAR_MOTOR_TIMESCALE) and there is a parameter that causes the motor's effectiveness to decay over time (VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE).

Steering the vehicle involves setting the VEHICLE_ANGULAR_MOTOR_DIRECTION and related parameters. It is also possible to set some flags that allow the angular motor slave to your camera view when in mouselook.

For more details about the vehicle motors read the sections on the linear and angular motors below.


11.7. The Linear Motor

The parameters that control the linear motor are:

  • VEHICLE_LINEAR_MOTOR_DIRECTION

    A vector. It is the velocity (meters/sec) that the vehicle will try to attain. It points in the vehicle's local frame, and has a maximum length of 40.

  • VEHICLE_LINEAR_MOTOR_OFFSET

    A vector. It is the offset point from the vehicle's center of mass at which the linear motor's impulse is applied. This allows the linear motor to also cause rotational torque. It is in the vehicle's local frame and its maximum length is 100 meters! No need to worry about stability -- if the vehicle starts to spin too fast (greater than about 4*PI radians per second) then angular velocity damping will kick in. The reason the offset is allowed to be so large is so that it can compete with the other vehicle behaviors such as angular deflection and the vertical attractor. Some of the other vehicle behaviors may drastically reduce the effective torque from the linear motor offset, in which case a longer leverage arm may help.

  • VEHICLE_LINEAR_MOTOR_TIMESCALE

    A float. Determines how long it takes for the motor to push the vehicle to full speed. Its minimum value is approximately 0.06 seconds.

  • VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE

    A float. The effectiveness of the motor will exponentially decay over this timescale, but the effectiveness will be reset whenever the motor's value is explicitly set. The maximum value of this decay timescale is 120 seconds, and this timescale is always in effect.

The flags that affect the linear motor are:

  • VEHICLE_FLAG_LIMIT_MOTOR_UP

    Useful for "ground vehicles". Setting this flag will clamp the z-component of the linear motor (in world frame) to prevent it from defeating gravity.

Setting the motor speed is not enough to enable all interesting vehicles. For example, some will want a car that immediately gets up to the speed they want, while others will want a boat that slowly climbs up to its maximum velocity. To control this effect the VEHICLE_LINEAR_MOTOR_TIMESCALE parameter can be used. Basically the "timescale" of a motor is the time constant for the vehicle to exponentially accelerate toward its full speed.

What would happen if you were to accidentally set the vehicle's linear velocity to maximum possible speed and then let go? It would run away and never stop, right? Not necessarily: an automatic "motor decay" has been built in such that all motors will gradually decrease their effectiveness after being set.

Each time the linear motor's vector is set its "grip" immediately starts to decay exponentially with a timescale determined by the VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, such that after enough time the motor ceases to have any effect. This decay timescale serves two purposes. First, since it cannot be set longer than 120 seconds, and is always enabled it guarantees that a vehicle will not push itself about forever in the absence of active control (from keyboard commands or some logic loop in the script). Second, it can be used to push some vehicles around using a simple impulse model. That is, rather than setting the motor "on" or "off" depending on whether a particular key is pressed "down" or "up" the decay timescale can be set short and the motor can be set "on" whenever the key transitions from "up" to "down" and allowed to automatically decay.

Since the motor's effectiveness is reset whenever the motor's vector is set, then setting it to a vector of length zero is different from allowing it to decay completely. The first case will cause the vehicle to try to reach zero velocity, while the second will leave the motor impotent.

The two motor timescales have very similar names, but have different effects, so try not to get them confused. VEHICLE_LINEAR_MOTOR_TIMESCALE is the time for motor to "win", and VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE is the time for the motor's "effectiveness" to decay toward zero. If you set one when you think you are changing the other you will have frustrating results. Also, if the motor's decay timescale is shorter than the regular timescale, then the effective magnitude of the motor vector will be diminished.


11.8. The Angular Motor

The parameters that control the angular motor are:

  • VEHICLE_ANGULAR_MOTOR_DIRECTION

    A vector. It is the angular velocity (radians/sec) that the vehicle will try to rotate. It points in the vehicle's local frame, and has a maximum value of 4*PI (two revolutions per second).

  • VEHICLE_ANGULAR_MOTOR_TIMESCALE

    A float. Determines how long it takes for the motor to spin the vehicle to full speed. Its minimum value is approximately 0.06 seconds.

  • VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE

    A float. The effectiveness of the motor will exponentially decay over this timescale, but the effectiveness will be reset whenever the motor's value is explicitly set. The maximum value of this decay timescale is 120 seconds, and this timescale is always in effect.

Like the linear motor the angular motor can be set explicitly, and has magnitude/direction, a timescale, and a decay timescale.

When it comes to actually steering a vehicle there are several ways to do it. One way would be for the script to grab keyboard input and to explicitly turn the motor on/off based on which keys are pressed. When steering this way you probably don't want it to turn very far or for very long. One way to do it using the angular motor would be to leave the decay timescale long, enable a significant amount of angular friction (to quickly slow the vehicle down when the motor is turned off) then set the angular motor to a large vector on a key press, and set it to zero when the key is released. That has the effect of making the vehicle unresponsive to external collisions, due to the angular friction.

Another way to do it is to set the VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE to a short value and push the vehicle about with a more impulsive method that sets the motor fast on a key press down (and optionally setting the motor to zero on a key up) relying on the automatic exponential decay of the motor's effectiveness rather than a constant angular friction.

Finally, it may be possible to discard the angular motor entirely and use the VEHICLE_LINEAR_MOTOR_OFFSET. Whenever the offset has a component that is perpendicular to the direction of the linear motor the vehicle will rotate as it travels. Note, with the incorrect values for offset and strength the linear motor effect can easily cause the vehicle to tumble and spin uncontrollably, so experiement with small offsets first!.

Setting the angular motor to zero magnitude is different from allowing it to decay. When the motor completely decays it no longer affects the motion of the vehicle, however setting it to zero will reset the "grip" of the vehicle and will make the vehicle try to achieve zero angular velocity.

Many real vehicles bank (roll about their forward axis) to effect a turn, such as motorcycles and airplanes. To make it easier to build banking vehicles there is banking behavior available which can be controlled by setting other parameters and is described in more detail here.

It is also possible to make a vehicle turn in response to changing the camera view (right now this only works in mouselook).


11.9. Using the Camera to Steer

The vehicle can be instructed to rotate its forward axis to point in the same direction as the camera view. This is achieved by setting some flags that change how the VEHICLE_ANGULAR_MOTOR_DIRECTION is interpreted. When used properly this feature has the advantage of being able to provide simple and stable steering that is resilient to bad render frame rates on the client.

The flags that affect the angular motor are:

  • VEHICLE_FLAG_MOUSELOOK_STEER

    Steer the vehicle using the mouse. Use this flag to make the angular motor try to make the vehicle turn such that its local x-axis points in the same direction as the client-side camera.

  • VEHICLE_FLAG_MOUSELOOK_BANK

    Same as above, but relies on banking. It remaps left-right motions of the client camera (also known as "yaw") to rotations about the vehicle's local x-axis (also known as "roll").

  • VEHICLE_FLAG_CAMERA_DECOUPLED

    Makes mouselook camera rotate independently of the vehicle. By default the client mouselook camera will rotate about with the vehicle, however when this flag is set the camera direction is independent of the vehicle's rotation.

When using the VEHICLE_FLAG_MOUSELOOK_STEER (or VEHICLE_FLAG_MOUSELOOK_BANK) the meaning of the VEHICLE_ANGULAR_MOTOR_DIRECTION parameter subtly changes. Instead of representing the "angular velocity" of the motor the components of the parameter scale the "measured angular velocity" (as determined by the rotation between the client's camera view direction and the forward-axis of the vehicle) to compute the "final angular velocity". That is, suppose you set the angular motor to <0, 0, 5>, then moved the camera view to be PI/4 radians to the left of the vehicle's forward axis, and down PI/8 toward the ground. The measured angular velocity would be <0, -PI/8, PI/4> radians/second, but the final velocity would be <0, 0, 5*PI/4>... the vehicle will turn left, but will not dip its nose down. Thus, by setting a component of the VEHICLE_ANGULAR_MOTOR_DIRECTION to zero, one can negate the pitch or yaw response of the motor, or even scale one to be much more responsive than the other.

The VEHICLE_ANGULAR_MOTOR_TIMESCALE still has an effect when using mouselook control, and scales the global responsiveness of the angular motor. The VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, on the other hand, is ignored when using mouselook controls.


11.10. The Vertical Attractor

Some vehicles, like boats, should always keep their up-side up. This can be done by enabling the "vertical attractor" behavior that springs the vehicle's local z-axis to the world z-axis (a.k.a. "up"). To take advantage of this feature you would set the VEHICLE_VERTICAL_ATTRACTION_TIMESCALE to control the period of the spring frequency, and then set the VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY to control the damping. An efficiency of 0.0 will cause the spring to wobble around its equilibrium, while an efficiency of 1.0 will cause the spring to reach it's equilibrium with exponential decay.


llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 4.0);
llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.5);
	

The vertical attractor is disabled by setting its timescale to anything larger than 300 seconds.

Note that by default the vertical attractor will prevent the vehicle from diving and climbing. So, if you wanted to make a airplane you would probably want to unlock the attractor around the pitch axis by setting the VEHICLE_FLAG_LIMIT_ROLL_ONLY bit:

llSetVehicleFlags(VEHICLE_FLAG_LIMIT_ROLL_ONLY);
	


11.11. Banking

The vertical attractor feature must be enabled in order for the banking behavior to function. The way banking works is this: a rotation around the vehicle's roll-axis will produce a angular velocity around the yaw-axis, causing the vehicle to turn. The magnitude of the yaw effect will be proportional to the VEHICLE_BANKING_EFFICIENCY, the angle of the roll rotation, and sometimes the vehicle's velocity along it's preferred axis of motion.

The VEHICLE_BANKING_EFFICIENCY can vary between -1 and +1. When it's positive then any positive rotation (by the right-hand rule) about the roll-axis will effect a (negative) torque around the yaw-axis, making it turn to the right -- that is the vehicle will lean into the turn, which is how real airplanes and motorcycle's work. Negating the banking coefficient will make it so that the vehicle leans to the outside of the turn (not very "physical" but might allow interesting vehicles so why not?).

The VEHICLE_BANKING_MIX is a fake (i.e. non-physical) parameter that is useful for making banking vehicles do what you want rather than what the laws of physics allow. For example, consider a real motorcycle... it must be moving forward in order for it to turn while banking, however video-game motorcycles are often configured to turn in place when at a dead stop -- because they're often easier to control that way using the limited interface of the keyboard or game controller. The VEHICLE_BANKING_MIX enables combinations of both realistic and non-realistic banking by functioning as a slider between a banking that is correspondingly totally static (0.0) and totally dynamic (1.0). By "static" we mean that the banking effect depends only on the vehicle's rotation about it's roll-axis compared to "dynamic" where the banking is also proportional to it's velocity along it's roll-axis. Finding the best value of the "mixture" will probably require trial and error.

The time it takes for the banking behavior to defeat a pre-existing angular velocity about the world z-axis is determined by the VEHICLE_BANKING_TIMESCALE. So if you want the vehicle to bank quickly then give it a banking timescale of about a second or less, otherwise you can make a sluggish vehicle by giving it a timescale of several seconds.


11.12. Friction Timescales

VEHICLE_LINEAR_FRICTION_TIMESCALE is a vector parameter that defines the timescales for the vehicle to come to a complete stop along the three local axes of the vehicle's reference frame. The timescale along each axis is independent of the others. For example, a sliding ground car would probably have very little friction along its x- and z-axes (so it can easily slide forward and fall down) while there would usually significant friction along its y-axis:

llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <1000, 1000, 3>);
	

Remember that a longer timescale corresponds to a weaker friction, hence to effectively disable all linear friction you would set all of the timescales to large values.

Setting the linear friction as a scalar is allowed, and has the effect of setting all of the timescales to the same value. Both code snippets below are equivalent, and both make friction negligible:

// set all linear friction timescales to 1000
llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <1000, 1000, 1000>);
	

// same as above, but fewer characters
llSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, 1000);
	

VEHICLE_ANGULAR_FRICTION_TIMESCALE is also a vector parameter that defines the timescales for the vehicle to stop rotating about the x-, y-, and z-axes, and are set and disabled in the same way as the linear friction.


11.13. Buoyancy

The vehicle has a built-in buoyancy feature that is independent of the llSetBuoyancy call. It is recommended that the two buoyancies do not mix! To make a vehicle buoyant, set the VEHICLE_BUOYANCY parameter to something between -1.0 (extra gravity) to 1.0 (full anti-gravity).

The buoyancy behavior is independent of hover, however in order for hover to work without a large offset of the VEHICLE_HOVER_HEIGHT, the VEHICLE_BUOYANCY should be set to 1.0.

It is not recommended that you mix vehicle buoyancy with the llSetBuoyancy script call. It would probably cause the object to fly up into space.


11.14. Hover

The hover behavior is enabled by setting the VEHICLE_HOVER_TIMESCALE to a value less than 300 seconds; larger timescales totally disable it. Most vehicles will work best with short hover timescales of a few seconds or less. The shorter the timescale, the faster the vehicle will slave to is target height. Note, that if the values of VEHICLE_LINEAR_FRICTION_TIMESCALE may affect the speed of the hover.

Hover is independent of buoyancy, however the VEHICLE_BUOYANCY should be set to 1.0, otherwise the vehicle will not lift itself off of the ground until the VEHICLE_HOVER_HEIGHT is made large enough to counter the acceleration of gravity, and the vehicle will never float all the way to its target height.

The VEHICLE_HOVER_EFFICIENCY can be thought of as a slider between bouncy (0.0) and smoothed (1.0). When in the bouncy range the vehicle will tend to hover a little lower than its target height and the VEHICLE_HOVER_TIMESCALE will be approximately the oscillation period of the bounce (the real period will tend to be a little longer than the timescale).

For performance reasons, until improvements are made to the Second Life physics engine the vehicles can only hover over the terrain and water, so they will not be able to hover above objects made out of primitives, such as bridges and houses. By default the hover behavior will float over terrain and water, however this can be changed by setting some flags:

If you wanted to make a boat you should set the VEHICLE_HOVER_WATER_ONLY flag, or if you wanted to drive a hover tank under water you would use the VEHICLE_HOVER_TERRAIN_ONLY flag instead. Finally, if you wanted to make a submarine or a balloon you would use the VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT. Note that the flags are independent of each other and that setting two contradictory flags will have undefined behavior. The flags are set using the script call llSetVehicleFlags().

The VEHICLE_HOVER_HEIGHT determines how high the vehicle will hover over the terrain and/or water, or the global height, and has a maximum value of 100 meters. Note that for hovering purposes the "center" of the vehicle is its "center of mass" which is not always obvious to the untrained eye, and it changes when avatar's sit on the vehicle.


11.15. Reference Frame

The vehicle relies on the x- (at), y- (left), and z- (up) axes in order to figure out which way it prefers to move and which end is up. By default these axes are identical to the local axes of the root primitive of the object, however this means that the vehicle's root primitive must, by default, be oriented to agree with the designed at, left, and up axes of the vehicle. But, what if the vehicle object was already pre-built with the root primitive in some non-trivial orientation relative to where the vehicle as a whole should move? This is where the VEHICLE_REFERENCE_FRAME parameter becomes useful; the vehicle's axes can be arbitrarily reoriented by setting this parameter.

As an example, suppose you had built a rocket out of a big cylinder, a cone for the nose, and some stretched cut boxes for the fins, then linked them all together with the cylinder as the root primitive. Ideally the rocket would move nose-first, however the cylinder's axis of symmetry is its local z-axis while the default "at-axis" of the vehicle, the axis it will want to deflect to forward under angular deflection, is the local x-axis and points out from the curved surface of the cylinder. The script code below will rotate the vehicle's axes such that the local z-axis becomes the "at-axis" and the local negative x-axis becomes the "up-axis":


// rotate the vehicle frame -PI/2 about the local y-axis (left-axis)
rotation rot = llEuler2Rot(<0, PI/2, 0>);
llSetVehicleRotationParam(VEHICLE_REFERENCE_FRAME, rot);

Another example of how the reference frame parameter could be used is to consider flying craft that uses the vertical attractor for stability during flying but wants to use VTOL (vertical takeoff and landing). During flight the craft's dorsal axis should point up, but during landing its nose-axis should be up. To land the vehicle: while the vertical attractor is in effect, rotate the existing VEHICLE_REFERENCE_FRAME by +PI/2 about the left-axis, then the vehicle will pitch up such that it's nose points toward the sky. The vehicle could be allowed to fall to the landing pad under friction, or a decreasing hover effect.


C.24. Vehicle Parameters

Parameters

VEHICLE_LINEAR_FRICTION_TIMESCALE

A vector of timescales for exponential decay of the vehicle's linear velocity along its preferred axes of motion (at, left, up). Range = [0.07, inf) seconds for each element of the vector.

VEHICLE_ANGULAR_FRICTION_TIMESCALE

A vector of timescales for exponential decay of the vehicle's angular velocity about its preferred axes of motion (at, left, up). Range = [0.07, inf) seconds for each element of the vector.

VEHICLE_LINEAR_MOTOR_DIRECTION

The direction and magnitude (in preferred frame) of the vehicle's linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. Range of magnitude = [0, 30] meters/second.

VEHICLE_LINEAR_MOTOR_OFFSET

The offset point from the vehicle's center of mass at which the linear motor's impulse is applied. This allows the linear motor to also cause rotational torque. Range of magnitude = [0, 100] meters.

VEHICLE_LINEAR_MOTOR_TIMESCALE

The timescale for exponential approach to full linear motor velocity.

VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE

The timescale for exponential decay of the linear motor's magnitude.

VEHICLE_ANGULAR_MOTOR_DIRECTION

The direction and magnitude (in preferred frame) of the vehicle's angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor.

VEHICLE_ANGULAR_MOTOR_TIMESCALE

The timescale for exponential approach to full angular motor velocity.

VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE

The timescale for exponential decay of the angular motor's magnitude.

VEHICLE_HOVER_HEIGHT

The height (above the terrain or water, or global) at which the vehicle will try to hover.

VEHICLE_HOVER_EFFICIENCY

A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior.

VEHICLE_HOVER_TIMESCALE

The period of bounce (or timescale of exponential approach, depending on the hover efficiency) for the vehicle to hover to the proper height.

VEHICLE_BUOYANCY

A slider between minimum (0.0) and maximum anti-gravity (1.0).

VEHICLE_LINEAR_DEFLECTION_EFFICIENCY

A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, it's a simple scalar for modulating the strength of linear deflection.

VEHICLE_LINEAR_DEFLECTION_TIMESCALE

The timescale for exponential success of linear deflection. It is another way to specify how much time it takes for the vehicle's linear velocity to be redirected to it's preferred axis of motion.

VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY

A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, it's a simple scalar for modulating the strength of angular deflection such that the vehicle's preferred axis of motion points toward it's real velocity.

VEHICLE_ANGULAR_DEFLECTION_TIMESCALE

The timescale for exponential success of angular deflection. It's another way to specify the strength of the vehicle's tendency to reorient itself so that it's preferred axis of motion agrees with it's true velocity.

VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY

A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright.

VEHICLE_VERTICAL_ATTRACTION_TIMESCALE

The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that it's preferred "up" axis is oriented along the world's "up" axis.

VEHICLE_BANKING_EFFICIENCY

A slider between anti (-1.0), none (0.0), and maximum (1.0) banking strength.

VEHICLE_BANKING_MIX

A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicle's linear speed.

VEHICLE_BANKING_TIMESCALE

The timescale for banking to exponentially approach it's maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing.

VEHICLE_REFERENCE_FRAME

A rotation of the vehicle's preferred axes of motion and orientation (at, left, up) with respect to the vehicle's local frame (x, y, z).


C.25. Vehicle Flags

Flags

VEHICLE_FLAG_NO_DEFLECTION_UP

This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky.

VEHICLE_FLAG_LIMIT_ROLL_ONLY

For vehicles with vertical attractor that want to be able to climb/dive, for instance, airplanes that want to use the banking feature.

VEHICLE_FLAG_HOVER_WATER_ONLY

Ignore terrain height when hovering.

VEHICLE_FLAG_HOVER_TERRAIN_ONLY

Ignore water height when hovering.

VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT

Hover at global height instead of height above ground or water.

VEHICLE_FLAG_HOVER_UP_ONLY

Hover doesn't push down. Use this flag for hovering vehicles that should be able to jump above their hover height.

VEHICLE_FLAG_LIMIT_MOTOR_UP

Prevents ground vehicles from motoring into the sky. This flag has a subtle effect when used with conjunction with banking: the strength of the banking will decay when the vehicle no longer experiences collisions. The decay timescale is the same as VEHICLE_BANKING_TIMESCALE . This is to help prevent ground vehicles from steering when they are in mid jump.

VEHICLE_FLAG_MOUSELOOK_STEER

Steer the vehicle using the mouse. Use this flag to make the angular motor try to make the vehicle turn such that its local x-axis points in the same direction as the client-side camera.

VEHICLE_FLAG_MOUSELOOK_BANK

Same as above, but relies on banking. It remaps left-right motions of the client camera (also known as "yaw") to rotations about the vehicle's local x-axis.

VEHICLE_FLAG_CAMERA_DECOUPLED

Makes mouselook camera rotate independently of the vehicle. By default the client mouselook camera will rotate about with the vehicle, however when this flag is set the camera direction is independent of the vehicle's rotation.


C.26. Vehicle Types

Types

VEHICLE_TYPE_SLED

Simple vehicle that bumps along the ground, and likes to move along it's local x-axis.

// most friction for left-right, least for up-down
llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <30, 1, 1000> );

// no angular friction
llSetVehicleVectorParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1000, 1000, 1000> );

// no linear motor
llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1000 );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 120 );

// no angular motor
llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1000 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 120 );

// no hover (but with timescale of 10 sec if enabled)
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 );
llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 10 );
llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 10 );
llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 );

// maximum linear deflection with timescale of 1 second
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1 );
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 1 );

// no angular deflection 
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 10 );

// no vertical attractor (doesn't mind flipping over)
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 );
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1000 );

// no banking
llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 1 );
llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 10 );

// default rotation of local frame
llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );

// remove these flags 
llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_WATER_ONLY 
                      | VEHICLE_FLAG_HOVER_TERRAIN_ONLY 
                      | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT 
                      | VEHICLE_FLAG_HOVER_UP_ONLY );

// set these flags (the limit_roll flag will have no effect
// until banking is enabled, if ever)
llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP 
                   | VEHICLE_FLAG_LIMIT_ROLL_ONLY
                   | VEHICLE_FLAG_LIMIT_MOTOR_UP );
        

VEHICLE_TYPE_CAR

Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.


// most friction for left-right, least for up-down
llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <100, 2, 1000> );
        
// no angular friction
llSetVehicleVectorParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1000, 1000, 1000> );

// linear motor wins after about a second, decays after about a minute
llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1 );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 );

// angular motor wins after a second, decays in less time than that
llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.8 );

// no hover 
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 );
llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 );
llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 );

// maximum linear deflection with timescale of 2 seconds
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1 );
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 2 );

// no angular deflection 
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 10 );
        
// critically damped vertical attractor
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 );
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 10 );

// weak negative critically damped banking
llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, -0.2 );
llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 1 );
llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 1 );

// default rotation of local frame
llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );

// remove these flags 
llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_WATER_ONLY 
                      | VEHICLE_FLAG_HOVER_TERRAIN_ONLY 
                      | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT);

// set these flags 
llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP 
                   | VEHICLE_FLAG_LIMIT_ROLL_ONLY 
                   | VEHICLE_FLAG_HOVER_UP_ONLY
                   | VEHICLE_FLAG_LIMIT_MOTOR_UP );
        

VEHICLE_TYPE_BOAT

Hovers over water with lots of friction and some angular deflection.


// least for forward-back, most friction for up-down
llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <10, 3, 2> );
        
// uniform angular friction (setting it as a scalar rather than a vector)
llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 10 );

// linear motor wins after about five seconds, decays after about a minute
llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 5 );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 );

// angular motor wins after four seconds, decays in same amount of time
llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 4 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 4 );

// hover 
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 );
llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.5 );
llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 2.0 );
llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1 );

// halfway linear deflection with timescale of 3 seconds
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.5 );
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 3 );

// angular deflection 
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.5 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 5 );
        
// somewhat bouncy vertical attractor 
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.5 );
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 5 );

// weak negative damped banking
llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, -0.3 );
llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.8 );
llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 1 );

// default rotation of local frame
llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );

// remove these flags 
llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_TERRAIN_ONLY 
                      | VEHICLE_FLAG_LIMIT_ROLL_ONLY 
                      | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT);

// set these flags 
llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP 
                   | VEHICLE_FLAG_HOVER_WATER_ONLY 
                   | VEHICLE_FLAG_HOVER_UP_ONLY 
                   | VEHICLE_FLAG_LIMIT_MOTOR_UP );
        

VEHICLE_TYPE_AIRPLANE

Uses linear deflection for lift, no hover, and banking to turn.

// very little friction along forward-back axis
llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <200, 10, 5> );
        
// uniform angular friction
llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 20 );

// linear motor
llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 2 );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 );

// angular motor
llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 4 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 8 );

// no hover 
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 );
llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.5 );
llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 );
llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 );

// linear deflection 
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.5 );
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.5 );

// angular deflection 
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 1.0 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 2.0 );
        
// vertical attractor
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.9 );
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 2 );

// banking
llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 1 );
llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.7 );
llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 2 );

// default rotation of local frame
llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );

// remove these flags 
llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP 
                      | VEHICLE_FLAG_HOVER_WATER_ONLY 
                      | VEHICLE_FLAG_HOVER_TERRAIN_ONLY 
                      | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT 
                      | VEHICLE_FLAG_HOVER_UP_ONLY
                      | VEHICLE_FLAG_LIMIT_MOTOR_UP );

// set these flags 
llSetVehicleFlags( VEHICLE_FLAG_LIMIT_ROLL_ONLY );
        

VEHICLE_TYPE_BALLOON

Hover, and friction, but no deflection.


// uniform linear friction
llSetVehicleFloatParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, 5 );
        
// uniform angular friction
llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 10 );

// linear motor
llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 5 );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 );

// angular motor
llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 6 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 10 );

// hover 
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 5 );
llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.8 );
llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 10 );
llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1 );

// no linear deflection 
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 5 );

// no angular deflection 
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 5 );
        
// no vertical attractor 
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 );
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1000 );

// no banking
llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.7 );
llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 5 );

// default rotation of local frame
llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );

// remove all flags 
llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP 
                      | VEHICLE_FLAG_HOVER_WATER_ONLY 
                      | VEHICLE_FLAG_LIMIT_ROLL_ONLY 
                      | VEHICLE_FLAG_HOVER_TERRAIN_ONLY 
                      | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT 
                      | VEHICLE_FLAG_HOVER_UP_ONLY 
                      | VEHICLE_FLAG_LIMIT_MOTOR_UP );
        

There are 4 comments on this page. [Display comments/form]