Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Create obj_controller
- window_set_fullscreen(false)
- G = 0.1;
- theta = 0.5;
- bodies = []
- simulation_width = room_width
- simulation_height = room_height
- initTree(1600)
- root = createNode(0, 0, simulation_width, simulation_height);
- var _num_bodies = 500
- for (var _i = 0; _i < _num_bodies; _i++) {
- var _mass = random_range(10, 100);
- array_push(bodies, {
- x: random(simulation_width),
- y: random(simulation_height),
- mass: _mass,
- radius: sqrt(_mass),
- velocity_x: 0,
- velocity_y: 0,
- force_x: 0,
- force_y: 0,
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment