fixed deprecation issues

This commit is contained in:
2026-03-21 18:00:28 +02:00
parent 8dd88174af
commit bd93436a78
+14 -13
View File
@@ -122,9 +122,9 @@ class GameEngine extends EventManager{
scene.background = new THREE.Color(1, 1, 1);
const mixer = new THREE.AnimationMixer(this.scene);
const clock = new THREE.Clock();
const timer = new THREE.Timer();
this.clock = clock;
this.timer = timer;
this.mixers = [mixer];
await this.initPhysics();
@@ -162,7 +162,7 @@ class GameEngine extends EventManager{
renderer.toneMapping = THREE.CineonToneMapping;
renderer.toneMappingExposure = 1.0;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap; // default THREE.PCFShadowMap
renderer.shadowMap.type = THREE.PCFShadowMap; // default THREE.PCFShadowMap
// renderer.toneMapping = THREE.ACESFilmicToneMapping;
// renderer.toneMappingExposure = 1;
// renderer.shadowMap.enabled = true;
@@ -224,19 +224,20 @@ class GameEngine extends EventManager{
await this.initScene();
function animate(time) {
let delta = gameEngine.clock.getDelta();
gameEngine.physics?.step();
gameEngine.handleXrAction(gameEngine, delta);
gameEngine.hero?.update(delta);
gameEngine.mixers.forEach(m => m.update(delta));
gameEngine.dispatchEvent({type: 'beforeRender'})
gameEngine.processHideIfFar();
function animate() {
this.timer.update();
let delta = this.timer.getDelta();
this.physics?.step();
this.handleXrAction(this, delta);
this.hero?.update(delta);
this.mixers.forEach(m => m.update(delta));
this.dispatchEvent({type: 'beforeRender'})
this.processHideIfFar();
this.motionQueue.update(delta);
gameEngine.render(gameEngine.scene, gameEngine.camera);
this.render(this.scene, this.camera);
if (!renderer.xr.isPresenting) {
gameEngine.gizmo?.render();
this.gizmo?.render();
}
}
renderer.setAnimationLoop(animate.bind(this));