添加两台风机

This commit is contained in:
2026-04-01 16:07:37 +08:00
parent fdf920c5aa
commit 32ae719b00

View File

@@ -56,7 +56,7 @@ export class OceanScene {
this.fogLayers = []; this.fogLayers = [];
this.horizonFog = null; this.horizonFog = null;
this.skyHazeBand = null; this.skyHazeBand = null;
this.windTurbine = null; this.windTurbines = [];
this.rainAudioPool = []; this.rainAudioPool = [];
this.rainAudioActiveIndex = 0; this.rainAudioActiveIndex = 0;
this.rainAudioIsPlaying = false; this.rainAudioIsPlaying = false;
@@ -1509,15 +1509,24 @@ export class OceanScene {
} }
async initWindTurbine() { async initWindTurbine() {
this.windTurbine = new OffshoreWindTurbineAsset({ const turbineConfigs = [
position: new THREE.Vector3(280, 0, -2350), { 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, yaw: 0,
scale: 0.68, scale: config.scale,
rotorSpeed: 0.24 rotorSpeed: config.rotorSpeed
}); });
await this.windTurbine.load(); await turbine.load();
this.windTurbine.addToScene(this.scene); turbine.addToScene(this.scene);
this.windTurbine.faceDirection(this.sun); turbine.faceDirection(this.sun);
this.windTurbines.push(turbine);
}));
} }
async initVegetation() { async initVegetation() {
@@ -2325,9 +2334,9 @@ export class OceanScene {
this.vegetationSystem.update(time); this.vegetationSystem.update(time);
} }
if (this.windTurbine) { for (const turbine of this.windTurbines) {
this.windTurbine.faceDirection(this.sun); turbine.faceDirection(this.sun);
this.windTurbine.update(time, delta); turbine.update(time, delta);
} }
if (this.lightningFlash > 0.001) { if (this.lightningFlash > 0.001) {