1
0

add vrm mode

This commit is contained in:
2026-03-07 14:35:30 +09:00
parent d1929396ba
commit f60961a963
6 changed files with 125 additions and 20 deletions

View File

@@ -69,11 +69,13 @@ function GoogleMaps3DTiles() {
);
}
export default function AtmosphereScene() {
export default function AtmosphereScene({ timeScale: timeScaleProp }) {
const { gl } = useThree();
const sunRef = useRef();
const atmosphereRef = useRef();
const dateRef = useRef(new Date(INITIAL_DATE));
const timeScaleRef = useRef(timeScaleProp ?? TIME_SCALE);
timeScaleRef.current = timeScaleProp ?? TIME_SCALE;
const [weather, setWeather] = useState(WEATHER_PRESETS[1]);
useEffect(() => {
@@ -93,7 +95,7 @@ export default function AtmosphereScene() {
useFrame((_, delta) => {
const currentDate = dateRef.current;
currentDate.setTime(currentDate.getTime() + delta * TIME_SCALE * 1000);
currentDate.setTime(currentDate.getTime() + delta * timeScaleRef.current * 1000);
if (atmosphereRef.current) {
atmosphereRef.current.updateByDate(currentDate);