public override void initBurstParticle(Emitter emitter, Particle particle)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    float        dt           = 0;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime = 0F;
                    _math.vec3 value_ = _math.vec3_(0F, 0F, 0F);
                    particleImpl._Position = _math.applyv3quat_(value_, emitter.rotation());
                    particleImpl._Position = _math.addv3_(particleImpl._Position, emitter.position());
                    float rnd_     = 0F + emitter.random()() * (1F - 0F);
                    float _path_in = _math.clamp_(rnd_, 0, 1);

                    _math.PathRes _path_srch = _math.pathRes(0, (_path_in - 0F) * 1F);
                    _math.vec2    _path_pos;
                    _math.pathLerp1(out _path_pos, this._path[_path_srch.s], _path_srch.i);
                    _math.vec3 conv3d_ = _math.vec3_(_path_pos.x, _path_pos.y, 0F);
                    particleImpl._Velocity = _math.applyv3quat_(conv3d_, emitter.rotation());
                    particleImpl._Velocity = _math.addv3_(particleImpl._Velocity, emitter.velocity());
                    float rnd_a = 0F + emitter.random()() * (360F - 0F);

                    particleImpl._Angle = rnd_a;
                    float rnd_b = 0F + emitter.random()() * (4F - 0F);

                    particleImpl._Tex__index = rnd_b;
                    float rnd_c = -180F + emitter.random()() * (180F - -180F);

                    particleImpl._Rot__speed = rnd_c;
                    particle.position_       = particleImpl._Position;
                }
                public override void updateParticle(Emitter emitter, Particle particle, float dt)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime += dt;
                    particle.position_      = particleImpl._Position;
                    ((Emitter_Sparks.EmitterData)particleImpl.attachedEmitters_[0].emitter_.data())._Color1 = emitterData._SparksColor1;
                    ((Emitter_Sparks.EmitterData)particleImpl.attachedEmitters_[0].emitter_.data())._Color2 = emitterData._SparksColor2;
                    particleImpl.attachedEmitters_[0].emitter_.update(dt, particle.position_, null);
                    float value_ = 0.3F;

                    if (particleImpl._lifetime > value_)
                    {
                        particle.dead_ = true;
                        particleImpl.attachedEmitters_[0].emitter_.stop();
                    }
                    float value_a = 100F;
                    float expr_   = (particleImpl._lifetime / value_);
                    float _plot_out;
                    float _plot_in0 = (expr_ < 0F?0F:(expr_ > 1F?1F:expr_));

                    _math.PathRes _plot_srch0 = _plot_in0 < 0.0292826?_math.pathRes(0, (_plot_in0 - 0F) * 34.15F):_math.pathRes(1, (_plot_in0 - 0.0292826F) * 15.4525F);
                    _math.funcLerp(out _plot_out, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                    float expr_a = (value_a * _plot_out);

                    particleImpl.size1_ = expr_a;
                    particleImpl.color_ = emitterData._Color;
                }
                public override void updateParticle(Emitter emitter, Particle particle, float dt)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime += dt;
                    _math.vec3 value_    = _math.vec3_(0F, -100F, 0F);
                    _math.vec3 fmove_fs  = value_;
                    _math.vec3 fmove_vs  = _math.vec3_(0F, 0F, 0F);
                    float      fmove_dtl = dt;

                    _math.vec3 fmove_v = particleImpl._Velocity;
                    _math.vec3 fmove_p = particleImpl._Position;
                    while (fmove_dtl > 0.0001F)
                    {
                        float      fmove_dtp = fmove_dtl;
                        _math.vec3 fmove_fsd = fmove_fs;
                        _math.vec3 fmove_rw  = _math.subv3_(fmove_vs, fmove_v);
                        float      fmove_rwl = _math.lengthv3sq_(fmove_rw);
                        if (fmove_rwl > 0.0001F)
                        {
                            fmove_rwl = (float)Math.Sqrt(fmove_rwl);
                            _math.vec3 fmove_rwn = _math.divv3scalar_(fmove_rw, fmove_rwl);
                            float      fmove_df  = 0.01F * 0.3F * fmove_rwl;
                            if (fmove_df * fmove_dtp > 0.2F)
                            {
                                fmove_dtp = 0.2F / fmove_df;
                            }
                            _math.addv3(out fmove_fsd, fmove_fsd, _math.mulv3scalar_(fmove_rwn, fmove_rwl * fmove_df));
                        }
                        _math.addv3(out fmove_v, fmove_v, _math.mulv3scalar_(fmove_fsd, fmove_dtp));
                        _math.addv3(out fmove_p, fmove_p, _math.mulv3scalar_(fmove_v, fmove_dtp));
                        fmove_dtl -= fmove_dtp;
                    }
                    particleImpl._Position = fmove_p;
                    particleImpl._Velocity = fmove_v;
                    particle.position_     = particleImpl._Position;
                    if (particleImpl._lifetime > particleImpl._Max_Life)
                    {
                        particle.dead_ = true;
                    }
                    float value_a = 30F;

                    _math.vec3 expr_  = _math.addv3_(particleImpl._Color, _math.mulv3scalar_(_math.subv3_(emitterData._Color2, particleImpl._Color), particleImpl._Colora));
                    float      expr_a = (particleImpl._lifetime / particleImpl._Max_Life);
                    float      _plota_out;
                    float      _plota_in0 = (expr_a < 0F?0F:(expr_a > 1F?1F:expr_a));

                    _math.PathRes _plota_srch0 = _plota_in0 < 0.79269?_math.pathRes(0, (_plota_in0 - 0F) * 1.26153F):_math.pathRes(1, (_plota_in0 - 0.79269F) * 4.82369F);
                    _math.funcLerp(out _plota_out, this._plota[0][_plota_srch0.s], _plota_srch0.i);
                    particleImpl.size1_ = value_a;
                    particleImpl.color_ = expr_;
                    particleImpl.alpha_ = _plota_out;
                }
