Tweak: Camera movement and door glow and chances of movement
This commit is contained in:
parent
192fc39461
commit
c521828a08
@ -5,11 +5,11 @@ import { state } from '../state.js';
|
|||||||
|
|
||||||
|
|
||||||
function updateCamera() {
|
function updateCamera() {
|
||||||
const globalTime = Date.now() * 0.00005;
|
const globalTime = Date.now() * 0.00003;
|
||||||
const lookAtTime = Date.now() * 0.00003;
|
const lookAtTime = Date.now() * 0.0002;
|
||||||
|
|
||||||
const camAmplitude = 0.5;
|
const camAmplitude = 0.2;
|
||||||
const lookAmplitude = 0.05;
|
const lookAmplitude = 0.1;
|
||||||
|
|
||||||
// Base Camera Position in front of the TV
|
// Base Camera Position in front of the TV
|
||||||
const baseX = -0.5;
|
const baseX = -0.5;
|
||||||
|
|||||||
@ -77,15 +77,15 @@ export function updateDoor() {
|
|||||||
|
|
||||||
if (stateTimer <= 0) {
|
if (stateTimer <= 0) {
|
||||||
const nextState = Math.random();
|
const nextState = Math.random();
|
||||||
if (nextState < 0.4) {
|
if (nextState < 0.1) {
|
||||||
doorState = DOOR_STATES.RESTING;
|
doorState = DOOR_STATES.RESTING;
|
||||||
stateTimer = 2 + Math.random() * 5;
|
stateTimer = 2 + Math.random() * 5;
|
||||||
} else if (nextState < 0.7) {
|
} else if (nextState < 0.5) {
|
||||||
doorState = DOOR_STATES.OPENING;
|
doorState = DOOR_STATES.OPENING;
|
||||||
stateTimer = 2 + Math.random() * 4;
|
stateTimer = 2 + Math.random() * 5;
|
||||||
} else {
|
} else {
|
||||||
doorState = DOOR_STATES.CLOSING;
|
doorState = DOOR_STATES.CLOSING;
|
||||||
stateTimer = 3 + Math.random() * 3;
|
stateTimer = 3 + Math.random() * 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ export function updateDoor() {
|
|||||||
break;
|
break;
|
||||||
case DOOR_STATES.CLOSING:
|
case DOOR_STATES.CLOSING:
|
||||||
if (doorGroupPanel.rotation.y < minAngle) {
|
if (doorGroupPanel.rotation.y < minAngle) {
|
||||||
doorGroupPanel.rotation.y += speed;
|
doorGroupPanel.rotation.y += speed * 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ export function updateDoor() {
|
|||||||
// Outside material pulsating glow
|
// Outside material pulsating glow
|
||||||
if (outsideMaterial) {
|
if (outsideMaterial) {
|
||||||
const glowMin = 0.001;
|
const glowMin = 0.001;
|
||||||
const glowMax = 0.01;
|
const glowMax = 0.005;
|
||||||
const glowSpeed = 0.0001; // Speed of the pulsation
|
const glowSpeed = 0.0001; // Speed of the pulsation
|
||||||
glowIntensity += glowDirection * glowSpeed;
|
glowIntensity += glowDirection * glowSpeed;
|
||||||
if (glowIntensity >= glowMax) {
|
if (glowIntensity >= glowMax) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user