@operato/scene-visualizer 1.2.37 → 1.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/db.sqlite +0 -0
  3. package/dist/camera copy.d.ts +20 -0
  4. package/dist/camera copy.js +103 -0
  5. package/dist/camera copy.js.map +1 -0
  6. package/dist/camera.d.ts +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +1 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/light.d.ts +15 -0
  11. package/dist/light.js +131 -0
  12. package/dist/light.js.map +1 -0
  13. package/dist/point-light.d.ts +14 -0
  14. package/dist/point-light.js +77 -0
  15. package/dist/point-light.js.map +1 -0
  16. package/dist/rack.d.ts +2 -2
  17. package/dist/stock.d.ts +1 -1
  18. package/dist/templates/index.d.ts +20 -0
  19. package/dist/templates/index.js +2 -0
  20. package/dist/templates/index.js.map +1 -1
  21. package/dist/templates/light.d.ts +22 -0
  22. package/dist/templates/light.js +23 -0
  23. package/dist/templates/light.js.map +1 -0
  24. package/dist/templates/point-light.d.ts +22 -0
  25. package/dist/templates/point-light.js +23 -0
  26. package/dist/templates/point-light.js.map +1 -0
  27. package/dist/templates/sprite.js +1 -1
  28. package/dist/templates/sprite.js.map +1 -1
  29. package/dist/templates/wall copy.d.ts +19 -0
  30. package/dist/templates/wall copy.js +20 -0
  31. package/dist/templates/wall copy.js.map +1 -0
  32. package/dist/three-container.js +0 -18
  33. package/dist/three-container.js.map +1 -1
  34. package/dist/threed/real-object-camera-meshed.d.ts +1 -1
  35. package/dist/threed/real-object-dom-element.d.ts +1 -0
  36. package/dist/threed/real-object-dom-element.js +6 -0
  37. package/dist/threed/real-object-dom-element.js.map +1 -1
  38. package/dist/threed/real-object-extrude.d.ts +1 -1
  39. package/dist/threed/real-object-mesh.d.ts +2 -2
  40. package/dist/threed/real-object-sprite.d.ts +1 -0
  41. package/dist/threed/real-object-sprite.js +6 -0
  42. package/dist/threed/real-object-sprite.js.map +1 -1
  43. package/dist/threed/texture/canvas-texture.js +25 -7
  44. package/dist/threed/texture/canvas-texture.js.map +1 -1
  45. package/helps/scene/component/light.ko.md +12 -0
  46. package/helps/scene/component/light.md +12 -0
  47. package/helps/scene/component/light.zh.md +12 -0
  48. package/icons/light.png +0 -0
  49. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +13 -3
  50. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +15 -0
  51. package/logs/application-2023-05-23-21.log +6 -0
  52. package/logs/application-2023-05-24-21.log +6 -0
  53. package/logs/application-2023-05-25-00.log +20 -0
  54. package/logs/connections-2023-05-23-21.log +41 -0
  55. package/logs/connections-2023-05-24-21.log +41 -0
  56. package/logs/connections-2023-05-25-00.log +123 -0
  57. package/package.json +3 -3
  58. package/src/index.ts +1 -0
  59. package/src/light.ts +155 -0
  60. package/src/templates/index.ts +2 -0
  61. package/src/templates/light.ts +23 -0
  62. package/src/templates/sprite.ts +1 -1
  63. package/src/three-container.ts +0 -21
  64. package/src/threed/real-object-dom-element.ts +9 -4
  65. package/src/threed/real-object-sprite.ts +9 -0
  66. package/src/threed/texture/canvas-texture.ts +32 -6
  67. package/translations/en.json +6 -1
  68. package/translations/ko.json +6 -1
  69. package/translations/ms.json +6 -1
  70. package/translations/zh.json +6 -1
  71. package/tsconfig.tsbuildinfo +1 -1
  72. package/logs/application-2023-05-20-07.log +0 -6
