diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-08-19 02:19:37 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-08-19 02:19:37 +0900 |
| commit | 79c647502873bb10d4f8403d1e10c41e1b99c1cf (patch) | |
| tree | 7475faaeafeb4f7e77ea3076e1aa7f07c9132a22 /src/client/app | |
| parent | Refactoring (diff) | |
| download | sharkey-79c647502873bb10d4f8403d1e10c41e1b99c1cf.tar.gz sharkey-79c647502873bb10d4f8403d1e10c41e1b99c1cf.tar.bz2 sharkey-79c647502873bb10d4f8403d1e10c41e1b99c1cf.zip | |
Improve readability
Diffstat (limited to 'src/client/app')
| -rw-r--r-- | src/client/app/common/scripts/room/room.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/app/common/scripts/room/room.ts b/src/client/app/common/scripts/room/room.ts index b277da92a4..4966302ef8 100644 --- a/src/client/app/common/scripts/room/room.ts +++ b/src/client/app/common/scripts/room/room.ts @@ -21,6 +21,9 @@ type Options = { useOrthographicCamera: boolean; }; +/** + * MisskeyRoom Core Engine + */ export class Room { private clock: THREE.Clock; private scene: THREE.Scene; @@ -450,6 +453,7 @@ export class Room { const furniture = this.furnitures.find(furniture => furniture.id === model.name); const def = furnitureDefs.find(d => d.id === furniture.type); if (def.texture == null) return; + model.traverse(child => { if (!(child instanceof THREE.Mesh)) return; for (const t of Object.keys(def.texture)) { @@ -520,13 +524,12 @@ export class Room { if (intersects.length > 0) { const intersected = this.getRoot(intersects[0].object); - if (!this.isSelectedObject(intersected)) { - intersected.traverse(child => { - if (child instanceof THREE.Mesh) { - (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x191919); - } - }); - } + if (this.isSelectedObject(intersected)) return; + intersected.traverse(child => { + if (child instanceof THREE.Mesh) { + (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x191919); + } + }); } } |