/// <summary> /// Scene constructor taking custom parameters /// </summary> /// <param name="cannon"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="gravity"></param> /// <param name="environment_density"></param> /// <param name="resistance_force"></param> /// <param name="shot_power"></param> /// <param name="projectile_mass"></param> /// <param name="projectile_restitution"></param> public Scene(Cannon cannon, uint width, uint height, double gravity, double environment_density, double resistance_force, double shot_power, double projectile_mass, double projectile_restitution) { this.cannon = cannon; cannon_scale = cannon.length / cannon.width; this.width = width; this.height = height; this.gravity = new ChangableValues(new Point(20, 5), width, text_height, gravity); this.environment_density = new ChangableValues(new Point(20, 35), width, text_height, environment_density); this.shot_power = new ChangableValues(new Point(20, 65), width, text_height, shot_power); this.projectile_radius = new ChangableValues(new Point(20, 95), width, text_height, cannon.width); this.projectile_mass = new ChangableValues(new Point(20, 125), width, text_height, projectile_mass); this.resistance_force = new ChangableValues(new Point(20, 155), width, text_height, resistance_force); this.projectile_restitution = new ChangableValues(new Point(20, 185), width, text_height, projectile_restitution); displacement_force = environment_density * gravity * Math.PI * Math.Pow(projectile_radius.value, 2); }
/// <summary> /// Scene constructor setting default values to parameters /// </summary> /// <param name="cannon"></param> /// <param name="width"></param> /// <param name="height"></param> public Scene(Cannon cannon, uint width, uint height) { this.cannon = cannon; cannon_scale = cannon.length / cannon.width; this.width = width; this.height = height; gravity = new ChangableValues(new Point(20, 5), width, text_height, 9.81); environment_density = new ChangableValues(new Point(20, 35), width, text_height, 1.9); shot_power = new ChangableValues(new Point(20, 65), width, text_height, 2000); projectile_radius = new ChangableValues(new Point(20, 95), width, text_height, cannon.width); projectile_mass = new ChangableValues(new Point(20, 125), width, text_height, 300); resistance_force = new ChangableValues(new Point(20, 155), width, text_height, 0.2); projectile_restitution = new ChangableValues(new Point(20, 185), width, text_height, 10); displacement_force = environment_density.value * gravity.value * Math.PI * Math.Pow(projectile_radius.value, 2); }