Beispiel #4
0
            public override void initBurstParticle(Emitter emitter, Particle particle)
            {
                ParticleImpl particleImpl = (ParticleImpl)particle;
                float        dt           = 0;
                EmitterData  emitterData  = (EmitterData)emitter.data();

                GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                particleImpl._lifetime = 0F;
                _math.vec3 value_ = _math.vec3_(0F, 0F, 0F);
                particleImpl._Position = _math.applyv3quat_(value_, emitter.rotation());
                particleImpl._Position = _math.addv3_(particleImpl._Position, emitter.position());
                particleImpl._Angle    = 0F;
                float rnd_ = 5F + emitter.random()() * (30F - 5F);

                particleImpl._Size = rnd_;
                float rnd_a = 0F + emitter.random()() * (1F - 0F);

                _math.vec3 _plot_out;
                float      _plot_in0 = (rnd_a < 0F?0F:(rnd_a > 0.9F?0.9F:rnd_a));

                _math.PathRes _plot_srch0 = _plot_in0 < 0.6?_plot_in0 < 0.3?_math.pathRes(0, (_plot_in0 - 0F) * 3.33333F):_math.pathRes(1, (_plot_in0 - 0.3F) * 3.33333F):_math.pathRes(2, (_plot_in0 - 0.6F) * 3.33333F);
                _math.funcLerp(out _plot_out.x, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                float _plot_in1 = (rnd_a < 0F?0F:(rnd_a > 0.6F?0.6F:rnd_a));

                _math.PathRes _plot_srch1 = _plot_in1 < 0.3?_math.pathRes(0, (_plot_in1 - 0F) * 3.33333F):_math.pathRes(1, (_plot_in1 - 0.3F) * 3.33333F);
                _math.funcLerp(out _plot_out.y, this._plot[1][_plot_srch1.s], _plot_srch1.i);
                float _plot_in2 = (rnd_a < 0F?0F:(rnd_a > 0.9F?0.9F:rnd_a));

                _math.PathRes _plot_srch2 = _plot_in2 < 0.6?_plot_in2 < 0.3?_math.pathRes(0, (_plot_in2 - 0F) * 3.33333F):_math.pathRes(1, (_plot_in2 - 0.3F) * 3.33333F):_math.pathRes(2, (_plot_in2 - 0.6F) * 3.33333F);
                _math.funcLerp(out _plot_out.z, this._plot[2][_plot_srch2.s], _plot_srch2.i);
                particleImpl._Color = _plot_out;
                float rnd_b = 0F + emitter.random()() * (800F - 0F);

                _math.vec3 randvec_ = _math.randv3gen_(rnd_b, emitter.random());
                particleImpl._Velocity = _math.applyv3quat_(randvec_, emitter.rotation());
                particleImpl._Velocity = _math.addv3_(particleImpl._Velocity, emitter.velocity());
                particle.position_     = particleImpl._Position;
            }
                public override void updateParticle(Emitter emitter, Particle particle, float dt)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime += dt;
                    float move_ = particleImpl._Angle + particleImpl._Rot__speed * dt;

                    particleImpl._Angle = move_;
                    particle.position_  = particleImpl._Position;
                    float value_ = 4F;

                    if (particleImpl._lifetime > value_)
                    {
                        particle.dead_ = true;
                    }
                    float value_a = 120F;
                    float expr_   = (particleImpl._lifetime / value_);
                    float _plot_out;
                    float _plot_in0 = (expr_ < 0F?0F:(expr_ > 1F?1F:expr_));

                    _math.PathRes _plot_srch0 = _math.pathRes(0, (_plot_in0 - 0F) * 15F);
                    _math.funcLerp(out _plot_out, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                    float expr_a = (value_a * _plot_out);

                    _math.vec3 expr_b = _math.addv3_(emitterData._Color1, _math.mulv3scalar_(_math.subv3_(emitterData._Color2, emitterData._Color1), particleImpl._Color));
                    float      _plota_out;
                    float      _plota_in0 = (expr_ < 0F?0F:(expr_ > 1F?1F:expr_));

                    _math.PathRes _plota_srch0 = _plota_in0 < 0.4?_math.pathRes(0, (_plota_in0 - 0F) * 2.5F):_math.pathRes(1, (_plota_in0 - 0.4F) * 1.66667F);
                    _math.funcLerp(out _plota_out, this._plota[0][_plota_srch0.s], _plota_srch0.i);
                    particleImpl.size1_ = expr_a;
                    particleImpl.color_ = expr_b;
                    particleImpl.alpha_ = _plota_out;
                }
                public override void initBurstParticle(Emitter emitter, Particle particle)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    float        dt           = 0;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime = 0F;
                    float rnd_ = 1F + emitter.random()() * (3F - 1F);

                    particleImpl._Max_Life = rnd_;
                    _math.vec3 value_ = _math.vec3_(0F, 0F, 0F);
                    particleImpl._Position = _math.addv3_(value_, emitter.position());
                    float rnd_a = 0F + emitter.random()() * (1F - 0F);
                    float _plot_out;
                    float _plot_in0 = (rnd_a < 0F?0F:(rnd_a > 1F?1F:rnd_a));

                    _math.PathRes _plot_srch0 = _math.pathRes(0, (_plot_in0 - 0F) * 15F);
                    _math.funcLerp(out _plot_out, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                    float _path_in = _math.clamp_(_plot_out, 0, 1);

                    _math.PathRes _path_srch = _math.pathRes(0, (_path_in - 0F) * 1F);
                    _math.vec2    _path_pos;
                    _math.pathLerp1(out _path_pos, this._path[_path_srch.s], _path_srch.i);
                    _math.vec3 conv3d_ = _math.vec3_(_path_pos.x, _path_pos.y, 0F);
                    particleImpl._Velocity = _math.applyv3quat_(conv3d_, emitter.rotation());
                    particleImpl._Velocity = _math.addv3_(particleImpl._Velocity, emitter.velocity());
                    particleImpl._Angle    = 0F;
                    particleImpl._Color    = emitterData._Color1;
                    float rnd_b = 0F + emitter.random()() * (1F - 0F);

                    particleImpl._Colora = rnd_b;
                    particle.position_   = particleImpl._Position;
                }
Beispiel #7
0
            public override void initBurstParticle(Emitter emitter, Particle particle)
            {
                ParticleImpl particleImpl = (ParticleImpl)particle;
                float        dt           = 0;
                EmitterData  emitterData  = (EmitterData)emitter.data();

                GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                particleImpl._lifetime = 0F;
                float rnd_     = 0F + emitter.random()() * (1F - 0F);
                float _path_in = _math.clamp_(rnd_, 0, 1);

                _math.PathRes _path_srch = _path_in < 0.495668?_math.pathRes(0, (_path_in - 0F) * 2.01748F):_math.pathRes(1, (_path_in - 0.495668F) * 1.98282F);
                _math.vec2    _path_pos;
                _math.pathLerp1(out _path_pos, this._path[_path_srch.s], _path_srch.i);
                _math.vec3 conv3d_ = _math.vec3_(_path_pos.x, _path_pos.y, 0F);
                particleImpl._Position = _math.addv3_(conv3d_, emitter.position());
                _math.vec3 randvec_ = _math.randv3gen_(100F, emitter.random());
                particleImpl._Velocity = randvec_;
                particleImpl._Angle    = 0F;
                particle.position_     = particleImpl._Position;
                _math.setv2(out particleImpl.prevPosition_, particle.position_.x, particle.position_.y);
            }
                public override void updateParticle(Emitter emitter, Particle particle, float dt)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime += dt;
                    _math.vec3 value_    = _math.vec3_(0F, -300F, 0F);
                    _math.vec3 fmove_fs  = value_;
                    _math.vec3 fmove_vs  = _math.vec3_(0F, 0F, 0F);
                    float      fmove_dtl = dt;

                    _math.vec3 fmove_v = particleImpl._Velocity;
                    _math.vec3 fmove_p = particleImpl._Position;
                    while (fmove_dtl > 0.0001F)
                    {
                        float      fmove_dtp = fmove_dtl;
                        _math.vec3 fmove_fsd = fmove_fs;
                        _math.vec3 fmove_rw  = _math.subv3_(fmove_vs, fmove_v);
                        float      fmove_rwl = _math.lengthv3sq_(fmove_rw);
                        if (fmove_rwl > 0.0001F)
                        {
                            fmove_rwl = (float)Math.Sqrt(fmove_rwl);
                            _math.vec3 fmove_rwn = _math.divv3scalar_(fmove_rw, fmove_rwl);
                            float      fmove_df  = 0.01F * 1F * fmove_rwl;
                            if (fmove_df * fmove_dtp > 0.2F)
                            {
                                fmove_dtp = 0.2F / fmove_df;
                            }
                            _math.addv3(out fmove_fsd, fmove_fsd, _math.mulv3scalar_(fmove_rwn, fmove_rwl * fmove_df));
                        }
                        _math.addv3(out fmove_v, fmove_v, _math.mulv3scalar_(fmove_fsd, fmove_dtp));
                        _math.addv3(out fmove_p, fmove_p, _math.mulv3scalar_(fmove_v, fmove_dtp));
                        fmove_dtl -= fmove_dtp;
                    }
                    particleImpl._Position = fmove_p;
                    particleImpl._Velocity = fmove_v;
                    float move_ = particleImpl._Angle + particleImpl._Rot__speed * dt;

                    particleImpl._Angle = move_;
                    particle.position_  = particleImpl._Position;
                    float value_a = 2F;

                    if (particleImpl._lifetime > value_a)
                    {
                        particle.dead_ = true;
                    }
                    float value_b = 30F;
                    float _plot_out;
                    float _plot_in0 = (particleImpl._lifetime < 0F?0F:(particleImpl._lifetime > 1F?1F:particleImpl._lifetime));

                    _math.PathRes _plot_srch0 = _math.pathRes(0, (_plot_in0 - 0F) * 1F);
                    _math.funcLerp(out _plot_out, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                    float expr_  = (value_b * _plot_out);
                    float expr_a = (particleImpl._lifetime / value_a);
                    float _plota_out;
                    float _plota_in0 = (expr_a < 0F?0F:(expr_a > 1F?1F:expr_a));

                    _math.PathRes _plota_srch0 = _math.pathRes(0, (_plota_in0 - 0F) * 1F);
                    _math.funcLerp(out _plota_out, this._plota[0][_plota_srch0.s], _plota_srch0.i);
                    particleImpl.size1_ = expr_;
                    particleImpl.alpha_ = _plota_out;
                }
                public override void updateParticle(Emitter emitter, Particle particle, float dt)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime += dt;
                    _math.vec3 noise_a = _math.mulv3scalar_(_math.vec3_(100F, 50F, 30F), emitter.effect().time());
                    _math.addv3(out noise_a, noise_a, particleImpl._Position);
                    _math.vec3 noise_i = _math.mulv3scalar_(noise_a, 1.0F / 500F);
                    _math.vec3 noise   = _math.noisePixelLinear3_(noise_i);
                    _math.mulv3(out noise, noise, _math.vec3_(0.0078125F, 0.0078125F, 0.0078125F));
                    _math.addv3(out noise, noise, _math.vec3_(-1F, -1F, -1F));
                    _math.mulv3scalar(out noise, noise, 600F);
                    _math.vec3 fmove_fs  = noise;
                    _math.vec3 fmove_vs  = _math.vec3_(0F, 0F, 0F);
                    float      fmove_dtl = dt;

                    _math.vec3 fmove_v = particleImpl._Velocity;
                    _math.vec3 fmove_p = particleImpl._Position;
                    while (fmove_dtl > 0.0001F)
                    {
                        float      fmove_dtp = fmove_dtl;
                        _math.vec3 fmove_fsd = fmove_fs;
                        _math.vec3 fmove_rw  = _math.subv3_(fmove_vs, fmove_v);
                        float      fmove_rwl = _math.lengthv3sq_(fmove_rw);
                        if (fmove_rwl > 0.0001F)
                        {
                            fmove_rwl = (float)Math.Sqrt(fmove_rwl);
                            _math.vec3 fmove_rwn = _math.divv3scalar_(fmove_rw, fmove_rwl);
                            float      fmove_df  = 0.01F * 1F * fmove_rwl;
                            if (fmove_df * fmove_dtp > 0.2F)
                            {
                                fmove_dtp = 0.2F / fmove_df;
                            }
                            _math.addv3(out fmove_fsd, fmove_fsd, _math.mulv3scalar_(fmove_rwn, fmove_rwl * fmove_df));
                        }
                        _math.addv3(out fmove_v, fmove_v, _math.mulv3scalar_(fmove_fsd, fmove_dtp));
                        _math.addv3(out fmove_p, fmove_p, _math.mulv3scalar_(fmove_v, fmove_dtp));
                        fmove_dtl -= fmove_dtp;
                    }
                    particleImpl._Position = fmove_p;
                    particleImpl._Velocity = fmove_v;
                    particle.position_     = particleImpl._Position;
                    float value_ = 2F;

                    if (particleImpl._lifetime > value_)
                    {
                        particle.dead_ = true;
                    }
                    float expr_ = (particleImpl._lifetime / value_);
                    float _plot_out;
                    float _plot_in0 = (expr_ < 0F?0F:(expr_ > 1F?1F:expr_));

                    _math.PathRes _plot_srch0 = _math.pathRes(0, (_plot_in0 - 0F) * 1F);
                    _math.funcLerp(out _plot_out, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                    float expr_a = (particleImpl._Size * _plot_out);

                    _math.vec3 expr_b = _math.addv3_(emitterData._Color1, _math.mulv3scalar_(_math.subv3_(emitterData._Color2, emitterData._Color1), particleImpl._Color));
                    particleImpl.size1_ = expr_a;
                    particleImpl.color_ = expr_b;
                }
Beispiel #10
0
                public override void updateParticle(Emitter emitter, Particle particle, float dt)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime += dt;
                    _math.vec3 value_  = _math.vec3_(0F, 800F, 0F);
                    _math.vec3 noise_a = _math.mulv3scalar_(_math.vec3_(100F, 50F, 30F), emitter.effect().time());
                    _math.addv3(out noise_a, noise_a, particleImpl._Position);
                    _math.vec3 noise_i = _math.mulv3scalar_(noise_a, 1.0F / 1000F);
                    _math.vec3 noise   = _math.noisePixelLinear3_(noise_i);
                    _math.mulv3(out noise, noise, _math.vec3_(0.0078125F, 0.0078125F, 0.0078125F));
                    _math.addv3(out noise, noise, _math.vec3_(-1F, -1F, -1F));
                    _math.mulv3scalar(out noise, noise, 1200F);
                    _math.vec3 fmove_fs = value_;
                    _math.addv3(out fmove_fs, fmove_fs, noise);
                    _math.vec3 fmove_vs  = _math.vec3_(0F, 0F, 0F);
                    float      fmove_dtl = dt;

                    _math.vec3 fmove_v = particleImpl._Velocity;
                    _math.vec3 fmove_p = particleImpl._Position;
                    while (fmove_dtl > 0.0001F)
                    {
                        float      fmove_dtp = fmove_dtl;
                        _math.vec3 fmove_fsd = fmove_fs;
                        _math.vec3 fmove_rw  = _math.subv3_(fmove_vs, fmove_v);
                        float      fmove_rwl = _math.lengthv3sq_(fmove_rw);
                        if (fmove_rwl > 0.0001F)
                        {
                            fmove_rwl = (float)Math.Sqrt(fmove_rwl);
                            _math.vec3 fmove_rwn = _math.divv3scalar_(fmove_rw, fmove_rwl);
                            float      fmove_df  = 0.01F * 1F * fmove_rwl;
                            if (fmove_df * fmove_dtp > 0.2F)
                            {
                                fmove_dtp = 0.2F / fmove_df;
                            }
                            _math.addv3(out fmove_fsd, fmove_fsd, _math.mulv3scalar_(fmove_rwn, fmove_rwl * fmove_df));
                        }
                        _math.addv3(out fmove_v, fmove_v, _math.mulv3scalar_(fmove_fsd, fmove_dtp));
                        _math.addv3(out fmove_p, fmove_p, _math.mulv3scalar_(fmove_v, fmove_dtp));
                        fmove_dtl -= fmove_dtp;
                    }
                    particleImpl._Position = fmove_p;
                    particleImpl._Velocity = fmove_v;
                    particle.position_     = particleImpl._Position;
                    if (particleImpl._lifetime > particleImpl._Max_Life)
                    {
                        particle.dead_ = true;
                    }
                    _math.vec2 value_a = _math.vec2_(6F, 6F);
                    float      _plot_out;
                    float      _plot_in0 = (particleImpl._lifetime < 0F?0F:(particleImpl._lifetime > 1.35236F?(0F + ((particleImpl._lifetime - 0F) % 1.35236F)):particleImpl._lifetime));

                    _math.PathRes _plot_srch0 = _plot_in0 < 0.739748?_plot_in0 < 0.4?_plot_in0 < 0.1?_math.pathRes(0, (_plot_in0 - 0F) * 10F):_math.pathRes(1, (_plot_in0 - 0.1F) * 3.33333F):_plot_in0 < 0.558348?_math.pathRes(2, (_plot_in0 - 0.4F) * 6.3152F):_math.pathRes(3, (_plot_in0 - 0.558348F) * 5.51269F):_plot_in0 < 1.03367?_plot_in0 < 0.833292?_math.pathRes(4, (_plot_in0 - 0.739748F) * 10.6901F):_math.pathRes(5, (_plot_in0 - 0.833292F) * 4.99066F):_plot_in0 < 1.2?_math.pathRes(6, (_plot_in0 - 1.03367F) * 6.01203F):_math.pathRes(7, (_plot_in0 - 1.2F) * 6.56334F);
                    _math.funcLerp(out _plot_out, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                    particleImpl.size2_ = value_a;
                    particleImpl.alpha_ = _plot_out;
                }
Beispiel #11
0
                public override void updateParticle(Emitter emitter, Particle particle, float dt)
                {
                    ParticleImpl particleImpl = (ParticleImpl)particle;
                    EmitterData  emitterData  = (EmitterData)emitter.data();

                    GeneratorPeriodic generator     = (GeneratorPeriodic)emitter.generator();
                    GeneratorImpl     generatorImpl = (GeneratorImpl)generator.impl();

                    particleImpl._lifetime += dt;
                    _math.vec3 value_  = _math.vec3_(0F, 400F, 0F);
                    _math.vec3 noise_a = _math.mulv3scalar_(_math.vec3_(100F, 50F, 30F), emitter.effect().time());
                    _math.addv3(out noise_a, noise_a, particleImpl._Position);
                    _math.vec3 noise_i = _math.mulv3scalar_(noise_a, 1.0F / 1000F);
                    _math.vec3 noise   = _math.noisePixelLinear3_(noise_i);
                    _math.mulv3(out noise, noise, _math.vec3_(0.0078125F, 0.0078125F, 0.0078125F));
                    _math.addv3(out noise, noise, _math.vec3_(-1F, -1F, -1F));
                    _math.mulv3scalar(out noise, noise, 200F);
                    _math.vec3 fmove_fs = value_;
                    _math.addv3(out fmove_fs, fmove_fs, noise);
                    _math.vec3 fmove_vs  = _math.vec3_(0F, 0F, 0F);
                    float      fmove_dtl = dt;

                    _math.vec3 fmove_v = particleImpl._Velocity;
                    _math.vec3 fmove_p = particleImpl._Position;
                    while (fmove_dtl > 0.0001F)
                    {
                        float      fmove_dtp = fmove_dtl;
                        _math.vec3 fmove_fsd = fmove_fs;
                        _math.vec3 fmove_rw  = _math.subv3_(fmove_vs, fmove_v);
                        float      fmove_rwl = _math.lengthv3sq_(fmove_rw);
                        if (fmove_rwl > 0.0001F)
                        {
                            fmove_rwl = (float)Math.Sqrt(fmove_rwl);
                            _math.vec3 fmove_rwn = _math.divv3scalar_(fmove_rw, fmove_rwl);
                            float      fmove_df  = 0.01F * 1F * fmove_rwl;
                            if (fmove_df * fmove_dtp > 0.2F)
                            {
                                fmove_dtp = 0.2F / fmove_df;
                            }
                            _math.addv3(out fmove_fsd, fmove_fsd, _math.mulv3scalar_(fmove_rwn, fmove_rwl * fmove_df));
                        }
                        _math.addv3(out fmove_v, fmove_v, _math.mulv3scalar_(fmove_fsd, fmove_dtp));
                        _math.addv3(out fmove_p, fmove_p, _math.mulv3scalar_(fmove_v, fmove_dtp));
                        fmove_dtl -= fmove_dtp;
                    }
                    particleImpl._Position = fmove_p;
                    float value_a = 1.5F;
                    float expr_   = (particleImpl._lifetime / value_a);
                    float _plot_out;
                    float _plot_in0 = (expr_ < 0F?0F:(expr_ > 1F?1F:expr_));

                    _math.PathRes _plot_srch0 = _math.pathRes(0, (_plot_in0 - 0F) * 15F);
                    _math.funcLerp(out _plot_out, this._plot[0][_plot_srch0.s], _plot_srch0.i);
                    float move_ = particleImpl._Angle + _plot_out * dt;

                    particleImpl._Angle    = move_;
                    particleImpl._Velocity = fmove_v;
                    particle.position_     = particleImpl._Position;
                    if (particleImpl._lifetime > value_a)
                    {
                        particle.dead_ = true;
                    }
                    float value_b = 40F;
                    float _plota_out;
                    float _plota_in0 = (expr_ < 0F?0F:(expr_ > 1F?1F:expr_));

                    _math.PathRes _plota_srch0 = _plota_in0 < 0.2?_math.pathRes(0, (_plota_in0 - 0F) * 75F):_math.pathRes(1, (_plota_in0 - 0.2F) * 18.75F);
                    _math.funcLerp(out _plota_out, this._plota[0][_plota_srch0.s], _plota_srch0.i);
                    float expr_a = (value_b * _plota_out);
                    float _plotb_out;
                    float _plotb_in0 = (expr_ < 0F?0F:(expr_ > 1F?1F:expr_));

                    _math.PathRes _plotb_srch0 = _plotb_in0 < 0.1?_math.pathRes(0, (_plotb_in0 - 0F) * 10F):_math.pathRes(1, (_plotb_in0 - 0.1F) * 16.6667F);
                    _math.funcLerp(out _plotb_out, this._plotb[0][_plotb_srch0.s], _plotb_srch0.i);
                    particleImpl.size1_ = expr_a;
                    particleImpl.alpha_ = _plotb_out;
                }