mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 10:19:06 +01:00
Improve readability
This commit is contained in:
parent
5c5d132466
commit
23a7dcbd33
@ -21,6 +21,9 @@ type Options = {
|
|||||||
useOrthographicCamera: boolean;
|
useOrthographicCamera: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MisskeyRoom Core Engine
|
||||||
|
*/
|
||||||
export class Room {
|
export class Room {
|
||||||
private clock: THREE.Clock;
|
private clock: THREE.Clock;
|
||||||
private scene: THREE.Scene;
|
private scene: THREE.Scene;
|
||||||
@ -450,6 +453,7 @@ export class Room {
|
|||||||
const furniture = this.furnitures.find(furniture => furniture.id === model.name);
|
const furniture = this.furnitures.find(furniture => furniture.id === model.name);
|
||||||
const def = furnitureDefs.find(d => d.id === furniture.type);
|
const def = furnitureDefs.find(d => d.id === furniture.type);
|
||||||
if (def.texture == null) return;
|
if (def.texture == null) return;
|
||||||
|
|
||||||
model.traverse(child => {
|
model.traverse(child => {
|
||||||
if (!(child instanceof THREE.Mesh)) return;
|
if (!(child instanceof THREE.Mesh)) return;
|
||||||
for (const t of Object.keys(def.texture)) {
|
for (const t of Object.keys(def.texture)) {
|
||||||
@ -520,13 +524,12 @@ export class Room {
|
|||||||
|
|
||||||
if (intersects.length > 0) {
|
if (intersects.length > 0) {
|
||||||
const intersected = this.getRoot(intersects[0].object);
|
const intersected = this.getRoot(intersects[0].object);
|
||||||
if (!this.isSelectedObject(intersected)) {
|
if (this.isSelectedObject(intersected)) return;
|
||||||
intersected.traverse(child => {
|
intersected.traverse(child => {
|
||||||
if (child instanceof THREE.Mesh) {
|
if (child instanceof THREE.Mesh) {
|
||||||
(child.material as THREE.MeshStandardMaterial).emissive.setHex(0x191919);
|
(child.material as THREE.MeshStandardMaterial).emissive.setHex(0x191919);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user