Difference between revisions of "Neurocam Particle Engine"

From Second Life Wiki
Jump to navigation Jump to search
(New page: <lsl> //Written By Draconis Neurocam //You are free: // * to Share — to copy, distribute and transmit the work // * to Remix — to adapt the work //Under the following condit...)
 
m (Cosmetic. unified style, slight cleanup + added whitespaces for better readability)
Line 25: Line 25:




float burst_radius=1.0;
float burst_radius = 1.0;
float angle_begin=PI_BY_TWO;
float angle_begin = PI_BY_TWO;
float angle_end=PI_BY_TWO;
float angle_end   = PI_BY_TWO;
key target="";
key   target       = "";


vector start_color= <.5,0,1>;
vector start_color = <0.5,0,1>;
vector end_color= <0,0,0>;
vector end_color   = <0,0,0>;
float start_alpha=1.0;
float   start_alpha = 1.0;
float end_alpha=.1;
float   end_alpha   = 0.1;
vector start_scale=<.5,.5,.5>;
vector start_scale = <0.5,0.5,0.5>;
vector end_scale=<1,1,1>;
vector end_scale   = <1,1,1>;
key texture="dcab6cc4-172f-e30d-b1d0-f558446f20d4";
key     texture     = "dcab6cc4-172f-e30d-b1d0-f558446f20d4";


float source_max_age=0.0;
float   source_max_age       = 0.0;
float particle_max_age=2.0;
float   particle_max_age     = 2.0;
float burst_rate=.02;
float   burst_rate           = 0.02;
integer burst_particle_count=2;
integer burst_particle_count = 2;


vector acceleration=<0,1,1>;
vector acceleration = <0,1,1>;
vector omega=<2,0,0>;
vector omega       = <2,0,0>;
float speed_min=1.0;
float   speed_min   = 1.0;
float speed_max=1.0;
float   speed_max   = 1.0;


Particles()
Particles()
Line 54: Line 54:
         //System Behaviour
         //System Behaviour
         PSYS_PART_FLAGS,  
         PSYS_PART_FLAGS,  
                         //PSYS_PART_BOUNCE_MASK
                         //PSYS_PART_BOUNCE_MASK  
                         PSYS_PART_EMISSIVE_MASK
                         PSYS_PART_EMISSIVE_MASK  
                         //|PSYS_PART_FOLLOW_SRC_MASK
                         //| PSYS_PART_FOLLOW_SRC_MASK  
                         |PSYS_PART_FOLLOW_VELOCITY_MASK
                         | PSYS_PART_FOLLOW_VELOCITY_MASK  
                         |PSYS_PART_INTERP_COLOR_MASK
                         | PSYS_PART_INTERP_COLOR_MASK  
                         |PSYS_PART_INTERP_SCALE_MASK
                         | PSYS_PART_INTERP_SCALE_MASK  
                         //|PSYS_PART_TARGET_LINEAR_MASK
                         //| PSYS_PART_TARGET_LINEAR_MASK  
                         //|PSYS_PART_TARGET_POS_MASK
                         //| PSYS_PART_TARGET_POS_MASK  
                         //|PSYS_PART_WIND_MASK
                         //| PSYS_PART_WIND_MASK
                         ,
                         ,
                          
                          
Line 74: Line 74:
                         ,
                         ,
                          
                          
         PSYS_SRC_BURST_RADIUS,burst_radius,
         PSYS_SRC_BURST_RADIUS, burst_radius,
         PSYS_SRC_ANGLE_BEGIN,angle_begin,
         PSYS_SRC_ANGLE_BEGIN, angle_begin,
         PSYS_SRC_ANGLE_END,angle_end,
         PSYS_SRC_ANGLE_END,   angle_end,
         PSYS_SRC_TARGET_KEY,target,
         PSYS_SRC_TARGET_KEY,   target,
          
          
         //Particle appearance
         //Particle appearance
         PSYS_PART_START_COLOR,start_color,
         PSYS_PART_START_COLOR, start_color,
         PSYS_PART_END_COLOR, end_color,
         PSYS_PART_END_COLOR,   end_color,
         PSYS_PART_START_ALPHA, start_alpha,
         PSYS_PART_START_ALPHA, start_alpha,
         PSYS_PART_END_ALPHA, end_alpha,
         PSYS_PART_END_ALPHA,   end_alpha,
         PSYS_PART_START_SCALE, start_scale,
         PSYS_PART_START_SCALE, start_scale,
         PSYS_PART_END_SCALE, end_scale,
         PSYS_PART_END_SCALE,   end_scale,
         PSYS_SRC_TEXTURE,texture,
         PSYS_SRC_TEXTURE,     texture,
          
          
         //Particle Flow
         //Particle Flow
         PSYS_SRC_MAX_AGE,source_max_age,
         PSYS_SRC_MAX_AGE,         source_max_age,
         PSYS_PART_MAX_AGE,particle_max_age,
         PSYS_PART_MAX_AGE,         particle_max_age,
         PSYS_SRC_BURST_RATE,burst_rate,
         PSYS_SRC_BURST_RATE,       burst_rate,
         PSYS_SRC_BURST_PART_COUNT,burst_particle_count,  
         PSYS_SRC_BURST_PART_COUNT, burst_particle_count,  
          
          
         //Particle Motion
         //Particle Motion
         PSYS_SRC_ACCEL,acceleration,
         PSYS_SRC_ACCEL,           acceleration,
         PSYS_SRC_OMEGA,omega,
         PSYS_SRC_OMEGA,           omega,
         PSYS_SRC_BURST_SPEED_MIN,speed_min,
         PSYS_SRC_BURST_SPEED_MIN, speed_min,
         PSYS_SRC_BURST_SPEED_MAX,speed_max
         PSYS_SRC_BURST_SPEED_MAX, speed_max
          
          
         ]);
         ]);

