rm update
This commit is contained in:
parent
7c3912e69b
commit
f3eab1c169
25
src/index.ts
25
src/index.ts
@ -99,21 +99,6 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
const clock = new THREE.Clock();
|
const clock = new THREE.Clock();
|
||||||
clock.start();
|
clock.start();
|
||||||
|
|
||||||
const update = () => {
|
|
||||||
|
|
||||||
controls.update();
|
|
||||||
requestAnimationFrame(update);
|
|
||||||
const deltaTime = clock.getDelta();
|
|
||||||
if (currentMixer) {
|
|
||||||
currentMixer.update(deltaTime);
|
|
||||||
}
|
|
||||||
if (currentVrm) {
|
|
||||||
currentVrm.update(deltaTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderer.render(scene, camera);
|
|
||||||
}
|
|
||||||
|
|
||||||
scene.background = new THREE.Color( 0xffffff );
|
scene.background = new THREE.Color( 0xffffff );
|
||||||
const directionalLight = new THREE.DirectionalLight(0xffffff);
|
const directionalLight = new THREE.DirectionalLight(0xffffff);
|
||||||
directionalLight.position.set(1, 1, 1);
|
directionalLight.position.set(1, 1, 1);
|
||||||
@ -157,9 +142,15 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
floor_grid();
|
floor_grid();
|
||||||
floor_bg();
|
floor_bg();
|
||||||
|
|
||||||
update();
|
|
||||||
|
|
||||||
function animate() {
|
function animate() {
|
||||||
|
controls.update();
|
||||||
|
const delta = clock.getDelta();
|
||||||
|
if (currentMixer) {
|
||||||
|
currentMixer.update(delta);
|
||||||
|
}
|
||||||
|
if (currentVrm) {
|
||||||
|
currentVrm.update(delta);
|
||||||
|
}
|
||||||
requestAnimationFrame(animate);
|
requestAnimationFrame(animate);
|
||||||
scene.rotation.y += 0.005;
|
scene.rotation.y += 0.005;
|
||||||
renderer.render(scene, camera);
|
renderer.render(scene, camera);
|
||||||
|
Loading…
Reference in New Issue
Block a user