1
0
This commit is contained in:
2025-11-21 15:07:16 +09:00
parent 9248f35fe6
commit 595466a3fe

View File

@@ -30,14 +30,12 @@ const VRM_URL = `${BASE_URL}ai.vrm`;
const VRMA_URL = `${BASE_URL}fly.vrma`;
const EARTH_RADIUS = 6378137;
// 天気変更の間隔 (ms) - 5分
const WEATHER_INTERVAL = 5 * 60 * 1000;
// 時間の進行速度 (倍率)
const TIME_SCALE = 100;
const TIME_SCALE = 10;
// 初期時刻: 正午 (12:00)
const INITIAL_DATE = new Date('2024-06-21T12:00:00');
const INITIAL_DATE = new Date('2024-06-21T16:00:00');
// --- Weather Presets (天候設定) ---
const WEATHER_PRESETS = [
@@ -237,17 +235,12 @@ function AtmosphereScene() {
// 3. 時間進行と太陽移動 (Canvas内なのでuseFrameが使える)
useFrame((state, delta) => {
// 時間を進める
const currentDate = dateRef.current;
const elapsedMs = delta * TIME_SCALE * 1000;
currentDate.setTime(currentDate.getTime() + elapsedMs);
// Atmosphere更新
if (atmosphereRef.current) {
atmosphereRef.current.updateByDate(currentDate);
}
// 太陽移動
if (sunRef.current) {
const hours = currentDate.getHours() + currentDate.getMinutes() / 60 + currentDate.getSeconds() / 3600;
const sunAngle = MathUtils.mapLinear(hours, 6, 18, 0, Math.PI);
@@ -256,7 +249,7 @@ function AtmosphereScene() {
if (hours < 6 || hours > 18) {
sunRef.current.position.set(0, -1, 0);
sunRef.current.intensity = 0.0;
sunRef.current.intensity = 10.0;
} else {
sunRef.current.position.set(sunX, sunY, 0.2);
sunRef.current.intensity = MathUtils.lerp(0.5, 3.0, sunY);