1
0

add burst

This commit is contained in:
2026-03-07 20:22:44 +09:00
parent 69d4c5a787
commit 3f41d65e30
6 changed files with 294 additions and 10 deletions

View File

@@ -69,13 +69,28 @@ function GoogleMaps3DTiles() {
);
}
export default function AtmosphereScene({ timeScale: timeScaleProp }) {
export default function AtmosphereScene({ timeScale: timeScaleProp, overrideDate, overrideTimeScale }) {
const { gl } = useThree();
const sunRef = useRef();
const atmosphereRef = useRef();
const dateRef = useRef(new Date(INITIAL_DATE));
const savedDateRef = useRef(null);
const timeScaleRef = useRef(timeScaleProp ?? TIME_SCALE);
timeScaleRef.current = timeScaleProp ?? TIME_SCALE;
// Override date for burst effect
const hasBurstRef = useRef(false);
useEffect(() => {
if (overrideDate) {
hasBurstRef.current = true;
dateRef.current = new Date(overrideDate);
} else if (hasBurstRef.current) {
hasBurstRef.current = false;
// Burst ended: set to sunrise
dateRef.current = new Date('2024-06-22T10:00:00');
}
}, [overrideDate]);
timeScaleRef.current = overrideTimeScale ?? timeScaleProp ?? TIME_SCALE;
const [weather, setWeather] = useState(WEATHER_PRESETS[1]);
useEffect(() => {