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

LSL Wiki : Vehicles

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ec2-54-89-1-216.compute-1.amazonaws.com

Vehicles


These functions, when applied to any ordinary object, imbue it with special powers, allowing you to create versatile vehicles with physics that can slide, hover, fly, and float or dive.

Unlike the rest of the official LSL guide, the vehicles section is quite good. See the original LindenVehicleTutorial or the newer Wiki'fied version Vehicle Tutorial.

Some of the behaviors you can set include:

Note: Vehicles can only be 32 prims maximum (each passenger will count as 1 prim), and never attachments. While a vehicle must be physical to function, non-physical flexible prims can be used in non-root positions on the vehicle.

Functions

llSetVehicleType define type of vehicle
llSetVehicleFlags set vehicle flags
llRemoveVehicleFlags remove vehicle flags
llSetVehicleFloatParam set vehicle parameters of type float
llSetVehicleVectorParam set vehicle parameters of type vector
llSetVehicleRotationParam set vehicle parameters of type rotation

Note: The camera and llSitTarget functions may be useful for vehicles as well.


Constants

(use the matching llSetVehicle<Type>Param function from the table above)

Constant Value Type Description
VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY 32 float slider between 0 (no deflection) and 1 (maximum strength)
VEHICLE_ANGULAR_DEFLECTION_TIMESCALE 33 float exponential timescale for the vehicle to achieve full angular deflection
VEHICLE_ANGULAR_FRICTION_TIMESCALE 17 vector vector of timescales for exponential decay of angular velocity about the three vehicle axes
VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE 35 float exponential timescale for the angular motor's effectiveness to decay toward zero
VEHICLE_ANGULAR_MOTOR_DIRECTION 19 vector angular velocity that the vehicle will try to achieve
VEHICLE_ANGULAR_MOTOR_TIMESCALE 34 float exponential timescale for the vehicle to achive its full angular motor velocity
VEHICLE_BANKING_EFFICIENCY 38 float slider between -1 (leans out of turns), 0 (no banking), and +1 (leans into turns)
VEHICLE_BANKING_MIX 39 float slider between 0 (static banking) and 1 (dynamic banking)
VEHICLE_BANKING_TIMESCALE 40 float exponential timescale for the banking behavior to take full effect
VEHICLE_BUOYANCY 27 float slider between -1 (double-gravity) and 1 (full anti-gravity)
VEHICLE_HOVER_HEIGHT 24 float height the vehicle will try to hover (*1)
VEHICLE_HOVER_EFFICIENCY 25 float slider between 0 (bouncy) and 1 (critically damped) hover behavior
VEHICLE_HOVER_TIMESCALE 26 float period of time for the vehicle to achieve its hover height
VEHICLE_LINEAR_DEFLECTION_EFFICIENCY 28 float slider between 0 (no deflection) and 1 (maximum strength)
VEHICLE_LINEAR_DEFLECTION_TIMESCALE 29 float exponential timescale for the vehicle to redirect its velocity to be along its x-axis
VEHICLE_LINEAR_FRICTION_TIMESCALE 16 vector vector of timescales for exponential decay of linear velocity along the three vehicle axes
VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE 31 float exponential timescale for the linear motor's effectiveness to decay toward zero
VEHICLE_LINEAR_MOTOR_DIRECTION 18 vector linear velocity that the vehicle will try to achieve
VEHICLE_LINEAR_MOTOR_TIMESCALE 30 float exponential timescale for the vehicle to achive its full linear motor velocity
VEHICLE_LINEAR_MOTOR_OFFSET 20 vector offset from the center of mass of the vehicle where the linear motor is applied (new in 1.6)
VEHICLE_REFERENCE_FRAME 44 rotation rotation of vehicle axes relative to local frame
VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY 36 float slider between 0 (bouncy) and 1 (critically damped) attraction of vehicle z-axis to world z-axis (vertical)
VEHICLE_VERTICAL_ATTRACTION_TIMESCALE 37 float exponential timescale for the vehicle to align its z-axis to the world z-axis (vertical)


(*1) - The height value is interpreted ground-relative, water-relative or global-position-based according to the hover-related flags (see llSetVehicleFlags). A height larger than 100m seems interpreted as 100. (so when something should be able to go inland, which can easily be 40m up, over 100m in mountain areas, try not to use global height.) Values of 0.0 and below give no response. Very small values like 0.001 do, but objects don't seem to go lower than 2m.

Quick Copy & Paste Vehicle Params

llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.0);  // Between 0 (no deflection) and 1 (maximum strength)
llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 0.0); // Time for vehicle to achieve full angular deflection
llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, ZERO_VECTOR); // Time for exponential decay angular velocity about the three vehicle axes
llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.0); // Time for angular motor's effectiveness to decay toward zero
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, ZERO_VECTOR); // Angular velocity that vehicle will try to achieve
llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 0.0); // Times for vehicle to achive full angular motor velocity
llSetVehicleFloatParam(VEHICLE_BANKING_EFFICIENCY, 0.0); // Between -1 (leans out of turns), 0 (no banking), and +1 (leans into turns)
llSetVehicleFloatParam(VEHICLE_BANKING_MIX, 0.0); // Betwen 0 (static banking) and 1 (dynamic banking)
llSetVehicleFloatParam(VEHICLE_BANKING_TIMESCALE, 0.0); // Time for banking behavior to take full effect
llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.0); // Between 0 (no anti-gravity) and 1 (full anti-gravity)
llSetVehicleFloatParam(VEHICLE_HOVER_HEIGHT, 0.0); // Height vehicle will try to hover
llSetVehicleFloatParam(VEHICLE_HOVER_EFFICIENCY, 0.0); // Between 0 (bouncy) and 1 (critically damped) hover behavior
llSetVehicleFloatParam(VEHICLE_HOVER_TIMESCALE, 0.0); // Period of time vehicle will achieve its hover height
llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.0); // Slider between 0 (no deflection) and 1 (maximum strength)
llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.0); // Time for vehicle to redirect velocity to be along x-axis
llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, ZERO_VECTOR); // Time for decay of linear velocity along three vehicle axes
llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 0.0); // Time for linear motor's effectiveness decay toward zero
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_OFFSET,ZERO_VECTOR); // Offset from the center of mass of the vehicle where the linear motor is applied (new in 1.6) 
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, ZERO_VECTOR); // Linear velocity vehicle will try to achieve
llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 0.0); // Time for vehicle to achive full linear motor velocity
llSetVehicleRotationParam(VEHICLE_REFERENCE_FRAME, ZERO_ROTATION); // Rotation of vehicle axes relative to local frame
llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.0); // Between 0 (bouncy) and 1 (critically damped) attraction of vehicle z-axis to world (vertical)
llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 0.0); // Time for vehicle to align z-axis to world z-axis (vertical)

Functions | Constants
There are 6 comments on this page. [Display comments/form]