diff options
author | Jakob Odersky <jodersky@gmail.com> | 2011-05-11 14:59:00 +0000 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2011-05-11 14:59:00 +0000 |
commit | 64d6cd8a7ed46be4a34b4818705186f8e0998ab1 (patch) | |
tree | 0a889a5ff9bdb7a010bb9e028a5dc2ca0d05be65 /src/main/Accelerator.cc | |
parent | ff64cec5fdf5b18e6aee31e8b3148a0305e1d1de (diff) | |
download | vhc-64d6cd8a7ed46be4a34b4818705186f8e0998ab1.tar.gz vhc-64d6cd8a7ed46be4a34b4818705186f8e0998ab1.tar.bz2 vhc-64d6cd8a7ed46be4a34b4818705186f8e0998ab1.zip |
Rajoute getHorizontalAt() pour tous les elements, en vue des faisceaux
Diffstat (limited to 'src/main/Accelerator.cc')
-rw-r--r-- | src/main/Accelerator.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/Accelerator.cc b/src/main/Accelerator.cc index 37f8dbb..ca5de8a 100644 --- a/src/main/Accelerator.cc +++ b/src/main/Accelerator.cc @@ -144,13 +144,15 @@ void Accelerator::step(double dt) { for (ParticleIterator i = particleCollec.begin(); i != particleCollec.end(); ++i) { Particle& particle = **i; + particle.setForce(Vector3D::Null); + particle.applyMagneticForce(particle.getElement()->magneticFieldAt(particle.getPosition()), dt); Vector3D a = particle.getForce() / (particle.getGamma() * particle.getMass()); particle.setVelocity(particle.getVelocity() + a * dt); particle.translate(particle.getVelocity() * dt); - particle.setForce(Vector3D::Null); + } |