public VisualizerCommandSet Tick(double newTime) { var set = new VisualizerCommandSet(); container.Update(newTime - Time); // Box scale Vector3D position = ConvertToVector3D(container.Size / 2); Vector3D scale = ConvertToVector3D(container.Size / 2 * BoxScale); set.AddCommand(new TransformObject(0, position, scale, 0, 0)); container.ParticlesToAdd.ForEach((particle) => AddParticle(particle, set)); container.ParticlesToRemove.ForEach((particle) => RemoveParticle(particle, set)); foreach (var particle in container.Particles) { int index = particleMap[particle]; set.AddCommand(new MoveObject(index, ConvertToVector3D(particle.Position))); } Time = newTime; return(set); }
public CommandSet <VisualizerControl.Visualizer> Tick(double newTime) { var set = new VisualizerCommandSet(); container.Update(newTime - Time); foreach (var particle in container.Particles) { int index = particleMap[particle]; set.AddCommand(new MoveObject(index, ConvertToVector3D(particle.Position))); } Time = newTime; return(set); }