diff --git a/src/OceanScene.js b/src/OceanScene.js index 022cd30..3555be3 100644 --- a/src/OceanScene.js +++ b/src/OceanScene.js @@ -56,7 +56,7 @@ export class OceanScene { this.fogLayers = []; this.horizonFog = null; this.skyHazeBand = null; - this.windTurbine = null; + this.windTurbines = []; this.rainAudioPool = []; this.rainAudioActiveIndex = 0; this.rainAudioIsPlaying = false; @@ -1509,15 +1509,24 @@ export class OceanScene { } async initWindTurbine() { - this.windTurbine = new OffshoreWindTurbineAsset({ - position: new THREE.Vector3(280, 0, -2350), - yaw: 0, - scale: 0.68, - rotorSpeed: 0.24 - }); - await this.windTurbine.load(); - this.windTurbine.addToScene(this.scene); - this.windTurbine.faceDirection(this.sun); + const turbineConfigs = [ + { position: new THREE.Vector3(280, 0, -2350), scale: 0.68, rotorSpeed: 0.24 }, + { position: new THREE.Vector3(-200, 0, -2900), scale: 0.54, rotorSpeed: 0.19 }, + { position: new THREE.Vector3(700, 0, -1850), scale: 0.62, rotorSpeed: 0.28 }, + ]; + + await Promise.all(turbineConfigs.map(async (config) => { + const turbine = new OffshoreWindTurbineAsset({ + position: config.position, + yaw: 0, + scale: config.scale, + rotorSpeed: config.rotorSpeed + }); + await turbine.load(); + turbine.addToScene(this.scene); + turbine.faceDirection(this.sun); + this.windTurbines.push(turbine); + })); } async initVegetation() { @@ -2325,9 +2334,9 @@ export class OceanScene { this.vegetationSystem.update(time); } - if (this.windTurbine) { - this.windTurbine.faceDirection(this.sun); - this.windTurbine.update(time, delta); + for (const turbine of this.windTurbines) { + turbine.faceDirection(this.sun); + turbine.update(time, delta); } if (this.lightningFlash > 0.001) {