Skip to content
Snippets Groups Projects
Commit 2234755a authored by Armin Co's avatar Armin Co
Browse files

Better view.

parent c429d97b
Branches
No related tags found
No related merge requests found
......@@ -9,8 +9,8 @@
namespace QPong
{
constexpr int arrayWidth = 512;
constexpr int arrayHeight = 512;
constexpr int arrayWidth = 312;
constexpr int arrayHeight = 312;
constexpr unsigned arraySize = arrayWidth * arrayHeight;
......
......@@ -155,11 +155,11 @@ void Particle::propagate()
double x = xAt(ix);
double E = obstaclePotential(x, y, m_players[Players::One].x, m_players[Players::One].y);
double E2 = obstaclePotential(x, y, m_players[Players::Two].x, m_players[Players::Two].y);
double E3 = sqr(y) * sqr(y) * sqr(y) * sqr(y) * 0.00012;
double E3 = sqr(y) * sqr(y) * sqr(y) * 0.001;
int index = QPong::arrayWidth * iy + ix;
std::complex<double> tmp = m_psi[index] * exp(-Ci * dt / hbar * (E + E2 + E3));
m_psi[index] = tmp;
m_bufPositionRepresentation->updateBuffer(index, tmp, (E+E2+E3)*800);
m_bufPositionRepresentation->updateBuffer(index, tmp, (E+E2+E3*0.99)*800);
}
}
fftw_execute (m_planForward); // transform into momentum repr.
......
......@@ -48,23 +48,23 @@ const QColor ParticleImage::getValue(unsigned index)
double obs = m_obsbuf[index];
c.r = obs + r*r;
c.g = r*r + i*i;
c.g = r*r + i*i + obs / 2;
// c.b = 0;
c.b = i*i;
if (c.r > 1.0)
if (c.r >= 1.0)
{
c.r = 1.0;
c.r = 0.99;
}
if (c.g > 1.0)
if (c.g >= 0.99)
{
c.g = 1.0;
c.g = 0.99;
}
if (c.b > 1.0)
if (c.b >= 1.0)
{
c.b = 1.0;
c.b = 0.99;
}
return c;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment