Wind On Physical Object

Written by: Headmaster
// Wind affects avatar clothing/hair, trees, and can affect particles and flexible prims.
// Wind "naturally" (programatically) varies in velocity and direction.
// Wind does not cause friction. (from the wiki)
//
// This script takes the vector returned by llWind, which represents the
// speed and direction of the wind at the current position (it doesnt' use any
// offset hence 'ZERO_VECTOR'),
// and applys an impulse to the object to match it, simulating the impulse that
// would be applied by the wind.
//
// It doesnt really work well unless youre object is small/light enough to be actually
// moved by the impulse. Otherwise it tends to just sit there and vibrate.
//
// Of course the '/35' is the result of my own experimentation, you will probably
// want to play with this value until it suits your own object.
 
default
{
 
        state_entry()
        {
                llApplyImpulse(llWind(ZERO_VECTOR)/35,TRUE);
                llResetScript();
        }
 
}

 

Category: