Skip to content

Commit

Permalink
🚧 Depth sorting for 3d module
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Aug 16, 2020
1 parent 5709b96 commit 8165fd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/data/ct.libs/3d/injects/beforeroomdraw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if (this === ct.room) {
for (const child of ct.camera3d.room.children) {
child.distanceToCamera = child.getDepth();
}
ct.camera3d.room.children.sort(function sortByDepth(a, b) {
return b.distanceToCamera - a.distanceToCamera;
});
}
6 changes: 3 additions & 3 deletions app/data/ct.libs/3d/projection.ict
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ types:
uid: 0ae31f06-ea0f-446a-9caa-22dba4d7cad9
lastmod: 1597380836327
- name: Comigo
depth: 20
depth: -40
oncreate: ''
onstep: this.move();
ondraw: ''
Expand All @@ -169,7 +169,7 @@ types:
uid: 312c8e4f-52cb-4f54-a3a6-9711048504d2
lastmod: 1597381479959
- name: Lamp
depth: 20
depth: -40
oncreate: ''
onstep: this.move();
ondraw: ''
Expand All @@ -179,7 +179,7 @@ types:
threeDOrientation: xNegative
threeDEnabled: true
uid: 93de9f6e-dc74-4277-a778-b9b9ded16c37
lastmod: 1597379858109
lastmod: 1597541560523
- name: SandCellSquare
depth: 0
oncreate: ''
Expand Down

0 comments on commit 8165fd4

Please sign in to comment.