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

LSL Wiki : LibraryBarometer

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl805.us.archive.org

Barometer


This script will calculate air pressure at the objects vector plus offset.

// llAirPressure(vector v) Script
// Created by: Cid Jacobs 
// Original by: Cid Jacobs
// Last Updated: 11-17-05
// Notes: Speak with Cid Jacobs about any concerns.
//
//
//--------------------Globals
//Global Memory Storage For Calibration Offset
float Calibration = 101.32500;
//Global Memory Storage For User Definable Vector Offset
vector Offset = <0,0,10>;
//
//
//--------------------User Defined Function
float llAirPressure(vector Offset)
{
    //Extrapolate Task's Local Coordinates
    vector Position = llGetPos();
    //Calculate And Calibrate Air Pressure
    float Base_Reading = llLog10(5- (((Position.z - llWater(ZERO_VECTOR)) + Offset.z)/15500));
    //Total Sum Air Pressure
    float KiloPascal = (Calibration + Base_Reading);
    return KiloPascal;
}
//
//
//--------------------States
//Mandatory Default State
default
{
    //Triggered By The Start Of Agent Clicking
    touch_start(integer num_detected)
    {
        //Say Current Total Air Pressure at Task + V
        llSay(0,"Current air pressure is: "
        + 
        (string)llAirPressure(Offset)
        +
        " KiloPascal.");
    }
}
Comments [Hide comments/form]
Air pressure???

Does the Havok Physics engine take that into account on moving objects?

My reading of the way air behaves in Second Life is that air is frictionless and weightless medium (although wind does have some effect on flexible objects, but that behaviour seems not to depend on altitude, at least that effect is nowhere documented).
-- a82-93-140-232.adsl.xs4all.nl (2007-10-04 04:56:45)
Attach a comment to this page: