CParticleEvolver Flocking

From PopcornFX
Jump to: navigation, search

Flocking evolver Last update: v1.9.0 - Main page : Particle evolvers Particle evolvers


The flocking evolver allows to simulate complex autonomous flocking behaviors. Useful if you want to create a flock of fish, birds, ants, flies, etc.. out of particles.


IMPORTANT : The flocking evolver needs to be bound to a Spatial layer Spatial layer to work properly, and must be used in conjunction with a spatial insertion evolver Spatial insertion evolver.


Flocking evolver Node properties

Field name Default value Description
Flocking evolver Movement
ForceMagnitude 7 range : [0, +inf[
MinSpeed 1 range : [0, +inf[
MaxSpeed 2 range : [0, +inf[
IgnoreSmallerNeighbors 1 will ignore neighbors smaller than 'IgnoreSmallerNeighbors' multiplied by the particle size. Setting this field to 0.5 will make the particle ignore all other particles that are smaller than half its size, when searching for neighbors. This is useful to make large "leaders" that are unaffected by the smaller crowds.
Flocking evolver Separation
SeparationFactor 0.5 Influence factor of separation on the overall behavior. The higher the value, the more each flock element will try keeping away from its neighbors.
SeparationSearchRadius 0.8 Neighbor search radius of an individual flock element for the separation behavior.
SeparationSearchAngle 270 Field of view angle in degrees of an individual flock element for the separation behaviour.
Flocking evolver Alignment
AlignmentFactor 0.33 Influence factor of alignment on the overall behavior. The higher the value, the more each flock element will align its heading with its neighbors.
AlignmentSearchRadius 1 Neighbor search radius of an individual flock element for the alignment behavior.
AlignmentSearchAngle 90 Field of view angle in degrees of an individual flock element for the alignment behavior.
Flocking evolver Cohesion
CohesionFactor 0.33 Influence factor of cohesion on the overall behavior. The higher the value, the more each flock element will try keeping a close distance to its neighbors.
CohesionSearchRadius 1.7 Neighbor search radius of an individual flock element for the cohesion behavior.
CohesionSearchAngle 190 Field of view angle in degrees of an individual flock element for the cohesion behavior.
Flocking evolver Performance
MaxNeighborCount -1 Maximum number of neighbors considered by the particle. -1 means unlimited.
Flocking evolver Field customization
PositionField "Position" If this field is declared as a <float3>, it will be used as the particle position.
VelocityField "Velocity" If this field is declared as a <float3>, it will be used as the particle velocity.
MeanNeighborDirectionField "MeanNeighborDirection" If this field is declared as a <float3>, the evolver will output, for each particle, the direction vector to the average position of its neighbors. Basically points to the direction of the nearby flock mass
Flocking evolver properties


Flocking evolver Auto-fields

The flocking evolver automatically creates, if they don't exist, the following particle fields:

Name Type Footprint TransformMode self access to field
Position float3 16 bytes Transform read
Velocity float3 16 bytes Rotate read/write
MeanNeighborDirection float4 16 bytes Rotate read/write