@@ -0,0 +1,41 @@
1
+ 2023-05-23T21:42:14+09:00 info: Initializing ConnectionManager...
2
+ 2023-05-23T21:42:14+09:00 info: Connector 'echo-back-server' started to ready
3
+ 2023-05-23T21:42:14+09:00 info: Connector 'echo-back' started to ready
4
+ 2023-05-23T21:42:14+09:00 info: Connector 'http-connector' started to ready
5
+ 2023-05-23T21:42:14+09:00 info: Connector 'graphql-connector' started to ready
6
+ 2023-05-23T21:42:14+09:00 info: Connector 'sqlite-connector' started to ready
7
+ 2023-05-23T21:42:14+09:00 info: Connector 'postgresql-connector' started to ready
8
+ 2023-05-23T21:42:14+09:00 info: Connector 'mqtt-connector' started to ready
9
+ 2023-05-23T21:42:14+09:00 info: Connector 'mssql-connector' started to ready
10
+ 2023-05-23T21:42:14+09:00 info: Connector 'oracle-connector' started to ready
11
+ 2023-05-23T21:42:14+09:00 info: Connector 'mysql-connector' started to ready
12
+ 2023-05-23T21:42:14+09:00 info: Connector 'socket-server' started to ready
13
+ 2023-05-23T21:42:14+09:00 info: Connector 'msgraph-connector' started to ready
14
+ 2023-05-23T21:42:14+09:00 info: Connector 'openai-connector' started to ready
15
+ 2023-05-23T21:42:14+09:00 info: echo-back-servers are ready
16
+ 2023-05-23T21:42:14+09:00 info: echo-back connections are ready
17
+ 2023-05-23T21:42:14+09:00 info: http-connector connections are ready
18
+ 2023-05-23T21:42:14+09:00 info: graphql-connector connections are ready
19
+ 2023-05-23T21:42:14+09:00 info: sqlite-connector connections are ready
20
+ 2023-05-23T21:42:14+09:00 info: postgresql-connector connections are ready
21
+ 2023-05-23T21:42:14+09:00 info: mqtt-connector connections are ready
22
+ 2023-05-23T21:42:14+09:00 info: mssql-connector connections are ready
23
+ 2023-05-23T21:42:14+09:00 info: oracle-connector connections are ready
24
+ 2023-05-23T21:42:14+09:00 info: mysql-connector connections are ready
25
+ 2023-05-23T21:42:14+09:00 info: socket servers are ready
26
+ 2023-05-23T21:42:14+09:00 info: msgraph-connector connections are ready
27
+ 2023-05-23T21:42:14+09:00 info: openai-connector connections are ready
28
+ 2023-05-23T21:42:14+09:00 info: All connector for 'echo-back-server' ready
29
+ 2023-05-23T21:42:14+09:00 info: All connector for 'echo-back' ready
30
+ 2023-05-23T21:42:14+09:00 info: All connector for 'http-connector' ready
31
+ 2023-05-23T21:42:14+09:00 info: All connector for 'graphql-connector' ready
32
+ 2023-05-23T21:42:14+09:00 info: All connector for 'sqlite-connector' ready
33
+ 2023-05-23T21:42:14+09:00 info: All connector for 'postgresql-connector' ready
34
+ 2023-05-23T21:42:14+09:00 info: All connector for 'mqtt-connector' ready
35
+ 2023-05-23T21:42:14+09:00 info: All connector for 'mssql-connector' ready
36
+ 2023-05-23T21:42:14+09:00 info: All connector for 'oracle-connector' ready
37
+ 2023-05-23T21:42:14+09:00 info: All connector for 'mysql-connector' ready
38
+ 2023-05-23T21:42:14+09:00 info: All connector for 'socket-server' ready
39
+ 2023-05-23T21:42:14+09:00 info: All connector for 'msgraph-connector' ready
40
+ 2023-05-23T21:42:14+09:00 info: All connector for 'openai-connector' ready
41
+ 2023-05-23T21:42:14+09:00 info: ConnectionManager initialization done:
@@ -0,0 +1,41 @@
1
+ 2023-05-24T21:23:43+09:00 info: Initializing ConnectionManager...
2
+ 2023-05-24T21:23:43+09:00 info: Connector 'echo-back-server' started to ready
3
+ 2023-05-24T21:23:43+09:00 info: Connector 'echo-back' started to ready
4
+ 2023-05-24T21:23:43+09:00 info: Connector 'http-connector' started to ready
5
+ 2023-05-24T21:23:43+09:00 info: Connector 'graphql-connector' started to ready
6
+ 2023-05-24T21:23:43+09:00 info: Connector 'sqlite-connector' started to ready
7
+ 2023-05-24T21:23:43+09:00 info: Connector 'postgresql-connector' started to ready
8
+ 2023-05-24T21:23:43+09:00 info: Connector 'mqtt-connector' started to ready
9
+ 2023-05-24T21:23:43+09:00 info: Connector 'mssql-connector' started to ready
10
+ 2023-05-24T21:23:43+09:00 info: Connector 'oracle-connector' started to ready
11
+ 2023-05-24T21:23:43+09:00 info: Connector 'mysql-connector' started to ready
12
+ 2023-05-24T21:23:43+09:00 info: Connector 'socket-server' started to ready
13
+ 2023-05-24T21:23:43+09:00 info: Connector 'msgraph-connector' started to ready
14
+ 2023-05-24T21:23:43+09:00 info: Connector 'openai-connector' started to ready
15
+ 2023-05-24T21:23:43+09:00 info: echo-back-servers are ready
16
+ 2023-05-24T21:23:43+09:00 info: echo-back connections are ready
17
+ 2023-05-24T21:23:43+09:00 info: http-connector connections are ready
18
+ 2023-05-24T21:23:43+09:00 info: graphql-connector connections are ready
19
+ 2023-05-24T21:23:43+09:00 info: sqlite-connector connections are ready
20
+ 2023-05-24T21:23:43+09:00 info: postgresql-connector connections are ready
21
+ 2023-05-24T21:23:43+09:00 info: mqtt-connector connections are ready
22
+ 2023-05-24T21:23:43+09:00 info: mssql-connector connections are ready
23
+ 2023-05-24T21:23:43+09:00 info: oracle-connector connections are ready
24
+ 2023-05-24T21:23:43+09:00 info: mysql-connector connections are ready
25
+ 2023-05-24T21:23:43+09:00 info: socket servers are ready
26
+ 2023-05-24T21:23:43+09:00 info: msgraph-connector connections are ready
27
+ 2023-05-24T21:23:43+09:00 info: openai-connector connections are ready
28
+ 2023-05-24T21:23:43+09:00 info: All connector for 'echo-back-server' ready
29
+ 2023-05-24T21:23:43+09:00 info: All connector for 'echo-back' ready
30
+ 2023-05-24T21:23:43+09:00 info: All connector for 'http-connector' ready
31
+ 2023-05-24T21:23:43+09:00 info: All connector for 'graphql-connector' ready
32
+ 2023-05-24T21:23:43+09:00 info: All connector for 'sqlite-connector' ready
33
+ 2023-05-24T21:23:43+09:00 info: All connector for 'postgresql-connector' ready
34
+ 2023-05-24T21:23:43+09:00 info: All connector for 'mqtt-connector' ready
35
+ 2023-05-24T21:23:43+09:00 info: All connector for 'mssql-connector' ready
36
+ 2023-05-24T21:23:43+09:00 info: All connector for 'oracle-connector' ready
37
+ 2023-05-24T21:23:43+09:00 info: All connector for 'mysql-connector' ready
38
+ 2023-05-24T21:23:43+09:00 info: All connector for 'socket-server' ready
39
+ 2023-05-24T21:23:43+09:00 info: All connector for 'msgraph-connector' ready
40
+ 2023-05-24T21:23:43+09:00 info: All connector for 'openai-connector' ready
41
+ 2023-05-24T21:23:43+09:00 info: ConnectionManager initialization done:
@@ -0,0 +1,123 @@
1
+ 2023-05-25T00:03:32+09:00 info: Initializing ConnectionManager...
2
+ 2023-05-25T00:03:32+09:00 info: Connector 'echo-back-server' started to ready
3
+ 2023-05-25T00:03:32+09:00 info: Connector 'echo-back' started to ready
4
+ 2023-05-25T00:03:32+09:00 info: Connector 'http-connector' started to ready
5
+ 2023-05-25T00:03:32+09:00 info: Connector 'graphql-connector' started to ready
6
+ 2023-05-25T00:03:32+09:00 info: Connector 'sqlite-connector' started to ready
7
+ 2023-05-25T00:03:32+09:00 info: Connector 'postgresql-connector' started to ready
8
+ 2023-05-25T00:03:32+09:00 info: Connector 'mqtt-connector' started to ready
9
+ 2023-05-25T00:03:32+09:00 info: Connector 'mssql-connector' started to ready
10
+ 2023-05-25T00:03:32+09:00 info: Connector 'oracle-connector' started to ready
11
+ 2023-05-25T00:03:32+09:00 info: Connector 'mysql-connector' started to ready
12
+ 2023-05-25T00:03:32+09:00 info: Connector 'socket-server' started to ready
13
+ 2023-05-25T00:03:32+09:00 info: Connector 'msgraph-connector' started to ready
14
+ 2023-05-25T00:03:32+09:00 info: Connector 'openai-connector' started to ready
15
+ 2023-05-25T00:03:32+09:00 info: echo-back-servers are ready
16
+ 2023-05-25T00:03:32+09:00 info: echo-back connections are ready
17
+ 2023-05-25T00:03:32+09:00 info: http-connector connections are ready
18
+ 2023-05-25T00:03:32+09:00 info: graphql-connector connections are ready
19
+ 2023-05-25T00:03:32+09:00 info: sqlite-connector connections are ready
20
+ 2023-05-25T00:03:32+09:00 info: postgresql-connector connections are ready
21
+ 2023-05-25T00:03:32+09:00 info: mqtt-connector connections are ready
22
+ 2023-05-25T00:03:32+09:00 info: mssql-connector connections are ready
23
+ 2023-05-25T00:03:32+09:00 info: oracle-connector connections are ready
24
+ 2023-05-25T00:03:32+09:00 info: mysql-connector connections are ready
25
+ 2023-05-25T00:03:32+09:00 info: socket servers are ready
26
+ 2023-05-25T00:03:32+09:00 info: msgraph-connector connections are ready
27
+ 2023-05-25T00:03:32+09:00 info: openai-connector connections are ready
28
+ 2023-05-25T00:03:32+09:00 info: All connector for 'echo-back-server' ready
29
+ 2023-05-25T00:03:32+09:00 info: All connector for 'echo-back' ready
30
+ 2023-05-25T00:03:32+09:00 info: All connector for 'http-connector' ready
31
+ 2023-05-25T00:03:32+09:00 info: All connector for 'graphql-connector' ready
32
+ 2023-05-25T00:03:32+09:00 info: All connector for 'sqlite-connector' ready
33
+ 2023-05-25T00:03:32+09:00 info: All connector for 'postgresql-connector' ready
34
+ 2023-05-25T00:03:32+09:00 info: All connector for 'mqtt-connector' ready
35
+ 2023-05-25T00:03:32+09:00 info: All connector for 'mssql-connector' ready
36
+ 2023-05-25T00:03:32+09:00 info: All connector for 'oracle-connector' ready
37
+ 2023-05-25T00:03:32+09:00 info: All connector for 'mysql-connector' ready
38
+ 2023-05-25T00:03:32+09:00 info: All connector for 'socket-server' ready
39
+ 2023-05-25T00:03:32+09:00 info: All connector for 'msgraph-connector' ready
40
+ 2023-05-25T00:03:32+09:00 info: All connector for 'openai-connector' ready
41
+ 2023-05-25T00:03:32+09:00 info: ConnectionManager initialization done:
42
+ 2023-05-25T00:27:21+09:00 info: Initializing ConnectionManager...
43
+ 2023-05-25T00:27:21+09:00 info: Connector 'echo-back-server' started to ready
44
+ 2023-05-25T00:27:21+09:00 info: Connector 'echo-back' started to ready
45
+ 2023-05-25T00:27:21+09:00 info: Connector 'http-connector' started to ready
46
+ 2023-05-25T00:27:21+09:00 info: Connector 'graphql-connector' started to ready
47
+ 2023-05-25T00:27:21+09:00 info: Connector 'sqlite-connector' started to ready
48
+ 2023-05-25T00:27:21+09:00 info: Connector 'postgresql-connector' started to ready
49
+ 2023-05-25T00:27:21+09:00 info: Connector 'mqtt-connector' started to ready
50
+ 2023-05-25T00:27:21+09:00 info: Connector 'mssql-connector' started to ready
51
+ 2023-05-25T00:27:21+09:00 info: Connector 'oracle-connector' started to ready
52
+ 2023-05-25T00:27:21+09:00 info: Connector 'mysql-connector' started to ready
53
+ 2023-05-25T00:27:21+09:00 info: Connector 'socket-server' started to ready
54
+ 2023-05-25T00:27:21+09:00 info: Connector 'msgraph-connector' started to ready
55
+ 2023-05-25T00:27:21+09:00 info: Connector 'openai-connector' started to ready
56
+ 2023-05-25T00:27:21+09:00 info: echo-back-servers are ready
57
+ 2023-05-25T00:27:21+09:00 info: echo-back connections are ready
58
+ 2023-05-25T00:27:21+09:00 info: http-connector connections are ready
59
+ 2023-05-25T00:27:21+09:00 info: graphql-connector connections are ready
60
+ 2023-05-25T00:27:21+09:00 info: sqlite-connector connections are ready
61
+ 2023-05-25T00:27:21+09:00 info: postgresql-connector connections are ready
62
+ 2023-05-25T00:27:21+09:00 info: mqtt-connector connections are ready
63
+ 2023-05-25T00:27:21+09:00 info: mssql-connector connections are ready
64
+ 2023-05-25T00:27:21+09:00 info: oracle-connector connections are ready
65
+ 2023-05-25T00:27:21+09:00 info: mysql-connector connections are ready
66
+ 2023-05-25T00:27:21+09:00 info: socket servers are ready
67
+ 2023-05-25T00:27:21+09:00 info: msgraph-connector connections are ready
68
+ 2023-05-25T00:27:21+09:00 info: openai-connector connections are ready
69
+ 2023-05-25T00:27:21+09:00 info: All connector for 'echo-back-server' ready
70
+ 2023-05-25T00:27:21+09:00 info: All connector for 'echo-back' ready
71
+ 2023-05-25T00:27:21+09:00 info: All connector for 'http-connector' ready
72
+ 2023-05-25T00:27:21+09:00 info: All connector for 'graphql-connector' ready
73
+ 2023-05-25T00:27:21+09:00 info: All connector for 'sqlite-connector' ready
74
+ 2023-05-25T00:27:21+09:00 info: All connector for 'postgresql-connector' ready
75
+ 2023-05-25T00:27:21+09:00 info: All connector for 'mqtt-connector' ready
76
+ 2023-05-25T00:27:21+09:00 info: All connector for 'mssql-connector' ready
77
+ 2023-05-25T00:27:21+09:00 info: All connector for 'oracle-connector' ready
78
+ 2023-05-25T00:27:21+09:00 info: All connector for 'mysql-connector' ready
79
+ 2023-05-25T00:27:21+09:00 info: All connector for 'socket-server' ready
80
+ 2023-05-25T00:27:21+09:00 info: All connector for 'msgraph-connector' ready
81
+ 2023-05-25T00:27:21+09:00 info: All connector for 'openai-connector' ready
82
+ 2023-05-25T00:27:21+09:00 info: ConnectionManager initialization done:
83
+ 2023-05-25T00:28:40+09:00 info: Initializing ConnectionManager...
84
+ 2023-05-25T00:28:40+09:00 info: Connector 'echo-back-server' started to ready
85
+ 2023-05-25T00:28:40+09:00 info: Connector 'echo-back' started to ready
86
+ 2023-05-25T00:28:40+09:00 info: Connector 'http-connector' started to ready
87
+ 2023-05-25T00:28:40+09:00 info: Connector 'graphql-connector' started to ready
88
+ 2023-05-25T00:28:40+09:00 info: Connector 'sqlite-connector' started to ready
89
+ 2023-05-25T00:28:40+09:00 info: Connector 'postgresql-connector' started to ready
90
+ 2023-05-25T00:28:40+09:00 info: Connector 'mqtt-connector' started to ready
91
+ 2023-05-25T00:28:40+09:00 info: Connector 'mssql-connector' started to ready
92
+ 2023-05-25T00:28:40+09:00 info: Connector 'oracle-connector' started to ready
93
+ 2023-05-25T00:28:40+09:00 info: Connector 'mysql-connector' started to ready
94
+ 2023-05-25T00:28:40+09:00 info: Connector 'socket-server' started to ready
95
+ 2023-05-25T00:28:40+09:00 info: Connector 'msgraph-connector' started to ready
96
+ 2023-05-25T00:28:40+09:00 info: Connector 'openai-connector' started to ready
97
+ 2023-05-25T00:28:40+09:00 info: echo-back-servers are ready
98
+ 2023-05-25T00:28:40+09:00 info: echo-back connections are ready
99
+ 2023-05-25T00:28:40+09:00 info: http-connector connections are ready
100
+ 2023-05-25T00:28:40+09:00 info: graphql-connector connections are ready
101
+ 2023-05-25T00:28:40+09:00 info: sqlite-connector connections are ready
102
+ 2023-05-25T00:28:40+09:00 info: postgresql-connector connections are ready
103
+ 2023-05-25T00:28:40+09:00 info: mqtt-connector connections are ready
104
+ 2023-05-25T00:28:40+09:00 info: mssql-connector connections are ready
105
+ 2023-05-25T00:28:40+09:00 info: oracle-connector connections are ready
106
+ 2023-05-25T00:28:40+09:00 info: mysql-connector connections are ready
107
+ 2023-05-25T00:28:40+09:00 info: socket servers are ready
108
+ 2023-05-25T00:28:40+09:00 info: msgraph-connector connections are ready
109
+ 2023-05-25T00:28:40+09:00 info: openai-connector connections are ready
110
+ 2023-05-25T00:28:40+09:00 info: All connector for 'echo-back-server' ready
111
+ 2023-05-25T00:28:40+09:00 info: All connector for 'echo-back' ready
112
+ 2023-05-25T00:28:40+09:00 info: All connector for 'http-connector' ready
113
+ 2023-05-25T00:28:40+09:00 info: All connector for 'graphql-connector' ready
114
+ 2023-05-25T00:28:40+09:00 info: All connector for 'sqlite-connector' ready
115
+ 2023-05-25T00:28:40+09:00 info: All connector for 'postgresql-connector' ready
116
+ 2023-05-25T00:28:40+09:00 info: All connector for 'mqtt-connector' ready
117
+ 2023-05-25T00:28:40+09:00 info: All connector for 'mssql-connector' ready
118
+ 2023-05-25T00:28:40+09:00 info: All connector for 'oracle-connector' ready
119
+ 2023-05-25T00:28:40+09:00 info: All connector for 'mysql-connector' ready
120
+ 2023-05-25T00:28:40+09:00 info: All connector for 'socket-server' ready
121
+ 2023-05-25T00:28:40+09:00 info: All connector for 'msgraph-connector' ready
122
+ 2023-05-25T00:28:40+09:00 info: All connector for 'openai-connector' ready
123
+ 2023-05-25T00:28:40+09:00 info: ConnectionManager initialization done:
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/scene-visualizer",
3
3
  "description": "visualizer component for operato-scene",
