Feature: static stage lights before the show
This commit is contained in:
parent
066fcc26cc
commit
dcf12771d6
@ -82,10 +82,29 @@ export class StageLights extends SceneFeature {
|
|||||||
baseX: x
|
baseX: x
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize static random state for pre-party
|
||||||
|
this.staticColor = new THREE.Color().setHSL(Math.random(), 0.8, 0.5);
|
||||||
|
this.focusPoint.set((Math.random() - 0.5) * 20, Math.random() * 2, -10 + (Math.random() - 0.5) * 10);
|
||||||
|
this.targetFocusPoint.copy(this.focusPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
update(deltaTime) {
|
update(deltaTime) {
|
||||||
const time = state.clock.getElapsedTime();
|
const time = state.clock.getElapsedTime();
|
||||||
|
|
||||||
|
if (!state.partyStarted) {
|
||||||
|
this.lights.forEach((item) => {
|
||||||
|
const targetX = this.focusPoint.x + (item.baseX * 0.2);
|
||||||
|
item.target.position.set(targetX, this.focusPoint.y, this.focusPoint.z);
|
||||||
|
item.fixture.lookAt(targetX, this.focusPoint.y, this.focusPoint.z);
|
||||||
|
item.light.intensity = 30;
|
||||||
|
if (this.staticColor) {
|
||||||
|
item.light.color.copy(this.staticColor);
|
||||||
|
item.lens.material.color.copy(this.staticColor);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Change target area logic
|
// Change target area logic
|
||||||
let shouldChange = false;
|
let shouldChange = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user