add stats

This commit is contained in:
2025-01-18 20:10:54 +09:00
parent 8457312f63
commit 7824ba976b
7 changed files with 22 additions and 6 deletions
+8
View File
@@ -1,5 +1,6 @@
import * as THREE from 'three'
import { Tween } from '@tweenjs/tween.js'
import Stats from 'stats.js'
const global = (0,eval)('this')
const scene = new THREE.Scene()
@@ -70,10 +71,15 @@ const tweenDuration = 33
const keysDown = {}
const mouse = {}
var stats = new Stats()
stats.showPanel(0)
function render() {
stats.begin()
cameraMovement()
Object.values(positionTweens).forEach((tween) => tween.update()) // TODO: clean up tweens
renderer.render(scene, camera)
stats.end()
}
function minimapRender() {
@@ -560,4 +566,6 @@ window.addEventListener('load', () => {
const minimap = minimapRenderer.domElement
minimap.classList.add('minimap')
document.body.appendChild(minimap)
document.body.appendChild(stats.dom)
})