4
4
  "author": "heartyoh",
5
- "version": "1.2.37",
5
+ "version": "1.2.39",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "@hatiolab/prettier-config": "^1.0.0",
37
37
  "@things-factory/builder": "^6.0.0",
38
38
  "@things-factory/operato-board": "^6.0.0",
39
- "@types/three": "^0.151.0",
39
+ "@types/three": "^0.152.0",
40
40
  "@types/tinycolor2": "^1.4.3",
41
41
  "@typescript-eslint/eslint-plugin": "^4.33.0",
42
42
  "@typescript-eslint/parser": "^4.33.0",
@@ -62,5 +62,5 @@
62
62
  "prettier --write"
63
63
  ]
64
64
  },
65
- "gitHead": "a98649c72912eb41db840d6a5442ad8ef6b855e1"
65
+ "gitHead": "b9e52c76a2cd160a6f7341aa26694c928ed1051a"
66
66
  }
package/src/index.ts CHANGED
@@ -26,3 +26,4 @@ export * from './sphere'
26
26
  export * from './visualizer'
27
27
  export * from './three-container'
28
28
  export * from './wall'
29
+ export * from './light'
package/src/light.ts ADDED
@@ -0,0 +1,155 @@
1
+ /*
2
+ * Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { Anchor, Component, ComponentNature, Ellipse } from '@hatiolab/things-scene'
5
+ import * as THREE from 'three'
6
+ import { RealObject } from './threed/real-object'
7
+
8
+ const NATURE = {
9
+ mutable: false,
10
+ resizable: true,
11
+ rotatable: true,
12
+ properties: [
13
+ {
14
+ type: 'select',
15
+ label: 'light-type',
16
+ name: 'lightType',
17
+ property: {
18
+ options: ['', 'point', 'directional']
19
+ }
20
+ },
21
+ {
22
+ type: 'number',
23
+ label: 'intensity',
24
+ name: 'intensity'
25
+ },
26
+ {
27
+ type: 'number',
28
+ label: 'distance',
29
+ name: 'distance'
30
+ },
31
+ {
32
+ type: 'number',
33
+ label: 'decay',
34
+ name: 'decay'
35
+ },
36
+ {
37
+ type: 'checkbox',
38
+ label: 'cast-shadow',
39
+ name: 'castShadow'
40
+ },
41
+ {
42
+ type: 'number',
43
+ label: 'near',
44
+ name: 'near',
45
+ placeholder: '0.5'
46
+ },
47
+ {
48
+ type: 'number',
49
+ label: 'far',
50
+ name: 'far',
51
+ placeholder: '1000'
52
+ },
53
+ {
54
+ type: 'number',
55
+ label: 'fov',
56
+ name: 'fov',
57
+ placeholder: '90'
58
+ },
59
+ {
60
+ type: 'number',
61
+ label: 'zoom',
62
+ name: 'zoom',
63
+ placeholder: '1'
64
+ },
65
+ {
66
+ type: 'checkbox',
67
+ label: 'show-helper',
68
+ name: 'showHelper'
69
+ }
70
+ ],
71
+ help: 'scene/component/light'
72
+ }
73
+
74
+ export class LightObject extends RealObject<THREE.Light> {
75
+ helper?: THREE.CameraHelper
76
+
77
+ updatePointLight() {
78
+ var {
79
+ lightType = 'point',
80
+ distance = 0, // unlimited
81
+ intensity = 10,
82
+ decay = 1,
83
+ fillStyle: color = 'white',
84
+ castShadow,
85
+ near = 0.5,
86
+ far = 1000,
87
+ fov = 90,
88
+ zoom = 1,
89
+ showHelper
90
+ } = this.component.state
91
+
92
+ this.object3d!.color = new THREE.Color(color)
93
+ if (lightType == 'point') {
94
+ ;(this.object3d as THREE.PointLight)!.distance = distance
95
+ ;(this.object3d as THREE.PointLight)!.decay = decay
96
+ }
97
+ this.object3d!.intensity = intensity
98
+ this.object3d!.castShadow = castShadow
99
+ if (castShadow) {
100
+ const camera = this.object3d!.shadow?.camera as THREE.PerspectiveCamera
101
+ camera.far = far
102
+ camera.near = near
103
+ camera.fov = fov
104
+ camera.zoom = zoom
105
+ }
106
+
107
+ if (showHelper) {
108
+ const camera = this.object3d!.shadow?.camera as THREE.PerspectiveCamera
109
+
110
+ if (!this.helper) {
111
+ this.helper = new THREE.CameraHelper(camera!)
112
+ this.object3d.add(this.helper)
113
+ }
114
+ } else if (this.helper) {
115
+ this.object3d.remove(this.helper)
116
+ delete this.helper
117
+ }
118
+ }
119
+
120
+ protected getObject3dInstance(): THREE.Light {
121
+ var { lightType = 'point' } = this.component.state
122
+
123
+ return lightType == 'point' ? new THREE.PointLight() : new THREE.DirectionalLight()
124
+ }
125
+
126
+ update() {
127
+ this.clear()
128
+ this.build()
129
+
130
+ this.updateDimension()
131
+ this.updateHidden()
132
+
133
+ this.updatePointLight()
134
+ }
135
+ }
136
+
137
+ export class PointLight extends Ellipse {
138
+ is3dish() {
139
+ return true
140
+ }
141
+
142
+ buildRealObject(): RealObject | undefined {
143
+ return new LightObject(this)
144
+ }
145
+
146
+ get anchors(): Array<Anchor> {
147
+ return []
148
+ }
149
+
150
+ get nature(): ComponentNature {
151
+ return NATURE
152
+ }
153
+ }
154
+
155
+ Component.register('light', PointLight)
@@ -9,6 +9,7 @@ import sprite from './sprite'
9
9
  import wall from './wall'
10
10
  import desk from './desk'
11
11
  import camera from './camera'
12
+ import light from './light'
12
13
  import GLTFObject from './gltf-object'
13
14
 
14
15
  export default [
@@ -16,6 +17,7 @@ export default [
16
17
  visualizer,
17
18
  rackTable,
18
19
  camera,
20
+ light,
19
21
  cube,
20
22
  cylinder,
21
23
  sphere,
@@ -0,0 +1,23 @@
1
+ const icon = new URL('../../icons/light.png', import.meta.url).href
2
+
3
+ export default {
4
+ type: 'light',
5
+ description: 'Light',
6
+ group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
7
+ icon,
8
+ model: {
9
+ type: 'light',
10
+ rx: 10,
11
+ ry: 10,
12
+ cx: 150,
13
+ cy: 150,
14
+ zPos: 1000,
15
+ fillStyle: '#fff',
16
+ strokeStyle: '#000',
17
+ alpha: 1,
18
+ hidden: false,
19
+ lineWidth: 1,
20
+ lineDash: 'solid',
21
+ lineCap: 'butt'
22
+ }
23
+ }
@@ -11,7 +11,7 @@ export default {
11
11
  left: 100,
12
12
  width: 200,
13
13
  height: 80,
14
- zPos: 1,
14
+ zPos: 40,
15
15
  depth: 10,
16
16
  fillStyle: '#ffffff',
17
17
  strokeStyle: '#999',
@@ -232,21 +232,8 @@ export class ThreeContainer extends Container implements ThreeDimensionalContain
232
232
 
233
233
  // Lights
234
234
  var _hemiLight = new THREE.HemisphereLight(0xdddddd, 0x333333, 0.035)
235
- var _directionalLight = new THREE.DirectionalLight(0xd6e1ff, 0.01)
236
- var _pointLight1 = new THREE.PointLight(0xd6e1ff, 1, undefined, 2)
237
-
238
- _pointLight1.power = cameraZPos * 50
239
- _pointLight1.castShadow = true
240
- _pointLight1.position.set(0, cameraZPos, 0)
241
- _pointLight1.shadow.camera.near = 0.1
242
- _pointLight1.shadow.camera.far = cameraZPos * 2
243
-
244
- // const helper = new THREE.CameraHelper(_pointLight1.shadow.camera)
245
- // this._scene3d?.add(helper)
246
235
 
247
236
  this.scene3d!.add(_hemiLight)
248
- this.scene3d!.add(_pointLight1)
249
- this._camera.add(_directionalLight)
250
237
 
251
238
  this._mouse = new THREE.Vector2()
252
239
 
@@ -258,19 +245,11 @@ export class ThreeContainer extends Container implements ThreeDimensionalContain
258
245
  this._camera.updateProjectionMatrix()
259
246
 
260
247
  const floor = createFloor(this)
261
- // if (this._floor) {
262
- // this.object3d.remove(this._floor)
263
- // this._floor.clear()
264
- // delete this._floor
265
- // }
266
248
 
267
249
  if (floor) {
268
- // this._floor = floor
269
250
  this._scene3d.add(floor)
270
251
  }
271
252
 
272
- // this.invalidate()
273
-
274
253
  // postprocessing
275
254
 
276
255
  var composer = (this.composer = new EffectComposer(renderer3d!))
@@ -2,19 +2,24 @@
2
2
  * Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import * as THREE from 'three'
6
- import { HTMLOverlayElement, HTMLOverlayContainer } from '@hatiolab/things-scene'
5
+ import { HTMLOverlayElement, HTMLOverlayContainer, DELTA } from '@hatiolab/things-scene'
7
6
 
8
- import { RealObjectMesh } from './real-object-mesh'
9
7
  import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js'
10
8
  import { RealObject } from './real-object'
11
- import { SCALE_MIN } from './common'
12
9
 
13
10
  export class RealObjectDomElement extends RealObject<CSS3DObject> {
14
11
  protected getObject3dInstance() {
15
12
  return new CSS3DObject((this.component as HTMLOverlayElement | HTMLOverlayContainer).element)
16
13
  }
17
14
 
15
+ get cz() {
16
+ var { zPos = 0 } = this.component.state
17
+ var { height } = this.component.bounds
18
+ var { tz = 0 } = this.component.delta() as DELTA
19
+
20
+ return zPos + tz + height / 2
21
+ }
22
+
18
23
  build() {
19
24
  super.build()
20
25
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as THREE from 'three'
6
6
  import { applyAlpha } from './common'
7
+ import { DELTA } from '@hatiolab/things-scene'
7
8
 
8
9
  import { RealObject } from './real-object'
9
10
 
@@ -22,6 +23,14 @@ export abstract class RealObjectSprite extends RealObject<THREE.Sprite> {
22
23
 
23
24
  /* overide */
