CParticleEvolver Attractor

From PopcornFX
Jump to: navigation, search

Attractor evolver Last update: v1.10.0 - Main page : Particle evolvers Particle evolvers

The attractor evolver turns custom shapes into gravity sources for particles to be attracted to.
It does not perform any dynamics computations, it only stores the force to apply on the particles inside a custom field, to be used by the Physics evolver Physics evolver.
Usually, the attractor evolver will be used inside a Localspace evolver Localspace evolver

Attractor evolver

Attractor evolver Node properties

Field name Default value Description
Attractor evolver General
Shape None The name of the shape which attracts or repels particles
ForceAtSurface 1.0 The force magnitude on the shape surface (decays as the square of the distance to the surface). Positive values attract particles, Negative values repel them.
FalloffType Physical Type of influence falloff.
  • Physical : natural inverse-squared-distance falloff
  • Finite : specify a max influence radius
InfluenceDistance 10.0 Distance from the attractor's surface above which the attractor has no influence anymore.
FalloffSteepness 8.0 Controls the steepness of the influence falloff curve when 'FalloffType' is set to 'Finite'
RepulseWhenInside false Repulse when inside the 'Shape'. In other words, particles are always atracted to the surface of the 'Shape' even when they're inside it.
Attractor evolver Field customization
PositionField "Position" If this field is declared as a <float3>, it will be used as the particle position to compute the attraction force.
ForceField "Force" If this field is declared as a <float3>, it will be used to store the computed attraction force.
Attractor evolver layout

Attractor evolver Auto-fields

The attractor evolver will automatically create the following particle fields:

Name Type Footprint TransformMode self access to field
Position float3 16 bytes Transform read/write
name in 'ForceField' property float3 16 bytes Rotate read/write

Attractor evolver Side-effects

The attractor evolver will modify the following particle fields:

  • the field referenced in the 'ForceField' property

IMPORTANT: The attractor evolver will actually OVERWRITE the output 'ForceField', and will not accumulate inside it, so if you need to use multiple attractors, you'll need multiple intermediate force fields, and add them together inside a script.

IMPORTANT: you must make sure the physics evolver use the same input 'Force' field as the attractor.
For example, if you rename the default 'ForceField' property from "Force" to "MyAttractionForce", the attractor evolver will create a new particle field named "MyAttractionForce", but the physics evolver will still look for a "Force" field, therefore you must also go into the physics evolver and change its own 'ForceField' property to "MyAttractionForce".

Match between 'ForceField' of attractor and physics evolver

Here is a sample of the attractor evolver running on a shape collection containing a small cube with a large mass, and a large capsule with a small mass:

CParticleEvolver Attractor Viewport 02.jpg CParticleEvolver Attractor Viewport 03.jpg CParticleEvolver Attractor Viewport 04.jpg

CParticleEvolver Attractor Viewport 05.jpg CParticleEvolver Attractor Viewport 06.jpg CParticleEvolver Attractor Viewport 07.jpg