From 9bea4a8e86f98288abb0d37143159247ce91d708 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 8 Aug 2021 21:51:04 +0200 Subject: Cleaned up Battle instance name --- derelict.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/derelict.js b/derelict.js index 9bd77bf..aa4d891 100644 --- a/derelict.js +++ b/derelict.js @@ -330,15 +330,15 @@ function averagePosition(positions) { } function processBattle({snapshot, renderer, renderer2d, container, toolbar, skybox}) { - const battle_obj = new Battle({container, renderer, renderer2d}) + const battle = new Battle({container, renderer, renderer2d}) const wrecks = snapshot.getKillmails().map(killmail => new Wreck({killmail, snapshot})) wrecks.forEach(wreck => wreck.killmail.victim.position = vec3FromXYZ(wreck.killmail.victim.position)) - wrecks.forEach(wreck => battle_obj.add(wreck)) - battle_obj.grids.forEach(grid => window.addEventListener('resize', () => grid.onresize())) - battle_obj.grids.forEach(grid => grid.recenter()) + wrecks.forEach(wreck => battle.add(wreck)) + battle.grids.forEach(grid => window.addEventListener('resize', () => grid.onresize())) + battle.grids.forEach(grid => grid.recenter()) const gridSelection = document.getElementById("grid") - battle_obj.grids.forEach(grid => { + battle.grids.forEach(grid => { const option = document.createElement("option") const origin = new THREE.Vector3() origin.copy(grid.wrecks[0].killmail.victim.position) @@ -347,22 +347,22 @@ function processBattle({snapshot, renderer, renderer2d, container, toolbar, skyb gridSelection.appendChild(option) }) gridSelection.oninput = () => { - battle_obj.grids.forEach(g => g.disable()) - battle_obj.grids.at(gridSelection.selectedIndex).enable() - battle_obj.grids.at(gridSelection.selectedIndex).draw() + battle.grids.forEach(g => g.disable()) + battle.grids.at(gridSelection.selectedIndex).enable() + battle.grids.at(gridSelection.selectedIndex).draw() } gridSelection.oninput() skybox.then(skybox => { const rt = new THREE.WebGLCubeRenderTarget(skybox.image.height) rt.fromEquirectangularTexture(renderer, skybox) - battle_obj.grids.forEach(g => g.scene.background = rt) + battle.grids.forEach(g => g.scene.background = rt) }) - const statusBar = new StatusBar(battle_obj.timeline) + const statusBar = new StatusBar(battle.timeline) container.appendChild(statusBar.domElement) - battle_obj.timeline.update() + battle.timeline.update() } export function init({id, container, toolbar}) { -- cgit v1.1