You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: runtime.rs
    path of file: ./repos/nbody-wasm-sim/src
    
    the code of the file until where you have to start completion: use glam::Vec2;
use winit::event::Event;
use winit::event::WindowEvent;
use winit::event_loop::{ControlFlow, EventLoopWindowTarget};
use winit::window::Window;

use crate::dom::Dom;
use crate::render::WgpuContext;
use crate::sim::{Simulation, WORLD_RADIUS};

pub struct Runtime {
    context: WgpuContext,
    window: Window,
    dom: Dom,
    sim: Simulation,
}

impl Runtime {
    pu
    
    pub fn new(context: WgpuContext, window: Window, dom: Dom) -> Self {
        let mut sim = Simulation::default();
        // Zoom into sim
        let view_size = Vec2::new(
            window.inner_size().width as f32,
            window.inner_size().height as f32,
        );
        sim.state.zoom = if view_size.y < view_size.x {
            view_size.y / (WORLD_RADIUS * 2.0)
        } else {
            view_size.x / (WORLD_RADIUS * 2.0)
        };

        Self {
            context,
            window,
            dom,
            sim,
        }
    }