Refactor and enhance spirit object processing in app.js
This commit is contained in:
@@ -368,9 +368,19 @@ async function showSpirit(spirit) {
|
|||||||
}
|
}
|
||||||
console.log("Lade Spirit", spirit.modelUrl);
|
console.log("Lade Spirit", spirit.modelUrl);
|
||||||
const { scene: spiritObj } = await gltfLoader.loadAsync(spirit.modelUrl);
|
const { scene: spiritObj } = await gltfLoader.loadAsync(spirit.modelUrl);
|
||||||
console.log("spiritObj children", spiritObj.children)
|
// TESTBLOCK
|
||||||
currentSpirit = new Spirit(scene, spiritObj, spirit);
|
spiritObj.traverse(mesh => {
|
||||||
window.currentSpirit = currentSpirit;
|
if (mesh.isMesh) {
|
||||||
|
mesh.material.opacity = 1;
|
||||||
|
mesh.material.transparent = false;
|
||||||
|
mesh.material.color.set(0xffffff);
|
||||||
|
mesh.castShadow = true;
|
||||||
|
mesh.receiveShadow = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
spiritObj.position.set(0, 0, 0); // GANZ vorne
|
||||||
|
scene.add(spiritObj);
|
||||||
|
window.lastSpiritObj = spiritObj; // Debug
|
||||||
updateSpiritOverlay(spirit);
|
updateSpiritOverlay(spirit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user