24
25
 
26
+ get cz() {
27
+ var { zPos = 0 } = this.component.state
28
+ var { height } = this.component.bounds
29
+ var { tz = 0 } = this.component.delta() as DELTA
30
+
31
+ return zPos + tz + height / 2
32
+ }
33
+
25
34
  updateAlpha() {
26
35
  var { alpha = 1, fillStyle } = this.component.state
27
36
 
@@ -3,14 +3,36 @@ import { Component } from '@hatiolab/things-scene'
3
3
 
4
4
  import { createCanvas } from '../html/elements'
5
5
 
6
+ function nextPowerOf2(n: number) {
7
+ var count = 0
8
+
9
+ if (n && !(n & (n - 1))) {
10
+ return n
11
+ }
12
+
13
+ while (n != 0) {
14
+ n >>= 1
15
+ count += 1
16
+ }
17
+
18
+ return 1 << count
19
+ }
20
+
6
21
  export function createCanvasTexture(component: Component): THREE.Texture {
22
+ var { lineWidth } = component.state
7
23
  var { width, height } = component.bounds
8
24
 
25
+ width += lineWidth
26
+ height += lineWidth
27
+
9
28
  // Factor for increasing image resolution.
10
29
  // TODO to be able to redraw according to the change in zoom value.
11
- const scale = (component.realObject?.threeContainer?.zoom as number) * 2
30
+ const scale = 2 // component.realObject?.threeContainer?.zoom as number
12
31
 
13
- let canvas = createCanvas(width * scale, height * scale)
32
+ var poweredWidth = nextPowerOf2(width * scale)
33
+ var poweredHeight = nextPowerOf2(height * scale)
34
+
35
+ let canvas = createCanvas(poweredWidth, poweredHeight)
14
36
 
15
37
  var texture = new THREE.CanvasTexture(canvas)
16
38
 
@@ -19,19 +41,23 @@ export function createCanvasTexture(component: Component): THREE.Texture {
19
41
  texture.needsUpdate = true
20
42
  texture.wrapS = THREE.RepeatWrapping
21
43
  texture.wrapT = THREE.RepeatWrapping
22
- texture.offset.set(0, 0)
23
- texture.repeat.set(1, 1)
44
+ texture.offset.set(0, 1 - (height * scale) / poweredHeight)
45
+ texture.repeat.set((width * scale) / poweredWidth, (height * scale) / poweredHeight)
24
46
  texture.magFilter = THREE.NearestFilter
25
- texture.minFilter = THREE.LinearMipMapLinearFilter
26
- // @ts-ignore
47
+ texture.minFilter = THREE.LinearFilter
48
+ // texture.minFilter = THREE.LinearMipMapLinearFilter
27
49
  texture.colorSpace = THREE.SRGBColorSpace
28
50
 
29
51
  return texture
30
52
  }
31
53
 
32
54
  export function renderCanvasTexture(canvas: HTMLCanvasElement, component: Component, scale: number) {
55
+ var { lineWidth } = component.state
33
56
  var { left, top } = component.bounds
34
57
 
58
+ left -= lineWidth / 2
59
+ top -= lineWidth / 2
60
+
35
61
  let context = canvas.getContext('2d')
36
62
 
37
63
  context!.scale(scale, scale)
@@ -8,5 +8,10 @@
8
8
  "label.section-digits": "section digits",
9
9
  "label.shelf-locations": "shelf locations",
10
10
  "label.unit-digits": "unit digits",
11
- "label.popup-position": "popup position"
11
+ "label.popup-position": "popup position",
12
+ "label.light-type": "light type",
13
+ "label.intensity": "intensity",
14
+ "label.distance": "distance",
15
+ "label.decay": "decay",
16
+ "label.cast-shadow": "cast shadow"
12
17
  }
@@ -8,5 +8,10 @@
8
8
  "label.section-digits": "section digits",
9
9
  "label.shelf-locations": "shelf locations",
10
10
  "label.unit-digits": "unit digits",
11
- "label.popup-position": "팝업 위치"
11
+ "label.popup-position": "팝업 위치",
12
+ "label.light-type": "조명 타입",
13
+ "label.intensity": "intensity",
14
+ "label.distance": "distance",
15
+ "label.decay": "decay",
16
+ "label.cast-shadow": "cast shadow"
12
17
  }
@@ -8,5 +8,10 @@
8
8
  "label.section-digits": "[ms] section digits",
9
9
  "label.shelf-locations": "[ms] shelf locations",
10
10
  "label.unit-digits": "[ms] unit digits",
11
- "label.popup-position": "[ms] popup position"
11
+ "label.popup-position": "[ms] popup position",
12
+ "label.light-type": "light type",
13
+ "label.intensity": "intensity",
14
+ "label.distance": "distance",
15
+ "label.decay": "decay",
16
+ "label.cast-shadow": "cast shadow"
12
17
  }
@@ -8,5 +8,10 @@
8
8
  "label.section-digits": "段数字",
9
9
  "label.shelf-locations": "货架位置",
10
10
  "label.unit-digits": "单位数字",
11
- "label.popup-position": "弹出位置"
11
+ "label.popup-position": "弹出位置",
12
+ "label.light-type": "light type",
13
+ "label.intensity": "intensity",
14
+ "label.distance": "distance",
15
+ "label.decay": "decay",
16
+ "label.cast-shadow": "cast shadow"
12
17
  }