11.07.2015 Views

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 11. VehiclesSetting the linear friction as a scalar is allowed, and has the effect of setting all of the timescales to the samevalue. Both code snippets below are equivalent, and both make friction negligible:// set all linear friction timescales to 1000llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, );// same as above, but fewer charactersllSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, 1000);VEHICLE_ANGULAR_FRICTION_TIMESCALE is also a vector parameter that defines the timescales for thevehicle to stop rotating about the x-, y-, and z-axes, and are set and disabled in the same way as the linear friction.11.11. BuoyancyThe vehicle has a built-in buoyancy feature that is independent of the llSetBuoyancy call. It is recommended thatthe two buoyancies do not mix! To make a vehicle buoyant, set the VEHICLE_BUOYANCY parameter tosomething between 0.0 (no buoyancy whatsoever) 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 theVEHICLE_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 probablycause the object to fly up into space.11.12. HoverThe hover behavior is enabled by setting the VEHICLE_HOVER_TIMESCALE to a value less than 300seconds; larger timescales totally disable it. Most vehicles will work best with short hover timescales of a fewseconds or less. The shorter the timescale, the faster the vehicle will slave to is target height. Note, that if thevalues 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 thevehicle will not lift itself off of the ground until the VEHICLE_HOVER_HEIGHT is made large enough tocounter 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 theVEHICLE_HOVER_TIMESCALE will be approximately the oscillation period of the bounce (the real periodwill tend to be a little longer than the timescale).33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!