Particles: initial support for events and actions

The following nodes work now (although things can still be improved of course):
Particle Birth Event, Praticle Time Step Event, Set Particle Attribute and Execute Condition.

Multiple Set Particle Attribute nodes can be chained using the "Execute" sockets.
They will be executed from left to right.
This commit is contained in:
2020-07-27 16:26:32 +02:00
parent a83bb170b0
commit 38e65331a8
12 changed files with 503 additions and 177 deletions

View File

@@ -61,7 +61,7 @@ class ParticleFunctionEvaluator {
ResourceCollector resources_;
const ParticleFunction &particle_fn_;
const SimulationSolveContext &solve_context_;
const ParticleChunkContext &particle_chunk_context_;
const ParticleChunkContext &particles_;
IndexMask mask_;
fn::MFContextBuilder global_context_;
fn::MFContextBuilder per_particle_context_;
@@ -71,13 +71,13 @@ class ParticleFunctionEvaluator {
public:
ParticleFunctionEvaluator(const ParticleFunction &particle_fn,
const SimulationSolveContext &solve_context,
const ParticleChunkContext &particle_chunk_context);
const ParticleChunkContext &particles);
~ParticleFunctionEvaluator();
void compute();
fn::GVSpan get(int output_index, StringRef expected_name) const;
fn::GVSpan get(int output_index, StringRef expected_name = "") const;
template<typename T> fn::VSpan<T> get(int output_index, StringRef expected_name) const
template<typename T> fn::VSpan<T> get(int output_index, StringRef expected_name = "") const
{
return this->get(output_index, expected_name).typed<T>();
}