add burst
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user