+ let mandelwow_bbox = bounding_box::BoundingBox::new(&display, &bounds, &bounding_box_program);
+ let shaded_cube = ShadedCube::new(&display, &shaded_program);
+
+ const SEA_XSIZE: usize = 24;
+ const SEA_ZSIZE: usize = 20;
+ let sea_xmin = -14.0f32;
+ let sea_xmax = 14.0f32;
+ let sea_y = -2.5;
+ let sea_zmin = -2.0f32;
+ let sea_zmax = -26.0f32;
+ let sea_xstep = (sea_xmax - sea_xmin) / (SEA_XSIZE as f32);
+ let sea_zstep = (sea_zmax - sea_zmin) / (SEA_ZSIZE as f32);
+
+ let mut sea = [[Vector3::zero(); SEA_ZSIZE]; SEA_XSIZE];
+ for x in 0..SEA_XSIZE {
+ for z in 0..SEA_ZSIZE {
+ sea[x][z] = Vector3 {
+ x: sea_xmin + (x as f32) * sea_xstep,
+ y: sea_y,
+ z: sea_zmin + (z as f32) * sea_zstep,
+ };
+ }
+ }
+
+ let mut last_hit = 0.0f32;
+ let mut hit_time = 0.0f32;
+ set_main_loop_callback(|| {
+ let t = timer.t;
+ let new_hit = sound::hit_event(&mut soundplayer);
+ if new_hit > last_hit {
+ hit_time = t;
+ }
+ last_hit = new_hit;
+ let hit_delta = t - hit_time;
+ let hit_scale = 1. / (1. + hit_delta * hit_delta * 15.0) + 1.;