Difference between revisions of "FastConeSpread"

From Second Life Wiki
Jump to navigation Jump to search
(New page: <lsl> // 2008, Nexii Malthus // Licensed under the Creative Commons Attribution-Share Alike 3.0 License float Spread = 15.0; default{ state_entry(){ Spread *= DEG_TO_RAD; ...)
 
Line 1: Line 1:
{{LSL Header}}
<lsl>
<lsl>
// 2008, Nexii Malthus
// 2008, Nexii Malthus
// Licensed under the Creative Commons Attribution-Share Alike 3.0 License
// Licensed under the Creative Commons Attribution-Share Alike 3.0 License
// http://creativecommons.org/licenses/by-sa/3.0/


float Spread = 15.0;
float Spread = 15.0;

Revision as of 02:19, 6 May 2009

<lsl> // 2008, Nexii Malthus // Licensed under the Creative Commons Attribution-Share Alike 3.0 License // http://creativecommons.org/licenses/by-sa/3.0/

float Spread = 15.0;

default{

   state_entry(){
       Spread *= DEG_TO_RAD;
   }
   
   touch_start( integer d ){
       float x = (llFrand(1)-0.5)*PI;
       float y = (llFrand(1)-0.5)*Spread;
       
       rotation rSpread = <0,llSin(y),0,llCos(y)> * <llSin(x),0,0,llCos(x)>;
       llSetRot( rSpread );
   }

} </lsl>