|
|
@ -2,7 +2,7 @@ use memoffset::offset_of;
|
|
|
|
use ash::vk;
|
|
|
|
use ash::vk;
|
|
|
|
use rand::{thread_rng, distributions::{Distribution, Uniform}};
|
|
|
|
use rand::{thread_rng, distributions::{Distribution, Uniform}};
|
|
|
|
use cgmath::{InnerSpace, Vector2, Vector4};
|
|
|
|
use cgmath::{InnerSpace, Vector2, Vector4};
|
|
|
|
use num::traits::FloatConst;
|
|
|
|
|
|
|
|
use crate::utility::constants::*;
|
|
|
|
use crate::utility::constants::*;
|
|
|
|
use std::f32::consts::PI;
|
|
|
|
use std::f32::consts::PI;
|
|
|
|
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ impl Particle {
|
|
|
|
let between = Uniform::from(0.0..1.0);
|
|
|
|
let between = Uniform::from(0.0..1.0);
|
|
|
|
let mut rng = thread_rng();
|
|
|
|
let mut rng = thread_rng();
|
|
|
|
|
|
|
|
|
|
|
|
for i in 0..PARTICLE_COUNT {
|
|
|
|
for _i in 0..PARTICLE_COUNT {
|
|
|
|
let r = (between.sample(&mut rng) as f32).sqrt();
|
|
|
|
let r = (between.sample(&mut rng) as f32).sqrt();
|
|
|
|
let theta = between.sample(&mut rng) * 2.0 * PI;
|
|
|
|
let theta = between.sample(&mut rng) * 2.0 * PI;
|
|
|
|
let x = r * theta.cos() * WINDOW_HEIGHT as f32 * WINDOW_WIDTH as f32;
|
|
|
|
let x = r * theta.cos() * WINDOW_HEIGHT as f32 * WINDOW_WIDTH as f32;
|
|
|
|