/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//
// PointParticleSystem
//
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
CKObjectDeclaration *od = CreateCKObjectDeclaration("Particle Systems");
od->SetDescription("Emits particles from a point");
od->SetType( CKDLL_BEHAVIORPROTOTYPE);
od->SetGuid(POINTSYSTEM_GUID);
od->SetIconIndex(32);
od->SetAuthorGuid(VIRTOOLS_GUID);
od->SetAuthorName("Virtools");
od->SetVersion(0x00010000);
od->SetCreationFunction(CreateGeneralParticleSystemProto);
od->SetCompatibleClassId(CKCID_3DENTITY);
od->SetCategory("Particles");
/* rem:
On: activates the behavior.
Off: disables the behavior.
Exit On: is activated when the behavior's process is activated.
Exit Off: is activated when the behavior's process is disabled.
Parameters:
Emission Delay: Time (in ms) to wait before the next particles' emission. 0 means each frame.
Emission Delay Variance: Modification of the preceding parameter, +/- its value.
Yaw Variance: Max opening angle in the XZ plane. Particles will be given a direction having an angle in this plane between 0 and this value from the Z direction of the emitter.
Pitch Variance: Max opening angle in the ZY plane. Particles will be given a direction having an angle in this plane between 0 and this value from the Z direction of the emitter.
Speed: Speed of the particle representing the actual distance they cover in 1 ms.
Speed Variance: Modification of the preceding parameter, +/- its value.
Angular Speed: Angular Speed of the particle representing the actual angle in radians they cover in 1 ms. (used for Sprite and Object Rendering Mode.)
Angular Speed Variance: Modification of the preceding parameter, +/- its value.
Spreading: Multiplicative Factor applied to the length of the sprites. (used for Oriented Sprite only.)
Spreading Variation: Modification of the preceding parameter, +/- its value.
Lifespan: The lifespan of a particle (in ms).
Lifespan Variance: The random variance of the lifespan (in ms) of individual particles, +/- lifespan value. ie : With a lifespan of 100, a lifespan variance of 15 means a particle may have a lifespan anywhere from 85 to 115 ms.
Maximum Number: Maximum number of particles displayed in the same frame. This number is limited by the Total Number Allocated in the Settings (100 by default), and must be changed there if you wish to override it.
Emission: The number of particles launched at each emission.
Emission Variance: Modification of the preceding parameter, +/- its value.
Initial Size: The initial size of the Particle (used in (Orientable)Sprite and Object Rendering Mode).
Initial Size Variance: Modification of the preceding parameter, +/- its value.
Ending Size: The ending size of the Particle (used in (Orientable)Sprite and Object Rendering Mode).
Ending Size Variance: Modification of the preceding parameter, +/- its value.
Bounce: The bouncing factor of the Particle (used when Deflectors are present.).
Bounce Variance: Modification of the preceding parameter, +/- its value.
Weight: The weight of the Particle (used when Gravity Interactor is present.).
Weight Variance: Modification of the preceding parameter, +/- its value.
Surface: The surface of the Particle (used when Wind or Atmosphere Interactors are present.).
Surface Variance: Modification of the preceding parameter, +/- its value.
Initial Color: The initial Color of the Particle.
Initial Color Variance: Modification of the preceding parameter, +/- its value.
Ending Color: The ending Color of the Particle.
Ending Color Variance: Modification of the preceding parameter, +/- its value.
Texture: The texture (or texture suite) of the Particle.
Initial Texture Frame: The initial Texture animation frame of the Particle.
Initial Texture Frame Variance: Modification of the preceding parameter, +/- its value.
Texture Speed: The speed, in ms, at which the frames are proceeded in the animation.
Texture Speed Variance: Modification of the preceding parameter, +/- its value.
Texture Frame Count: The number of animation frames included in your texture (it must be disposed in 2x2, 3x3, etc... but you don't have to use all the space in the texture (a 7 frame animation will be included in a texture of 3x3 frames).
Texture Loop: Specifies how the animation progress. Looping or not, or Ping-Pong (back and forth)?.
Settings :
Total Number : The total number of particles allocated in memory.
Particle Rendering : The rendering mode used for the particles.
Point : draw 1 pixel points at the particle place.Source Blend : The source blending mode of the sprite or object. see Materials/Basic/Set Src Blend.
Line : draw 1 pixel thin line connecting current particle position to last frame particle position.
Sprite : render a 3D Sprite at the particle place.
Object : render a 3d object chosen randomly in the following group at the particle place.
Oriented Sprite : render a stretched 3d sprite connecting current particle position to last frame particle position.
Radial Sprite : render a stretched 3d sprite connecting the center of world to the current particle position.
Interactors :
Interactors are object attributes that create an influence over particle systems. The first two interactors can be applied to any object you want, even a scene or a texture; otherwise they are applied to frames
Atmosphere: The atmosphere interactor is used to brake the particles, as if there was an air resistance. The equation used is :
(new particle direction) = (particle direction) - (particle direction)*atmosphereforce*(particle surface)
You are supposed to use only one atmosphere interactor per scene but if you use more than one, their effect will be cumulative...
Gravity: The gravity interactor simulates the earth attraction. The equation used is :
(new particle direction).y = (particle direction).y + gravityforce*(particle weight)
You'll have to use a negative number in the gravity force to make the particle fall down, but you can also reverse the gravity by using positive number.
You are supposed to use only one gravity interactor per scene but if you use more than one, their effect will be cumulative...
The following interactors are to be used on frames only.
Global Wind: The Global Wind interactor simulates a wind blowing the particles away, from wherever they are in the Z local axis direction of the frame, ie the interactor owner. The equation used is :
(new particle direction) = (particle direction) + (wind Z direction)*windforce*(particle surface)
A negative wind force will make the particle go into the wind.
You can use as many global wind attributes as you like, their effect will be cumulative...
Local Wind: The Local Wind interactor simulates a wind blowing the particles away, only when they are in the cylinder which have the X and Y axis of the interactor owner as basis, in the Z local axis direction of the interactor owner. The equation used is :
(new particle direction) = (particle direction) + attenuation*(wind Z direction)*windforce*(particle surface)
with : attenuation = 1/(1+(particle distance form the emitter basis)*decayforce
A negative wind force will make the particle go back the wind direction. The higher the decay force, the less the particles will be affected by the interactor when they are away from it.
Magnet: The Magnet interactor simulates a magnet attracting (or repulsing) the particles away, according to their distance. The equation used is :
t = 1 + SquareDistance((particle position) - (magnet position))
(new particle position) = (magnet position) + ((particle position) - (magnet position))*(t/(t+magnetforce))
The nearer are the particles, the faster they move. The greater the force is, the faster they move too.
A negative magnet force will repulse the particle.
Vortex: The Vortex interactor simulates a vortex field making the particles turn on its axis, with their speed according to their distance. The equation used is :
t = 1/(1 + SquareDistance((particle position) - (vortex position)))
(new particle position) = Rotate((particle position),(around vortex position),t*xforce,t*yforce,t*zforce)
The nearer are the particles from an axis, the faster they rotate. The greater the force is, the faster they rotate too.
A negative force will make the particle turn counterclockwise.
Disruption Box: The Disruption Box interactor simulates a volume which disturb the particle direction.The equation used is :
if(particle in box) (new particle direction) = (particle direction) + boxdisruptionforce*(random point in box - (particle position))
The greater the force is, the faster the particles will move away.
Mutation Box: The Mutation Box interactor allows particle penetrating its volume to mutates in size, color and texture. You can also choose the speed at which it will mutate. The greater the speed is, the faster the particles will reach its new form.
Tunnel: The Tunnel interactor conduct particles nearby thru the tunnel, accelerating or decelerating them. You can set the velocity aimed by the particles travelling in the tunnel, the absorption radius of the tunnel, the attraction shape modifies the force of the attraction, the attraction speed, and finally the attraction direction which represent a force modifying the direction of the particle itself.
Deflectors :
Deflectors are attributes applied to frames or objects that create obstacles for particle systems. For each particle, we test if between the last frame and the current frame, it touched an obstacle and,
if so, we change its direction and position according to the following equation :
dp = (particle direction).(impact normal)
(new particle direction) = ( (particle direction)-(impact normal)*dp ) * (deflector friction) + (impact normal)*dp*(particle bounce)*(deflector response)
Object Deflector: The Object deflector attribute is to be applied on a 3DEntity with a mesh and define it as an obstacle for the particles. The more faces the object has, the slower the processing will be... So don't abuse it.
Other Deflectors: The Plane, Infinite Plane, Cylinder, Sphere, Box deflectors are applied to frames and can be geometrically changed by applying (non)uniform scale on the frame. A line mesh representing the deflectors shape is created to help you visualize it.
*/ return od; }