Revision as of 08:06, 25 February 2009

<lsl> //Written By Draconis Neurocam

//You are free:

// * to Share — to copy, distribute and transmit the work // * to Remix — to adapt the work


//Under the following conditions:

// *

// Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

// Attribute this work: // What does "Attribute this work" mean? // The page you came from contained embedded licensing metadata, including how the creator wishes to be attributed for re-use. You can use the HTML here to cite the work. Doing so will also include metadata on your page so that others can find the original work as well.

// * For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. // * Any of the above conditions can be waived if you get permission from the copyright holder. // * Nothing in this license impairs or restricts the author's moral rights. //http://creativecommons.org/licenses/by/3.0/


float burst_radius = 1.0; float angle_begin = PI_BY_TWO; float angle_end = PI_BY_TWO; key target = "";

vector start_color = <0.5,0,1>; vector end_color = <0,0,0>; float start_alpha = 1.0; float end_alpha = 0.1; vector start_scale = <0.5,0.5,0.5>; vector end_scale = <1,1,1>; key texture = "dcab6cc4-172f-e30d-b1d0-f558446f20d4";

float source_max_age = 0.0; float particle_max_age = 2.0; float burst_rate = 0.02; integer burst_particle_count = 2;

vector acceleration = <0,1,1>; vector omega = <2,0,0>; float speed_min = 1.0; float speed_max = 1.0;

Particles() {

   llParticleSystem([
       //System Behaviour
       PSYS_PART_FLAGS, 
                        //PSYS_PART_BOUNCE_MASK 
                        PSYS_PART_EMISSIVE_MASK 
                        //| PSYS_PART_FOLLOW_SRC_MASK 
                        | PSYS_PART_FOLLOW_VELOCITY_MASK 
                        | PSYS_PART_INTERP_COLOR_MASK 
                        | PSYS_PART_INTERP_SCALE_MASK 
                        //| PSYS_PART_TARGET_LINEAR_MASK 
                        //| PSYS_PART_TARGET_POS_MASK 
                        //| PSYS_PART_WIND_MASK
                        ,
                        
       //System Presentation
       PSYS_SRC_PATTERN,
                       //PSYS_SRC_PATTERN_ANGLE
                       //PSYS_SRC_PATTERN_ANGLE_CONE
                       //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
                       PSYS_SRC_PATTERN_DROP
                       //PSYS_SRC_PATTERN_EXPLODE
                       ,
                       
       PSYS_SRC_BURST_RADIUS, burst_radius,
       PSYS_SRC_ANGLE_BEGIN,  angle_begin,
       PSYS_SRC_ANGLE_END,    angle_end,
       PSYS_SRC_TARGET_KEY,   target,
       
       //Particle appearance
       PSYS_PART_START_COLOR, start_color,
       PSYS_PART_END_COLOR,   end_color,
       PSYS_PART_START_ALPHA, start_alpha,
       PSYS_PART_END_ALPHA,   end_alpha,
       PSYS_PART_START_SCALE, start_scale,
       PSYS_PART_END_SCALE,   end_scale,
       PSYS_SRC_TEXTURE,      texture,
       
       //Particle Flow
       PSYS_SRC_MAX_AGE,          source_max_age,
       PSYS_PART_MAX_AGE,         particle_max_age,
       PSYS_SRC_BURST_RATE,       burst_rate,
       PSYS_SRC_BURST_PART_COUNT, burst_particle_count, 
       
       //Particle Motion
       PSYS_SRC_ACCEL,           acceleration,
       PSYS_SRC_OMEGA,           omega,
       PSYS_SRC_BURST_SPEED_MIN, speed_min,
       PSYS_SRC_BURST_SPEED_MAX, speed_max
       
       ]);

}

default {

   state_entry()
   {
       Particles();
   }

} </lsl>