diff --git a/src/main.zig b/src/main.zig index 8de5caa..9465582 100644 --- a/src/main.zig +++ b/src/main.zig @@ -83,9 +83,9 @@ const Particle = struct { self.velocity.a.y += val; } pub fn applyForce(self : *Self,vec : pr.Vec) void { - self.velocity.a.x += vec.a.x * 0.5; - self.velocity.a.y += vec.a.y * 0.5; - self.velocity.a.z += vec.a.z; + self.acceleration.a.x += vec.a.x * 0.5; + self.acceleration.a.y += vec.a.y * 0.5; + self.acceleration.a.z += vec.a.z; } }; @@ -135,7 +135,7 @@ const Emitter = struct if(p.show == 1) { - p.applyGravity(0); + p.applyGravity(2); p.applyForce(att.attract(p.*)); p.applyForce(att2.attract(p.*)); p.update(); @@ -157,8 +157,8 @@ const Attractor = struct var vec = self.vec.sub(particle.position); if( vec.a.x != 0 and vec.a.y != 0) { - vec.a.x = vec.a.x/20; - vec.a.y = vec.a.y/20; + vec.a.x = vec.a.x/200; + vec.a.y = vec.a.y/200; } return vec; } diff --git a/zig-out/bin/raylib-test b/zig-out/bin/raylib-test index aaa4d08..cf2e6cd 100755 Binary files a/zig-out/bin/raylib-test and b/zig-out/bin/raylib-test differ