add vrm mode
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user