diff options
author | sotech117 <michael_foiani@brown.edu> | 2024-05-10 13:34:09 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2024-05-10 13:34:09 -0400 |
commit | 63d2e9cbf4508d5118c654e81ea4da33763dc73f (patch) | |
tree | 95f7fbb6838c9b3cba31d0f39783614b2149a6a3 | |
parent | 9a9bb1a85de1eddb993efa635a59c693c37ec32f (diff) |
jess updated
-rw-r--r-- | resources/shaders/particles.frag | 1 | ||||
-rw-r--r-- | src/particlesystem.cpp | 10 | ||||
-rw-r--r-- | src/particlesystem.h | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/resources/shaders/particles.frag b/resources/shaders/particles.frag index fdbd8f0..a21d91b 100644 --- a/resources/shaders/particles.frag +++ b/resources/shaders/particles.frag @@ -12,4 +12,5 @@ void main() { vec4 c = texture(particle_texture, TexCoords); fragColor = c*vec4(1,1,1,alpha); + //fragColor = vec4(1); } diff --git a/src/particlesystem.cpp b/src/particlesystem.cpp index 65d61ac..3e94862 100644 --- a/src/particlesystem.cpp +++ b/src/particlesystem.cpp @@ -45,10 +45,10 @@ Eigen::Vector3f particlesystem::getRandomInitialVel(){ } Eigen::Vector3f getInitVel(OceanSpray s){ - float x = getRandomInRange(0,1); - float y = getRandomInRange(0.1, .9); + float x = getRandomInRange(.6,4); + float y = getRandomInRange(0.5, 1.5); Eigen::Vector3f v = Eigen::Vector3f(s.slope_vector[0], y, s.slope_vector[1]) + Eigen::Vector3f(x,0,0); - return v*10.f; + return v*300.f; //p.vel[1] = 0.1; @@ -107,9 +107,9 @@ void particlesystem::update(double deltaTime){ // if particle is still alive, update pos if (p.life >= 0.f){ - float r = getRandomInRange(.5, 1.6f); + float r = getRandomInRange(30, 80.f); p.vel += gravity*dt*r; - p.pos += p.vel * dt * 10.f; + p.pos += p.vel * dt; // p.vel[1] -= (p.vel.dot(p.vel) / 2 + gravity[0]) * dt; // p.pos += p.vel * dt * 10.f; } diff --git a/src/particlesystem.h b/src/particlesystem.h index 608e229..26cb3f4 100644 --- a/src/particlesystem.h +++ b/src/particlesystem.h @@ -57,7 +57,7 @@ private: - float d = 2.f; + float d = 50.f; std::vector<float> m_vertices = { -d, d, 0,1, -d, -d, 0, 0, |