lythreeframe 1.3.2 → 1.3.3
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.
- package/dist/bundle.cjs.js +55 -3837
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.esm.js +55 -3837
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +5 -2
package/dist/bundle.cjs.js
CHANGED
|
@@ -18,3895 +18,113 @@ var CSS2DRenderer_js = require('three/examples/jsm/renderers/CSS2DRenderer.js');
|
|
|
18
18
|
var PointerLockControls_js = require('three/examples/jsm/controls/PointerLockControls.js');
|
|
19
19
|
var TransformControls_js = require('three/examples/jsm/controls/TransformControls.js');
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
* virtual class of 3D Object, should not be use directly.
|
|
23
|
-
*/
|
|
24
|
-
class BaseObject {
|
|
25
|
-
get isTickEnabled() {
|
|
26
|
-
return this.bCanTick;
|
|
27
|
-
}
|
|
28
|
-
set isTickEnabled(bCanTick) {
|
|
29
|
-
this.bCanTick = bCanTick;
|
|
30
|
-
}
|
|
31
|
-
get uuid() {
|
|
32
|
-
return this._uuid;
|
|
33
|
-
}
|
|
34
|
-
constructor(uuid = webgpu.MathUtils.generateUUID()) {
|
|
35
|
-
this.bCanTick = false;
|
|
36
|
-
this.tickEvents = [];
|
|
37
|
-
this.bCanTick = false;
|
|
38
|
-
this._uuid = uuid;
|
|
39
|
-
}
|
|
40
|
-
tick(deltaTime) {
|
|
41
|
-
if (!this.bCanTick) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
this.tickEvents.forEach((elem) => {
|
|
45
|
-
elem(deltaTime);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
addTickEvent(event) {
|
|
49
|
-
this.tickEvents.push(event);
|
|
50
|
-
}
|
|
51
|
-
removeTickEvent(event) {
|
|
52
|
-
let index = this.tickEvents.indexOf(event);
|
|
53
|
-
if (index != -1) {
|
|
54
|
-
this.tickEvents.splice(index, 1);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
clearTickEvents() {
|
|
58
|
-
this.tickEvents = [];
|
|
59
|
-
}
|
|
60
|
-
destroy() {
|
|
61
|
-
}
|
|
62
|
-
}
|
|
21
|
+
const _0x219d91=_0x620a;function _0x3664(){const _0x506c29=['generateUUID','forEach','3061988wVweEn','indexOf','3uhcxtR','36786432hwtLDg','push','isTickEnabled','2593175eMEBBq','20KTyERh','_uuid','434oLFJBX','tickEvents','8387489bJfXeU','18166fInjsv','6800872maqJoJ','tick','clearTickEvents','addTickEvent','removeTickEvent','splice','127nPdfaL','destroy','98628fnBmEB','bCanTick','9SmIYLa'];_0x3664=function(){return _0x506c29;};return _0x3664();}(function(_0xcd4f40,_0xc4fff){const _0x49b49c=_0x620a,_0x5e5247=_0xcd4f40();while(!![]){try{const _0x3f854c=-parseInt(_0x49b49c(0x1ee))/0x1*(parseInt(_0x49b49c(0x1e7))/0x2)+-parseInt(_0x49b49c(0x1dd))/0x3*(-parseInt(_0x49b49c(0x1db))/0x4)+-parseInt(_0x49b49c(0x1e1))/0x5+-parseInt(_0x49b49c(0x1d6))/0x6*(-parseInt(_0x49b49c(0x1e4))/0x7)+parseInt(_0x49b49c(0x1e8))/0x8*(-parseInt(_0x49b49c(0x1d8))/0x9)+-parseInt(_0x49b49c(0x1e2))/0xa*(parseInt(_0x49b49c(0x1e6))/0xb)+parseInt(_0x49b49c(0x1de))/0xc;if(_0x3f854c===_0xc4fff)break;else _0x5e5247['push'](_0x5e5247['shift']());}catch(_0x36beb0){_0x5e5247['push'](_0x5e5247['shift']());}}}(_0x3664,0xc405a));function _0x620a(_0x5c01fe,_0x18bb7e){_0x5c01fe=_0x5c01fe-0x1d6;const _0x3664ea=_0x3664();let _0x620aef=_0x3664ea[_0x5c01fe];return _0x620aef;}class BaseObject{get[_0x219d91(0x1e0)](){const _0x1344dd=_0x219d91;return this[_0x1344dd(0x1d7)];}set[_0x219d91(0x1e0)](_0x25f5b4){const _0x516ef8=_0x219d91;this[_0x516ef8(0x1d7)]=_0x25f5b4;}get['uuid'](){const _0x1af3e9=_0x219d91;return this[_0x1af3e9(0x1e3)];}constructor(_0x1bb619=webgpu.MathUtils[_0x219d91(0x1d9)]()){const _0x3cb49c=_0x219d91;this[_0x3cb49c(0x1d7)]=![],this[_0x3cb49c(0x1e5)]=[],this[_0x3cb49c(0x1d7)]=![],this[_0x3cb49c(0x1e3)]=_0x1bb619;}[_0x219d91(0x1e9)](_0x1e07d2){const _0x3bbf67=_0x219d91;if(!this['bCanTick'])return;this['tickEvents'][_0x3bbf67(0x1da)](_0x4cdcef=>{_0x4cdcef(_0x1e07d2);});}[_0x219d91(0x1eb)](_0x2dc430){const _0x51cbb5=_0x219d91;this[_0x51cbb5(0x1e5)][_0x51cbb5(0x1df)](_0x2dc430);}[_0x219d91(0x1ec)](_0x45b51c){const _0x1985b7=_0x219d91;let _0xd0389b=this[_0x1985b7(0x1e5)][_0x1985b7(0x1dc)](_0x45b51c);_0xd0389b!=-1&&this[_0x1985b7(0x1e5)][_0x1985b7(0x1ed)](_0xd0389b,0x1);}[_0x219d91(0x1ea)](){this['tickEvents']=[];}[_0x219d91(0x1ef)](){}}
|
|
63
22
|
|
|
64
|
-
class Component extends BaseObject {
|
|
65
|
-
set parentActor(value) {
|
|
66
|
-
this._parentActor = value;
|
|
67
|
-
}
|
|
68
|
-
get parentActor() {
|
|
69
|
-
return this._parentActor;
|
|
70
|
-
}
|
|
71
|
-
get threeObject() {
|
|
72
|
-
return this.obj;
|
|
73
|
-
}
|
|
74
|
-
set threeObject(newThreeObject) {
|
|
75
|
-
this.obj = newThreeObject;
|
|
76
|
-
if (this.obj) {
|
|
77
|
-
this.obj.userData["LYObject"] = this;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
get name() {
|
|
81
|
-
return this._name;
|
|
82
|
-
}
|
|
83
|
-
set name(name) {
|
|
84
|
-
this._name = name;
|
|
85
|
-
if (this.obj) {
|
|
86
|
-
this.obj.name = name;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
constructor(uuid) {
|
|
90
|
-
super(uuid ? uuid : webgpu.MathUtils.generateUUID());
|
|
91
|
-
this.obj = null;
|
|
92
|
-
this._parentActor = null;
|
|
93
|
-
this._name = "Component";
|
|
94
|
-
this._parentActor = null;
|
|
95
|
-
let obj = this.createDefaultObject();
|
|
96
|
-
if (obj) {
|
|
97
|
-
this.threeObject = obj;
|
|
98
|
-
this._name = `${this.threeObject.type}Component`;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
console.warn("Component createDefaultObject return null");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
createDefaultObject(_arg) {
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
destroyObject() {
|
|
108
|
-
if (!this.obj) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
destroy() {
|
|
113
|
-
this.destroyObject();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
23
|
+
const _0x3c1b3b=_0x2def;(function(_0x3dcdf7,_0x3223e9){const _0x42eac8=_0x2def,_0x65298a=_0x3dcdf7();while(!![]){try{const _0x29b3c8=-parseInt(_0x42eac8(0x72))/0x1*(-parseInt(_0x42eac8(0x7c))/0x2)+parseInt(_0x42eac8(0x75))/0x3+-parseInt(_0x42eac8(0x7a))/0x4*(parseInt(_0x42eac8(0x79))/0x5)+parseInt(_0x42eac8(0x6d))/0x6*(parseInt(_0x42eac8(0x74))/0x7)+-parseInt(_0x42eac8(0x6c))/0x8+-parseInt(_0x42eac8(0x80))/0x9*(-parseInt(_0x42eac8(0x6f))/0xa)+parseInt(_0x42eac8(0x70))/0xb;if(_0x29b3c8===_0x3223e9)break;else _0x65298a['push'](_0x65298a['shift']());}catch(_0x57dacd){_0x65298a['push'](_0x65298a['shift']());}}}(_0x3675,0x6b78e));function _0x3675(){const _0x36c51d=['createDefaultObject','1720oNaMsa','7358065UbgvOM','_parentActor','373UWwbwB','threeObject','21aPCMXL','401622DYYINM','destroyObject','name','parentActor','495bLjvbj','19732iaPhWC','destroy','98HxuBHO','obj','generateUUID','LYObject','11430VPvSID','_name','userData','3429568myNfVv','635526kTSepK'];_0x3675=function(){return _0x36c51d;};return _0x3675();}function _0x2def(_0x4e2552,_0x14a334){_0x4e2552=_0x4e2552-0x6b;const _0x3675cd=_0x3675();let _0x2defe1=_0x3675cd[_0x4e2552];return _0x2defe1;}class Component extends BaseObject{set[_0x3c1b3b(0x78)](_0x53d304){const _0x58a03d=_0x3c1b3b;this[_0x58a03d(0x71)]=_0x53d304;}get['parentActor'](){return this['_parentActor'];}get[_0x3c1b3b(0x73)](){const _0x1b4df6=_0x3c1b3b;return this[_0x1b4df6(0x7d)];}set[_0x3c1b3b(0x73)](_0x26fe03){const _0x4c18e5=_0x3c1b3b;this[_0x4c18e5(0x7d)]=_0x26fe03,this[_0x4c18e5(0x7d)]&&(this[_0x4c18e5(0x7d)][_0x4c18e5(0x6b)][_0x4c18e5(0x7f)]=this);}get[_0x3c1b3b(0x77)](){const _0x42f1a8=_0x3c1b3b;return this[_0x42f1a8(0x81)];}set[_0x3c1b3b(0x77)](_0x4ddabf){const _0x424897=_0x3c1b3b;this[_0x424897(0x81)]=_0x4ddabf,this[_0x424897(0x7d)]&&(this[_0x424897(0x7d)][_0x424897(0x77)]=_0x4ddabf);}constructor(_0x41c58f){const _0x123cd4=_0x3c1b3b;super(_0x41c58f?_0x41c58f:webgpu.MathUtils[_0x123cd4(0x7e)]()),this['obj']=null,this['_parentActor']=null,this['_name']='Component',this['_parentActor']=null;let _0x58b628=this[_0x123cd4(0x6e)]();_0x58b628?(this[_0x123cd4(0x73)]=_0x58b628,this['_name']=this[_0x123cd4(0x73)]['type']+'Component'):console['warn']('Component\x20createDefaultObject\x20return\x20null');}[_0x3c1b3b(0x6e)](_0x35c747){return null;}[_0x3c1b3b(0x76)](){const _0x7c95c4=_0x3c1b3b;if(!this[_0x7c95c4(0x7d)])return;}[_0x3c1b3b(0x7b)](){const _0x286cd5=_0x3c1b3b;this[_0x286cd5(0x76)]();}}
|
|
116
24
|
|
|
117
|
-
|
|
118
|
-
// {
|
|
119
|
-
// KeepWorld: 1,
|
|
120
|
-
// KeepRelative: 2,
|
|
121
|
-
// }
|
|
122
|
-
exports.AttachmentRules = void 0;
|
|
123
|
-
(function (AttachmentRules) {
|
|
124
|
-
AttachmentRules[AttachmentRules["KeepWorld"] = 1] = "KeepWorld";
|
|
125
|
-
AttachmentRules[AttachmentRules["KeepRelative"] = 2] = "KeepRelative";
|
|
126
|
-
})(exports.AttachmentRules || (exports.AttachmentRules = {}));
|
|
25
|
+
function _0x8dc5(){var _0x18671f=['KeepRelative','1077000jPJBuz','736057zvtfEP','348264aPTJfh','852122DBkuTd','992955NKurGv','117rLbXee','2550hplAMh','14424aorRoC','KeepWorld','2425iVSvJJ'];_0x8dc5=function(){return _0x18671f;};return _0x8dc5();}function _0x49fc(_0x453632,_0x234ebb){_0x453632=_0x453632-0x6e;var _0x8dc52f=_0x8dc5();var _0x49fc09=_0x8dc52f[_0x453632];return _0x49fc09;}(function(_0x45ab76,_0x2e52ec){var _0x45bb28=_0x49fc,_0x43b692=_0x45ab76();while(!![]){try{var _0x3028f8=parseInt(_0x45bb28(0x71))/0x1+-parseInt(_0x45bb28(0x72))/0x2+parseInt(_0x45bb28(0x73))/0x3+-parseInt(_0x45bb28(0x6f))/0x4+-parseInt(_0x45bb28(0x78))/0x5*(-parseInt(_0x45bb28(0x75))/0x6)+parseInt(_0x45bb28(0x70))/0x7+parseInt(_0x45bb28(0x76))/0x8*(-parseInt(_0x45bb28(0x74))/0x9);if(_0x3028f8===_0x2e52ec)break;else _0x43b692['push'](_0x43b692['shift']());}catch(_0x5cf5a3){_0x43b692['push'](_0x43b692['shift']());}}}(_0x8dc5,0x4259f));exports.AttachmentRules = void 0;(function(_0x2bc9fd){var _0xcda9ea=_0x49fc;_0x2bc9fd[_0x2bc9fd[_0xcda9ea(0x77)]=0x1]=_0xcda9ea(0x77),_0x2bc9fd[_0x2bc9fd[_0xcda9ea(0x6e)]=0x2]=_0xcda9ea(0x6e);}(exports.AttachmentRules||(exports.AttachmentRules={})));
|
|
127
26
|
|
|
128
|
-
class Delegate {
|
|
129
|
-
constructor() {
|
|
130
|
-
this.functions = [];
|
|
131
|
-
}
|
|
132
|
-
broadcast(...args) {
|
|
133
|
-
this.functions.forEach((func) => func(...args));
|
|
134
|
-
}
|
|
135
|
-
add(func) {
|
|
136
|
-
this.functions.push(func);
|
|
137
|
-
}
|
|
138
|
-
remove(func) {
|
|
139
|
-
const index = this.functions.indexOf(func);
|
|
140
|
-
if (index >= 0) {
|
|
141
|
-
this.functions.splice(index, 1);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
console.warn("function not found");
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
clear() {
|
|
148
|
-
this.functions = [];
|
|
149
|
-
}
|
|
150
|
-
}
|
|
27
|
+
function _0x21cb(){const _0x351e63=['730512oLpwTO','add','remove','21948GmZgfg','1459180DgUUPw','7655368lphLQV','140PRFhCT','clear','346854wNFgNq','function\x20not\x20found','indexOf','24376932soRJIL','functions','splice','183849WjdWDR','warn','78GFKyhB','forEach'];_0x21cb=function(){return _0x351e63;};return _0x21cb();}const _0x48c71d=_0x3058;function _0x3058(_0x2b69c5,_0x25979d){_0x2b69c5=_0x2b69c5-0x191;const _0x21cbdd=_0x21cb();let _0x3058c5=_0x21cbdd[_0x2b69c5];return _0x3058c5;}(function(_0x2bfa92,_0x27b8df){const _0x20df94=_0x3058,_0xf3f34b=_0x2bfa92();while(!![]){try{const _0x4cb012=-parseInt(_0x20df94(0x19e))/0x1+parseInt(_0x20df94(0x1a2))/0x2+-parseInt(_0x20df94(0x1a0))/0x3*(-parseInt(_0x20df94(0x193))/0x4)+-parseInt(_0x20df94(0x194))/0x5+parseInt(_0x20df94(0x198))/0x6*(-parseInt(_0x20df94(0x196))/0x7)+-parseInt(_0x20df94(0x195))/0x8+parseInt(_0x20df94(0x19b))/0x9;if(_0x4cb012===_0x27b8df)break;else _0xf3f34b['push'](_0xf3f34b['shift']());}catch(_0x3aed05){_0xf3f34b['push'](_0xf3f34b['shift']());}}}(_0x21cb,0x993e0));class Delegate{constructor(){this['functions']=[];}['broadcast'](..._0x40ca02){const _0xf9ffc6=_0x3058;this[_0xf9ffc6(0x19c)][_0xf9ffc6(0x1a1)](_0x3a8c89=>_0x3a8c89(..._0x40ca02));}[_0x48c71d(0x191)](_0x55cf6b){const _0x30558a=_0x48c71d;this[_0x30558a(0x19c)]['push'](_0x55cf6b);}[_0x48c71d(0x192)](_0x21a66b){const _0x5d1d62=_0x48c71d,_0x601861=this[_0x5d1d62(0x19c)][_0x5d1d62(0x19a)](_0x21a66b);_0x601861>=0x0?this[_0x5d1d62(0x19c)][_0x5d1d62(0x19d)](_0x601861,0x1):console[_0x5d1d62(0x19f)](_0x5d1d62(0x199));}[_0x48c71d(0x197)](){const _0xffcb04=_0x48c71d;this[_0xffcb04(0x19c)]=[];}}
|
|
151
28
|
|
|
152
|
-
class SceneComponent extends Component {
|
|
153
|
-
set parentActor(value) {
|
|
154
|
-
this.childrenComponents.forEach((elem) => {
|
|
155
|
-
elem.parentActor = value;
|
|
156
|
-
});
|
|
157
|
-
this._parentActor = value;
|
|
158
|
-
}
|
|
159
|
-
get parentActor() {
|
|
160
|
-
return this._parentActor;
|
|
161
|
-
}
|
|
162
|
-
// Delegate getters
|
|
163
|
-
get onHoverBeginDelegate() { return this._onHoverBeginDelegate; }
|
|
164
|
-
get onHoverEndDelegate() { return this._onHoverEndDelegate; }
|
|
165
|
-
get onClickDelegate() { return this._onClickDelegate; }
|
|
166
|
-
get onDoubleClickDelegate() { return this._onDoubleClickDelegate; }
|
|
167
|
-
get world() {
|
|
168
|
-
return this.app.world;
|
|
169
|
-
}
|
|
170
|
-
constructor(app, uuid) {
|
|
171
|
-
super(uuid);
|
|
172
|
-
this.bCanHover = false;
|
|
173
|
-
this.bCanClick = false;
|
|
174
|
-
// Component 级别事件 Delegates
|
|
175
|
-
this._onHoverBeginDelegate = new Delegate();
|
|
176
|
-
this._onHoverEndDelegate = new Delegate();
|
|
177
|
-
this._onClickDelegate = new Delegate();
|
|
178
|
-
this._onDoubleClickDelegate = new Delegate();
|
|
179
|
-
this.app = app;
|
|
180
|
-
this.name = "SceneComponent";
|
|
181
|
-
}
|
|
182
|
-
createDefaultObject() {
|
|
183
|
-
return new webgpu.Object3D();
|
|
184
|
-
}
|
|
185
|
-
tick(deltaTime) {
|
|
186
|
-
super.tick(deltaTime);
|
|
187
|
-
this.childrenComponents.forEach((elem) => {
|
|
188
|
-
elem.tick(deltaTime);
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
get isVisible() {
|
|
192
|
-
if (!this.obj) {
|
|
193
|
-
return false;
|
|
194
|
-
}
|
|
195
|
-
return this.obj.visible;
|
|
196
|
-
}
|
|
197
|
-
setVisible(bVisible) {
|
|
198
|
-
if (!this.obj) {
|
|
199
|
-
throw Error("threeObject is invalid");
|
|
200
|
-
}
|
|
201
|
-
this.obj.visible = bVisible;
|
|
202
|
-
if (this.world) {
|
|
203
|
-
this.world.viewport.markRenderStateDirty();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
setLayers(layer) {
|
|
207
|
-
if (!this.obj) {
|
|
208
|
-
throw Error("threeObject is invalid");
|
|
209
|
-
}
|
|
210
|
-
this.obj.layers.set(layer);
|
|
211
|
-
let childComps = this.childrenComponents;
|
|
212
|
-
childComps.forEach((elem) => {
|
|
213
|
-
elem.setLayers(layer);
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
getComponentById(id, bRecursive = true) {
|
|
217
|
-
if (this.uuid === id) {
|
|
218
|
-
return this;
|
|
219
|
-
}
|
|
220
|
-
if (bRecursive) {
|
|
221
|
-
let childComps = this.childrenComponents;
|
|
222
|
-
for (let i = 0; i < childComps.length; ++i) {
|
|
223
|
-
let comp = childComps[i].getComponentById(id, bRecursive);
|
|
224
|
-
if (comp) {
|
|
225
|
-
return comp;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
let childComps = this.childrenComponents;
|
|
231
|
-
for (let i = 0; i < childComps.length; ++i) {
|
|
232
|
-
let comp = childComps[i];
|
|
233
|
-
if (comp.uuid === id) {
|
|
234
|
-
return comp;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
getBoundsCenterPositionWS() {
|
|
241
|
-
let ret = new webgpu.Vector3();
|
|
242
|
-
this.getBounds().getCenter(ret);
|
|
243
|
-
return this.getWorldPosition();
|
|
244
|
-
}
|
|
245
|
-
getBoundsTopCenterPositionWS() {
|
|
246
|
-
let ret = new webgpu.Vector3();
|
|
247
|
-
let bounds = this.getBounds();
|
|
248
|
-
bounds.getCenter(ret);
|
|
249
|
-
ret.y = bounds.max.y;
|
|
250
|
-
return ret;
|
|
251
|
-
}
|
|
252
|
-
getBoundsBottomCenterPositionWS() {
|
|
253
|
-
let ret = new webgpu.Vector3();
|
|
254
|
-
let bounds = this.getBounds();
|
|
255
|
-
bounds.getCenter(ret);
|
|
256
|
-
ret.y = bounds.min.y;
|
|
257
|
-
return ret;
|
|
258
|
-
}
|
|
259
|
-
getBounds() {
|
|
260
|
-
if (!this.obj) {
|
|
261
|
-
throw Error("threeObject is invalid");
|
|
262
|
-
}
|
|
263
|
-
let ret = new webgpu.Box3();
|
|
264
|
-
ret.setFromObject(this.obj, false);
|
|
265
|
-
if (ret.isEmpty()) {
|
|
266
|
-
ret.min = ret.max = this.getWorldPosition();
|
|
267
|
-
}
|
|
268
|
-
return ret;
|
|
269
|
-
}
|
|
270
|
-
get parentComponent() {
|
|
271
|
-
var _a, _b;
|
|
272
|
-
if (!this.obj) {
|
|
273
|
-
throw Error("threeObject is invalid");
|
|
274
|
-
}
|
|
275
|
-
let target = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.userData.LYObject;
|
|
276
|
-
if (!target) {
|
|
277
|
-
return null;
|
|
278
|
-
}
|
|
279
|
-
if (!(target instanceof SceneComponent)) {
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
if (target.parentActor !== this.parentActor) {
|
|
283
|
-
return null;
|
|
284
|
-
}
|
|
285
|
-
return target;
|
|
286
|
-
}
|
|
287
|
-
get childrenComponents() {
|
|
288
|
-
if (!this.obj) {
|
|
289
|
-
throw Error("threeObject is invalid");
|
|
290
|
-
}
|
|
291
|
-
let childrens = [];
|
|
292
|
-
for (let i = 0; i < this.obj.children.length; ++i) {
|
|
293
|
-
if (!this.obj.children[i].userData.LYObject) {
|
|
294
|
-
// console.warn("One of children component has no parentActor", this.obj.children[i].userData.LYObject, this.obj.children[i]);
|
|
295
|
-
continue;
|
|
296
|
-
}
|
|
297
|
-
if (this.obj.children[i].userData.LYObject.parentActor === this.parentActor) {
|
|
298
|
-
childrens.push(this.obj.children[i].userData.LYObject);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return childrens;
|
|
302
|
-
}
|
|
303
|
-
onAddedToWorld(world) {
|
|
304
|
-
let childrens = this.childrenComponents;
|
|
305
|
-
for (let i = 0; i < childrens.length; ++i) {
|
|
306
|
-
childrens[i].onAddedToWorld(world);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
destroy() {
|
|
310
|
-
this.isHoverEnabled = false;
|
|
311
|
-
this.isClickEnabled = false;
|
|
312
|
-
this.detachFromParentActor();
|
|
313
|
-
this.detachFromParentComponent();
|
|
314
|
-
this.destroyChildren();
|
|
315
|
-
this.destroyObject();
|
|
316
|
-
if (this.world) {
|
|
317
|
-
this.world.viewport.markRenderStateDirty();
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
destroyObject() {
|
|
321
|
-
if (!this.obj) {
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
if (this.obj.parent) {
|
|
325
|
-
this.obj.parent.remove(this.obj);
|
|
326
|
-
}
|
|
327
|
-
super.destroyObject();
|
|
328
|
-
}
|
|
329
|
-
// Local Transforms
|
|
330
|
-
// // Position
|
|
331
|
-
getPosition() {
|
|
332
|
-
if (!this.obj) {
|
|
333
|
-
throw Error("threeObject is invalid");
|
|
334
|
-
}
|
|
335
|
-
if (this.obj.matrixAutoUpdate) {
|
|
336
|
-
return this.obj.position.clone();
|
|
337
|
-
}
|
|
338
|
-
else {
|
|
339
|
-
const position = new webgpu.Vector3();
|
|
340
|
-
const quaternion = new webgpu.Quaternion();
|
|
341
|
-
const scale = new webgpu.Vector3();
|
|
342
|
-
this.obj.matrix.decompose(position, quaternion, scale);
|
|
343
|
-
return position;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
setPosition(...args) {
|
|
347
|
-
var _a;
|
|
348
|
-
if (!this.obj) {
|
|
349
|
-
throw Error("threeObject is invalid");
|
|
350
|
-
}
|
|
351
|
-
let newPosition = null;
|
|
352
|
-
// 使用 isVector3 属性检查,避免多个 Three.js 实例导致 instanceof 失败
|
|
353
|
-
if (args.length === 1 && ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.isVector3)) {
|
|
354
|
-
const vec = args[0];
|
|
355
|
-
newPosition = new webgpu.Vector3(vec.x, vec.y, vec.z);
|
|
356
|
-
}
|
|
357
|
-
else if (args.length === 3 &&
|
|
358
|
-
typeof args[0] === "number" &&
|
|
359
|
-
typeof args[1] === "number" &&
|
|
360
|
-
typeof args[2] === "number") {
|
|
361
|
-
newPosition = new webgpu.Vector3(args[0], args[1], args[2]);
|
|
362
|
-
}
|
|
363
|
-
if (!newPosition) {
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
this.obj.position.copy(newPosition);
|
|
367
|
-
if (!this.obj.matrixAutoUpdate) {
|
|
368
|
-
this.obj.matrix.setPosition(newPosition.x, newPosition.y, newPosition.z);
|
|
369
|
-
}
|
|
370
|
-
this.obj.updateMatrix();
|
|
371
|
-
this.obj.updateMatrixWorld(true);
|
|
372
|
-
if (this.world) {
|
|
373
|
-
this.world.viewport.markRenderStateDirty();
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
// // Rotation
|
|
377
|
-
getRotation() {
|
|
378
|
-
if (!this.obj) {
|
|
379
|
-
throw Error("threeObject is invalid");
|
|
380
|
-
}
|
|
381
|
-
if (this.obj.matrixAutoUpdate) {
|
|
382
|
-
return this.obj.rotation.clone();
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
const position = new webgpu.Vector3();
|
|
386
|
-
const quaternion = new webgpu.Quaternion();
|
|
387
|
-
const scale = new webgpu.Vector3();
|
|
388
|
-
this.obj.matrix.decompose(position, quaternion, scale);
|
|
389
|
-
return new webgpu.Euler().setFromQuaternion(quaternion);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
setRotation(...args) {
|
|
393
|
-
var _a;
|
|
394
|
-
if (!this.obj) {
|
|
395
|
-
throw Error("threeObject is invalid");
|
|
396
|
-
}
|
|
397
|
-
let newRotation = null;
|
|
398
|
-
// 使用 isEuler 属性检查,避免多个 Three.js 实例导致 instanceof 失败
|
|
399
|
-
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.isEuler) {
|
|
400
|
-
const euler = args[0];
|
|
401
|
-
newRotation = new webgpu.Euler(euler.x, euler.y, euler.z, euler.order);
|
|
402
|
-
}
|
|
403
|
-
else if (typeof (args[0]) === "number" && typeof (args[1]) === "number" && typeof (args[2]) === "number") {
|
|
404
|
-
newRotation = new webgpu.Euler(args[0], args[1], args[2]);
|
|
405
|
-
}
|
|
406
|
-
if (!newRotation) {
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
this.obj.rotation.copy(newRotation);
|
|
410
|
-
this.obj.updateMatrix();
|
|
411
|
-
this.obj.updateMatrixWorld(true);
|
|
412
|
-
if (this.world) {
|
|
413
|
-
this.world.viewport.markRenderStateDirty();
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
// // quat
|
|
417
|
-
getQuaternion() {
|
|
418
|
-
if (!this.obj) {
|
|
419
|
-
throw Error("threeObject is invalid");
|
|
420
|
-
}
|
|
421
|
-
if (this.obj.matrixAutoUpdate) {
|
|
422
|
-
return this.obj.quaternion.clone();
|
|
423
|
-
}
|
|
424
|
-
else {
|
|
425
|
-
const position = new webgpu.Vector3();
|
|
426
|
-
const quaternion = new webgpu.Quaternion();
|
|
427
|
-
const scale = new webgpu.Vector3();
|
|
428
|
-
this.obj.matrix.decompose(position, quaternion, scale);
|
|
429
|
-
return quaternion;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
setQuaternion(...args) {
|
|
433
|
-
var _a;
|
|
434
|
-
if (!this.obj) {
|
|
435
|
-
throw Error("threeObject is invalid");
|
|
436
|
-
}
|
|
437
|
-
let newQuat = null;
|
|
438
|
-
// 使用 isQuaternion 属性检查,避免多个 Three.js 实例导致 instanceof 失败
|
|
439
|
-
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.isQuaternion) {
|
|
440
|
-
const q = args[0];
|
|
441
|
-
newQuat = new webgpu.Quaternion(q.x, q.y, q.z, q.w);
|
|
442
|
-
}
|
|
443
|
-
else if (typeof args[0] === "number" && typeof args[1] === "number" && typeof args[2] === "number" && typeof args[3] === "number") {
|
|
444
|
-
newQuat = new webgpu.Quaternion(args[0], args[1], args[2], args[3]);
|
|
445
|
-
}
|
|
446
|
-
if (!newQuat) {
|
|
447
|
-
console.error("setQuaternion failed,param is invalid", args);
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
this.obj.quaternion.copy(newQuat);
|
|
451
|
-
if (!this.obj.matrixAutoUpdate) {
|
|
452
|
-
const position = new webgpu.Vector3();
|
|
453
|
-
const quaternion = new webgpu.Quaternion();
|
|
454
|
-
const scale = new webgpu.Vector3();
|
|
455
|
-
this.obj.matrix.decompose(position, quaternion, scale);
|
|
456
|
-
this.obj.matrix.compose(position, newQuat, scale);
|
|
457
|
-
}
|
|
458
|
-
if (this.world) {
|
|
459
|
-
this.world.viewport.markRenderStateDirty();
|
|
460
|
-
}
|
|
461
|
-
this.obj.updateMatrix();
|
|
462
|
-
this.obj.updateMatrixWorld(true);
|
|
463
|
-
}
|
|
464
|
-
// // Scale
|
|
465
|
-
getScale() {
|
|
466
|
-
if (!this.obj) {
|
|
467
|
-
throw Error("threeObject is invalid");
|
|
468
|
-
}
|
|
469
|
-
if (this.obj.matrixAutoUpdate) {
|
|
470
|
-
return this.obj.scale.clone();
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
const position = new webgpu.Vector3();
|
|
474
|
-
const quaternion = new webgpu.Quaternion();
|
|
475
|
-
const scale = new webgpu.Vector3();
|
|
476
|
-
this.obj.matrix.decompose(position, quaternion, scale);
|
|
477
|
-
return scale;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
setScale(...args) {
|
|
481
|
-
var _a;
|
|
482
|
-
if (!this.obj) {
|
|
483
|
-
throw Error("threeObject is invalid");
|
|
484
|
-
}
|
|
485
|
-
let newScale = null;
|
|
486
|
-
// 使用 isVector3 属性检查,避免多个 Three.js 实例导致 instanceof 失败
|
|
487
|
-
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.isVector3) {
|
|
488
|
-
const vec = args[0];
|
|
489
|
-
newScale = new webgpu.Vector3(vec.x, vec.y, vec.z);
|
|
490
|
-
}
|
|
491
|
-
else if (typeof (args[0]) === "number" && typeof (args[1]) === "number" && typeof (args[2]) === "number") {
|
|
492
|
-
newScale = new webgpu.Vector3(args[0], args[1], args[2]);
|
|
493
|
-
}
|
|
494
|
-
if (!newScale) {
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
this.obj.scale.copy(newScale);
|
|
498
|
-
// if(!this.obj.matrixAutoUpdate)
|
|
499
|
-
// {
|
|
500
|
-
// const position = new Vector3();
|
|
501
|
-
// const quaternion = new Quaternion()
|
|
502
|
-
// const scale = new Vector3();
|
|
503
|
-
// this.obj.matrix.decompose(position, quaternion, scale)
|
|
504
|
-
// this.obj.matrix.compose(position, quaternion, new Vector3(param1, param2, param3))
|
|
505
|
-
// }
|
|
506
|
-
this.obj.updateMatrix();
|
|
507
|
-
this.obj.updateMatrixWorld(true);
|
|
508
|
-
if (this.world) {
|
|
509
|
-
this.world.viewport.markRenderStateDirty();
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
// matrix
|
|
513
|
-
getMatrix() {
|
|
514
|
-
if (!this.obj) {
|
|
515
|
-
throw Error("threeObject is invalid");
|
|
516
|
-
}
|
|
517
|
-
return this.obj.matrix;
|
|
518
|
-
}
|
|
519
|
-
setMatrix(matrix) {
|
|
520
|
-
var _a;
|
|
521
|
-
if (!this.obj) {
|
|
522
|
-
throw Error("threeObject is invalid");
|
|
523
|
-
}
|
|
524
|
-
// this.obj.matrix.copy(matrix)
|
|
525
|
-
matrix.decompose(this.obj.position, this.obj.quaternion, this.obj.scale);
|
|
526
|
-
this.obj.updateMatrix();
|
|
527
|
-
this.obj.updateMatrixWorld(true);
|
|
528
|
-
(_a = this.world) === null || _a === void 0 ? void 0 : _a.viewport.markRenderStateDirty();
|
|
529
|
-
}
|
|
530
|
-
// World Transform
|
|
531
|
-
// // WorldPosition
|
|
532
|
-
getWorldPosition() {
|
|
533
|
-
if (!this.obj) {
|
|
534
|
-
throw Error("threeObject is invalid");
|
|
535
|
-
}
|
|
536
|
-
let location = new webgpu.Vector3();
|
|
537
|
-
this.obj.getWorldPosition(location);
|
|
538
|
-
return location;
|
|
539
|
-
}
|
|
540
|
-
// // rotation(euler)
|
|
541
|
-
getWorldRotation() {
|
|
542
|
-
if (!this.obj) {
|
|
543
|
-
throw Error("threeObject is invalid");
|
|
544
|
-
}
|
|
545
|
-
let rotation = new webgpu.Quaternion();
|
|
546
|
-
this.obj.getWorldQuaternion(rotation);
|
|
547
|
-
return new webgpu.Euler().setFromQuaternion(rotation);
|
|
548
|
-
}
|
|
549
|
-
// // rotation(quat)
|
|
550
|
-
getWorldQuaternion() {
|
|
551
|
-
if (!this.obj) {
|
|
552
|
-
throw Error("threeObject is invalid");
|
|
553
|
-
}
|
|
554
|
-
let rotation = new webgpu.Quaternion();
|
|
555
|
-
this.obj.getWorldQuaternion(rotation);
|
|
556
|
-
return rotation;
|
|
557
|
-
}
|
|
558
|
-
// // Scale
|
|
559
|
-
getWorldScale() {
|
|
560
|
-
if (!this.obj) {
|
|
561
|
-
throw Error("threeObject is invalid");
|
|
562
|
-
}
|
|
563
|
-
let scale = new webgpu.Vector3();
|
|
564
|
-
this.obj.getWorldScale(scale);
|
|
565
|
-
return scale;
|
|
566
|
-
}
|
|
567
|
-
// // Matrix
|
|
568
|
-
getWorldMatrix() {
|
|
569
|
-
if (!this.obj) {
|
|
570
|
-
throw Error("threeObject is invalid");
|
|
571
|
-
}
|
|
572
|
-
this.obj.updateMatrixWorld(true);
|
|
573
|
-
return this.obj.matrixWorld.clone();
|
|
574
|
-
}
|
|
575
|
-
setWorldMatrix(newMatrix) {
|
|
576
|
-
if (!this.obj) {
|
|
577
|
-
throw Error("threeObject is invalid");
|
|
578
|
-
}
|
|
579
|
-
if (this.obj.parent) {
|
|
580
|
-
this.obj.parent.updateMatrixWorld(true);
|
|
581
|
-
// 计算父对象的逆世界矩阵
|
|
582
|
-
const parentInverseWorldMatrix = this.obj.parent.matrixWorld.clone().invert();
|
|
583
|
-
// 计算物体的本地矩阵
|
|
584
|
-
const cLocalMatrix = new webgpu.Matrix4().multiplyMatrices(parentInverseWorldMatrix, newMatrix);
|
|
585
|
-
// 更新物体的本地矩阵
|
|
586
|
-
this.setMatrix(cLocalMatrix);
|
|
587
|
-
// this.obj.matrix.copy(cLocalMatrix);
|
|
588
|
-
// this.obj.matrixAutoUpdate = false;
|
|
589
|
-
// this.obj.matrix.decompose(this.obj.position, this.obj.quaternion, this.obj.scale);
|
|
590
|
-
}
|
|
591
|
-
else {
|
|
592
|
-
this.setMatrix(newMatrix);
|
|
593
|
-
// // 没有父对象时直接设置世界矩阵为本地矩阵
|
|
594
|
-
// this.obj.matrix.copy(newMatrix);
|
|
595
|
-
// this.obj.matrixAutoUpdate = false;
|
|
596
|
-
}
|
|
597
|
-
// 更新世界矩阵
|
|
598
|
-
this.obj.updateMatrixWorld(true);
|
|
599
|
-
if (this.world) {
|
|
600
|
-
// 强制场景重新渲染
|
|
601
|
-
this.world.viewport.markRenderStateDirty();
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
getWorldForwardDirection() {
|
|
605
|
-
if (!this.obj) {
|
|
606
|
-
throw Error("threeObject is invalid");
|
|
607
|
-
}
|
|
608
|
-
let ret = new webgpu.Vector3();
|
|
609
|
-
this.obj.getWorldDirection(ret);
|
|
610
|
-
return ret;
|
|
611
|
-
}
|
|
612
|
-
getWorldUpDirection() {
|
|
613
|
-
if (!this.obj) {
|
|
614
|
-
throw Error("threeObject is invalid");
|
|
615
|
-
}
|
|
616
|
-
let ret = new webgpu.Vector3(0, 1, 0);
|
|
617
|
-
ret.applyQuaternion(this.getWorldQuaternion());
|
|
618
|
-
return ret;
|
|
619
|
-
}
|
|
620
|
-
getWorldRightDirection() {
|
|
621
|
-
if (!this.obj) {
|
|
622
|
-
throw Error("threeObject is invalid");
|
|
623
|
-
}
|
|
624
|
-
let ret = new webgpu.Vector3(1, 0, 0);
|
|
625
|
-
ret.applyQuaternion(this.getWorldQuaternion());
|
|
626
|
-
return ret;
|
|
627
|
-
}
|
|
628
|
-
worldToLocal(vec) {
|
|
629
|
-
if (!this.obj) {
|
|
630
|
-
throw Error("threeObject is invalid");
|
|
631
|
-
}
|
|
632
|
-
return this.obj.worldToLocal(vec);
|
|
633
|
-
}
|
|
634
|
-
localToWorld(vec) {
|
|
635
|
-
if (!this.obj) {
|
|
636
|
-
throw Error("threeObject is invalid");
|
|
637
|
-
}
|
|
638
|
-
return this.obj.localToWorld(vec);
|
|
639
|
-
}
|
|
640
|
-
// Attachment
|
|
641
|
-
// // to another component
|
|
642
|
-
// this function will not set newComponent's parentActor
|
|
643
|
-
attachComponent(newComponent) {
|
|
644
|
-
if (!this.obj) {
|
|
645
|
-
throw Error("threeObject is invalid");
|
|
646
|
-
}
|
|
647
|
-
if (!newComponent.threeObject) {
|
|
648
|
-
throw Error("newComponent threeObject is invalid");
|
|
649
|
-
}
|
|
650
|
-
this.obj.add(newComponent.threeObject);
|
|
651
|
-
if (this.world) {
|
|
652
|
-
newComponent.onAddedToWorld(this.world);
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
detachComponent(target) {
|
|
656
|
-
if (!this.obj) {
|
|
657
|
-
throw Error("threeObject is invalid");
|
|
658
|
-
}
|
|
659
|
-
if (!target.threeObject) {
|
|
660
|
-
throw Error("target threeObject is invalid");
|
|
661
|
-
}
|
|
662
|
-
this.obj.remove(target.threeObject);
|
|
663
|
-
}
|
|
664
|
-
// newComponent's parentActor will be the same as this
|
|
665
|
-
addChildComponent(newComponent, attachmentRule = exports.AttachmentRules.KeepRelative) {
|
|
666
|
-
if (!this.obj) {
|
|
667
|
-
throw Error("threeObject is invalid");
|
|
668
|
-
}
|
|
669
|
-
if (!newComponent.threeObject) {
|
|
670
|
-
throw Error("newComponent threeObject is invalid");
|
|
671
|
-
}
|
|
672
|
-
newComponent.parentActor = this.parentActor;
|
|
673
|
-
if (attachmentRule === exports.AttachmentRules.KeepWorld) {
|
|
674
|
-
let worldMatrix = newComponent.getWorldMatrix();
|
|
675
|
-
this.obj.add(newComponent.threeObject);
|
|
676
|
-
newComponent.setWorldMatrix(worldMatrix);
|
|
677
|
-
}
|
|
678
|
-
else {
|
|
679
|
-
this.obj.add(newComponent.threeObject);
|
|
680
|
-
}
|
|
681
|
-
if (this.world) {
|
|
682
|
-
newComponent.onAddedToWorld(this.world);
|
|
683
|
-
}
|
|
684
|
-
this.obj.updateMatrix();
|
|
685
|
-
this.obj.updateMatrixWorld(true);
|
|
686
|
-
}
|
|
687
|
-
removeChildComponent(targetComponent) {
|
|
688
|
-
if (!this.obj) {
|
|
689
|
-
throw Error("threeObject is invalid");
|
|
690
|
-
}
|
|
691
|
-
if (!targetComponent.threeObject) {
|
|
692
|
-
throw Error("targetComponent threeObject is invalid");
|
|
693
|
-
}
|
|
694
|
-
this.obj.remove(targetComponent.threeObject);
|
|
695
|
-
// targetComponent.destroy();
|
|
696
|
-
}
|
|
697
|
-
detachFromParentComponent() {
|
|
698
|
-
if (this.parentComponent) {
|
|
699
|
-
this.parentComponent.removeChildComponent(this);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
detachFromParentActor() {
|
|
703
|
-
if (this.parentActor) {
|
|
704
|
-
this.parentActor = null;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
destroyChildren() {
|
|
708
|
-
var _a;
|
|
709
|
-
if (!this.obj) {
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
let toDes = [];
|
|
713
|
-
for (let i = 0; i < this.obj.children.length; ++i) {
|
|
714
|
-
let obj = (_a = this.obj.children[i].userData) === null || _a === void 0 ? void 0 : _a.LYObject;
|
|
715
|
-
if (obj) {
|
|
716
|
-
toDes.push(obj);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
toDes.forEach((elem) => {
|
|
720
|
-
elem.destroy();
|
|
721
|
-
});
|
|
722
|
-
toDes = [];
|
|
723
|
-
}
|
|
724
|
-
/* horver */
|
|
725
|
-
set isHoverEnabled(bCanHorver) {
|
|
726
|
-
this.bCanHover = bCanHorver;
|
|
727
|
-
let children = this.childrenComponents;
|
|
728
|
-
for (let i = 0; i < children.length; ++i) {
|
|
729
|
-
children[i].isHoverEnabled = this.bCanHover;
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
get isHoverEnabled() {
|
|
733
|
-
return this.bCanHover;
|
|
734
|
-
}
|
|
735
|
-
// click
|
|
736
|
-
set isClickEnabled(bCanClick) {
|
|
737
|
-
this.bCanClick = bCanClick;
|
|
738
|
-
let children = this.childrenComponents;
|
|
739
|
-
for (let i = 0; i < children.length; ++i) {
|
|
740
|
-
children[i].isClickEnabled = this.bCanClick;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
get isClickEnabled() {
|
|
744
|
-
return this.bCanClick;
|
|
745
|
-
}
|
|
746
|
-
onHorveringBegin() {
|
|
747
|
-
this._onHoverBeginDelegate.broadcast();
|
|
748
|
-
}
|
|
749
|
-
onHorveringEnd() {
|
|
750
|
-
this._onHoverEndDelegate.broadcast();
|
|
751
|
-
}
|
|
752
|
-
/* click */
|
|
753
|
-
onClicked() {
|
|
754
|
-
this._onClickDelegate.broadcast();
|
|
755
|
-
}
|
|
756
|
-
onDoubleClicked() {
|
|
757
|
-
this._onDoubleClickDelegate.broadcast();
|
|
758
|
-
}
|
|
759
|
-
}
|
|
29
|
+
function _0x58dc(_0x2de2ae,_0x4ef695){_0x2de2ae=_0x2de2ae-0x87;const _0x208736=_0x2087();let _0x58dcb5=_0x208736[_0x2de2ae];return _0x58dcb5;}function _0x2087(){const _0xc4b106=['userData','app','isQuaternion','addChildComponent','copy','destroy','setFromQuaternion','getBoundsBottomCenterPositionWS','_onClickDelegate','getCenter','compose','target\x20threeObject\x20is\x20invalid','4DSrsAr','attachComponent','order','4856bzSiZg','destroyObject','39846qDjdFh','onHorveringEnd','max','getRotation','getWorldRightDirection','uuid','add','setVisible','parentActor','getWorldPosition','isEmpty','decompose','_parentActor','onClickDelegate','LYObject','matrix','push','_onHoverBeginDelegate','matrixAutoUpdate','607470qYoJyl','world','7670UiDeIG','number','viewport','setScale','onAddedToWorld','isHoverEnabled','22328dcegGH','getWorldScale','129hGaDJm','onClicked','getWorldForwardDirection','newComponent\x20threeObject\x20is\x20invalid','setQuaternion\x20failed,param\x20is\x20invalid','forEach','children','onDoubleClicked','isVisible','clone','isClickEnabled','childrenComponents','detachFromParentComponent','applyQuaternion','setMatrix','getWorldRotation','setLayers','set','position','updateMatrixWorld','broadcast','scale','_onHoverEndDelegate','getComponentById','name','destroyChildren','obj','getWorldQuaternion','getBounds','length','bCanClick','1071vowhMu','onDoubleClickDelegate','visible','removeChildComponent','onHorveringBegin','822PQzAmJ','quaternion','getBoundsTopCenterPositionWS','layers','threeObject','tick','markRenderStateDirty','rotation','12qExAbt','threeObject\x20is\x20invalid','_onDoubleClickDelegate','1807515VbDwQl','parentComponent','onHoverEndDelegate','onHoverBeginDelegate','isVector3','error','setFromObject','KeepWorld','SceneComponent','getMatrix','getBoundsCenterPositionWS','remove','parent','matrixWorld','bCanHover','getWorldMatrix','setWorldMatrix','updateMatrix','worldToLocal','setPosition','2936494xDbiUm','detachComponent','getQuaternion'];_0x2087=function(){return _0xc4b106;};return _0x2087();}const _0x35dfae=_0x58dc;(function(_0x4d1120,_0x1f4f59){const _0x23f697=_0x58dc,_0x5fac34=_0x4d1120();while(!![]){try{const _0x4864c6=parseInt(_0x23f697(0x8f))/0x1*(-parseInt(_0x23f697(0x8a))/0x2)+-parseInt(_0x23f697(0xac))/0x3*(-parseInt(_0x23f697(0xaa))/0x4)+-parseInt(_0x23f697(0xa4))/0x5*(-parseInt(_0x23f697(0xd0))/0x6)+parseInt(_0x23f697(0xcb))/0x7*(-parseInt(_0x23f697(0x8d))/0x8)+parseInt(_0x23f697(0xdb))/0x9+-parseInt(_0x23f697(0xa2))/0xa+parseInt(_0x23f697(0xef))/0xb*(-parseInt(_0x23f697(0xd8))/0xc);if(_0x4864c6===_0x1f4f59)break;else _0x5fac34['push'](_0x5fac34['shift']());}catch(_0x8b0477){_0x5fac34['push'](_0x5fac34['shift']());}}}(_0x2087,0x24ce3));class SceneComponent extends Component{set['parentActor'](_0x31a283){const _0x42bf0a=_0x58dc;this[_0x42bf0a(0xb7)][_0x42bf0a(0xb1)](_0x275dc5=>{_0x275dc5['parentActor']=_0x31a283;}),this['_parentActor']=_0x31a283;}get['parentActor'](){const _0x463225=_0x58dc;return this[_0x463225(0x9b)];}get[_0x35dfae(0xde)](){const _0x2606f7=_0x35dfae;return this[_0x2606f7(0xa0)];}get[_0x35dfae(0xdd)](){const _0x26108f=_0x35dfae;return this[_0x26108f(0xc2)];}get[_0x35dfae(0x9c)](){const _0xd1244c=_0x35dfae;return this[_0xd1244c(0xfa)];}get[_0x35dfae(0xcc)](){return this['_onDoubleClickDelegate'];}get[_0x35dfae(0xa3)](){const _0x156015=_0x35dfae;return this[_0x156015(0xf3)][_0x156015(0xa3)];}constructor(_0xbaca7a,_0x462b43){const _0x35f6ff=_0x35dfae;super(_0x462b43),this[_0x35f6ff(0xe9)]=![],this[_0x35f6ff(0xca)]=![],this[_0x35f6ff(0xa0)]=new Delegate(),this['_onHoverEndDelegate']=new Delegate(),this[_0x35f6ff(0xfa)]=new Delegate(),this[_0x35f6ff(0xda)]=new Delegate(),this[_0x35f6ff(0xf3)]=_0xbaca7a,this[_0x35f6ff(0xc4)]=_0x35f6ff(0xe3);}['createDefaultObject'](){return new webgpu.Object3D();}[_0x35dfae(0xd5)](_0x49be8e){const _0x3bd9e6=_0x35dfae;super[_0x3bd9e6(0xd5)](_0x49be8e),this[_0x3bd9e6(0xb7)][_0x3bd9e6(0xb1)](_0x32c71e=>{const _0x1d9e36=_0x3bd9e6;_0x32c71e[_0x1d9e36(0xd5)](_0x49be8e);});}get[_0x35dfae(0xb4)](){const _0x389b5d=_0x35dfae;if(!this[_0x389b5d(0xc6)])return ![];return this['obj'][_0x389b5d(0xcd)];}[_0x35dfae(0x96)](_0x20aea4){const _0x569229=_0x35dfae;if(!this[_0x569229(0xc6)])throw Error('threeObject\x20is\x20invalid');this[_0x569229(0xc6)][_0x569229(0xcd)]=_0x20aea4,this[_0x569229(0xa3)]&&this[_0x569229(0xa3)][_0x569229(0xa6)][_0x569229(0xd6)]();}[_0x35dfae(0xbc)](_0x12fdae){const _0x148402=_0x35dfae;if(!this[_0x148402(0xc6)])throw Error('threeObject\x20is\x20invalid');this[_0x148402(0xc6)][_0x148402(0xd3)][_0x148402(0xbd)](_0x12fdae);let _0x5b3289=this[_0x148402(0xb7)];_0x5b3289[_0x148402(0xb1)](_0x17c96d=>{const _0x175e8d=_0x148402;_0x17c96d[_0x175e8d(0xbc)](_0x12fdae);});}['getComponentById'](_0x5d1636,_0xd1965f=!![]){const _0x50e554=_0x35dfae;if(this[_0x50e554(0x94)]===_0x5d1636)return this;if(_0xd1965f){let _0x53c20c=this['childrenComponents'];for(let _0xa17e46=0x0;_0xa17e46<_0x53c20c['length'];++_0xa17e46){let _0x1b1fbd=_0x53c20c[_0xa17e46][_0x50e554(0xc3)](_0x5d1636,_0xd1965f);if(_0x1b1fbd)return _0x1b1fbd;}}else {let _0x231a9e=this['childrenComponents'];for(let _0x3ac989=0x0;_0x3ac989<_0x231a9e['length'];++_0x3ac989){let _0x256f88=_0x231a9e[_0x3ac989];if(_0x256f88[_0x50e554(0x94)]===_0x5d1636)return _0x256f88;}}return null;}[_0x35dfae(0xe5)](){const _0x5bd6d6=_0x35dfae;let _0xa354f0=new webgpu.Vector3();return this[_0x5bd6d6(0xc8)]()[_0x5bd6d6(0x87)](_0xa354f0),this[_0x5bd6d6(0x98)]();}[_0x35dfae(0xd2)](){const _0x3815d0=_0x35dfae;let _0x225eed=new webgpu.Vector3(),_0xa802a1=this[_0x3815d0(0xc8)]();return _0xa802a1[_0x3815d0(0x87)](_0x225eed),_0x225eed['y']=_0xa802a1['max']['y'],_0x225eed;}[_0x35dfae(0xf9)](){const _0x35c6c2=_0x35dfae;let _0x2abb61=new webgpu.Vector3(),_0x4478c0=this[_0x35c6c2(0xc8)]();return _0x4478c0[_0x35c6c2(0x87)](_0x2abb61),_0x2abb61['y']=_0x4478c0['min']['y'],_0x2abb61;}['getBounds'](){const _0x5d176b=_0x35dfae;if(!this[_0x5d176b(0xc6)])throw Error(_0x5d176b(0xd9));let _0x33c5f6=new webgpu.Box3();return _0x33c5f6[_0x5d176b(0xe1)](this[_0x5d176b(0xc6)],![]),_0x33c5f6[_0x5d176b(0x99)]()&&(_0x33c5f6['min']=_0x33c5f6[_0x5d176b(0x91)]=this[_0x5d176b(0x98)]()),_0x33c5f6;}get[_0x35dfae(0xdc)](){const _0x3f84aa=_0x35dfae;var _0x4539bf,_0x1fcfb4;if(!this[_0x3f84aa(0xc6)])throw Error(_0x3f84aa(0xd9));let _0x2e0ab6=(_0x1fcfb4=(_0x4539bf=this[_0x3f84aa(0xc6)])===null||_0x4539bf===void 0?void 0:_0x4539bf[_0x3f84aa(0xe7)])===null||_0x1fcfb4===void 0?void 0:_0x1fcfb4[_0x3f84aa(0xf2)][_0x3f84aa(0x9d)];if(!_0x2e0ab6)return null;if(!(_0x2e0ab6 instanceof SceneComponent))return null;if(_0x2e0ab6[_0x3f84aa(0x97)]!==this[_0x3f84aa(0x97)])return null;return _0x2e0ab6;}get[_0x35dfae(0xb7)](){const _0x4730ff=_0x35dfae;if(!this[_0x4730ff(0xc6)])throw Error(_0x4730ff(0xd9));let _0xc3f419=[];for(let _0xb7b628=0x0;_0xb7b628<this[_0x4730ff(0xc6)][_0x4730ff(0xb2)]['length'];++_0xb7b628){if(!this[_0x4730ff(0xc6)][_0x4730ff(0xb2)][_0xb7b628][_0x4730ff(0xf2)]['LYObject'])continue;this[_0x4730ff(0xc6)][_0x4730ff(0xb2)][_0xb7b628][_0x4730ff(0xf2)][_0x4730ff(0x9d)]['parentActor']===this[_0x4730ff(0x97)]&&_0xc3f419[_0x4730ff(0x9f)](this['obj'][_0x4730ff(0xb2)][_0xb7b628]['userData'][_0x4730ff(0x9d)]);}return _0xc3f419;}['onAddedToWorld'](_0x4c17c8){const _0x5d4f92=_0x35dfae;let _0x37d67c=this[_0x5d4f92(0xb7)];for(let _0x45fc35=0x0;_0x45fc35<_0x37d67c[_0x5d4f92(0xc9)];++_0x45fc35){_0x37d67c[_0x45fc35][_0x5d4f92(0xa8)](_0x4c17c8);}}[_0x35dfae(0xf7)](){const _0x2b3143=_0x35dfae;this[_0x2b3143(0xa9)]=![],this['isClickEnabled']=![],this['detachFromParentActor'](),this[_0x2b3143(0xb8)](),this[_0x2b3143(0xc5)](),this['destroyObject'](),this[_0x2b3143(0xa3)]&&this[_0x2b3143(0xa3)]['viewport'][_0x2b3143(0xd6)]();}['destroyObject'](){const _0x360b91=_0x35dfae;if(!this['obj'])return;this[_0x360b91(0xc6)][_0x360b91(0xe7)]&&this[_0x360b91(0xc6)][_0x360b91(0xe7)][_0x360b91(0xe6)](this[_0x360b91(0xc6)]),super[_0x360b91(0x8e)]();}['getPosition'](){const _0x2c82bd=_0x35dfae;if(!this[_0x2c82bd(0xc6)])throw Error('threeObject\x20is\x20invalid');if(this[_0x2c82bd(0xc6)]['matrixAutoUpdate'])return this[_0x2c82bd(0xc6)][_0x2c82bd(0xbe)][_0x2c82bd(0xb5)]();else {const _0x458be6=new webgpu.Vector3(),_0x1ca13f=new webgpu.Quaternion(),_0x1685e5=new webgpu.Vector3();return this[_0x2c82bd(0xc6)][_0x2c82bd(0x9e)][_0x2c82bd(0x9a)](_0x458be6,_0x1ca13f,_0x1685e5),_0x458be6;}}['setPosition'](..._0x116107){const _0x1a6e78=_0x35dfae;var _0x2b8995;if(!this[_0x1a6e78(0xc6)])throw Error(_0x1a6e78(0xd9));let _0x108abb=null;if(_0x116107[_0x1a6e78(0xc9)]===0x1&&((_0x2b8995=_0x116107[0x0])===null||_0x2b8995===void 0?void 0:_0x2b8995[_0x1a6e78(0xdf)])){const _0x121be3=_0x116107[0x0];_0x108abb=new webgpu.Vector3(_0x121be3['x'],_0x121be3['y'],_0x121be3['z']);}else _0x116107[_0x1a6e78(0xc9)]===0x3&&typeof _0x116107[0x0]===_0x1a6e78(0xa5)&&typeof _0x116107[0x1]===_0x1a6e78(0xa5)&&typeof _0x116107[0x2]==='number'&&(_0x108abb=new webgpu.Vector3(_0x116107[0x0],_0x116107[0x1],_0x116107[0x2]));if(!_0x108abb)return;this[_0x1a6e78(0xc6)]['position']['copy'](_0x108abb),!this[_0x1a6e78(0xc6)][_0x1a6e78(0xa1)]&&this['obj'][_0x1a6e78(0x9e)][_0x1a6e78(0xee)](_0x108abb['x'],_0x108abb['y'],_0x108abb['z']),this[_0x1a6e78(0xc6)][_0x1a6e78(0xec)](),this[_0x1a6e78(0xc6)][_0x1a6e78(0xbf)](!![]),this['world']&&this['world'][_0x1a6e78(0xa6)][_0x1a6e78(0xd6)]();}[_0x35dfae(0x92)](){const _0x20ca51=_0x35dfae;if(!this[_0x20ca51(0xc6)])throw Error(_0x20ca51(0xd9));if(this[_0x20ca51(0xc6)][_0x20ca51(0xa1)])return this[_0x20ca51(0xc6)]['rotation']['clone']();else {const _0x50ac6f=new webgpu.Vector3(),_0x4e4302=new webgpu.Quaternion(),_0x1e7620=new webgpu.Vector3();return this[_0x20ca51(0xc6)][_0x20ca51(0x9e)][_0x20ca51(0x9a)](_0x50ac6f,_0x4e4302,_0x1e7620),new webgpu.Euler()[_0x20ca51(0xf8)](_0x4e4302);}}['setRotation'](..._0x5ad5ac){const _0x339c16=_0x35dfae;var _0x2dd7af;if(!this[_0x339c16(0xc6)])throw Error('threeObject\x20is\x20invalid');let _0x3ebbf5=null;if((_0x2dd7af=_0x5ad5ac[0x0])===null||_0x2dd7af===void 0?void 0:_0x2dd7af['isEuler']){const _0x1df2c1=_0x5ad5ac[0x0];_0x3ebbf5=new webgpu.Euler(_0x1df2c1['x'],_0x1df2c1['y'],_0x1df2c1['z'],_0x1df2c1[_0x339c16(0x8c)]);}else typeof _0x5ad5ac[0x0]==='number'&&typeof _0x5ad5ac[0x1]==='number'&&typeof _0x5ad5ac[0x2]==='number'&&(_0x3ebbf5=new webgpu.Euler(_0x5ad5ac[0x0],_0x5ad5ac[0x1],_0x5ad5ac[0x2]));if(!_0x3ebbf5)return;this['obj'][_0x339c16(0xd7)][_0x339c16(0xf6)](_0x3ebbf5),this['obj'][_0x339c16(0xec)](),this[_0x339c16(0xc6)][_0x339c16(0xbf)](!![]),this[_0x339c16(0xa3)]&&this['world'][_0x339c16(0xa6)][_0x339c16(0xd6)]();}[_0x35dfae(0xf1)](){const _0x3a782b=_0x35dfae;if(!this[_0x3a782b(0xc6)])throw Error(_0x3a782b(0xd9));if(this[_0x3a782b(0xc6)]['matrixAutoUpdate'])return this[_0x3a782b(0xc6)][_0x3a782b(0xd1)][_0x3a782b(0xb5)]();else {const _0x232283=new webgpu.Vector3(),_0x26f110=new webgpu.Quaternion(),_0x4405ff=new webgpu.Vector3();return this[_0x3a782b(0xc6)][_0x3a782b(0x9e)]['decompose'](_0x232283,_0x26f110,_0x4405ff),_0x26f110;}}['setQuaternion'](..._0x2f0aa3){const _0x117c53=_0x35dfae;var _0x189038;if(!this[_0x117c53(0xc6)])throw Error('threeObject\x20is\x20invalid');let _0x26f327=null;if((_0x189038=_0x2f0aa3[0x0])===null||_0x189038===void 0?void 0:_0x189038[_0x117c53(0xf4)]){const _0x2caa30=_0x2f0aa3[0x0];_0x26f327=new webgpu.Quaternion(_0x2caa30['x'],_0x2caa30['y'],_0x2caa30['z'],_0x2caa30['w']);}else typeof _0x2f0aa3[0x0]===_0x117c53(0xa5)&&typeof _0x2f0aa3[0x1]===_0x117c53(0xa5)&&typeof _0x2f0aa3[0x2]===_0x117c53(0xa5)&&typeof _0x2f0aa3[0x3]===_0x117c53(0xa5)&&(_0x26f327=new webgpu.Quaternion(_0x2f0aa3[0x0],_0x2f0aa3[0x1],_0x2f0aa3[0x2],_0x2f0aa3[0x3]));if(!_0x26f327){console[_0x117c53(0xe0)](_0x117c53(0xb0),_0x2f0aa3);return;}this[_0x117c53(0xc6)]['quaternion'][_0x117c53(0xf6)](_0x26f327);if(!this[_0x117c53(0xc6)]['matrixAutoUpdate']){const _0x413c35=new webgpu.Vector3(),_0x5d1764=new webgpu.Quaternion(),_0x5134f5=new webgpu.Vector3();this[_0x117c53(0xc6)][_0x117c53(0x9e)][_0x117c53(0x9a)](_0x413c35,_0x5d1764,_0x5134f5),this[_0x117c53(0xc6)][_0x117c53(0x9e)][_0x117c53(0x88)](_0x413c35,_0x26f327,_0x5134f5);}this[_0x117c53(0xa3)]&&this[_0x117c53(0xa3)][_0x117c53(0xa6)][_0x117c53(0xd6)](),this[_0x117c53(0xc6)][_0x117c53(0xec)](),this[_0x117c53(0xc6)][_0x117c53(0xbf)](!![]);}['getScale'](){const _0x1f4090=_0x35dfae;if(!this[_0x1f4090(0xc6)])throw Error(_0x1f4090(0xd9));if(this[_0x1f4090(0xc6)][_0x1f4090(0xa1)])return this[_0x1f4090(0xc6)][_0x1f4090(0xc1)][_0x1f4090(0xb5)]();else {const _0x11520d=new webgpu.Vector3(),_0x400bfc=new webgpu.Quaternion(),_0x3ddf5d=new webgpu.Vector3();return this['obj']['matrix'][_0x1f4090(0x9a)](_0x11520d,_0x400bfc,_0x3ddf5d),_0x3ddf5d;}}[_0x35dfae(0xa7)](..._0xfa9ceb){const _0x1e501e=_0x35dfae;var _0x21f01b;if(!this[_0x1e501e(0xc6)])throw Error(_0x1e501e(0xd9));let _0x432d02=null;if((_0x21f01b=_0xfa9ceb[0x0])===null||_0x21f01b===void 0?void 0:_0x21f01b[_0x1e501e(0xdf)]){const _0x40e4dd=_0xfa9ceb[0x0];_0x432d02=new webgpu.Vector3(_0x40e4dd['x'],_0x40e4dd['y'],_0x40e4dd['z']);}else typeof _0xfa9ceb[0x0]===_0x1e501e(0xa5)&&typeof _0xfa9ceb[0x1]===_0x1e501e(0xa5)&&typeof _0xfa9ceb[0x2]==='number'&&(_0x432d02=new webgpu.Vector3(_0xfa9ceb[0x0],_0xfa9ceb[0x1],_0xfa9ceb[0x2]));if(!_0x432d02)return;this[_0x1e501e(0xc6)][_0x1e501e(0xc1)]['copy'](_0x432d02),this[_0x1e501e(0xc6)][_0x1e501e(0xec)](),this[_0x1e501e(0xc6)][_0x1e501e(0xbf)](!![]),this['world']&&this['world']['viewport']['markRenderStateDirty']();}[_0x35dfae(0xe4)](){const _0x5c1b46=_0x35dfae;if(!this['obj'])throw Error(_0x5c1b46(0xd9));return this[_0x5c1b46(0xc6)][_0x5c1b46(0x9e)];}['setMatrix'](_0x242379){const _0x202e01=_0x35dfae;var _0xba9283;if(!this['obj'])throw Error(_0x202e01(0xd9));_0x242379[_0x202e01(0x9a)](this[_0x202e01(0xc6)][_0x202e01(0xbe)],this[_0x202e01(0xc6)][_0x202e01(0xd1)],this[_0x202e01(0xc6)]['scale']),this[_0x202e01(0xc6)][_0x202e01(0xec)](),this[_0x202e01(0xc6)]['updateMatrixWorld'](!![]),(_0xba9283=this[_0x202e01(0xa3)])===null||_0xba9283===void 0?void 0:_0xba9283[_0x202e01(0xa6)][_0x202e01(0xd6)]();}[_0x35dfae(0x98)](){const _0x252cfb=_0x35dfae;if(!this[_0x252cfb(0xc6)])throw Error(_0x252cfb(0xd9));let _0x26f517=new webgpu.Vector3();return this[_0x252cfb(0xc6)][_0x252cfb(0x98)](_0x26f517),_0x26f517;}[_0x35dfae(0xbb)](){const _0x5ebbac=_0x35dfae;if(!this[_0x5ebbac(0xc6)])throw Error(_0x5ebbac(0xd9));let _0x1f331e=new webgpu.Quaternion();return this[_0x5ebbac(0xc6)][_0x5ebbac(0xc7)](_0x1f331e),new webgpu.Euler()[_0x5ebbac(0xf8)](_0x1f331e);}[_0x35dfae(0xc7)](){const _0x421405=_0x35dfae;if(!this['obj'])throw Error(_0x421405(0xd9));let _0x37e815=new webgpu.Quaternion();return this[_0x421405(0xc6)]['getWorldQuaternion'](_0x37e815),_0x37e815;}[_0x35dfae(0xab)](){const _0x5f535a=_0x35dfae;if(!this[_0x5f535a(0xc6)])throw Error(_0x5f535a(0xd9));let _0x2b3f69=new webgpu.Vector3();return this['obj'][_0x5f535a(0xab)](_0x2b3f69),_0x2b3f69;}['getWorldMatrix'](){const _0x322783=_0x35dfae;if(!this['obj'])throw Error(_0x322783(0xd9));return this[_0x322783(0xc6)][_0x322783(0xbf)](!![]),this[_0x322783(0xc6)][_0x322783(0xe8)][_0x322783(0xb5)]();}['setWorldMatrix'](_0x5bde56){const _0x3bb9bb=_0x35dfae;if(!this[_0x3bb9bb(0xc6)])throw Error(_0x3bb9bb(0xd9));if(this[_0x3bb9bb(0xc6)][_0x3bb9bb(0xe7)]){this['obj'][_0x3bb9bb(0xe7)][_0x3bb9bb(0xbf)](!![]);const _0x14bc31=this['obj'][_0x3bb9bb(0xe7)][_0x3bb9bb(0xe8)][_0x3bb9bb(0xb5)]()['invert'](),_0x529e81=new webgpu.Matrix4()['multiplyMatrices'](_0x14bc31,_0x5bde56);this[_0x3bb9bb(0xba)](_0x529e81);}else this[_0x3bb9bb(0xba)](_0x5bde56);this[_0x3bb9bb(0xc6)][_0x3bb9bb(0xbf)](!![]),this[_0x3bb9bb(0xa3)]&&this['world'][_0x3bb9bb(0xa6)]['markRenderStateDirty']();}[_0x35dfae(0xae)](){const _0x5e7f80=_0x35dfae;if(!this['obj'])throw Error('threeObject\x20is\x20invalid');let _0x3e3d54=new webgpu.Vector3();return this[_0x5e7f80(0xc6)]['getWorldDirection'](_0x3e3d54),_0x3e3d54;}['getWorldUpDirection'](){const _0x184807=_0x35dfae;if(!this['obj'])throw Error(_0x184807(0xd9));let _0x341b53=new webgpu.Vector3(0x0,0x1,0x0);return _0x341b53['applyQuaternion'](this[_0x184807(0xc7)]()),_0x341b53;}[_0x35dfae(0x93)](){const _0x2602c4=_0x35dfae;if(!this['obj'])throw Error(_0x2602c4(0xd9));let _0x28ea6d=new webgpu.Vector3(0x1,0x0,0x0);return _0x28ea6d[_0x2602c4(0xb9)](this['getWorldQuaternion']()),_0x28ea6d;}[_0x35dfae(0xed)](_0x2f36fe){const _0x281028=_0x35dfae;if(!this[_0x281028(0xc6)])throw Error(_0x281028(0xd9));return this[_0x281028(0xc6)][_0x281028(0xed)](_0x2f36fe);}['localToWorld'](_0x2db40d){const _0xfa41a4=_0x35dfae;if(!this[_0xfa41a4(0xc6)])throw Error('threeObject\x20is\x20invalid');return this['obj']['localToWorld'](_0x2db40d);}[_0x35dfae(0x8b)](_0x72f9a2){const _0x34dfa8=_0x35dfae;if(!this[_0x34dfa8(0xc6)])throw Error(_0x34dfa8(0xd9));if(!_0x72f9a2[_0x34dfa8(0xd4)])throw Error(_0x34dfa8(0xaf));this[_0x34dfa8(0xc6)]['add'](_0x72f9a2[_0x34dfa8(0xd4)]),this[_0x34dfa8(0xa3)]&&_0x72f9a2[_0x34dfa8(0xa8)](this['world']);}[_0x35dfae(0xf0)](_0xdd012e){const _0x4dd474=_0x35dfae;if(!this['obj'])throw Error(_0x4dd474(0xd9));if(!_0xdd012e['threeObject'])throw Error(_0x4dd474(0x89));this[_0x4dd474(0xc6)][_0x4dd474(0xe6)](_0xdd012e[_0x4dd474(0xd4)]);}[_0x35dfae(0xf5)](_0x1a7f71,_0x9a1a49=exports.AttachmentRules['KeepRelative']){const _0x1c07ed=_0x35dfae;if(!this[_0x1c07ed(0xc6)])throw Error(_0x1c07ed(0xd9));if(!_0x1a7f71['threeObject'])throw Error('newComponent\x20threeObject\x20is\x20invalid');_0x1a7f71[_0x1c07ed(0x97)]=this[_0x1c07ed(0x97)];if(_0x9a1a49===exports.AttachmentRules[_0x1c07ed(0xe2)]){let _0x5c332a=_0x1a7f71[_0x1c07ed(0xea)]();this['obj'][_0x1c07ed(0x95)](_0x1a7f71[_0x1c07ed(0xd4)]),_0x1a7f71[_0x1c07ed(0xeb)](_0x5c332a);}else this[_0x1c07ed(0xc6)][_0x1c07ed(0x95)](_0x1a7f71['threeObject']);this['world']&&_0x1a7f71[_0x1c07ed(0xa8)](this[_0x1c07ed(0xa3)]),this['obj'][_0x1c07ed(0xec)](),this[_0x1c07ed(0xc6)][_0x1c07ed(0xbf)](!![]);}[_0x35dfae(0xce)](_0x1bc5bd){const _0x63aaa0=_0x35dfae;if(!this['obj'])throw Error(_0x63aaa0(0xd9));if(!_0x1bc5bd[_0x63aaa0(0xd4)])throw Error('targetComponent\x20threeObject\x20is\x20invalid');this[_0x63aaa0(0xc6)]['remove'](_0x1bc5bd['threeObject']);}[_0x35dfae(0xb8)](){const _0x3e98f6=_0x35dfae;this['parentComponent']&&this[_0x3e98f6(0xdc)][_0x3e98f6(0xce)](this);}['detachFromParentActor'](){const _0xa317b0=_0x35dfae;this[_0xa317b0(0x97)]&&(this[_0xa317b0(0x97)]=null);}['destroyChildren'](){const _0x3cd8bc=_0x35dfae;var _0x271914;if(!this['obj'])return;let _0x18a1c2=[];for(let _0xb513e2=0x0;_0xb513e2<this[_0x3cd8bc(0xc6)]['children'][_0x3cd8bc(0xc9)];++_0xb513e2){let _0x1700c6=(_0x271914=this['obj']['children'][_0xb513e2][_0x3cd8bc(0xf2)])===null||_0x271914===void 0?void 0:_0x271914[_0x3cd8bc(0x9d)];_0x1700c6&&_0x18a1c2['push'](_0x1700c6);}_0x18a1c2[_0x3cd8bc(0xb1)](_0x1d89f5=>{const _0x1b428a=_0x3cd8bc;_0x1d89f5[_0x1b428a(0xf7)]();}),_0x18a1c2=[];}set[_0x35dfae(0xa9)](_0x109de9){const _0x56250d=_0x35dfae;this['bCanHover']=_0x109de9;let _0x547a0d=this['childrenComponents'];for(let _0x5b1343=0x0;_0x5b1343<_0x547a0d[_0x56250d(0xc9)];++_0x5b1343){_0x547a0d[_0x5b1343][_0x56250d(0xa9)]=this[_0x56250d(0xe9)];}}get[_0x35dfae(0xa9)](){const _0x1837c5=_0x35dfae;return this[_0x1837c5(0xe9)];}set['isClickEnabled'](_0x5dad7a){const _0x589056=_0x35dfae;this[_0x589056(0xca)]=_0x5dad7a;let _0x11a4e0=this['childrenComponents'];for(let _0x260d1b=0x0;_0x260d1b<_0x11a4e0[_0x589056(0xc9)];++_0x260d1b){_0x11a4e0[_0x260d1b][_0x589056(0xb6)]=this[_0x589056(0xca)];}}get[_0x35dfae(0xb6)](){return this['bCanClick'];}[_0x35dfae(0xcf)](){const _0x254991=_0x35dfae;this[_0x254991(0xa0)]['broadcast']();}[_0x35dfae(0x90)](){const _0x220ea6=_0x35dfae;this[_0x220ea6(0xc2)][_0x220ea6(0xc0)]();}[_0x35dfae(0xad)](){const _0x47af36=_0x35dfae;this['_onClickDelegate'][_0x47af36(0xc0)]();}[_0x35dfae(0xb3)](){const _0x50d6a3=_0x35dfae;this[_0x50d6a3(0xda)][_0x50d6a3(0xc0)]();}}
|
|
760
30
|
|
|
761
|
-
class MeshComponent extends SceneComponent {
|
|
762
|
-
get threeObject() {
|
|
763
|
-
if (!this.obj) {
|
|
764
|
-
throw new Error("threeObject is null");
|
|
765
|
-
}
|
|
766
|
-
return this.obj;
|
|
767
|
-
}
|
|
768
|
-
set threeObject(newThreeObject) {
|
|
769
|
-
this.obj = newThreeObject;
|
|
770
|
-
if (this.obj) {
|
|
771
|
-
this.obj.userData["LYObject"] = this;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
get geometry() {
|
|
775
|
-
if (!this._geometryPtr) {
|
|
776
|
-
throw new Error("geometryPtr is null");
|
|
777
|
-
}
|
|
778
|
-
return this._geometryPtr.getValue();
|
|
779
|
-
}
|
|
780
|
-
set geometry(geo) {
|
|
781
|
-
let geoPtr = this.app.assetManager.addGeometryAsset(geo);
|
|
782
|
-
this.geometryPtr = geoPtr;
|
|
783
|
-
}
|
|
784
|
-
get geometryPtr() {
|
|
785
|
-
if (!this._geometryPtr) {
|
|
786
|
-
throw new Error("geometryPtr is null");
|
|
787
|
-
}
|
|
788
|
-
return this._geometryPtr;
|
|
789
|
-
}
|
|
790
|
-
set geometryPtr(geo) {
|
|
791
|
-
if (this._geometryPtr) {
|
|
792
|
-
this._geometryPtr.release();
|
|
793
|
-
this._geometryPtr = null;
|
|
794
|
-
}
|
|
795
|
-
this._geometryPtr = geo;
|
|
796
|
-
let geometry = geo.getValue();
|
|
797
|
-
if (this.threeObject && geometry) {
|
|
798
|
-
this.threeObject.geometry = geometry;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
get material() {
|
|
802
|
-
let mats = [];
|
|
803
|
-
this._materialPtr.forEach((elem) => {
|
|
804
|
-
let mat = elem.getValue();
|
|
805
|
-
if (mat)
|
|
806
|
-
mats.push(mat);
|
|
807
|
-
});
|
|
808
|
-
return mats.length > 1 ? mats : mats[0];
|
|
809
|
-
}
|
|
810
|
-
get materialPtr() {
|
|
811
|
-
return this.materialPtr;
|
|
812
|
-
}
|
|
813
|
-
set material(newMat) {
|
|
814
|
-
let mats = Array.isArray(newMat) ? newMat : [newMat];
|
|
815
|
-
let matPtrs = [];
|
|
816
|
-
mats.forEach((elem) => {
|
|
817
|
-
let ptr = this.app.assetManager.addMaterialAsset(elem);
|
|
818
|
-
if (ptr)
|
|
819
|
-
matPtrs.push(ptr);
|
|
820
|
-
});
|
|
821
|
-
this.materialPtr = matPtrs;
|
|
822
|
-
}
|
|
823
|
-
set materialPtr(newMat) {
|
|
824
|
-
if (this._materialPtr) {
|
|
825
|
-
this._materialPtr.forEach((elem) => {
|
|
826
|
-
elem.release();
|
|
827
|
-
});
|
|
828
|
-
this._materialPtr = [];
|
|
829
|
-
}
|
|
830
|
-
let matPtrs = Array.isArray(newMat) ? newMat : [newMat];
|
|
831
|
-
let mats = [];
|
|
832
|
-
matPtrs.forEach((elem) => {
|
|
833
|
-
let mat = elem.getValue();
|
|
834
|
-
if (mat)
|
|
835
|
-
mats.push(mat);
|
|
836
|
-
elem.addRef();
|
|
837
|
-
});
|
|
838
|
-
if (this.threeObject) {
|
|
839
|
-
if (mats.length > 0)
|
|
840
|
-
this.threeObject.material = Array.isArray(newMat) ? mats[0] : mats;
|
|
841
|
-
}
|
|
842
|
-
this._materialPtr = matPtrs;
|
|
843
|
-
}
|
|
844
|
-
constructor(app, geometry, material, uuid) {
|
|
845
|
-
let matPtrs = [];
|
|
846
|
-
let mats = Array.isArray(material) ? material : [material];
|
|
847
|
-
mats.forEach((elem) => {
|
|
848
|
-
let ptr = app.assetManager.addMaterialAsset(elem);
|
|
849
|
-
if (ptr)
|
|
850
|
-
matPtrs.push(ptr);
|
|
851
|
-
});
|
|
852
|
-
super(app, uuid);
|
|
853
|
-
this._geometryPtr = app.assetManager.addGeometryAsset(geometry);
|
|
854
|
-
this._materialPtr = matPtrs;
|
|
855
|
-
matPtrs.forEach((elem) => {
|
|
856
|
-
elem.addRef();
|
|
857
|
-
});
|
|
858
|
-
this.threeObject.material = material;
|
|
859
|
-
this.threeObject.geometry = geometry;
|
|
860
|
-
}
|
|
861
|
-
createDefaultObject() {
|
|
862
|
-
return new webgpu.Mesh();
|
|
863
|
-
}
|
|
864
|
-
set castShadow(bCast) {
|
|
865
|
-
if (this.threeObject)
|
|
866
|
-
this.threeObject.castShadow = bCast;
|
|
867
|
-
}
|
|
868
|
-
get castShadow() {
|
|
869
|
-
return this.threeObject ? this.threeObject.castShadow : false;
|
|
870
|
-
}
|
|
871
|
-
set receiveShadow(bReceive) {
|
|
872
|
-
if (!this.threeObject) {
|
|
873
|
-
return;
|
|
874
|
-
}
|
|
875
|
-
this.threeObject.receiveShadow = bReceive;
|
|
876
|
-
}
|
|
877
|
-
get receiveShadow() {
|
|
878
|
-
return this.threeObject ? this.threeObject.receiveShadow : false;
|
|
879
|
-
}
|
|
880
|
-
getBoundsCenterPosition() {
|
|
881
|
-
let ret = new webgpu.Vector3();
|
|
882
|
-
this.getBounds().getCenter(ret);
|
|
883
|
-
return ret;
|
|
884
|
-
}
|
|
885
|
-
getBoundsTopCenterPosition() {
|
|
886
|
-
let ret = new webgpu.Vector3();
|
|
887
|
-
let bounds = this.getBounds();
|
|
888
|
-
bounds.getCenter(ret);
|
|
889
|
-
ret.y = bounds.max.y;
|
|
890
|
-
return ret;
|
|
891
|
-
}
|
|
892
|
-
getBoundsBottomCenterPosition() {
|
|
893
|
-
let ret = new webgpu.Vector3();
|
|
894
|
-
let bounds = this.getBounds();
|
|
895
|
-
bounds.getCenter(ret);
|
|
896
|
-
ret.y = bounds.min.y;
|
|
897
|
-
return ret;
|
|
898
|
-
}
|
|
899
|
-
destroyObject() {
|
|
900
|
-
var _a;
|
|
901
|
-
if (this.threeObject) {
|
|
902
|
-
this.threeObject.removeFromParent();
|
|
903
|
-
}
|
|
904
|
-
(_a = this._geometryPtr) === null || _a === void 0 ? void 0 : _a.release();
|
|
905
|
-
let matPtrs = Array.isArray(this._materialPtr) ? this._materialPtr : [this._materialPtr];
|
|
906
|
-
matPtrs.forEach((elem) => {
|
|
907
|
-
elem.release();
|
|
908
|
-
});
|
|
909
|
-
super.destroyObject();
|
|
910
|
-
}
|
|
911
|
-
}
|
|
31
|
+
const _0x62e471=_0x569c;function _0x48de(){const _0x34fe00=['getBounds','geometryPtr','getValue','30IynxnM','188408arLUrw','materialPtr','receiveShadow','LYObject','2585522kHqiuX','userData','material','6849155sSEAUu','obj','getBoundsBottomCenterPosition','removeFromParent','push','min','isArray','app','geometry','threeObject','geometryPtr\x20is\x20null','getCenter','getBoundsTopCenterPosition','addRef','threeObject\x20is\x20null','createDefaultObject','_geometryPtr','max','forEach','assetManager','5311192gUszSS','343YEMYfh','addMaterialAsset','411645fduJrJ','release','6BpdEMZ','790450PYTjfE','2838033QdLyAv','castShadow','destroyObject','_materialPtr'];_0x48de=function(){return _0x34fe00;};return _0x48de();}function _0x569c(_0x4588e5,_0x5e0527){_0x4588e5=_0x4588e5-0x11e;const _0x48de13=_0x48de();let _0x569c3b=_0x48de13[_0x4588e5];return _0x569c3b;}(function(_0x3876c4,_0x18e3b7){const _0x39609f=_0x569c,_0x39821a=_0x3876c4();while(!![]){try{const _0x4aca2e=-parseInt(_0x39609f(0x122))/0x1+parseInt(_0x39609f(0x12f))/0x2+parseInt(_0x39609f(0x11f))/0x3+parseInt(_0x39609f(0x146))/0x4+-parseInt(_0x39609f(0x132))/0x5*(parseInt(_0x39609f(0x121))/0x6)+parseInt(_0x39609f(0x147))/0x7*(parseInt(_0x39609f(0x12b))/0x8)+parseInt(_0x39609f(0x123))/0x9*(-parseInt(_0x39609f(0x12a))/0xa);if(_0x4aca2e===_0x18e3b7)break;else _0x39821a['push'](_0x39821a['shift']());}catch(_0x4eab82){_0x39821a['push'](_0x39821a['shift']());}}}(_0x48de,0xc4a69));class MeshComponent extends SceneComponent{get['threeObject'](){const _0x1729c5=_0x569c;if(!this[_0x1729c5(0x133)])throw new Error(_0x1729c5(0x140));return this[_0x1729c5(0x133)];}set['threeObject'](_0x254f3e){const _0x5c13ae=_0x569c;this[_0x5c13ae(0x133)]=_0x254f3e,this[_0x5c13ae(0x133)]&&(this['obj'][_0x5c13ae(0x130)][_0x5c13ae(0x12e)]=this);}get[_0x62e471(0x13a)](){const _0x2a7d03=_0x62e471;if(!this[_0x2a7d03(0x142)])throw new Error(_0x2a7d03(0x13c));return this[_0x2a7d03(0x142)][_0x2a7d03(0x129)]();}set['geometry'](_0xcb027f){const _0x51c43c=_0x62e471;let _0x1cb43e=this[_0x51c43c(0x139)]['assetManager']['addGeometryAsset'](_0xcb027f);this[_0x51c43c(0x128)]=_0x1cb43e;}get[_0x62e471(0x128)](){if(!this['_geometryPtr'])throw new Error('geometryPtr\x20is\x20null');return this['_geometryPtr'];}set[_0x62e471(0x128)](_0x33bc70){const _0x38bc2c=_0x62e471;this[_0x38bc2c(0x142)]&&(this['_geometryPtr'][_0x38bc2c(0x120)](),this[_0x38bc2c(0x142)]=null);this[_0x38bc2c(0x142)]=_0x33bc70;let _0x1ee909=_0x33bc70['getValue']();this['threeObject']&&_0x1ee909&&(this['threeObject'][_0x38bc2c(0x13a)]=_0x1ee909);}get[_0x62e471(0x131)](){const _0x518bdf=_0x62e471;let _0xc62452=[];return this[_0x518bdf(0x126)][_0x518bdf(0x144)](_0xeef218=>{const _0x27c117=_0x518bdf;let _0x5cc66d=_0xeef218[_0x27c117(0x129)]();if(_0x5cc66d)_0xc62452[_0x27c117(0x136)](_0x5cc66d);}),_0xc62452['length']>0x1?_0xc62452:_0xc62452[0x0];}get[_0x62e471(0x12c)](){const _0x516a97=_0x62e471;return this[_0x516a97(0x12c)];}set[_0x62e471(0x131)](_0x1005a9){const _0x90d0f2=_0x62e471;let _0x202228=Array['isArray'](_0x1005a9)?_0x1005a9:[_0x1005a9],_0x2a7f8e=[];_0x202228[_0x90d0f2(0x144)](_0x5aae57=>{const _0x5c0331=_0x90d0f2;let _0xde1b58=this[_0x5c0331(0x139)][_0x5c0331(0x145)][_0x5c0331(0x11e)](_0x5aae57);if(_0xde1b58)_0x2a7f8e[_0x5c0331(0x136)](_0xde1b58);}),this['materialPtr']=_0x2a7f8e;}set['materialPtr'](_0x59c517){const _0x2b8193=_0x62e471;this['_materialPtr']&&(this['_materialPtr'][_0x2b8193(0x144)](_0x90f8c4=>{const _0x1555da=_0x2b8193;_0x90f8c4[_0x1555da(0x120)]();}),this[_0x2b8193(0x126)]=[]);let _0x5f4d10=Array[_0x2b8193(0x138)](_0x59c517)?_0x59c517:[_0x59c517],_0x4cf76d=[];_0x5f4d10[_0x2b8193(0x144)](_0x5f42cb=>{const _0x589814=_0x2b8193;let _0x3d08c7=_0x5f42cb['getValue']();if(_0x3d08c7)_0x4cf76d[_0x589814(0x136)](_0x3d08c7);_0x5f42cb[_0x589814(0x13f)]();});if(this[_0x2b8193(0x13b)]){if(_0x4cf76d['length']>0x0)this['threeObject'][_0x2b8193(0x131)]=Array['isArray'](_0x59c517)?_0x4cf76d[0x0]:_0x4cf76d;}this['_materialPtr']=_0x5f4d10;}constructor(_0x2a6564,_0x2e8e0a,_0x24ca36,_0x10ead0){const _0x131dc4=_0x62e471;let _0x2af264=[],_0x10bd44=Array[_0x131dc4(0x138)](_0x24ca36)?_0x24ca36:[_0x24ca36];_0x10bd44[_0x131dc4(0x144)](_0x3309ac=>{const _0x9dc804=_0x131dc4;let _0x43c82a=_0x2a6564[_0x9dc804(0x145)]['addMaterialAsset'](_0x3309ac);if(_0x43c82a)_0x2af264['push'](_0x43c82a);}),super(_0x2a6564,_0x10ead0),this[_0x131dc4(0x142)]=_0x2a6564[_0x131dc4(0x145)]['addGeometryAsset'](_0x2e8e0a),this[_0x131dc4(0x126)]=_0x2af264,_0x2af264[_0x131dc4(0x144)](_0x3b4486=>{const _0x32b8b6=_0x131dc4;_0x3b4486[_0x32b8b6(0x13f)]();}),this['threeObject']['material']=_0x24ca36,this[_0x131dc4(0x13b)][_0x131dc4(0x13a)]=_0x2e8e0a;}[_0x62e471(0x141)](){return new webgpu.Mesh();}set[_0x62e471(0x124)](_0x24c3f0){const _0x495eaa=_0x62e471;if(this[_0x495eaa(0x13b)])this[_0x495eaa(0x13b)][_0x495eaa(0x124)]=_0x24c3f0;}get[_0x62e471(0x124)](){const _0x1a55be=_0x62e471;return this[_0x1a55be(0x13b)]?this[_0x1a55be(0x13b)]['castShadow']:![];}set[_0x62e471(0x12d)](_0x1cb2bc){const _0xdc968c=_0x62e471;if(!this[_0xdc968c(0x13b)])return;this['threeObject'][_0xdc968c(0x12d)]=_0x1cb2bc;}get[_0x62e471(0x12d)](){const _0x4e9172=_0x62e471;return this[_0x4e9172(0x13b)]?this[_0x4e9172(0x13b)][_0x4e9172(0x12d)]:![];}['getBoundsCenterPosition'](){const _0x52297f=_0x62e471;let _0x50c133=new webgpu.Vector3();return this[_0x52297f(0x127)]()[_0x52297f(0x13d)](_0x50c133),_0x50c133;}[_0x62e471(0x13e)](){const _0x4c757f=_0x62e471;let _0x541d1d=new webgpu.Vector3(),_0x5c1332=this[_0x4c757f(0x127)]();return _0x5c1332[_0x4c757f(0x13d)](_0x541d1d),_0x541d1d['y']=_0x5c1332[_0x4c757f(0x143)]['y'],_0x541d1d;}[_0x62e471(0x134)](){const _0x223e63=_0x62e471;let _0x5960fb=new webgpu.Vector3(),_0x52caa3=this[_0x223e63(0x127)]();return _0x52caa3[_0x223e63(0x13d)](_0x5960fb),_0x5960fb['y']=_0x52caa3[_0x223e63(0x137)]['y'],_0x5960fb;}[_0x62e471(0x125)](){const _0x31fc57=_0x62e471;var _0x5c3eb8;this[_0x31fc57(0x13b)]&&this['threeObject'][_0x31fc57(0x135)]();(_0x5c3eb8=this[_0x31fc57(0x142)])===null||_0x5c3eb8===void 0?void 0:_0x5c3eb8[_0x31fc57(0x120)]();let _0x50e050=Array[_0x31fc57(0x138)](this[_0x31fc57(0x126)])?this[_0x31fc57(0x126)]:[this['_materialPtr']];_0x50e050[_0x31fc57(0x144)](_0x4d7c20=>{const _0x39fc82=_0x31fc57;_0x4d7c20[_0x39fc82(0x120)]();}),super[_0x31fc57(0x125)]();}}
|
|
912
32
|
|
|
913
|
-
class TSmartPointer {
|
|
914
|
-
constructor(value, referenceCount = 1) {
|
|
915
|
-
this.referenceCount = 1;
|
|
916
|
-
this.value = null;
|
|
917
|
-
this.value = value;
|
|
918
|
-
this.referenceCount = referenceCount;
|
|
919
|
-
}
|
|
920
|
-
getRefCount() {
|
|
921
|
-
return this.referenceCount;
|
|
922
|
-
}
|
|
923
|
-
isValid() {
|
|
924
|
-
return this.value !== null;
|
|
925
|
-
}
|
|
926
|
-
addRef(count = 1) {
|
|
927
|
-
if (this.value !== null) {
|
|
928
|
-
this.referenceCount += count;
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
release() {
|
|
932
|
-
if (this.value !== null && this.referenceCount > 0) {
|
|
933
|
-
this.referenceCount--;
|
|
934
|
-
if (this.referenceCount === 0) {
|
|
935
|
-
this.dispose();
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
forceRelease() {
|
|
940
|
-
if (this.value !== null) {
|
|
941
|
-
this.dispose();
|
|
942
|
-
this.referenceCount = 0;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
/**
|
|
946
|
-
* 子类覆盖此方法以执行清理逻辑
|
|
947
|
-
*/
|
|
948
|
-
dispose() {
|
|
949
|
-
this.value = null;
|
|
950
|
-
}
|
|
951
|
-
getValue() {
|
|
952
|
-
return this.value;
|
|
953
|
-
}
|
|
954
|
-
}
|
|
33
|
+
var _0x2515bf=_0x597e;(function(_0x2c99c0,_0x2d290a){var _0x360f0e=_0x597e,_0x1d6abe=_0x2c99c0();while(!![]){try{var _0xeb9202=parseInt(_0x360f0e(0x126))/0x1+parseInt(_0x360f0e(0x121))/0x2+parseInt(_0x360f0e(0x11a))/0x3*(parseInt(_0x360f0e(0x128))/0x4)+-parseInt(_0x360f0e(0x129))/0x5*(parseInt(_0x360f0e(0x11f))/0x6)+-parseInt(_0x360f0e(0x125))/0x7+parseInt(_0x360f0e(0x124))/0x8+parseInt(_0x360f0e(0x123))/0x9*(-parseInt(_0x360f0e(0x122))/0xa);if(_0xeb9202===_0x2d290a)break;else _0x1d6abe['push'](_0x1d6abe['shift']());}catch(_0x14854f){_0x1d6abe['push'](_0x1d6abe['shift']());}}}(_0x2634,0x901e9));function _0x597e(_0x438c91,_0x8d4a9a){_0x438c91=_0x438c91-0x11a;var _0x26345d=_0x2634();var _0x597ef9=_0x26345d[_0x438c91];return _0x597ef9;}class TSmartPointer{constructor(_0x52a15d,_0x3a3a6a=0x1){var _0x398e13=_0x597e;this[_0x398e13(0x11b)]=0x1,this['value']=null,this[_0x398e13(0x11c)]=_0x52a15d,this[_0x398e13(0x11b)]=_0x3a3a6a;}[_0x2515bf(0x120)](){return this['referenceCount'];}['isValid'](){var _0x120599=_0x2515bf;return this[_0x120599(0x11c)]!==null;}[_0x2515bf(0x11e)](_0x5b2d7e=0x1){var _0x530ce0=_0x2515bf;this[_0x530ce0(0x11c)]!==null&&(this[_0x530ce0(0x11b)]+=_0x5b2d7e);}['release'](){var _0x1df07d=_0x2515bf;this['value']!==null&&this['referenceCount']>0x0&&(this[_0x1df07d(0x11b)]--,this[_0x1df07d(0x11b)]===0x0&&this[_0x1df07d(0x127)]());}[_0x2515bf(0x11d)](){var _0x193ae7=_0x2515bf;this[_0x193ae7(0x11c)]!==null&&(this[_0x193ae7(0x127)](),this[_0x193ae7(0x11b)]=0x0);}[_0x2515bf(0x127)](){var _0x18b575=_0x2515bf;this[_0x18b575(0x11c)]=null;}['getValue'](){var _0x49ab8e=_0x2515bf;return this[_0x49ab8e(0x11c)];}}function _0x2634(){var _0x5a4a21=['706674risDXH','getRefCount','845286ORqhbr','30WFTKUH','2750427tHImGu','4431896GVohho','2817535NDpWcI','274909mCVJyH','dispose','175900afqLYK','15rOnFiU','69HpXXwj','referenceCount','value','forceRelease','addRef'];_0x2634=function(){return _0x5a4a21;};return _0x2634();}
|
|
955
34
|
|
|
956
|
-
|
|
957
|
-
* userData 键名常量
|
|
958
|
-
*/
|
|
959
|
-
const ASSET_POINTER_KEY = 'assetPointer';
|
|
960
|
-
const EDITOR_ASSET_ID_KEY = 'editorAssetId';
|
|
961
|
-
/**
|
|
962
|
-
* Three.js 资源的智能指针
|
|
963
|
-
* 管理 BufferGeometry、Material、Texture 的生命周期
|
|
964
|
-
*/
|
|
965
|
-
class TAssetPointer extends TSmartPointer {
|
|
966
|
-
get uuid() {
|
|
967
|
-
return this._uuid;
|
|
968
|
-
}
|
|
969
|
-
constructor(value, referenceCount = 0) {
|
|
970
|
-
super(value, referenceCount);
|
|
971
|
-
this._uuid = value.uuid;
|
|
972
|
-
value.userData[ASSET_POINTER_KEY] = this;
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* 释放资源,清理 userData 并调用 Three.js 的 dispose
|
|
976
|
-
*/
|
|
977
|
-
dispose() {
|
|
978
|
-
if (this.value) {
|
|
979
|
-
// 清理 userData 中的引用
|
|
980
|
-
if (this.value.userData) {
|
|
981
|
-
delete this.value.userData[ASSET_POINTER_KEY];
|
|
982
|
-
delete this.value.userData[EDITOR_ASSET_ID_KEY];
|
|
983
|
-
}
|
|
984
|
-
// 调用 Three.js 资源的 dispose 方法
|
|
985
|
-
if (typeof this.value.dispose === "function") {
|
|
986
|
-
this.value.dispose();
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
// 调用父类清理 value = null
|
|
990
|
-
super.dispose();
|
|
991
|
-
}
|
|
992
|
-
}
|
|
35
|
+
const _0xc290f5=_0x593e;function _0x593e(_0x41e0f1,_0xa7e4c2){_0x41e0f1=_0x41e0f1-0x1c0;const _0x1dbb2b=_0x1dbb();let _0x593e0f=_0x1dbb2b[_0x41e0f1];return _0x593e0f;}(function(_0x2a0d82,_0x3bef3c){const _0x5db093=_0x593e,_0x53bf76=_0x2a0d82();while(!![]){try{const _0x155758=-parseInt(_0x5db093(0x1c3))/0x1*(parseInt(_0x5db093(0x1c6))/0x2)+-parseInt(_0x5db093(0x1c9))/0x3+-parseInt(_0x5db093(0x1c5))/0x4*(parseInt(_0x5db093(0x1ce))/0x5)+parseInt(_0x5db093(0x1cd))/0x6+-parseInt(_0x5db093(0x1c4))/0x7*(-parseInt(_0x5db093(0x1ca))/0x8)+-parseInt(_0x5db093(0x1c8))/0x9*(-parseInt(_0x5db093(0x1c2))/0xa)+parseInt(_0x5db093(0x1cf))/0xb;if(_0x155758===_0x3bef3c)break;else _0x53bf76['push'](_0x53bf76['shift']());}catch(_0x355bb4){_0x53bf76['push'](_0x53bf76['shift']());}}}(_0x1dbb,0x5b27a));const ASSET_POINTER_KEY=_0xc290f5(0x1d0);const EDITOR_ASSET_ID_KEY='editorAssetId';function _0x1dbb(){const _0x4fdfde=['userData','function','3911514QgEDfh','10ACHoid','1227347vteMJZ','assetPointer','value','dispose','3745850PYDFZF','1842XzmPuY','175APImcQ','1297216VcIxCt','298tjfHvm','_uuid','9qIWCLQ','1580760RmnXlh','219288LPMavb'];_0x1dbb=function(){return _0x4fdfde;};return _0x1dbb();}class TAssetPointer extends TSmartPointer{get['uuid'](){const _0x27bf1b=_0xc290f5;return this[_0x27bf1b(0x1c7)];}constructor(_0x1e0491,_0x7e8ef=0x0){const _0x1223c6=_0xc290f5;super(_0x1e0491,_0x7e8ef),this[_0x1223c6(0x1c7)]=_0x1e0491['uuid'],_0x1e0491['userData'][ASSET_POINTER_KEY]=this;}[_0xc290f5(0x1c1)](){const _0x16b67d=_0xc290f5;this[_0x16b67d(0x1c0)]&&(this[_0x16b67d(0x1c0)][_0x16b67d(0x1cb)]&&(delete this['value'][_0x16b67d(0x1cb)][ASSET_POINTER_KEY],delete this[_0x16b67d(0x1c0)]['userData'][EDITOR_ASSET_ID_KEY]),typeof this['value'][_0x16b67d(0x1c1)]===_0x16b67d(0x1cc)&&this['value']['dispose']()),super[_0x16b67d(0x1c1)]();}}
|
|
993
36
|
|
|
994
|
-
|
|
995
|
-
* 材质资产指针
|
|
996
|
-
* 管理材质及其关联的纹理引用
|
|
997
|
-
*/
|
|
998
|
-
class MaterialAssetPointer extends TAssetPointer {
|
|
999
|
-
constructor(value, usedTextures, referenceCount = 0) {
|
|
1000
|
-
super(value, referenceCount);
|
|
1001
|
-
this.textures = usedTextures;
|
|
1002
|
-
}
|
|
1003
|
-
get texturePointers() {
|
|
1004
|
-
return this.textures;
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* 设置材质的纹理属性
|
|
1008
|
-
*/
|
|
1009
|
-
setTexture(name, texturePtr) {
|
|
1010
|
-
const mat = this.getValue();
|
|
1011
|
-
const texture = texturePtr.getValue();
|
|
1012
|
-
if (!texture) {
|
|
1013
|
-
throw new Error("Texture is null");
|
|
1014
|
-
}
|
|
1015
|
-
if (!mat) {
|
|
1016
|
-
throw new Error("Material is null");
|
|
1017
|
-
}
|
|
1018
|
-
const oldTexture = this.textures.get(name);
|
|
1019
|
-
if (oldTexture !== texturePtr) {
|
|
1020
|
-
// 释放旧纹理引用
|
|
1021
|
-
if (oldTexture) {
|
|
1022
|
-
oldTexture.release();
|
|
1023
|
-
}
|
|
1024
|
-
// 设置新纹理
|
|
1025
|
-
this.textures.set(name, texturePtr);
|
|
1026
|
-
mat[name] = texture;
|
|
1027
|
-
texturePtr.addRef();
|
|
1028
|
-
mat.needsUpdate = true;
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
/**
|
|
1032
|
-
* 移除纹理属性
|
|
1033
|
-
*/
|
|
1034
|
-
removeTexture(name) {
|
|
1035
|
-
const mat = this.getValue();
|
|
1036
|
-
const oldTexture = this.textures.get(name);
|
|
1037
|
-
if (oldTexture) {
|
|
1038
|
-
oldTexture.release();
|
|
1039
|
-
this.textures.delete(name);
|
|
1040
|
-
if (mat) {
|
|
1041
|
-
mat[name] = null;
|
|
1042
|
-
mat.needsUpdate = true;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* 释放材质时同时释放所有关联的纹理引用
|
|
1048
|
-
*/
|
|
1049
|
-
dispose() {
|
|
1050
|
-
// 释放所有纹理引用
|
|
1051
|
-
for (const texture of this.textures.values()) {
|
|
1052
|
-
texture.release();
|
|
1053
|
-
}
|
|
1054
|
-
this.textures.clear();
|
|
1055
|
-
// 调用父类清理材质
|
|
1056
|
-
super.dispose();
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
37
|
+
const _0x217407=_0x2c9b;(function(_0x5a53b0,_0x579729){const _0x4d3af4=_0x2c9b,_0x2e3844=_0x5a53b0();while(!![]){try{const _0x4c9929=parseInt(_0x4d3af4(0x164))/0x1+parseInt(_0x4d3af4(0x15f))/0x2*(parseInt(_0x4d3af4(0x163))/0x3)+parseInt(_0x4d3af4(0x16d))/0x4+-parseInt(_0x4d3af4(0x169))/0x5+-parseInt(_0x4d3af4(0x160))/0x6+parseInt(_0x4d3af4(0x166))/0x7+-parseInt(_0x4d3af4(0x16f))/0x8;if(_0x4c9929===_0x579729)break;else _0x2e3844['push'](_0x2e3844['shift']());}catch(_0x406f2a){_0x2e3844['push'](_0x2e3844['shift']());}}}(_0xe0cb,0x4b1fa));function _0xe0cb(){const _0xf4847d=['getValue','addRef','values','removeTexture','delete','8kXdIlC','1392096kMlXKT','dispose','release','195969XlLVqy','374974aLCXYj','set','260911lsCnVy','texturePointers','textures','1829200LDrIZt','setTexture','Material\x20is\x20null','needsUpdate','1983608JdUYRo','get','2111032AIWghQ'];_0xe0cb=function(){return _0xf4847d;};return _0xe0cb();}function _0x2c9b(_0x192e63,_0x2f0f89){_0x192e63=_0x192e63-0x15b;const _0xe0cb28=_0xe0cb();let _0x2c9b00=_0xe0cb28[_0x192e63];return _0x2c9b00;}class MaterialAssetPointer extends TAssetPointer{constructor(_0x2afab2,_0x2c8031,_0x4a6819=0x0){super(_0x2afab2,_0x4a6819),this['textures']=_0x2c8031;}get[_0x217407(0x167)](){const _0x298c5f=_0x217407;return this[_0x298c5f(0x168)];}[_0x217407(0x16a)](_0x2ffe2f,_0xa50687){const _0x7ed9e0=_0x217407,_0x4c32a7=this[_0x7ed9e0(0x170)](),_0x50a22d=_0xa50687['getValue']();if(!_0x50a22d)throw new Error('Texture\x20is\x20null');if(!_0x4c32a7)throw new Error(_0x7ed9e0(0x16b));const _0x328f68=this[_0x7ed9e0(0x168)][_0x7ed9e0(0x16e)](_0x2ffe2f);_0x328f68!==_0xa50687&&(_0x328f68&&_0x328f68[_0x7ed9e0(0x162)](),this[_0x7ed9e0(0x168)][_0x7ed9e0(0x165)](_0x2ffe2f,_0xa50687),_0x4c32a7[_0x2ffe2f]=_0x50a22d,_0xa50687[_0x7ed9e0(0x15b)](),_0x4c32a7['needsUpdate']=!![]);}[_0x217407(0x15d)](_0x35a999){const _0x2f1452=_0x217407,_0x1e65d4=this[_0x2f1452(0x170)](),_0xcb48f1=this[_0x2f1452(0x168)]['get'](_0x35a999);_0xcb48f1&&(_0xcb48f1[_0x2f1452(0x162)](),this[_0x2f1452(0x168)][_0x2f1452(0x15e)](_0x35a999),_0x1e65d4&&(_0x1e65d4[_0x35a999]=null,_0x1e65d4[_0x2f1452(0x16c)]=!![]));}[_0x217407(0x161)](){const _0x4c4f1e=_0x217407;for(const _0x16c185 of this[_0x4c4f1e(0x168)][_0x4c4f1e(0x15c)]()){_0x16c185[_0x4c4f1e(0x162)]();}this[_0x4c4f1e(0x168)]['clear'](),super[_0x4c4f1e(0x161)]();}}
|
|
1059
38
|
|
|
1060
|
-
class TextureAssetPointer extends TAssetPointer
|
|
1061
|
-
constructor(value, referenceCount = 1) {
|
|
1062
|
-
super(value, referenceCount);
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
39
|
+
(function(_0x22ac12,_0x182b8a){var _0x141959=_0xfb30,_0x503dad=_0x22ac12();while(!![]){try{var _0x30819a=-parseInt(_0x141959(0x1a9))/0x1+parseInt(_0x141959(0x1ac))/0x2*(parseInt(_0x141959(0x1a7))/0x3)+parseInt(_0x141959(0x1ab))/0x4+parseInt(_0x141959(0x1ad))/0x5*(parseInt(_0x141959(0x1a8))/0x6)+parseInt(_0x141959(0x1a6))/0x7*(-parseInt(_0x141959(0x1aa))/0x8)+parseInt(_0x141959(0x1a5))/0x9*(-parseInt(_0x141959(0x1ae))/0xa)+parseInt(_0x141959(0x1af))/0xb;if(_0x30819a===_0x182b8a)break;else _0x503dad['push'](_0x503dad['shift']());}catch(_0x165be7){_0x503dad['push'](_0x503dad['shift']());}}}(_0xc28c,0xeefce));function _0xfb30(_0x5d6dc4,_0x424d37){_0x5d6dc4=_0x5d6dc4-0x1a5;var _0xc28c8f=_0xc28c();var _0xfb302d=_0xc28c8f[_0x5d6dc4];return _0xfb302d;}function _0xc28c(){var _0x152b52=['1891312CeQWxU','8AzbMKL','1350152QGYcfH','50HWldSA','11240Rfbldd','10rrWJzG','32568657doqYpv','667179mcBBwj','6867343NDLGpK','73359PJjmiV','42wJCNAe'];_0xc28c=function(){return _0x152b52;};return _0xc28c();}class TextureAssetPointer extends TAssetPointer{constructor(_0x16c9b0,_0x553fef=0x1){super(_0x16c9b0,_0x553fef);}}
|
|
1065
40
|
|
|
1066
|
-
class GeometryAssetPointer extends TAssetPointer
|
|
1067
|
-
constructor(value, referenceCount = 1) {
|
|
1068
|
-
super(value, referenceCount);
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
41
|
+
function _0x218b(_0x111626,_0x12ffd2){_0x111626=_0x111626-0xca;var _0x5946ea=_0x5946();var _0x218bca=_0x5946ea[_0x111626];return _0x218bca;}function _0x5946(){var _0x10fb32=['2599465BskUVt','1235088TqPugd','10xZmync','6BHxITR','387sEtkXg','128680YvvlTQ','88348PRjfgb','4KdGoEa','6209080LNqXBs','3001719Dfffkv','19798812QTFKHV'];_0x5946=function(){return _0x10fb32;};return _0x5946();}(function(_0x5b1c2a,_0x39a413){var _0xb9555d=_0x218b,_0x280290=_0x5b1c2a();while(!![]){try{var _0x4b60c4=parseInt(_0xb9555d(0xd0))/0x1*(-parseInt(_0xb9555d(0xd4))/0x2)+-parseInt(_0xb9555d(0xcf))/0x3+-parseInt(_0xb9555d(0xca))/0x4*(parseInt(_0xb9555d(0xce))/0x5)+-parseInt(_0xb9555d(0xd1))/0x6*(-parseInt(_0xb9555d(0xcc))/0x7)+parseInt(_0xb9555d(0xd3))/0x8*(-parseInt(_0xb9555d(0xd2))/0x9)+parseInt(_0xb9555d(0xcb))/0xa+parseInt(_0xb9555d(0xcd))/0xb;if(_0x4b60c4===_0x39a413)break;else _0x280290['push'](_0x280290['shift']());}catch(_0x58f2dd){_0x280290['push'](_0x280290['shift']());}}}(_0x5946,0xbf8f9));class GeometryAssetPointer extends TAssetPointer{constructor(_0x27c185,_0x22c908=0x1){super(_0x27c185,_0x22c908);}}
|
|
1071
42
|
|
|
1072
|
-
class AssetManager {
|
|
1073
|
-
constructor(app) {
|
|
1074
|
-
this.geometryAssets = new Map();
|
|
1075
|
-
this.textureAssets = new Map();
|
|
1076
|
-
this.materialAssets = new Map();
|
|
1077
|
-
this.dracoLoader = null;
|
|
1078
|
-
this.loadingManager = new webgpu.LoadingManager();
|
|
1079
|
-
this.gltfLoader = new Addons_js.GLTFLoader(this.loadingManager);
|
|
1080
|
-
this.app = app;
|
|
1081
|
-
}
|
|
1082
|
-
get LoadingManager() {
|
|
1083
|
-
return this.loadingManager;
|
|
1084
|
-
}
|
|
1085
|
-
async init() {
|
|
1086
|
-
return;
|
|
1087
|
-
}
|
|
1088
|
-
setupDracoLoader(dracoPath) {
|
|
1089
|
-
if (!this.dracoLoader) {
|
|
1090
|
-
// Create DRACOLoader without passing LoadingManager
|
|
1091
|
-
this.dracoLoader = new Addons_js.DRACOLoader();
|
|
1092
|
-
// Clear manager callbacks to avoid Worker cloning issues
|
|
1093
|
-
if (this.dracoLoader.manager) {
|
|
1094
|
-
const manager = this.dracoLoader.manager;
|
|
1095
|
-
manager.onStart = undefined;
|
|
1096
|
-
manager.onLoad = undefined;
|
|
1097
|
-
manager.onProgress = undefined;
|
|
1098
|
-
manager.onError = undefined;
|
|
1099
|
-
}
|
|
1100
|
-
this.dracoLoader.setDecoderPath(dracoPath);
|
|
1101
|
-
// Intercept Worker creation to fix Vue reactivity issues
|
|
1102
|
-
const OriginalWorker = window.Worker;
|
|
1103
|
-
if (OriginalWorker && !OriginalWorker._dracoPatched) {
|
|
1104
|
-
OriginalWorker._dracoPatched = true;
|
|
1105
|
-
window.Worker = function (scriptURL, options) {
|
|
1106
|
-
const worker = new OriginalWorker(scriptURL, options);
|
|
1107
|
-
const originalPostMessage = worker.postMessage.bind(worker);
|
|
1108
|
-
worker.postMessage = function (message, transfer) {
|
|
1109
|
-
// Fix decoderConfig if it exists and is a Vue proxy
|
|
1110
|
-
if (message && message.decoderConfig && typeof message.decoderConfig === 'object') {
|
|
1111
|
-
const config = message.decoderConfig;
|
|
1112
|
-
const plainConfig = {};
|
|
1113
|
-
// Copy all properties to create a plain object
|
|
1114
|
-
for (const key in config) {
|
|
1115
|
-
if (Object.prototype.hasOwnProperty.call(config, key)) {
|
|
1116
|
-
plainConfig[key] = config[key];
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
message = Object.assign(Object.assign({}, message), { decoderConfig: plainConfig });
|
|
1120
|
-
}
|
|
1121
|
-
return originalPostMessage(message, transfer);
|
|
1122
|
-
};
|
|
1123
|
-
return worker;
|
|
1124
|
-
};
|
|
1125
|
-
// Copy static properties
|
|
1126
|
-
for (const key in OriginalWorker) {
|
|
1127
|
-
if (Object.prototype.hasOwnProperty.call(OriginalWorker, key)) {
|
|
1128
|
-
window.Worker[key] = OriginalWorker[key];
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
this.dracoLoader.preload();
|
|
1133
|
-
this.gltfLoader.setDRACOLoader(this.dracoLoader);
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
convertThreeObjectToLYObject(parentLYComponent, threejsObject) {
|
|
1137
|
-
const location = threejsObject.position.clone();
|
|
1138
|
-
const rotation = threejsObject.rotation.clone();
|
|
1139
|
-
const scale = threejsObject.scale.clone();
|
|
1140
|
-
let newComp = null;
|
|
1141
|
-
const children = threejsObject.children;
|
|
1142
|
-
threejsObject.children = [];
|
|
1143
|
-
if (threejsObject.type === "Group" || threejsObject.type === "Object3D") {
|
|
1144
|
-
newComp = new SceneComponent(this.app, threejsObject.uuid);
|
|
1145
|
-
}
|
|
1146
|
-
else if (threejsObject.isMesh) {
|
|
1147
|
-
const obj = threejsObject;
|
|
1148
|
-
newComp = new MeshComponent(this.app, obj.geometry, obj.material);
|
|
1149
|
-
threejsObject.layers.set(0);
|
|
1150
|
-
}
|
|
1151
|
-
else {
|
|
1152
|
-
newComp = new SceneComponent(this.app, threejsObject.uuid);
|
|
1153
|
-
}
|
|
1154
|
-
if (newComp === null) {
|
|
1155
|
-
threejsObject.children = children;
|
|
1156
|
-
return null;
|
|
1157
|
-
}
|
|
1158
|
-
parentLYComponent.addChildComponent(newComp);
|
|
1159
|
-
newComp.setPosition(location);
|
|
1160
|
-
newComp.setRotation(rotation);
|
|
1161
|
-
newComp.setScale(scale);
|
|
1162
|
-
for (const child of children) {
|
|
1163
|
-
this.convertThreeObjectToLYObject(newComp, child);
|
|
1164
|
-
}
|
|
1165
|
-
return newComp;
|
|
1166
|
-
}
|
|
1167
|
-
collectResourcesAndReferences(object) {
|
|
1168
|
-
const countResource = (map, resource) => {
|
|
1169
|
-
var _a;
|
|
1170
|
-
const currentCount = (_a = map.get(resource)) !== null && _a !== void 0 ? _a : 0;
|
|
1171
|
-
map.set(resource, currentCount + 1);
|
|
1172
|
-
};
|
|
1173
|
-
const resources = {
|
|
1174
|
-
geometries: new Map(),
|
|
1175
|
-
materials: new Map(),
|
|
1176
|
-
textures: new Map()
|
|
1177
|
-
};
|
|
1178
|
-
object.traverse((child) => {
|
|
1179
|
-
const meshChild = child;
|
|
1180
|
-
if (meshChild.geometry instanceof webgpu.BufferGeometry) {
|
|
1181
|
-
countResource(resources.geometries, meshChild.geometry);
|
|
1182
|
-
}
|
|
1183
|
-
if (meshChild.material) {
|
|
1184
|
-
const mats = Array.isArray(meshChild.material) ? meshChild.material : [meshChild.material];
|
|
1185
|
-
mats.forEach((mat) => {
|
|
1186
|
-
if (mat) {
|
|
1187
|
-
countResource(resources.materials, mat);
|
|
1188
|
-
Object.values(mat).forEach((value) => {
|
|
1189
|
-
if (value instanceof webgpu.Texture) {
|
|
1190
|
-
countResource(resources.textures, value);
|
|
1191
|
-
}
|
|
1192
|
-
});
|
|
1193
|
-
}
|
|
1194
|
-
});
|
|
1195
|
-
}
|
|
1196
|
-
});
|
|
1197
|
-
resources.geometries.forEach((count, geometry) => this.addAsset(geometry, count));
|
|
1198
|
-
resources.materials.forEach((count, material) => this.addAsset(material, count));
|
|
1199
|
-
resources.textures.forEach((count, texture) => this.addAsset(texture, count));
|
|
1200
|
-
}
|
|
1201
|
-
checkMeshResource(mesh) {
|
|
1202
|
-
if (mesh.geometry && !mesh.geometry.userData["assetPointer"]) {
|
|
1203
|
-
this.addAsset(mesh.geometry);
|
|
1204
|
-
}
|
|
1205
|
-
if (mesh.material) {
|
|
1206
|
-
const mats = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
|
|
1207
|
-
mats.forEach((material) => {
|
|
1208
|
-
if (!material)
|
|
1209
|
-
return;
|
|
1210
|
-
if (!material.userData["assetPointer"]) {
|
|
1211
|
-
this.addAsset(material);
|
|
1212
|
-
}
|
|
1213
|
-
Object.values(material).forEach((value) => {
|
|
1214
|
-
if (value instanceof webgpu.Texture && !value.userData["assetPointer"]) {
|
|
1215
|
-
this.addAsset(value);
|
|
1216
|
-
}
|
|
1217
|
-
});
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
async loadGltfFromPathAsync(path) {
|
|
1222
|
-
this.setupDracoLoader("/SceneResource/draco/");
|
|
1223
|
-
return await this.gltfLoader.loadAsync(path);
|
|
1224
|
-
}
|
|
1225
|
-
loadGltfFromPath(path, onLoadFinished) {
|
|
1226
|
-
this.setupDracoLoader("/SceneResource/draco/");
|
|
1227
|
-
this.gltfLoader.load(path, onLoadFinished);
|
|
1228
|
-
}
|
|
1229
|
-
loadGltfFromBuffer(data, path, onLoadFinished) {
|
|
1230
|
-
this.setupDracoLoader("/SceneResource/draco/");
|
|
1231
|
-
this.gltfLoader.parse(data, path, onLoadFinished);
|
|
1232
|
-
}
|
|
1233
|
-
loadFile(filepath = '', onLoadFinished) {
|
|
1234
|
-
const loader = new webgpu.FileLoader();
|
|
1235
|
-
loader.load(filepath, onLoadFinished);
|
|
1236
|
-
}
|
|
1237
|
-
addAsset(asset, referenceCount = 0) {
|
|
1238
|
-
if (asset instanceof webgpu.BufferGeometry) {
|
|
1239
|
-
return this.addGeometryAsset(asset, referenceCount);
|
|
1240
|
-
}
|
|
1241
|
-
if (asset instanceof webgpu.Material) {
|
|
1242
|
-
return this.addMaterialAsset(asset, referenceCount);
|
|
1243
|
-
}
|
|
1244
|
-
if (asset instanceof webgpu.Texture) {
|
|
1245
|
-
return this.addTextureAsset(asset, referenceCount);
|
|
1246
|
-
}
|
|
1247
|
-
return undefined;
|
|
1248
|
-
}
|
|
1249
|
-
addMaterialAsset(asset, referenceCount = 0) {
|
|
1250
|
-
let pointer = asset.userData["assetPointer"];
|
|
1251
|
-
if (!pointer) {
|
|
1252
|
-
const textureMap = new Map();
|
|
1253
|
-
Object.entries(asset).forEach(([key, value]) => {
|
|
1254
|
-
if (value instanceof webgpu.Texture) {
|
|
1255
|
-
const texturePointer = this.addTextureAsset(value, 1);
|
|
1256
|
-
textureMap.set(key, texturePointer);
|
|
1257
|
-
}
|
|
1258
|
-
});
|
|
1259
|
-
pointer = new MaterialAssetPointer(asset, textureMap, referenceCount);
|
|
1260
|
-
this.materialAssets.set(asset.uuid, pointer);
|
|
1261
|
-
}
|
|
1262
|
-
else {
|
|
1263
|
-
pointer.addRef(referenceCount);
|
|
1264
|
-
}
|
|
1265
|
-
return pointer;
|
|
1266
|
-
}
|
|
1267
|
-
addTextureAsset(asset, referenceCount = 0) {
|
|
1268
|
-
let pointer = asset.userData["assetPointer"];
|
|
1269
|
-
if (!pointer) {
|
|
1270
|
-
pointer = new TextureAssetPointer(asset, referenceCount);
|
|
1271
|
-
this.textureAssets.set(asset.uuid, pointer);
|
|
1272
|
-
}
|
|
1273
|
-
else {
|
|
1274
|
-
pointer.addRef(referenceCount);
|
|
1275
|
-
}
|
|
1276
|
-
return pointer;
|
|
1277
|
-
}
|
|
1278
|
-
addGeometryAsset(asset, referenceCount = 0) {
|
|
1279
|
-
let pointer = asset.userData["assetPointer"];
|
|
1280
|
-
if (!pointer) {
|
|
1281
|
-
pointer = new GeometryAssetPointer(asset, referenceCount);
|
|
1282
|
-
this.geometryAssets.set(asset.uuid, pointer);
|
|
1283
|
-
}
|
|
1284
|
-
else {
|
|
1285
|
-
pointer.addRef(referenceCount);
|
|
1286
|
-
}
|
|
1287
|
-
return pointer;
|
|
1288
|
-
}
|
|
1289
|
-
releaseAsset(asset) {
|
|
1290
|
-
const pointer = asset.userData["assetPointer"];
|
|
1291
|
-
if (pointer) {
|
|
1292
|
-
pointer.release();
|
|
1293
|
-
}
|
|
1294
|
-
else {
|
|
1295
|
-
asset.dispose();
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
clearAssets() {
|
|
1299
|
-
this.geometryAssets.forEach((pointer) => pointer.forceRelease());
|
|
1300
|
-
this.geometryAssets.clear();
|
|
1301
|
-
this.materialAssets.forEach((pointer) => pointer.forceRelease());
|
|
1302
|
-
this.materialAssets.clear();
|
|
1303
|
-
this.textureAssets.forEach((pointer) => pointer.forceRelease());
|
|
1304
|
-
this.textureAssets.clear();
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
43
|
+
const _0x3ccc64=_0x3b7d;(function(_0x28e320,_0x16ec26){const _0x56130a=_0x3b7d,_0x3743b4=_0x28e320();while(!![]){try{const _0x439fcf=parseInt(_0x56130a(0x1a2))/0x1*(-parseInt(_0x56130a(0x1cf))/0x2)+parseInt(_0x56130a(0x194))/0x3+parseInt(_0x56130a(0x18f))/0x4+-parseInt(_0x56130a(0x1ba))/0x5+parseInt(_0x56130a(0x1c2))/0x6*(parseInt(_0x56130a(0x1be))/0x7)+parseInt(_0x56130a(0x1b0))/0x8+-parseInt(_0x56130a(0x18d))/0x9;if(_0x439fcf===_0x16ec26)break;else _0x3743b4['push'](_0x3743b4['shift']());}catch(_0x305c93){_0x3743b4['push'](_0x3743b4['shift']());}}}(_0x26f9,0x445e3));function _0x3b7d(_0x4fbdcd,_0x248523){_0x4fbdcd=_0x4fbdcd-0x18c;const _0x26f943=_0x26f9();let _0x3b7d73=_0x26f943[_0x4fbdcd];return _0x3b7d73;}function _0x26f9(){const _0x4b268f=['geometries','call','manager','onProgress','hasOwnProperty','materials','480123UjwwDr','convertThreeObjectToLYObject','1978416awVEbv','addRef','uuid','loadGltfFromPathAsync','addMaterialAsset','967065tyNqnB','userData','_dracoPatched','bind','onStart','scale','material','textureAssets','set','type','loadingManager','get','isArray','textures','350843kpCujL','checkMeshResource','entries','Worker','LoadingManager','clone','object','dracoLoader','decoderConfig','loadGltfFromBuffer','materialAssets','children','loadAsync','layers','312488jMeVdv','setPosition','rotation','/SceneResource/draco/','dispose','forceRelease','geometry','loadGltfFromPath','geometryAssets','assetPointer','920800hcFDtv','loadFile','setupDracoLoader','clear','17311pbPJsY','forEach','assign','parse','30veDvWT','addGeometryAsset','addAsset','gltfLoader','init','addTextureAsset','load','isMesh','position','values','setScale','app','traverse','2uHaopy','setDRACOLoader','onError','clearAssets','postMessage','setRotation'];_0x26f9=function(){return _0x4b268f;};return _0x26f9();}class AssetManager{constructor(_0x50726d){const _0x1e843a=_0x3b7d;this[_0x1e843a(0x1b8)]=new Map(),this[_0x1e843a(0x19b)]=new Map(),this[_0x1e843a(0x1ac)]=new Map(),this[_0x1e843a(0x1a9)]=null,this[_0x1e843a(0x19e)]=new webgpu.LoadingManager(),this[_0x1e843a(0x1c5)]=new Addons_js.GLTFLoader(this[_0x1e843a(0x19e)]),this[_0x1e843a(0x1cd)]=_0x50726d;}get[_0x3ccc64(0x1a6)](){const _0x209833=_0x3ccc64;return this[_0x209833(0x19e)];}async[_0x3ccc64(0x1c6)](){return;}['setupDracoLoader'](_0x5b7433){const _0x5cc4e7=_0x3ccc64;if(!this[_0x5cc4e7(0x1a9)]){this[_0x5cc4e7(0x1a9)]=new Addons_js.DRACOLoader();if(this['dracoLoader'][_0x5cc4e7(0x1d7)]){const _0x511476=this[_0x5cc4e7(0x1a9)][_0x5cc4e7(0x1d7)];_0x511476[_0x5cc4e7(0x198)]=undefined,_0x511476['onLoad']=undefined,_0x511476[_0x5cc4e7(0x1d8)]=undefined,_0x511476[_0x5cc4e7(0x1d1)]=undefined;}this[_0x5cc4e7(0x1a9)]['setDecoderPath'](_0x5b7433);const _0xcd02ce=window['Worker'];if(_0xcd02ce&&!_0xcd02ce[_0x5cc4e7(0x196)]){_0xcd02ce[_0x5cc4e7(0x196)]=!![],window[_0x5cc4e7(0x1a5)]=function(_0x28aaa1,_0x471864){const _0x5868ef=_0x5cc4e7,_0x429be4=new _0xcd02ce(_0x28aaa1,_0x471864),_0x322abb=_0x429be4[_0x5868ef(0x1d3)][_0x5868ef(0x197)](_0x429be4);return _0x429be4[_0x5868ef(0x1d3)]=function(_0x5b17da,_0x3cf1a8){const _0x3a4ef6=_0x5868ef;if(_0x5b17da&&_0x5b17da[_0x3a4ef6(0x1aa)]&&typeof _0x5b17da[_0x3a4ef6(0x1aa)]===_0x3a4ef6(0x1a8)){const _0x28f7db=_0x5b17da['decoderConfig'],_0x4661f1={};for(const _0x4018bc in _0x28f7db){Object['prototype']['hasOwnProperty']['call'](_0x28f7db,_0x4018bc)&&(_0x4661f1[_0x4018bc]=_0x28f7db[_0x4018bc]);}_0x5b17da=Object[_0x3a4ef6(0x1c0)](Object[_0x3a4ef6(0x1c0)]({},_0x5b17da),{'decoderConfig':_0x4661f1});}return _0x322abb(_0x5b17da,_0x3cf1a8);},_0x429be4;};for(const _0x4a7040 in _0xcd02ce){Object['prototype'][_0x5cc4e7(0x1d9)][_0x5cc4e7(0x1d6)](_0xcd02ce,_0x4a7040)&&(window[_0x5cc4e7(0x1a5)][_0x4a7040]=_0xcd02ce[_0x4a7040]);}}this['dracoLoader']['preload'](),this[_0x5cc4e7(0x1c5)][_0x5cc4e7(0x1d0)](this[_0x5cc4e7(0x1a9)]);}}[_0x3ccc64(0x18e)](_0x14648e,_0x3cd406){const _0x3e2459=_0x3ccc64,_0xabf0cd=_0x3cd406[_0x3e2459(0x1ca)][_0x3e2459(0x1a7)](),_0x58e439=_0x3cd406[_0x3e2459(0x1b2)][_0x3e2459(0x1a7)](),_0x2e07f5=_0x3cd406[_0x3e2459(0x199)][_0x3e2459(0x1a7)]();let _0x2906e8=null;const _0x94ed15=_0x3cd406[_0x3e2459(0x1ad)];_0x3cd406[_0x3e2459(0x1ad)]=[];if(_0x3cd406[_0x3e2459(0x19d)]==='Group'||_0x3cd406[_0x3e2459(0x19d)]==='Object3D')_0x2906e8=new SceneComponent(this[_0x3e2459(0x1cd)],_0x3cd406[_0x3e2459(0x191)]);else {if(_0x3cd406[_0x3e2459(0x1c9)]){const _0x4c4f43=_0x3cd406;_0x2906e8=new MeshComponent(this['app'],_0x4c4f43[_0x3e2459(0x1b6)],_0x4c4f43[_0x3e2459(0x19a)]),_0x3cd406[_0x3e2459(0x1af)]['set'](0x0);}else _0x2906e8=new SceneComponent(this[_0x3e2459(0x1cd)],_0x3cd406[_0x3e2459(0x191)]);}if(_0x2906e8===null)return _0x3cd406[_0x3e2459(0x1ad)]=_0x94ed15,null;_0x14648e['addChildComponent'](_0x2906e8),_0x2906e8[_0x3e2459(0x1b1)](_0xabf0cd),_0x2906e8[_0x3e2459(0x1d4)](_0x58e439),_0x2906e8[_0x3e2459(0x1cc)](_0x2e07f5);for(const _0x317968 of _0x94ed15){this[_0x3e2459(0x18e)](_0x2906e8,_0x317968);}return _0x2906e8;}['collectResourcesAndReferences'](_0x52fa92){const _0x1fca3e=_0x3ccc64,_0x1c6e0a=(_0x1d390d,_0x2faeab)=>{const _0x34b9ef=_0x3b7d;var _0x1d52a3;const _0xdd6039=(_0x1d52a3=_0x1d390d[_0x34b9ef(0x19f)](_0x2faeab))!==null&&_0x1d52a3!==void 0?_0x1d52a3:0x0;_0x1d390d[_0x34b9ef(0x19c)](_0x2faeab,_0xdd6039+0x1);},_0x45089d={'geometries':new Map(),'materials':new Map(),'textures':new Map()};_0x52fa92[_0x1fca3e(0x1ce)](_0x4576fb=>{const _0x3eb727=_0x1fca3e,_0x9e75a4=_0x4576fb;_0x9e75a4[_0x3eb727(0x1b6)]instanceof webgpu.BufferGeometry&&_0x1c6e0a(_0x45089d[_0x3eb727(0x1d5)],_0x9e75a4[_0x3eb727(0x1b6)]);if(_0x9e75a4[_0x3eb727(0x19a)]){const _0x39171b=Array['isArray'](_0x9e75a4[_0x3eb727(0x19a)])?_0x9e75a4['material']:[_0x9e75a4[_0x3eb727(0x19a)]];_0x39171b[_0x3eb727(0x1bf)](_0x5f3c7a=>{const _0x3f85ae=_0x3eb727;_0x5f3c7a&&(_0x1c6e0a(_0x45089d[_0x3f85ae(0x18c)],_0x5f3c7a),Object['values'](_0x5f3c7a)['forEach'](_0x1f6061=>{_0x1f6061 instanceof webgpu.Texture&&_0x1c6e0a(_0x45089d['textures'],_0x1f6061);}));});}}),_0x45089d['geometries'][_0x1fca3e(0x1bf)]((_0x37a783,_0x380c7c)=>this[_0x1fca3e(0x1c4)](_0x380c7c,_0x37a783)),_0x45089d[_0x1fca3e(0x18c)][_0x1fca3e(0x1bf)]((_0x37ec3f,_0x4ef4bc)=>this[_0x1fca3e(0x1c4)](_0x4ef4bc,_0x37ec3f)),_0x45089d[_0x1fca3e(0x1a1)][_0x1fca3e(0x1bf)]((_0x2bc4fa,_0x4d4c24)=>this[_0x1fca3e(0x1c4)](_0x4d4c24,_0x2bc4fa));}[_0x3ccc64(0x1a3)](_0x3d30a0){const _0x2446e0=_0x3ccc64;_0x3d30a0['geometry']&&!_0x3d30a0[_0x2446e0(0x1b6)][_0x2446e0(0x195)][_0x2446e0(0x1b9)]&&this[_0x2446e0(0x1c4)](_0x3d30a0[_0x2446e0(0x1b6)]);if(_0x3d30a0['material']){const _0x543564=Array[_0x2446e0(0x1a0)](_0x3d30a0['material'])?_0x3d30a0[_0x2446e0(0x19a)]:[_0x3d30a0['material']];_0x543564[_0x2446e0(0x1bf)](_0x37b7ae=>{const _0x4388ce=_0x2446e0;if(!_0x37b7ae)return;!_0x37b7ae[_0x4388ce(0x195)][_0x4388ce(0x1b9)]&&this[_0x4388ce(0x1c4)](_0x37b7ae),Object[_0x4388ce(0x1cb)](_0x37b7ae)[_0x4388ce(0x1bf)](_0x21de0b=>{const _0x3d21ef=_0x4388ce;_0x21de0b instanceof webgpu.Texture&&!_0x21de0b[_0x3d21ef(0x195)][_0x3d21ef(0x1b9)]&&this[_0x3d21ef(0x1c4)](_0x21de0b);});});}}async[_0x3ccc64(0x192)](_0x260f9a){const _0x46d66d=_0x3ccc64;return this[_0x46d66d(0x1bc)](_0x46d66d(0x1b3)),await this[_0x46d66d(0x1c5)][_0x46d66d(0x1ae)](_0x260f9a);}[_0x3ccc64(0x1b7)](_0x2068de,_0x2c0a5b){const _0x197f7a=_0x3ccc64;this[_0x197f7a(0x1bc)]('/SceneResource/draco/'),this[_0x197f7a(0x1c5)][_0x197f7a(0x1c8)](_0x2068de,_0x2c0a5b);}[_0x3ccc64(0x1ab)](_0x3f12ce,_0x17cbda,_0x26a7b5){const _0x2f1320=_0x3ccc64;this[_0x2f1320(0x1bc)]('/SceneResource/draco/'),this['gltfLoader'][_0x2f1320(0x1c1)](_0x3f12ce,_0x17cbda,_0x26a7b5);}[_0x3ccc64(0x1bb)](_0x54e47a='',_0x5072db){const _0x49a7bc=new webgpu.FileLoader();_0x49a7bc['load'](_0x54e47a,_0x5072db);}[_0x3ccc64(0x1c4)](_0x2cd105,_0x47a888=0x0){const _0x19d65e=_0x3ccc64;if(_0x2cd105 instanceof webgpu.BufferGeometry)return this[_0x19d65e(0x1c3)](_0x2cd105,_0x47a888);if(_0x2cd105 instanceof webgpu.Material)return this['addMaterialAsset'](_0x2cd105,_0x47a888);if(_0x2cd105 instanceof webgpu.Texture)return this[_0x19d65e(0x1c7)](_0x2cd105,_0x47a888);return undefined;}[_0x3ccc64(0x193)](_0x5b919b,_0x3fc263=0x0){const _0x2dce51=_0x3ccc64;let _0x222ead=_0x5b919b['userData']['assetPointer'];if(!_0x222ead){const _0x550104=new Map();Object[_0x2dce51(0x1a4)](_0x5b919b)[_0x2dce51(0x1bf)](([_0x5ce477,_0x64f4f7])=>{const _0xbafda0=_0x2dce51;if(_0x64f4f7 instanceof webgpu.Texture){const _0x26e838=this[_0xbafda0(0x1c7)](_0x64f4f7,0x1);_0x550104['set'](_0x5ce477,_0x26e838);}}),_0x222ead=new MaterialAssetPointer(_0x5b919b,_0x550104,_0x3fc263),this[_0x2dce51(0x1ac)]['set'](_0x5b919b[_0x2dce51(0x191)],_0x222ead);}else _0x222ead['addRef'](_0x3fc263);return _0x222ead;}[_0x3ccc64(0x1c7)](_0x59d31b,_0x6b8f3e=0x0){const _0x24fac8=_0x3ccc64;let _0x15e0cc=_0x59d31b[_0x24fac8(0x195)][_0x24fac8(0x1b9)];return !_0x15e0cc?(_0x15e0cc=new TextureAssetPointer(_0x59d31b,_0x6b8f3e),this[_0x24fac8(0x19b)]['set'](_0x59d31b[_0x24fac8(0x191)],_0x15e0cc)):_0x15e0cc[_0x24fac8(0x190)](_0x6b8f3e),_0x15e0cc;}[_0x3ccc64(0x1c3)](_0x22a4e3,_0x3cfabe=0x0){const _0x5d6cf4=_0x3ccc64;let _0x3e5292=_0x22a4e3['userData'][_0x5d6cf4(0x1b9)];return !_0x3e5292?(_0x3e5292=new GeometryAssetPointer(_0x22a4e3,_0x3cfabe),this['geometryAssets']['set'](_0x22a4e3[_0x5d6cf4(0x191)],_0x3e5292)):_0x3e5292[_0x5d6cf4(0x190)](_0x3cfabe),_0x3e5292;}['releaseAsset'](_0xabfe8b){const _0x4d5092=_0x3ccc64,_0x2a1a1e=_0xabfe8b['userData']['assetPointer'];_0x2a1a1e?_0x2a1a1e['release']():_0xabfe8b[_0x4d5092(0x1b4)]();}[_0x3ccc64(0x1d2)](){const _0x31c024=_0x3ccc64;this[_0x31c024(0x1b8)][_0x31c024(0x1bf)](_0x322b6c=>_0x322b6c[_0x31c024(0x1b5)]()),this['geometryAssets'][_0x31c024(0x1bd)](),this[_0x31c024(0x1ac)]['forEach'](_0x3268fc=>_0x3268fc[_0x31c024(0x1b5)]()),this[_0x31c024(0x1ac)][_0x31c024(0x1bd)](),this[_0x31c024(0x19b)][_0x31c024(0x1bf)](_0x27fc6d=>_0x27fc6d[_0x31c024(0x1b5)]()),this[_0x31c024(0x19b)][_0x31c024(0x1bd)]();}}
|
|
1307
44
|
|
|
1308
|
-
|
|
1309
|
-
* 资产类别 - 用于底层资产管理
|
|
1310
|
-
*/
|
|
1311
|
-
exports.AssetCategory = void 0;
|
|
1312
|
-
(function (AssetCategory) {
|
|
1313
|
-
AssetCategory["Geometry"] = "geometry";
|
|
1314
|
-
AssetCategory["Material"] = "material";
|
|
1315
|
-
AssetCategory["Texture"] = "texture";
|
|
1316
|
-
AssetCategory["Actor"] = "actor";
|
|
1317
|
-
AssetCategory["ActorManager"] = "actorManager";
|
|
1318
|
-
AssetCategory["Level"] = "level";
|
|
1319
|
-
AssetCategory["HTML"] = "html";
|
|
1320
|
-
AssetCategory["Code"] = "code";
|
|
1321
|
-
AssetCategory["Undefined"] = "undefined";
|
|
1322
|
-
})(exports.AssetCategory || (exports.AssetCategory = {}));
|
|
1323
|
-
/**
|
|
1324
|
-
* 资产加载状态
|
|
1325
|
-
*/
|
|
1326
|
-
exports.AssetLoadState = void 0;
|
|
1327
|
-
(function (AssetLoadState) {
|
|
1328
|
-
AssetLoadState["Unloaded"] = "unloaded";
|
|
1329
|
-
AssetLoadState["Loading"] = "loading";
|
|
1330
|
-
AssetLoadState["Loaded"] = "loaded";
|
|
1331
|
-
AssetLoadState["Error"] = "error";
|
|
1332
|
-
})(exports.AssetLoadState || (exports.AssetLoadState = {}));
|
|
1333
|
-
/**
|
|
1334
|
-
* 引用者类型
|
|
1335
|
-
*/
|
|
1336
|
-
exports.ReferenceType = void 0;
|
|
1337
|
-
(function (ReferenceType) {
|
|
1338
|
-
ReferenceType["Actor"] = "actor";
|
|
1339
|
-
ReferenceType["Component"] = "component";
|
|
1340
|
-
ReferenceType["Material"] = "material";
|
|
1341
|
-
ReferenceType["Level"] = "level";
|
|
1342
|
-
ReferenceType["AssetPointer"] = "assetPointer";
|
|
1343
|
-
ReferenceType["External"] = "external";
|
|
1344
|
-
})(exports.ReferenceType || (exports.ReferenceType = {}));
|
|
1345
|
-
/**
|
|
1346
|
-
* @deprecated 使用 AssetCategory 替代
|
|
1347
|
-
*/
|
|
1348
|
-
exports.AssetType = void 0;
|
|
1349
|
-
(function (AssetType) {
|
|
1350
|
-
AssetType[AssetType["geometry"] = 1] = "geometry";
|
|
1351
|
-
AssetType[AssetType["material"] = 2] = "material";
|
|
1352
|
-
AssetType[AssetType["texture"] = 3] = "texture";
|
|
1353
|
-
AssetType[AssetType["undefined"] = -1] = "undefined";
|
|
1354
|
-
})(exports.AssetType || (exports.AssetType = {}));
|
|
45
|
+
(function(_0x15ef5e,_0x35b74a){var _0x4f5d55=_0x4207,_0x1f47ec=_0x15ef5e();while(!![]){try{var _0x541aad=-parseInt(_0x4f5d55(0x153))/0x1+-parseInt(_0x4f5d55(0x160))/0x2*(parseInt(_0x4f5d55(0x16a))/0x3)+parseInt(_0x4f5d55(0x154))/0x4*(-parseInt(_0x4f5d55(0x151))/0x5)+-parseInt(_0x4f5d55(0x161))/0x6*(parseInt(_0x4f5d55(0x176))/0x7)+-parseInt(_0x4f5d55(0x150))/0x8*(-parseInt(_0x4f5d55(0x158))/0x9)+-parseInt(_0x4f5d55(0x173))/0xa*(-parseInt(_0x4f5d55(0x16d))/0xb)+parseInt(_0x4f5d55(0x167))/0xc*(parseInt(_0x4f5d55(0x155))/0xd);if(_0x541aad===_0x35b74a)break;else _0x1f47ec['push'](_0x1f47ec['shift']());}catch(_0x479a7a){_0x1f47ec['push'](_0x1f47ec['shift']());}}}(_0x36ce,0x90215));exports.AssetCategory = void 0;(function(_0x1930b4){var _0x36162e=_0x4207;_0x1930b4[_0x36162e(0x14f)]=_0x36162e(0x15f),_0x1930b4[_0x36162e(0x170)]=_0x36162e(0x15c),_0x1930b4[_0x36162e(0x162)]='texture',_0x1930b4[_0x36162e(0x168)]=_0x36162e(0x172),_0x1930b4[_0x36162e(0x175)]=_0x36162e(0x15a),_0x1930b4[_0x36162e(0x157)]=_0x36162e(0x16c),_0x1930b4[_0x36162e(0x174)]=_0x36162e(0x159),_0x1930b4[_0x36162e(0x15e)]=_0x36162e(0x163),_0x1930b4['Undefined']='undefined';}(exports.AssetCategory||(exports.AssetCategory={})));exports.AssetLoadState = void 0;function _0x4207(_0x5b47bb,_0x41bdc9){_0x5b47bb=_0x5b47bb-0x14f;var _0x36ce20=_0x36ce();var _0x420726=_0x36ce20[_0x5b47bb];return _0x420726;}function _0x36ce(){var _0x2a375e=['220KIhYgJ','HTML','ActorManager','345793NRQvcl','assetPointer','Geometry','8yvWpcO','14570hXFADJ','External','179019vsPdih','1108QiTKqP','130xMbuYQ','Loading','Level','426339oWAQHT','html','actorManager','undefined','material','Unloaded','Code','geometry','2lucjEv','108PwGAOy','Texture','code','Component','unloaded','error','3088872NDsnbh','Actor','AssetPointer','2487279ZOdLdK','texture','level','336699AMQwss','Error','loaded','Material','external','actor'];_0x36ce=function(){return _0x2a375e;};return _0x36ce();}(function(_0x4f2bb0){var _0xc80061=_0x4207;_0x4f2bb0[_0xc80061(0x15d)]=_0xc80061(0x165),_0x4f2bb0[_0xc80061(0x156)]='loading',_0x4f2bb0['Loaded']=_0xc80061(0x16f),_0x4f2bb0[_0xc80061(0x16e)]=_0xc80061(0x166);}(exports.AssetLoadState||(exports.AssetLoadState={})));exports.ReferenceType = void 0;(function(_0x2c710e){var _0x370e8d=_0x4207;_0x2c710e[_0x370e8d(0x168)]=_0x370e8d(0x172),_0x2c710e[_0x370e8d(0x164)]='component',_0x2c710e['Material']=_0x370e8d(0x15c),_0x2c710e[_0x370e8d(0x157)]=_0x370e8d(0x16c),_0x2c710e[_0x370e8d(0x169)]=_0x370e8d(0x177),_0x2c710e[_0x370e8d(0x152)]=_0x370e8d(0x171);}(exports.ReferenceType||(exports.ReferenceType={})));exports.AssetType = void 0;(function(_0x3264e4){var _0x29d39e=_0x4207;_0x3264e4[_0x3264e4[_0x29d39e(0x15f)]=0x1]='geometry',_0x3264e4[_0x3264e4[_0x29d39e(0x15c)]=0x2]=_0x29d39e(0x15c),_0x3264e4[_0x3264e4[_0x29d39e(0x16b)]=0x3]=_0x29d39e(0x16b),_0x3264e4[_0x3264e4[_0x29d39e(0x15b)]=-1]='undefined';}(exports.AssetType||(exports.AssetType={})));
|
|
1355
46
|
|
|
1356
|
-
const DefaultPostProcessParam = {
|
|
1357
|
-
steps: []
|
|
1358
|
-
};
|
|
1359
|
-
exports.PostProcessStepType = void 0;
|
|
1360
|
-
(function (PostProcessStepType) {
|
|
1361
|
-
PostProcessStepType[PostProcessStepType["Bloom"] = 0] = "Bloom";
|
|
1362
|
-
PostProcessStepType[PostProcessStepType["DepthOfField"] = 1] = "DepthOfField";
|
|
1363
|
-
PostProcessStepType[PostProcessStepType["ScreenSpaceReflection"] = 2] = "ScreenSpaceReflection";
|
|
1364
|
-
PostProcessStepType[PostProcessStepType["GroundTruthAmbientOcclusion"] = 3] = "GroundTruthAmbientOcclusion";
|
|
1365
|
-
PostProcessStepType[PostProcessStepType["Outline"] = 4] = "Outline";
|
|
1366
|
-
PostProcessStepType[PostProcessStepType["Antialiasing"] = 5] = "Antialiasing";
|
|
1367
|
-
PostProcessStepType[PostProcessStepType["LensFlare"] = 6] = "LensFlare";
|
|
1368
|
-
})(exports.PostProcessStepType || (exports.PostProcessStepType = {}));
|
|
47
|
+
function _0x329f(){const _0x1ab80d=['329198INZtgo','Antialiasing','ScreenSpaceReflection','Bloom','Outline','2838bQpzwm','10740OSyezZ','LensFlare','1106470blIFGK','8hQKUeb','2617290BkRcIR','DepthOfField','4cnsRLH','GroundTruthAmbientOcclusion','498411RscDhw','527724fiuDXt','12Dspidj','601748oCeMVf','1FEPAxf'];_0x329f=function(){return _0x1ab80d;};return _0x329f();}function _0x1804(_0xcac385,_0x38853a){_0xcac385=_0xcac385-0x1c9;const _0x329fd6=_0x329f();let _0x1804f4=_0x329fd6[_0xcac385];return _0x1804f4;}(function(_0x5a6464,_0x3196a9){const _0x57c125=_0x1804,_0x420453=_0x5a6464();while(!![]){try{const _0x162322=-parseInt(_0x57c125(0x1cc))/0x1*(parseInt(_0x57c125(0x1cd))/0x2)+parseInt(_0x57c125(0x1c9))/0x3+parseInt(_0x57c125(0x1d9))/0x4*(parseInt(_0x57c125(0x1d5))/0x5)+-parseInt(_0x57c125(0x1ca))/0x6*(parseInt(_0x57c125(0x1cb))/0x7)+parseInt(_0x57c125(0x1d6))/0x8*(parseInt(_0x57c125(0x1db))/0x9)+parseInt(_0x57c125(0x1d7))/0xa+parseInt(_0x57c125(0x1d2))/0xb*(-parseInt(_0x57c125(0x1d3))/0xc);if(_0x162322===_0x3196a9)break;else _0x420453['push'](_0x420453['shift']());}catch(_0x2b6678){_0x420453['push'](_0x420453['shift']());}}}(_0x329f,0x23db9));const DefaultPostProcessParam={'steps':[]};exports.PostProcessStepType = void 0;(function(_0xdb412a){const _0x4e2293=_0x1804;_0xdb412a[_0xdb412a[_0x4e2293(0x1d0)]=0x0]=_0x4e2293(0x1d0),_0xdb412a[_0xdb412a[_0x4e2293(0x1d8)]=0x1]=_0x4e2293(0x1d8),_0xdb412a[_0xdb412a[_0x4e2293(0x1cf)]=0x2]=_0x4e2293(0x1cf),_0xdb412a[_0xdb412a[_0x4e2293(0x1da)]=0x3]=_0x4e2293(0x1da),_0xdb412a[_0xdb412a[_0x4e2293(0x1d1)]=0x4]=_0x4e2293(0x1d1),_0xdb412a[_0xdb412a[_0x4e2293(0x1ce)]=0x5]=_0x4e2293(0x1ce),_0xdb412a[_0xdb412a['LensFlare']=0x6]=_0x4e2293(0x1d4);}(exports.PostProcessStepType||(exports.PostProcessStepType={})));
|
|
1369
48
|
|
|
1370
|
-
class World {
|
|
1371
|
-
get scene() {
|
|
1372
|
-
var _a;
|
|
1373
|
-
let scene = (_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.scene;
|
|
1374
|
-
if (!scene) {
|
|
1375
|
-
throw new Error("scene is null");
|
|
1376
|
-
}
|
|
1377
|
-
return scene;
|
|
1378
|
-
}
|
|
1379
|
-
get viewport() {
|
|
1380
|
-
return this.app.viewport;
|
|
1381
|
-
}
|
|
1382
|
-
get controller() {
|
|
1383
|
-
return this.app.controller;
|
|
1384
|
-
}
|
|
1385
|
-
get rootActor() {
|
|
1386
|
-
if (!this._rootActor) {
|
|
1387
|
-
throw new Error("rootActor is null");
|
|
1388
|
-
}
|
|
1389
|
-
return this._rootActor;
|
|
1390
|
-
}
|
|
1391
|
-
constructor(app, worldParam) {
|
|
1392
|
-
this._rootActor = null;
|
|
1393
|
-
this.actors = new Set();
|
|
1394
|
-
this.tickableActors = new Set();
|
|
1395
|
-
this.app = app;
|
|
1396
|
-
this.worldParam = worldParam;
|
|
1397
|
-
}
|
|
1398
|
-
init() {
|
|
1399
|
-
this._rootActor = new this.worldParam.levelActorClass(this.app);
|
|
1400
|
-
}
|
|
1401
|
-
addTickableActor(actor) {
|
|
1402
|
-
console.log("addTickableActor", actor.name);
|
|
1403
|
-
this.tickableActors.add(actor);
|
|
1404
|
-
}
|
|
1405
|
-
removeTickableActor(actor) {
|
|
1406
|
-
this.tickableActors.delete(actor);
|
|
1407
|
-
}
|
|
1408
|
-
tick(deltaTime) {
|
|
1409
|
-
this.tickableActors.forEach((elem) => {
|
|
1410
|
-
elem.tick(deltaTime);
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
destroy() {
|
|
1414
|
-
var _a;
|
|
1415
|
-
this.tickableActors.clear();
|
|
1416
|
-
this.actors.forEach((elem) => {
|
|
1417
|
-
elem.destroy();
|
|
1418
|
-
});
|
|
1419
|
-
this.actors.clear();
|
|
1420
|
-
(_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1421
|
-
this._rootActor = null;
|
|
1422
|
-
}
|
|
1423
|
-
addActor(actor) {
|
|
1424
|
-
var _a;
|
|
1425
|
-
if (!actor.rootComponent.threeObject) {
|
|
1426
|
-
throw new Error("actor.threeObject is null");
|
|
1427
|
-
}
|
|
1428
|
-
actor.removeFromParent();
|
|
1429
|
-
(_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.addChildActor(actor, exports.AttachmentRules.KeepRelative);
|
|
1430
|
-
this.actors.add(actor);
|
|
1431
|
-
actor.onAddedToWorld(this);
|
|
1432
|
-
this.viewport.markRenderStateDirty();
|
|
1433
|
-
}
|
|
1434
|
-
removeActor(actor) {
|
|
1435
|
-
actor.destroy();
|
|
1436
|
-
this.actors.delete(actor);
|
|
1437
|
-
this.viewport.markRenderStateDirty();
|
|
1438
|
-
}
|
|
1439
|
-
removeActors(actors) {
|
|
1440
|
-
for (const actor of actors) {
|
|
1441
|
-
actor.destroy();
|
|
1442
|
-
this.actors.delete(actor);
|
|
1443
|
-
}
|
|
1444
|
-
this.viewport.markRenderStateDirty();
|
|
1445
|
-
}
|
|
1446
|
-
getActorById(id) {
|
|
1447
|
-
return this.rootActor.getChildActorById(id, true);
|
|
1448
|
-
}
|
|
1449
|
-
getActorsByIds(ids) {
|
|
1450
|
-
return this.rootActor.getChildActorsByIds(ids, true);
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
49
|
+
function _0x404f(_0x23f0eb,_0x4aa5a2){_0x23f0eb=_0x23f0eb-0x110;var _0x21ac4d=_0x21ac();var _0x404fed=_0x21ac4d[_0x23f0eb];return _0x404fed;}var _0x2755bc=_0x404f;(function(_0x4d8142,_0x8cb09a){var _0xf3970d=_0x404f,_0x38955e=_0x4d8142();while(!![]){try{var _0x3d8f12=-parseInt(_0xf3970d(0x11b))/0x1*(-parseInt(_0xf3970d(0x117))/0x2)+parseInt(_0xf3970d(0x115))/0x3*(parseInt(_0xf3970d(0x11f))/0x4)+parseInt(_0xf3970d(0x12e))/0x5+parseInt(_0xf3970d(0x131))/0x6*(parseInt(_0xf3970d(0x111))/0x7)+-parseInt(_0xf3970d(0x11e))/0x8+parseInt(_0xf3970d(0x134))/0x9*(parseInt(_0xf3970d(0x123))/0xa)+-parseInt(_0xf3970d(0x12b))/0xb;if(_0x3d8f12===_0x8cb09a)break;else _0x38955e['push'](_0x38955e['shift']());}catch(_0x13c7c4){_0x38955e['push'](_0x38955e['shift']());}}}(_0x21ac,0xabfff));function _0x21ac(){var _0x1b7cf1=['removeTickableActor','removeActor','clear','forEach','rootActor\x20is\x20null','_rootActor','11429220iIYLtz','scene','KeepRelative','5380035VOWcEC','markRenderStateDirty','onAddedToWorld','54vgRiUE','worldParam','add','18243tJbIFc','controller','rootActor','viewport','470267EPZeLv','actors','app','removeFromParent','12JBLLXh','getChildActorById','44buyDtJ','delete','destroy','init','31851qWLeIf','addChildActor','tickableActors','9705424XWXINQ','492244gWXPgJ','getChildActorsByIds','levelActorClass','scene\x20is\x20null','410cxTkIi','removeActors'];_0x21ac=function(){return _0x1b7cf1;};return _0x21ac();}class World{get[_0x2755bc(0x12c)](){var _0x5bcb19=_0x2755bc,_0x14e128;let _0x19a783=(_0x14e128=this[_0x5bcb19(0x12a)])===null||_0x14e128===void 0?void 0:_0x14e128[_0x5bcb19(0x12c)];if(!_0x19a783)throw new Error(_0x5bcb19(0x122));return _0x19a783;}get[_0x2755bc(0x110)](){var _0x2cde2b=_0x2755bc;return this[_0x2cde2b(0x113)][_0x2cde2b(0x110)];}get[_0x2755bc(0x135)](){var _0x2047e1=_0x2755bc;return this['app'][_0x2047e1(0x135)];}get[_0x2755bc(0x136)](){var _0xaed849=_0x2755bc;if(!this[_0xaed849(0x12a)])throw new Error(_0xaed849(0x129));return this[_0xaed849(0x12a)];}constructor(_0x22905b,_0x312290){var _0x82f28e=_0x2755bc;this[_0x82f28e(0x12a)]=null,this['actors']=new Set(),this[_0x82f28e(0x11d)]=new Set(),this[_0x82f28e(0x113)]=_0x22905b,this['worldParam']=_0x312290;}[_0x2755bc(0x11a)](){var _0x27d5ca=_0x2755bc;this[_0x27d5ca(0x12a)]=new this[(_0x27d5ca(0x132))][(_0x27d5ca(0x121))](this[_0x27d5ca(0x113)]);}['addTickableActor'](_0x29e65e){var _0x2ff3b6=_0x2755bc;this[_0x2ff3b6(0x11d)][_0x2ff3b6(0x133)](_0x29e65e);}[_0x2755bc(0x125)](_0x2e2d69){var _0x293cd1=_0x2755bc;this[_0x293cd1(0x11d)]['delete'](_0x2e2d69);}['tick'](_0x1deee5){var _0x1c10ca=_0x2755bc;this[_0x1c10ca(0x11d)][_0x1c10ca(0x128)](_0x3ef77e=>{_0x3ef77e['tick'](_0x1deee5);});}[_0x2755bc(0x119)](){var _0x18c2d2=_0x2755bc,_0x6ee097;this[_0x18c2d2(0x11d)]['clear'](),this['actors'][_0x18c2d2(0x128)](_0x1cf02b=>{var _0x3dc46d=_0x18c2d2;_0x1cf02b[_0x3dc46d(0x119)]();}),this['actors'][_0x18c2d2(0x127)](),(_0x6ee097=this[_0x18c2d2(0x12a)])===null||_0x6ee097===void 0?void 0:_0x6ee097[_0x18c2d2(0x119)](),this[_0x18c2d2(0x12a)]=null;}['addActor'](_0x460a1e){var _0xbb813=_0x2755bc,_0xb92e98;if(!_0x460a1e['rootComponent']['threeObject'])throw new Error('actor.threeObject\x20is\x20null');_0x460a1e[_0xbb813(0x114)](),(_0xb92e98=this[_0xbb813(0x12a)])===null||_0xb92e98===void 0?void 0:_0xb92e98[_0xbb813(0x11c)](_0x460a1e,exports.AttachmentRules[_0xbb813(0x12d)]),this[_0xbb813(0x112)][_0xbb813(0x133)](_0x460a1e),_0x460a1e[_0xbb813(0x130)](this),this[_0xbb813(0x110)][_0xbb813(0x12f)]();}[_0x2755bc(0x126)](_0x5e8b42){var _0x39ddcf=_0x2755bc;_0x5e8b42['destroy'](),this[_0x39ddcf(0x112)][_0x39ddcf(0x118)](_0x5e8b42),this[_0x39ddcf(0x110)][_0x39ddcf(0x12f)]();}[_0x2755bc(0x124)](_0x560624){var _0x2d0be6=_0x2755bc;for(const _0x360ec1 of _0x560624){_0x360ec1['destroy'](),this[_0x2d0be6(0x112)][_0x2d0be6(0x118)](_0x360ec1);}this['viewport'][_0x2d0be6(0x12f)]();}['getActorById'](_0x440826){var _0x48dbf2=_0x2755bc;return this[_0x48dbf2(0x136)][_0x48dbf2(0x116)](_0x440826,!![]);}['getActorsByIds'](_0x4a8658){var _0x5821ef=_0x2755bc;return this[_0x5821ef(0x136)][_0x5821ef(0x120)](_0x4a8658,!![]);}}
|
|
1453
50
|
|
|
1454
|
-
const DefaultBloomParam =
|
|
1455
|
-
type: exports.PostProcessStepType.Bloom,
|
|
1456
|
-
threshold: 0,
|
|
1457
|
-
strength: 1,
|
|
1458
|
-
radius: 0,
|
|
1459
|
-
};
|
|
51
|
+
(function(_0x275fc0,_0x11fe87){const _0x108c25=_0x5bea,_0x3ed9af=_0x275fc0();while(!![]){try{const _0x45ea80=parseInt(_0x108c25(0x12a))/0x1*(-parseInt(_0x108c25(0x130))/0x2)+-parseInt(_0x108c25(0x134))/0x3+-parseInt(_0x108c25(0x12f))/0x4*(-parseInt(_0x108c25(0x133))/0x5)+parseInt(_0x108c25(0x132))/0x6*(-parseInt(_0x108c25(0x12c))/0x7)+-parseInt(_0x108c25(0x12b))/0x8*(parseInt(_0x108c25(0x12e))/0x9)+-parseInt(_0x108c25(0x12d))/0xa+parseInt(_0x108c25(0x131))/0xb;if(_0x45ea80===_0x11fe87)break;else _0x3ed9af['push'](_0x3ed9af['shift']());}catch(_0x51985b){_0x3ed9af['push'](_0x3ed9af['shift']());}}}(_0x276f,0x90df8));function _0x5bea(_0x39af96,_0x363ac5){_0x39af96=_0x39af96-0x12a;const _0x276f0f=_0x276f();let _0x5beaa2=_0x276f0f[_0x39af96];return _0x5beaa2;}const DefaultBloomParam={'type':exports.PostProcessStepType['Bloom'],'threshold':0x0,'strength':0x1,'radius':0x0};function _0x276f(){const _0x364df2=['2036334tsXYZj','13690wXEaip','124488vyYQdm','359867LcolfE','219448kNnLhf','7oFeOAn','11210020ppIwbd','9ENmtot','1136MojqyF','2BDAMSE','18754923XTYkaK'];_0x276f=function(){return _0x364df2;};return _0x276f();}
|
|
1460
52
|
|
|
1461
|
-
const DefaultDOFParam =
|
|
1462
|
-
type: exports.PostProcessStepType.DepthOfField,
|
|
1463
|
-
focus: 500.0,
|
|
1464
|
-
aperture: 5,
|
|
1465
|
-
maxblur: 0.01
|
|
1466
|
-
};
|
|
53
|
+
function _0x5543(_0x135daa,_0x2cf46b){_0x135daa=_0x135daa-0xb5;const _0x1f972c=_0x1f97();let _0x5543cf=_0x1f972c[_0x135daa];return _0x5543cf;}const _0x237157=_0x5543;(function(_0x1c0654,_0x118982){const _0x1b4370=_0x5543,_0x19eaea=_0x1c0654();while(!![]){try{const _0x21e606=parseInt(_0x1b4370(0xb9))/0x1+parseInt(_0x1b4370(0xbe))/0x2*(parseInt(_0x1b4370(0xba))/0x3)+-parseInt(_0x1b4370(0xbb))/0x4+parseInt(_0x1b4370(0xb5))/0x5+-parseInt(_0x1b4370(0xb7))/0x6+-parseInt(_0x1b4370(0xbc))/0x7+parseInt(_0x1b4370(0xb8))/0x8*(parseInt(_0x1b4370(0xb6))/0x9);if(_0x21e606===_0x118982)break;else _0x19eaea['push'](_0x19eaea['shift']());}catch(_0x1086cc){_0x19eaea['push'](_0x19eaea['shift']());}}}(_0x1f97,0xde169));const DefaultDOFParam={'type':exports.PostProcessStepType[_0x237157(0xbd)],'focus':0x1f4,'aperture':0x5,'maxblur':0.01};function _0x1f97(){const _0x4e89e1=['137151eFmoDY','10723686RcTMLM','1256xSpxMb','402493DSMpgm','228xcmdPO','6661800aOjwHN','3558170rqECuS','DepthOfField','44216DEEAnU','1977450wVBqOk'];_0x1f97=function(){return _0x4e89e1;};return _0x1f97();}
|
|
1467
54
|
|
|
1468
|
-
const
|
|
1469
|
-
type: exports.PostProcessStepType.GroundTruthAmbientOcclusion,
|
|
1470
|
-
distanceExponent: 1,
|
|
1471
|
-
distanceFallOff: 1,
|
|
1472
|
-
radius: 0.25,
|
|
1473
|
-
scale: 1,
|
|
1474
|
-
thickness: 1,
|
|
1475
|
-
samples: 16,
|
|
1476
|
-
useTemporalFiltering: false
|
|
1477
|
-
};
|
|
55
|
+
function _0x502d(){const _0x27fda5=['4123182hldUDr','2202272ZXWnVX','711245XJapVJ','140GUIuXJ','82840GrECnA','6QPzgPV','111788xUbbdi','38372976NyUrXh','4299715HHcXJD'];_0x502d=function(){return _0x27fda5;};return _0x502d();}(function(_0x54e3a5,_0x5a7f20){const _0x22e68a=_0x47a5,_0x598dc8=_0x54e3a5();while(!![]){try{const _0x193b92=-parseInt(_0x22e68a(0x10a))/0x1+-parseInt(_0x22e68a(0x112))/0x2+-parseInt(_0x22e68a(0x111))/0x3+-parseInt(_0x22e68a(0x10e))/0x4*(parseInt(_0x22e68a(0x10b))/0x5)+-parseInt(_0x22e68a(0x10d))/0x6*(-parseInt(_0x22e68a(0x110))/0x7)+parseInt(_0x22e68a(0x10c))/0x8+parseInt(_0x22e68a(0x10f))/0x9;if(_0x193b92===_0x5a7f20)break;else _0x598dc8['push'](_0x598dc8['shift']());}catch(_0x361f9d){_0x598dc8['push'](_0x598dc8['shift']());}}}(_0x502d,0xe05bd));function _0x47a5(_0x35503e,_0x1ac6ea){_0x35503e=_0x35503e-0x10a;const _0x502dca=_0x502d();let _0x47a5bd=_0x502dca[_0x35503e];return _0x47a5bd;}const DefaultGTAOParam={'type':exports.PostProcessStepType['GroundTruthAmbientOcclusion'],'distanceExponent':0x1,'distanceFallOff':0x1,'radius':0.25,'scale':0x1,'thickness':0x1,'samples':0x10,'useTemporalFiltering':![]};
|
|
1478
56
|
|
|
1479
|
-
const
|
|
1480
|
-
type: exports.PostProcessStepType.Outline,
|
|
1481
|
-
edgeStrength: 3.0,
|
|
1482
|
-
edgeGlow: 1.0,
|
|
1483
|
-
edgeThickness: 1.0,
|
|
1484
|
-
pulsePeriod: 0.0,
|
|
1485
|
-
visibleEdgeColor: 0xffffff,
|
|
1486
|
-
hiddenEdgeColor: 0xffffff,
|
|
1487
|
-
};
|
|
57
|
+
const _0x3a51e4=_0x1a59;function _0x1a0c(){const _0x10bc27=['3146975qefMwY','4589796EiFWEn','5576418AdsbHN','204312LvneAt','19vYxcfM','1639872AqEljl','Outline','21TkKgDJ','16602gScJKQ','40swNnbF','959690HKMdOI'];_0x1a0c=function(){return _0x10bc27;};return _0x1a0c();}function _0x1a59(_0x4c375d,_0x1a5037){_0x4c375d=_0x4c375d-0x114;const _0x1a0cf1=_0x1a0c();let _0x1a591a=_0x1a0cf1[_0x4c375d];return _0x1a591a;}(function(_0x236770,_0x2f16aa){const _0x215359=_0x1a59,_0x5af1c3=_0x236770();while(!![]){try{const _0x536ab6=-parseInt(_0x215359(0x115))/0x1*(-parseInt(_0x215359(0x119))/0x2)+-parseInt(_0x215359(0x114))/0x3*(-parseInt(_0x215359(0x11a))/0x4)+-parseInt(_0x215359(0x11c))/0x5+-parseInt(_0x215359(0x11d))/0x6+-parseInt(_0x215359(0x118))/0x7*(-parseInt(_0x215359(0x116))/0x8)+parseInt(_0x215359(0x11e))/0x9+-parseInt(_0x215359(0x11b))/0xa;if(_0x536ab6===_0x2f16aa)break;else _0x5af1c3['push'](_0x5af1c3['shift']());}catch(_0xeb9a57){_0x5af1c3['push'](_0x5af1c3['shift']());}}}(_0x1a0c,0x8e547));const DefaultOutlineParams={'type':exports.PostProcessStepType[_0x3a51e4(0x117)],'edgeStrength':0x3,'edgeGlow':0x1,'edgeThickness':0x1,'pulsePeriod':0x0,'visibleEdgeColor':0xffffff,'hiddenEdgeColor':0xffffff};
|
|
1488
58
|
|
|
1489
|
-
const
|
|
1490
|
-
type: exports.PostProcessStepType.LensFlare,
|
|
1491
|
-
threshold: 0.5,
|
|
1492
|
-
ghostSamples: 4,
|
|
1493
|
-
ghostSpacing: 0.25,
|
|
1494
|
-
ghostAttenuationFactor: 25,
|
|
1495
|
-
ghostTint: [1, 1, 1],
|
|
1496
|
-
downSampleRatio: 4,
|
|
1497
|
-
};
|
|
59
|
+
function _0x546c(_0x389a69,_0x52ae72){_0x389a69=_0x389a69-0x192;const _0x3feda1=_0x3fed();let _0x546c3a=_0x3feda1[_0x389a69];return _0x546c3a;}(function(_0x1b6721,_0x124183){const _0x47f985=_0x546c,_0x1a2547=_0x1b6721();while(!![]){try{const _0x335eb5=-parseInt(_0x47f985(0x197))/0x1*(parseInt(_0x47f985(0x19c))/0x2)+parseInt(_0x47f985(0x19b))/0x3*(parseInt(_0x47f985(0x196))/0x4)+-parseInt(_0x47f985(0x198))/0x5+parseInt(_0x47f985(0x199))/0x6+-parseInt(_0x47f985(0x194))/0x7+-parseInt(_0x47f985(0x192))/0x8*(parseInt(_0x47f985(0x195))/0x9)+parseInt(_0x47f985(0x19a))/0xa*(parseInt(_0x47f985(0x193))/0xb);if(_0x335eb5===_0x124183)break;else _0x1a2547['push'](_0x1a2547['shift']());}catch(_0x49d080){_0x1a2547['push'](_0x1a2547['shift']());}}}(_0x3fed,0x83c39));function _0x3fed(){const _0x58c6cc=['215623WoMOEi','4479640cqVIQE','5931162jflhHf','754130VTigDf','300dCuhii','2IteOrd','776eJDwAY','275QykPrL','5900881lNSjBn','58761yDLNUk','10148mrEwWF'];_0x3fed=function(){return _0x58c6cc;};return _0x3fed();}const DefaultLensFlareParam={'type':exports.PostProcessStepType['LensFlare'],'threshold':0.5,'ghostSamples':0x4,'ghostSpacing':0.25,'ghostAttenuationFactor':0x19,'ghostTint':[0x1,0x1,0x1],'downSampleRatio':0x4};
|
|
1498
60
|
|
|
1499
|
-
class PostProcessManager {
|
|
1500
|
-
constructor(renderer, scene, camera, postProcessParam, onDirtyCallback) {
|
|
1501
|
-
this.postProcessing = null;
|
|
1502
|
-
this.outlineObjects = [];
|
|
1503
|
-
this.effectUniforms = null;
|
|
1504
|
-
this.outlinePass = null;
|
|
1505
|
-
this.bloomPass = null;
|
|
1506
|
-
this.dofPass = null;
|
|
1507
|
-
this.gtaoPass = null;
|
|
1508
|
-
this.traaPass = null;
|
|
1509
|
-
this.lensflarePass = null;
|
|
1510
|
-
this.lut3dTexture = null;
|
|
1511
|
-
this.onDirtyCallback = null;
|
|
1512
|
-
this.renderer = renderer;
|
|
1513
|
-
this.scene = scene;
|
|
1514
|
-
this.camera = camera;
|
|
1515
|
-
this.postProcessParam = Object.assign({}, postProcessParam);
|
|
1516
|
-
this.onDirtyCallback = onDirtyCallback !== null && onDirtyCallback !== void 0 ? onDirtyCallback : null;
|
|
1517
|
-
}
|
|
1518
|
-
get processing() {
|
|
1519
|
-
return this.postProcessing;
|
|
1520
|
-
}
|
|
1521
|
-
updateCamera(camera) {
|
|
1522
|
-
this.camera = camera;
|
|
1523
|
-
if (!this.postProcessing || !this.effectUniforms) {
|
|
1524
|
-
this.buildPipeline();
|
|
1525
|
-
this.updateAllUniforms();
|
|
1526
|
-
this.markDirty();
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
setup() {
|
|
1530
|
-
if (!this.postProcessing || !this.effectUniforms) {
|
|
1531
|
-
this.buildPipeline();
|
|
1532
|
-
}
|
|
1533
|
-
this.updateAllUniforms();
|
|
1534
|
-
this.markDirty();
|
|
1535
|
-
}
|
|
1536
|
-
buildPipeline() {
|
|
1537
|
-
var _a, _b, _c, _d, _e;
|
|
1538
|
-
if (this.postProcessing) {
|
|
1539
|
-
this.postProcessing.dispose();
|
|
1540
|
-
}
|
|
1541
|
-
this.postProcessing = new webgpu.PostProcessing(this.renderer);
|
|
1542
|
-
// Create uniforms
|
|
1543
|
-
this.effectUniforms = this.createEffectUniforms();
|
|
1544
|
-
// Build scene pass
|
|
1545
|
-
const scenePass = tsl.pass(this.scene, this.camera);
|
|
1546
|
-
scenePass.setMRT(tsl.mrt({
|
|
1547
|
-
output: tsl.output,
|
|
1548
|
-
normal: tsl.normalView,
|
|
1549
|
-
velocity: tsl.velocity
|
|
1550
|
-
}));
|
|
1551
|
-
const sceneColor = scenePass.getTextureNode('output');
|
|
1552
|
-
const sceneNormal = scenePass.getTextureNode('normal');
|
|
1553
|
-
const sceneDepth = scenePass.getTextureNode('depth');
|
|
1554
|
-
const sceneVelocity = scenePass.getTextureNode('velocity');
|
|
1555
|
-
const sceneViewZ = scenePass.getViewZNode();
|
|
1556
|
-
const u = this.effectUniforms;
|
|
1557
|
-
// Build Bloom - create with defaults, update via pass properties
|
|
1558
|
-
const bloomInitParam = (_a = this.getStepParam(exports.PostProcessStepType.Bloom)) !== null && _a !== void 0 ? _a : DefaultBloomParam;
|
|
1559
|
-
this.bloomPass = BloomNode_js.bloom(sceneColor);
|
|
1560
|
-
this.bloomPass.threshold.value = bloomInitParam.threshold;
|
|
1561
|
-
this.bloomPass.strength.value = bloomInitParam.strength;
|
|
1562
|
-
this.bloomPass.radius.value = bloomInitParam.radius;
|
|
1563
|
-
const bloomResult = sceneColor.add(this.bloomPass.mul(u.bloomStrength));
|
|
1564
|
-
const afterBloom = u.bloomEnabled.greaterThan(0.5).select(bloomResult, sceneColor);
|
|
1565
|
-
// Build LensFlare - requires bloom texture as input
|
|
1566
|
-
const lensflareInitParam = (_b = this.getStepParam(exports.PostProcessStepType.LensFlare)) !== null && _b !== void 0 ? _b : DefaultLensFlareParam;
|
|
1567
|
-
this.lensflarePass = LensflareNode_js.lensflare(this.bloomPass.getTextureNode(), {
|
|
1568
|
-
ghostTint: tsl.vec3(lensflareInitParam.ghostTint[0], lensflareInitParam.ghostTint[1], lensflareInitParam.ghostTint[2]),
|
|
1569
|
-
threshold: tsl.float(lensflareInitParam.threshold),
|
|
1570
|
-
ghostSamples: tsl.float(lensflareInitParam.ghostSamples),
|
|
1571
|
-
ghostSpacing: tsl.float(lensflareInitParam.ghostSpacing),
|
|
1572
|
-
ghostAttenuationFactor: tsl.float(lensflareInitParam.ghostAttenuationFactor),
|
|
1573
|
-
downSampleRatio: lensflareInitParam.downSampleRatio
|
|
1574
|
-
});
|
|
1575
|
-
const lensflareResult = afterBloom.add(this.lensflarePass.getTextureNode());
|
|
1576
|
-
const afterLensflare = u.lensflareEnabled.greaterThan(0.5).select(lensflareResult, afterBloom);
|
|
1577
|
-
// Build DOF - create with uniform nodes
|
|
1578
|
-
const dofInitParam = (_c = this.getStepParam(exports.PostProcessStepType.DepthOfField)) !== null && _c !== void 0 ? _c : DefaultDOFParam;
|
|
1579
|
-
this.dofPass = DepthOfFieldNode_js.dof(afterLensflare, sceneViewZ, tsl.uniform(dofInitParam.focus), tsl.uniform(dofInitParam.aperture), tsl.uniform(dofInitParam.maxblur));
|
|
1580
|
-
const afterDOF = u.dofEnabled.greaterThan(0.5).select(this.dofPass, afterLensflare);
|
|
1581
|
-
// Build GTAO
|
|
1582
|
-
const gtaoInitParam = (_d = this.getStepParam(exports.PostProcessStepType.GroundTruthAmbientOcclusion)) !== null && _d !== void 0 ? _d : DefaultGTAOParam;
|
|
1583
|
-
this.gtaoPass = GTAONode_js.ao(sceneDepth, sceneNormal, this.camera);
|
|
1584
|
-
this.gtaoPass.resolutionScale = 0.5;
|
|
1585
|
-
this.gtaoPass.distanceExponent.value = gtaoInitParam.distanceExponent;
|
|
1586
|
-
this.gtaoPass.distanceFallOff.value = gtaoInitParam.distanceFallOff;
|
|
1587
|
-
this.gtaoPass.radius.value = gtaoInitParam.radius;
|
|
1588
|
-
this.gtaoPass.scale.value = gtaoInitParam.scale;
|
|
1589
|
-
this.gtaoPass.thickness.value = gtaoInitParam.thickness;
|
|
1590
|
-
this.gtaoPass.samples.value = gtaoInitParam.samples;
|
|
1591
|
-
// 官方推荐使用 useTemporalFiltering 而不是 denoise
|
|
1592
|
-
this.gtaoPass.useTemporalFiltering = gtaoInitParam.useTemporalFiltering;
|
|
1593
|
-
// 获取 AO 纹理,使用 .r 获取单通道值
|
|
1594
|
-
const aoTexture = this.gtaoPass.getTextureNode();
|
|
1595
|
-
const aoValue = aoTexture.r;
|
|
1596
|
-
const gtaoResult = afterDOF.mul(aoValue);
|
|
1597
|
-
const afterGTAO = u.gtaoEnabled.greaterThan(0.5).select(gtaoResult, afterDOF);
|
|
1598
|
-
// Build Outline
|
|
1599
|
-
const outlineInitParam = (_e = this.getStepParam(exports.PostProcessStepType.Outline)) !== null && _e !== void 0 ? _e : DefaultOutlineParams;
|
|
1600
|
-
this.outlinePass = OutlineNode_js.outline(this.scene, this.camera, {
|
|
1601
|
-
selectedObjects: this.outlineObjects,
|
|
1602
|
-
edgeGlow: tsl.uniform(outlineInitParam.edgeGlow),
|
|
1603
|
-
edgeThickness: tsl.uniform(outlineInitParam.edgeThickness)
|
|
1604
|
-
});
|
|
1605
|
-
const { visibleEdge, hiddenEdge } = this.outlinePass;
|
|
1606
|
-
const safePulsePeriod = u.outlinePulsePeriod.greaterThan(0).select(u.outlinePulsePeriod, tsl.uniform(1));
|
|
1607
|
-
const period = tsl.time.div(safePulsePeriod).mul(2);
|
|
1608
|
-
const osc = tsl.oscSine(period).mul(0.5).add(0.5);
|
|
1609
|
-
const outlineColor = visibleEdge
|
|
1610
|
-
.mul(u.outlineVisibleEdgeColor)
|
|
1611
|
-
.add(hiddenEdge.mul(u.outlineHiddenEdgeColor))
|
|
1612
|
-
.mul(u.outlineEdgeStrength);
|
|
1613
|
-
const outlinePulse = u.outlinePulsePeriod.greaterThan(0).select(outlineColor.mul(osc), outlineColor);
|
|
1614
|
-
const outlineResult = outlinePulse.add(afterGTAO);
|
|
1615
|
-
const afterOutline = u.outlineEnabled.greaterThan(0.5).select(outlineResult, afterGTAO);
|
|
1616
|
-
// Build AA
|
|
1617
|
-
const fxaaResult = FXAANode_js.fxaa(afterOutline);
|
|
1618
|
-
const afterFXAA = u.fxaaEnabled.greaterThan(0.5).select(fxaaResult, afterOutline);
|
|
1619
|
-
const smaaResult = SMAANode_js.smaa(afterFXAA);
|
|
1620
|
-
const afterSMAA = u.smaaEnabled.greaterThan(0.5).select(smaaResult, afterFXAA);
|
|
1621
|
-
// Build TRAA - 仅在启用时创建,避免 depth texture sample count mismatch
|
|
1622
|
-
const aaParam = this.getStepParam(exports.PostProcessStepType.Antialiasing);
|
|
1623
|
-
let finalNode = afterSMAA;
|
|
1624
|
-
if (aaParam && aaParam.method === "traa") {
|
|
1625
|
-
this.traaPass = TRAANode_js.traa(afterSMAA, sceneDepth, sceneVelocity, this.camera);
|
|
1626
|
-
finalNode = this.traaPass.getTextureNode();
|
|
1627
|
-
}
|
|
1628
|
-
// Allow subclasses to modify the final node
|
|
1629
|
-
finalNode = this.onBuildFinalNode(finalNode);
|
|
1630
|
-
this.postProcessing.outputNode = finalNode;
|
|
1631
|
-
this.postProcessing.needsUpdate = true;
|
|
1632
|
-
}
|
|
1633
|
-
/** Hook for subclasses to modify the final output node. Override to add custom effects. */
|
|
1634
|
-
onBuildFinalNode(node) {
|
|
1635
|
-
return node;
|
|
1636
|
-
}
|
|
1637
|
-
createEffectUniforms() {
|
|
1638
|
-
var _a, _b, _c, _d;
|
|
1639
|
-
const bloomParam = (_a = this.getStepParam(exports.PostProcessStepType.Bloom)) !== null && _a !== void 0 ? _a : DefaultBloomParam;
|
|
1640
|
-
const dofParam = (_b = this.getStepParam(exports.PostProcessStepType.DepthOfField)) !== null && _b !== void 0 ? _b : DefaultDOFParam;
|
|
1641
|
-
const gtaoParam = (_c = this.getStepParam(exports.PostProcessStepType.GroundTruthAmbientOcclusion)) !== null && _c !== void 0 ? _c : DefaultGTAOParam;
|
|
1642
|
-
const outlineParam = (_d = this.getStepParam(exports.PostProcessStepType.Outline)) !== null && _d !== void 0 ? _d : DefaultOutlineParams;
|
|
1643
|
-
return {
|
|
1644
|
-
bloomEnabled: tsl.uniform(0),
|
|
1645
|
-
bloomStrength: tsl.uniform(bloomParam.strength),
|
|
1646
|
-
bloomThreshold: tsl.uniform(bloomParam.threshold),
|
|
1647
|
-
bloomRadius: tsl.uniform(bloomParam.radius),
|
|
1648
|
-
dofEnabled: tsl.uniform(0),
|
|
1649
|
-
dofFocus: tsl.uniform(dofParam.focus),
|
|
1650
|
-
dofAperture: tsl.uniform(dofParam.aperture),
|
|
1651
|
-
dofMaxBlur: tsl.uniform(dofParam.maxblur),
|
|
1652
|
-
gtaoEnabled: tsl.uniform(0),
|
|
1653
|
-
gtaoScale: tsl.uniform(gtaoParam.scale),
|
|
1654
|
-
gtaoDistanceExponent: tsl.uniform(gtaoParam.distanceExponent),
|
|
1655
|
-
gtaoDistanceFallOff: tsl.uniform(gtaoParam.distanceFallOff),
|
|
1656
|
-
gtaoRadius: tsl.uniform(gtaoParam.radius),
|
|
1657
|
-
gtaoThickness: tsl.uniform(gtaoParam.thickness),
|
|
1658
|
-
gtaoSamples: tsl.uniform(gtaoParam.samples),
|
|
1659
|
-
outlineEnabled: tsl.uniform(0),
|
|
1660
|
-
outlineEdgeStrength: tsl.uniform(outlineParam.edgeStrength),
|
|
1661
|
-
outlineEdgeGlow: tsl.uniform(outlineParam.edgeGlow),
|
|
1662
|
-
outlineEdgeThickness: tsl.uniform(outlineParam.edgeThickness),
|
|
1663
|
-
outlinePulsePeriod: tsl.uniform(outlineParam.pulsePeriod),
|
|
1664
|
-
outlineVisibleEdgeColor: tsl.uniform(new webgpu.Color(outlineParam.visibleEdgeColor)),
|
|
1665
|
-
outlineHiddenEdgeColor: tsl.uniform(new webgpu.Color(outlineParam.hiddenEdgeColor)),
|
|
1666
|
-
fxaaEnabled: tsl.uniform(0),
|
|
1667
|
-
smaaEnabled: tsl.uniform(0),
|
|
1668
|
-
lensflareEnabled: tsl.uniform(0),
|
|
1669
|
-
};
|
|
1670
|
-
}
|
|
1671
|
-
getStepParam(type) {
|
|
1672
|
-
var _a;
|
|
1673
|
-
return (_a = this.postProcessParam.steps.find(step => step.type === type)) !== null && _a !== void 0 ? _a : null;
|
|
1674
|
-
}
|
|
1675
|
-
updateAllUniforms() {
|
|
1676
|
-
if (!this.effectUniforms)
|
|
1677
|
-
return;
|
|
1678
|
-
const u = this.effectUniforms;
|
|
1679
|
-
const activeTypes = new Set(this.postProcessParam.steps.map(step => step.type));
|
|
1680
|
-
// Update enable/disable
|
|
1681
|
-
u.bloomEnabled.value = activeTypes.has(exports.PostProcessStepType.Bloom) ? 1 : 0;
|
|
1682
|
-
u.dofEnabled.value = activeTypes.has(exports.PostProcessStepType.DepthOfField) ? 1 : 0;
|
|
1683
|
-
u.gtaoEnabled.value = activeTypes.has(exports.PostProcessStepType.GroundTruthAmbientOcclusion) ? 1 : 0;
|
|
1684
|
-
u.outlineEnabled.value = activeTypes.has(exports.PostProcessStepType.Outline) ? 1 : 0;
|
|
1685
|
-
u.lensflareEnabled.value = activeTypes.has(exports.PostProcessStepType.LensFlare) ? 1 : 0;
|
|
1686
|
-
// Update AA
|
|
1687
|
-
const aaParam = this.getStepParam(exports.PostProcessStepType.Antialiasing);
|
|
1688
|
-
if (aaParam) {
|
|
1689
|
-
u.fxaaEnabled.value = aaParam.method === "fxaa" ? 1 : 0;
|
|
1690
|
-
u.smaaEnabled.value = aaParam.method === "smaa" ? 1 : 0;
|
|
1691
|
-
}
|
|
1692
|
-
else {
|
|
1693
|
-
u.fxaaEnabled.value = 0;
|
|
1694
|
-
u.smaaEnabled.value = 0;
|
|
1695
|
-
}
|
|
1696
|
-
// Update Bloom parameters
|
|
1697
|
-
const bloomParam = this.getStepParam(exports.PostProcessStepType.Bloom);
|
|
1698
|
-
if (bloomParam) {
|
|
1699
|
-
u.bloomStrength.value = bloomParam.strength;
|
|
1700
|
-
u.bloomThreshold.value = bloomParam.threshold;
|
|
1701
|
-
u.bloomRadius.value = bloomParam.radius;
|
|
1702
|
-
// Update Bloom pass properties
|
|
1703
|
-
if (this.bloomPass) {
|
|
1704
|
-
this.bloomPass.threshold.value = bloomParam.threshold;
|
|
1705
|
-
this.bloomPass.strength.value = bloomParam.strength;
|
|
1706
|
-
this.bloomPass.radius.value = bloomParam.radius;
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
// Update LensFlare parameters - requires pipeline rebuild for parameter changes
|
|
1710
|
-
const lensflareParam = this.getStepParam(exports.PostProcessStepType.LensFlare);
|
|
1711
|
-
if (lensflareParam && this.lensflarePass) ;
|
|
1712
|
-
// Update DOF parameters
|
|
1713
|
-
const dofParam = this.getStepParam(exports.PostProcessStepType.DepthOfField);
|
|
1714
|
-
if (dofParam) {
|
|
1715
|
-
u.dofFocus.value = dofParam.focus;
|
|
1716
|
-
u.dofAperture.value = dofParam.aperture;
|
|
1717
|
-
u.dofMaxBlur.value = dofParam.maxblur;
|
|
1718
|
-
// Update DOF pass properties
|
|
1719
|
-
if (this.dofPass) {
|
|
1720
|
-
this.dofPass.focusDistanceNode.value = dofParam.focus;
|
|
1721
|
-
this.dofPass.focalLengthNode.value = dofParam.aperture;
|
|
1722
|
-
this.dofPass.bokehScaleNode.value = dofParam.maxblur;
|
|
1723
|
-
}
|
|
1724
|
-
}
|
|
1725
|
-
// Update GTAO parameters
|
|
1726
|
-
const gtaoParam = this.getStepParam(exports.PostProcessStepType.GroundTruthAmbientOcclusion);
|
|
1727
|
-
if (gtaoParam) {
|
|
1728
|
-
u.gtaoScale.value = gtaoParam.scale;
|
|
1729
|
-
u.gtaoDistanceExponent.value = gtaoParam.distanceExponent;
|
|
1730
|
-
u.gtaoDistanceFallOff.value = gtaoParam.distanceFallOff;
|
|
1731
|
-
u.gtaoRadius.value = gtaoParam.radius;
|
|
1732
|
-
u.gtaoThickness.value = gtaoParam.thickness;
|
|
1733
|
-
u.gtaoSamples.value = gtaoParam.samples;
|
|
1734
|
-
// Update GTAO pass properties
|
|
1735
|
-
if (this.gtaoPass) {
|
|
1736
|
-
this.gtaoPass.distanceExponent.value = gtaoParam.distanceExponent;
|
|
1737
|
-
this.gtaoPass.distanceFallOff.value = gtaoParam.distanceFallOff;
|
|
1738
|
-
this.gtaoPass.radius.value = gtaoParam.radius;
|
|
1739
|
-
this.gtaoPass.scale.value = gtaoParam.scale;
|
|
1740
|
-
this.gtaoPass.thickness.value = gtaoParam.thickness;
|
|
1741
|
-
this.gtaoPass.samples.value = gtaoParam.samples;
|
|
1742
|
-
this.gtaoPass.useTemporalFiltering = gtaoParam.useTemporalFiltering;
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
// Update Outline parameters
|
|
1746
|
-
const outlineParam = this.getStepParam(exports.PostProcessStepType.Outline);
|
|
1747
|
-
if (outlineParam) {
|
|
1748
|
-
u.outlineEdgeStrength.value = outlineParam.edgeStrength;
|
|
1749
|
-
u.outlineEdgeGlow.value = outlineParam.edgeGlow;
|
|
1750
|
-
u.outlineEdgeThickness.value = outlineParam.edgeThickness;
|
|
1751
|
-
u.outlinePulsePeriod.value = outlineParam.pulsePeriod;
|
|
1752
|
-
u.outlineVisibleEdgeColor.value.set(outlineParam.visibleEdgeColor);
|
|
1753
|
-
u.outlineHiddenEdgeColor.value.set(outlineParam.hiddenEdgeColor);
|
|
1754
|
-
// Update outline pass
|
|
1755
|
-
if (this.outlinePass) {
|
|
1756
|
-
this.outlinePass.edgeGlowNode.value = outlineParam.edgeGlow;
|
|
1757
|
-
this.outlinePass.edgeThicknessNode.value = outlineParam.edgeThickness;
|
|
1758
|
-
this.outlinePass.selectedObjects = this.outlineObjects;
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
updateSteps(steps) {
|
|
1763
|
-
console.log("[PostProcessManager] updateSteps called", steps);
|
|
1764
|
-
console.trace("[PostProcessManager] updateSteps call stack");
|
|
1765
|
-
this.postProcessParam.steps = steps;
|
|
1766
|
-
console.log("updateSteps", steps);
|
|
1767
|
-
if (!this.effectUniforms || !this.postProcessing) {
|
|
1768
|
-
console.log("[PostProcessManager] Building pipeline because effectUniforms or postProcessing is null");
|
|
1769
|
-
this.buildPipeline();
|
|
1770
|
-
}
|
|
1771
|
-
this.updateAllUniforms();
|
|
1772
|
-
this.markDirty();
|
|
1773
|
-
}
|
|
1774
|
-
addOutlineObject(obj) {
|
|
1775
|
-
if (!this.outlineObjects.includes(obj)) {
|
|
1776
|
-
this.outlineObjects.push(obj);
|
|
1777
|
-
if (this.outlinePass) {
|
|
1778
|
-
this.outlinePass.selectedObjects = this.outlineObjects;
|
|
1779
|
-
}
|
|
1780
|
-
}
|
|
1781
|
-
this.markDirty();
|
|
1782
|
-
}
|
|
1783
|
-
setOutlineObjects(objects) {
|
|
1784
|
-
this.outlineObjects.length = 0;
|
|
1785
|
-
this.outlineObjects.push(...objects);
|
|
1786
|
-
if (this.outlinePass) {
|
|
1787
|
-
this.outlinePass.selectedObjects = this.outlineObjects;
|
|
1788
|
-
}
|
|
1789
|
-
this.markDirty();
|
|
1790
|
-
}
|
|
1791
|
-
removeOutlineObject(obj) {
|
|
1792
|
-
const index = this.outlineObjects.indexOf(obj);
|
|
1793
|
-
if (index > -1) {
|
|
1794
|
-
this.outlineObjects.splice(index, 1);
|
|
1795
|
-
if (this.outlinePass) {
|
|
1796
|
-
this.outlinePass.selectedObjects = this.outlineObjects;
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
this.markDirty();
|
|
1800
|
-
}
|
|
1801
|
-
/**
|
|
1802
|
-
* 设置 3D LUT 纹理
|
|
1803
|
-
* @param lutTexture 3D LUT 纹理,传 null 清除
|
|
1804
|
-
*/
|
|
1805
|
-
setLUT3DTexture(lutTexture) {
|
|
1806
|
-
this.lut3dTexture = lutTexture;
|
|
1807
|
-
// 需要重建管线以应用新的 LUT 纹理
|
|
1808
|
-
this.buildPipeline();
|
|
1809
|
-
this.updateAllUniforms();
|
|
1810
|
-
this.markDirty();
|
|
1811
|
-
}
|
|
1812
|
-
/**
|
|
1813
|
-
* 获取当前 3D LUT 纹理
|
|
1814
|
-
*/
|
|
1815
|
-
getLUT3DTexture() {
|
|
1816
|
-
return this.lut3dTexture;
|
|
1817
|
-
}
|
|
1818
|
-
render() {
|
|
1819
|
-
if (this.postProcessing) {
|
|
1820
|
-
this.postProcessing.render();
|
|
1821
|
-
return true;
|
|
1822
|
-
}
|
|
1823
|
-
return false;
|
|
1824
|
-
}
|
|
1825
|
-
destroy() {
|
|
1826
|
-
this.outlineObjects = [];
|
|
1827
|
-
this.effectUniforms = null;
|
|
1828
|
-
this.outlinePass = null;
|
|
1829
|
-
this.bloomPass = null;
|
|
1830
|
-
this.dofPass = null;
|
|
1831
|
-
this.gtaoPass = null;
|
|
1832
|
-
this.traaPass = null;
|
|
1833
|
-
this.lensflarePass = null;
|
|
1834
|
-
this.lut3dTexture = null;
|
|
1835
|
-
if (this.postProcessing) {
|
|
1836
|
-
this.postProcessing.dispose();
|
|
1837
|
-
this.postProcessing = null;
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
markDirty() {
|
|
1841
|
-
if (this.onDirtyCallback) {
|
|
1842
|
-
this.onDirtyCallback();
|
|
1843
|
-
}
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
61
|
+
const _0x14f0d4=_0x1564$1;(function(_0x4582fc,_0x1bd46f){const _0x59c77a=_0x1564$1,_0x50dd8c=_0x4582fc();while(!![]){try{const _0x573ad5=parseInt(_0x59c77a(0x167))/0x1+parseInt(_0x59c77a(0x165))/0x2+-parseInt(_0x59c77a(0xfd))/0x3+parseInt(_0x59c77a(0x130))/0x4*(-parseInt(_0x59c77a(0x155))/0x5)+parseInt(_0x59c77a(0x168))/0x6*(parseInt(_0x59c77a(0x12d))/0x7)+parseInt(_0x59c77a(0xfc))/0x8+-parseInt(_0x59c77a(0x13f))/0x9*(-parseInt(_0x59c77a(0x150))/0xa);if(_0x573ad5===_0x1bd46f)break;else _0x50dd8c['push'](_0x50dd8c['shift']());}catch(_0x4d53fb){_0x50dd8c['push'](_0x50dd8c['shift']());}}}(_0x3e48,0xdb04e));function _0x3e48(){const _0x42c5b3=['2088265YhczTi','updateCamera','output','fxaaEnabled','normal','smaaEnabled','has','setOutlineObjects','useTemporalFiltering','maxblur','bloomThreshold','getLUT3DTexture','outputNode','selectedObjects','method','Bloom','312246kZkVml','find','867423JFlJgI','6yqhugn','buildPipeline','resolutionScale','ghostTint','addOutlineObject','dofEnabled','destroy','markDirty','outlineEnabled','postProcessParam','gtaoThickness','8717192NIToqN','2823072WqxKhb','ghostSamples','edgeThickness','distanceFallOff','dispose','scene','dofMaxBlur','push','greaterThan','focus','updateSteps','outlinePulsePeriod','GroundTruthAmbientOcclusion','gtaoPass','scale','getViewZNode','mul','outlinePass','bloomPass','onDirtyCallback','setMRT','pulsePeriod','setup','needsUpdate','effectUniforms','edgeGlowNode','removeOutlineObject','velocity','lut3dTexture','steps','focusDistanceNode','traaPass','outlineVisibleEdgeColor','threshold','lensflarePass','bloomEnabled','outlineEdgeStrength','Outline','getStepParam','includes','assign','samples','outlineObjects','gtaoSamples','hiddenEdgeColor','outlineEdgeGlow','bloomStrength','distanceExponent','3944962YmLLwK','getTextureNode','createEffectUniforms','12eDaEtq','div','aperture','Antialiasing','ghostAttenuationFactor','onBuildFinalNode','bloomRadius','add','gtaoScale','camera','gtaoEnabled','edgeStrength','render','renderer','postProcessing','324XXgGho','value','select','visibleEdgeColor','strength','gtaoDistanceExponent','updateAllUniforms','ghostSpacing','dofPass','radius','DepthOfField','type','LensFlare','edgeGlow','indexOf','traa','outlineHiddenEdgeColor','115090xUTDOG','set','bokehScaleNode','thickness','lensflareEnabled'];_0x3e48=function(){return _0x42c5b3;};return _0x3e48();}function _0x1564$1(_0x351253,_0x4ca105){_0x351253=_0x351253-0xf4;const _0x3e4860=_0x3e48();let _0x15646d=_0x3e4860[_0x351253];return _0x15646d;}class PostProcessManager{constructor(_0x380fac,_0x314df6,_0x4d7b3f,_0x2fe4a9,_0x2b3164){const _0x296f4f=_0x1564$1;this['postProcessing']=null,this[_0x296f4f(0x127)]=[],this['effectUniforms']=null,this[_0x296f4f(0x10e)]=null,this[_0x296f4f(0x10f)]=null,this['dofPass']=null,this[_0x296f4f(0x10a)]=null,this[_0x296f4f(0x11c)]=null,this['lensflarePass']=null,this[_0x296f4f(0x119)]=null,this[_0x296f4f(0x110)]=null,this['renderer']=_0x380fac,this['scene']=_0x314df6,this[_0x296f4f(0x139)]=_0x4d7b3f,this[_0x296f4f(0xfa)]=Object[_0x296f4f(0x125)]({},_0x2fe4a9),this[_0x296f4f(0x110)]=_0x2b3164!==null&&_0x2b3164!==void 0?_0x2b3164:null;}get['processing'](){const _0x4cc8ac=_0x1564$1;return this[_0x4cc8ac(0x13e)];}[_0x14f0d4(0x156)](_0x396fa7){const _0x51b7aa=_0x14f0d4;this[_0x51b7aa(0x139)]=_0x396fa7,(!this[_0x51b7aa(0x13e)]||!this[_0x51b7aa(0x115)])&&(this[_0x51b7aa(0x169)](),this['updateAllUniforms'](),this[_0x51b7aa(0xf8)]());}[_0x14f0d4(0x113)](){const _0x5e5b27=_0x14f0d4;(!this[_0x5e5b27(0x13e)]||!this[_0x5e5b27(0x115)])&&this[_0x5e5b27(0x169)](),this['updateAllUniforms'](),this[_0x5e5b27(0xf8)]();}[_0x14f0d4(0x169)](){const _0x3a5c1c=_0x14f0d4;var _0x47459d,_0xc3ef2e,_0x533cee,_0x4709dd,_0x4c9a97;this['postProcessing']&&this[_0x3a5c1c(0x13e)][_0x3a5c1c(0x101)]();this[_0x3a5c1c(0x13e)]=new webgpu.PostProcessing(this[_0x3a5c1c(0x13d)]),this['effectUniforms']=this[_0x3a5c1c(0x12f)]();const _0x5ee135=tsl.pass(this[_0x3a5c1c(0x102)],this[_0x3a5c1c(0x139)]);_0x5ee135[_0x3a5c1c(0x111)](tsl.mrt({'output':tsl.output,'normal':tsl.normalView,'velocity':tsl.velocity}));const _0x46a0d1=_0x5ee135[_0x3a5c1c(0x12e)](_0x3a5c1c(0x157)),_0x152055=_0x5ee135[_0x3a5c1c(0x12e)](_0x3a5c1c(0x159)),_0x293683=_0x5ee135[_0x3a5c1c(0x12e)]('depth'),_0x27ea10=_0x5ee135[_0x3a5c1c(0x12e)](_0x3a5c1c(0x118)),_0x48c63b=_0x5ee135[_0x3a5c1c(0x10c)](),_0x4e157d=this[_0x3a5c1c(0x115)],_0x45c6f4=(_0x47459d=this[_0x3a5c1c(0x123)](exports.PostProcessStepType['Bloom']))!==null&&_0x47459d!==void 0?_0x47459d:DefaultBloomParam;this[_0x3a5c1c(0x10f)]=BloomNode_js.bloom(_0x46a0d1),this['bloomPass']['threshold'][_0x3a5c1c(0x140)]=_0x45c6f4[_0x3a5c1c(0x11e)],this[_0x3a5c1c(0x10f)]['strength'][_0x3a5c1c(0x140)]=_0x45c6f4['strength'],this[_0x3a5c1c(0x10f)][_0x3a5c1c(0x148)]['value']=_0x45c6f4[_0x3a5c1c(0x148)];const _0x506d50=_0x46a0d1['add'](this[_0x3a5c1c(0x10f)][_0x3a5c1c(0x10d)](_0x4e157d[_0x3a5c1c(0x12b)])),_0x306b79=_0x4e157d[_0x3a5c1c(0x120)][_0x3a5c1c(0x105)](0.5)[_0x3a5c1c(0x141)](_0x506d50,_0x46a0d1),_0x5cfa3d=(_0xc3ef2e=this['getStepParam'](exports.PostProcessStepType['LensFlare']))!==null&&_0xc3ef2e!==void 0?_0xc3ef2e:DefaultLensFlareParam;this[_0x3a5c1c(0x11f)]=LensflareNode_js.lensflare(this['bloomPass'][_0x3a5c1c(0x12e)](),{'ghostTint':tsl.vec3(_0x5cfa3d[_0x3a5c1c(0xf4)][0x0],_0x5cfa3d[_0x3a5c1c(0xf4)][0x1],_0x5cfa3d[_0x3a5c1c(0xf4)][0x2]),'threshold':tsl.float(_0x5cfa3d[_0x3a5c1c(0x11e)]),'ghostSamples':tsl.float(_0x5cfa3d[_0x3a5c1c(0xfe)]),'ghostSpacing':tsl.float(_0x5cfa3d[_0x3a5c1c(0x146)]),'ghostAttenuationFactor':tsl.float(_0x5cfa3d[_0x3a5c1c(0x134)]),'downSampleRatio':_0x5cfa3d['downSampleRatio']});const _0x5ba523=_0x306b79[_0x3a5c1c(0x137)](this[_0x3a5c1c(0x11f)][_0x3a5c1c(0x12e)]()),_0x5c4e3d=_0x4e157d[_0x3a5c1c(0x154)]['greaterThan'](0.5)['select'](_0x5ba523,_0x306b79),_0x10ac02=(_0x533cee=this[_0x3a5c1c(0x123)](exports.PostProcessStepType['DepthOfField']))!==null&&_0x533cee!==void 0?_0x533cee:DefaultDOFParam;this['dofPass']=DepthOfFieldNode_js.dof(_0x5c4e3d,_0x48c63b,tsl.uniform(_0x10ac02['focus']),tsl.uniform(_0x10ac02[_0x3a5c1c(0x132)]),tsl.uniform(_0x10ac02[_0x3a5c1c(0x15e)]));const _0x4e75ce=_0x4e157d[_0x3a5c1c(0xf6)][_0x3a5c1c(0x105)](0.5)[_0x3a5c1c(0x141)](this['dofPass'],_0x5c4e3d),_0x450f70=(_0x4709dd=this[_0x3a5c1c(0x123)](exports.PostProcessStepType[_0x3a5c1c(0x109)]))!==null&&_0x4709dd!==void 0?_0x4709dd:DefaultGTAOParam;this['gtaoPass']=GTAONode_js.ao(_0x293683,_0x152055,this[_0x3a5c1c(0x139)]),this[_0x3a5c1c(0x10a)][_0x3a5c1c(0x16a)]=0.5,this[_0x3a5c1c(0x10a)][_0x3a5c1c(0x12c)][_0x3a5c1c(0x140)]=_0x450f70[_0x3a5c1c(0x12c)],this[_0x3a5c1c(0x10a)][_0x3a5c1c(0x100)][_0x3a5c1c(0x140)]=_0x450f70[_0x3a5c1c(0x100)],this[_0x3a5c1c(0x10a)]['radius'][_0x3a5c1c(0x140)]=_0x450f70[_0x3a5c1c(0x148)],this[_0x3a5c1c(0x10a)][_0x3a5c1c(0x10b)][_0x3a5c1c(0x140)]=_0x450f70['scale'],this[_0x3a5c1c(0x10a)][_0x3a5c1c(0x153)][_0x3a5c1c(0x140)]=_0x450f70[_0x3a5c1c(0x153)],this[_0x3a5c1c(0x10a)][_0x3a5c1c(0x126)][_0x3a5c1c(0x140)]=_0x450f70[_0x3a5c1c(0x126)],this['gtaoPass']['useTemporalFiltering']=_0x450f70[_0x3a5c1c(0x15d)];const _0xe46d97=this[_0x3a5c1c(0x10a)]['getTextureNode'](),_0x21f1e3=_0xe46d97['r'],_0x2e540a=_0x4e75ce[_0x3a5c1c(0x10d)](_0x21f1e3),_0x2ad125=_0x4e157d['gtaoEnabled'][_0x3a5c1c(0x105)](0.5)[_0x3a5c1c(0x141)](_0x2e540a,_0x4e75ce),_0x46f0f1=(_0x4c9a97=this[_0x3a5c1c(0x123)](exports.PostProcessStepType['Outline']))!==null&&_0x4c9a97!==void 0?_0x4c9a97:DefaultOutlineParams;this['outlinePass']=OutlineNode_js.outline(this[_0x3a5c1c(0x102)],this[_0x3a5c1c(0x139)],{'selectedObjects':this[_0x3a5c1c(0x127)],'edgeGlow':tsl.uniform(_0x46f0f1[_0x3a5c1c(0x14c)]),'edgeThickness':tsl.uniform(_0x46f0f1['edgeThickness'])});const {visibleEdge:_0x3f86c1,hiddenEdge:_0x58d6ab}=this['outlinePass'],_0x344283=_0x4e157d[_0x3a5c1c(0x108)]['greaterThan'](0x0)[_0x3a5c1c(0x141)](_0x4e157d[_0x3a5c1c(0x108)],tsl.uniform(0x1)),_0x4f3bef=tsl.time[_0x3a5c1c(0x131)](_0x344283)[_0x3a5c1c(0x10d)](0x2),_0x4637db=tsl.oscSine(_0x4f3bef)[_0x3a5c1c(0x10d)](0.5)[_0x3a5c1c(0x137)](0.5),_0x301a08=_0x3f86c1['mul'](_0x4e157d['outlineVisibleEdgeColor'])[_0x3a5c1c(0x137)](_0x58d6ab[_0x3a5c1c(0x10d)](_0x4e157d[_0x3a5c1c(0x14f)]))[_0x3a5c1c(0x10d)](_0x4e157d['outlineEdgeStrength']),_0x3da29f=_0x4e157d[_0x3a5c1c(0x108)][_0x3a5c1c(0x105)](0x0)[_0x3a5c1c(0x141)](_0x301a08[_0x3a5c1c(0x10d)](_0x4637db),_0x301a08),_0x4245c5=_0x3da29f[_0x3a5c1c(0x137)](_0x2ad125),_0x36d8cc=_0x4e157d[_0x3a5c1c(0xf9)][_0x3a5c1c(0x105)](0.5)[_0x3a5c1c(0x141)](_0x4245c5,_0x2ad125),_0x17d9b6=FXAANode_js.fxaa(_0x36d8cc),_0x378225=_0x4e157d[_0x3a5c1c(0x158)][_0x3a5c1c(0x105)](0.5)[_0x3a5c1c(0x141)](_0x17d9b6,_0x36d8cc),_0x3ad589=SMAANode_js.smaa(_0x378225),_0x58face=_0x4e157d[_0x3a5c1c(0x15a)]['greaterThan'](0.5)[_0x3a5c1c(0x141)](_0x3ad589,_0x378225),_0x3fc9e2=this[_0x3a5c1c(0x123)](exports.PostProcessStepType['Antialiasing']);let _0xc5b979=_0x58face;_0x3fc9e2&&_0x3fc9e2[_0x3a5c1c(0x163)]===_0x3a5c1c(0x14e)&&(this[_0x3a5c1c(0x11c)]=TRAANode_js.traa(_0x58face,_0x293683,_0x27ea10,this[_0x3a5c1c(0x139)]),_0xc5b979=this[_0x3a5c1c(0x11c)][_0x3a5c1c(0x12e)]()),_0xc5b979=this[_0x3a5c1c(0x135)](_0xc5b979),this[_0x3a5c1c(0x13e)][_0x3a5c1c(0x161)]=_0xc5b979,this[_0x3a5c1c(0x13e)][_0x3a5c1c(0x114)]=!![];}[_0x14f0d4(0x135)](_0x28a26a){return _0x28a26a;}['createEffectUniforms'](){const _0x5f069f=_0x14f0d4;var _0x481773,_0x2a98e0,_0x2b6113,_0x4f9a42;const _0x5eaaef=(_0x481773=this[_0x5f069f(0x123)](exports.PostProcessStepType[_0x5f069f(0x164)]))!==null&&_0x481773!==void 0?_0x481773:DefaultBloomParam,_0xfaf8c1=(_0x2a98e0=this[_0x5f069f(0x123)](exports.PostProcessStepType[_0x5f069f(0x149)]))!==null&&_0x2a98e0!==void 0?_0x2a98e0:DefaultDOFParam,_0x304205=(_0x2b6113=this['getStepParam'](exports.PostProcessStepType['GroundTruthAmbientOcclusion']))!==null&&_0x2b6113!==void 0?_0x2b6113:DefaultGTAOParam,_0x531c16=(_0x4f9a42=this[_0x5f069f(0x123)](exports.PostProcessStepType['Outline']))!==null&&_0x4f9a42!==void 0?_0x4f9a42:DefaultOutlineParams;return {'bloomEnabled':tsl.uniform(0x0),'bloomStrength':tsl.uniform(_0x5eaaef[_0x5f069f(0x143)]),'bloomThreshold':tsl.uniform(_0x5eaaef[_0x5f069f(0x11e)]),'bloomRadius':tsl.uniform(_0x5eaaef[_0x5f069f(0x148)]),'dofEnabled':tsl.uniform(0x0),'dofFocus':tsl.uniform(_0xfaf8c1[_0x5f069f(0x106)]),'dofAperture':tsl.uniform(_0xfaf8c1[_0x5f069f(0x132)]),'dofMaxBlur':tsl.uniform(_0xfaf8c1[_0x5f069f(0x15e)]),'gtaoEnabled':tsl.uniform(0x0),'gtaoScale':tsl.uniform(_0x304205[_0x5f069f(0x10b)]),'gtaoDistanceExponent':tsl.uniform(_0x304205['distanceExponent']),'gtaoDistanceFallOff':tsl.uniform(_0x304205[_0x5f069f(0x100)]),'gtaoRadius':tsl.uniform(_0x304205[_0x5f069f(0x148)]),'gtaoThickness':tsl.uniform(_0x304205[_0x5f069f(0x153)]),'gtaoSamples':tsl.uniform(_0x304205['samples']),'outlineEnabled':tsl.uniform(0x0),'outlineEdgeStrength':tsl.uniform(_0x531c16[_0x5f069f(0x13b)]),'outlineEdgeGlow':tsl.uniform(_0x531c16[_0x5f069f(0x14c)]),'outlineEdgeThickness':tsl.uniform(_0x531c16['edgeThickness']),'outlinePulsePeriod':tsl.uniform(_0x531c16[_0x5f069f(0x112)]),'outlineVisibleEdgeColor':tsl.uniform(new webgpu.Color(_0x531c16[_0x5f069f(0x142)])),'outlineHiddenEdgeColor':tsl.uniform(new webgpu.Color(_0x531c16[_0x5f069f(0x129)])),'fxaaEnabled':tsl.uniform(0x0),'smaaEnabled':tsl.uniform(0x0),'lensflareEnabled':tsl.uniform(0x0)};}['getStepParam'](_0x47286c){const _0x4f7016=_0x14f0d4;var _0x43446c;return (_0x43446c=this['postProcessParam']['steps'][_0x4f7016(0x166)](_0xc49cea=>_0xc49cea[_0x4f7016(0x14a)]===_0x47286c))!==null&&_0x43446c!==void 0?_0x43446c:null;}[_0x14f0d4(0x145)](){const _0x19f050=_0x14f0d4;if(!this[_0x19f050(0x115)])return;const _0x2b9741=this[_0x19f050(0x115)],_0x3d3894=new Set(this['postProcessParam']['steps']['map'](_0x2057f9=>_0x2057f9[_0x19f050(0x14a)]));_0x2b9741[_0x19f050(0x120)][_0x19f050(0x140)]=_0x3d3894[_0x19f050(0x15b)](exports.PostProcessStepType['Bloom'])?0x1:0x0,_0x2b9741['dofEnabled'][_0x19f050(0x140)]=_0x3d3894['has'](exports.PostProcessStepType['DepthOfField'])?0x1:0x0,_0x2b9741[_0x19f050(0x13a)][_0x19f050(0x140)]=_0x3d3894[_0x19f050(0x15b)](exports.PostProcessStepType[_0x19f050(0x109)])?0x1:0x0,_0x2b9741[_0x19f050(0xf9)][_0x19f050(0x140)]=_0x3d3894[_0x19f050(0x15b)](exports.PostProcessStepType[_0x19f050(0x122)])?0x1:0x0,_0x2b9741[_0x19f050(0x154)][_0x19f050(0x140)]=_0x3d3894[_0x19f050(0x15b)](exports.PostProcessStepType[_0x19f050(0x14b)])?0x1:0x0;const _0x5931e9=this['getStepParam'](exports.PostProcessStepType[_0x19f050(0x133)]);_0x5931e9?(_0x2b9741[_0x19f050(0x158)]['value']=_0x5931e9[_0x19f050(0x163)]==='fxaa'?0x1:0x0,_0x2b9741[_0x19f050(0x15a)][_0x19f050(0x140)]=_0x5931e9['method']==='smaa'?0x1:0x0):(_0x2b9741[_0x19f050(0x158)][_0x19f050(0x140)]=0x0,_0x2b9741['smaaEnabled']['value']=0x0);const _0x37a408=this['getStepParam'](exports.PostProcessStepType[_0x19f050(0x164)]);_0x37a408&&(_0x2b9741[_0x19f050(0x12b)][_0x19f050(0x140)]=_0x37a408['strength'],_0x2b9741[_0x19f050(0x15f)][_0x19f050(0x140)]=_0x37a408[_0x19f050(0x11e)],_0x2b9741[_0x19f050(0x136)][_0x19f050(0x140)]=_0x37a408[_0x19f050(0x148)],this[_0x19f050(0x10f)]&&(this[_0x19f050(0x10f)]['threshold']['value']=_0x37a408[_0x19f050(0x11e)],this[_0x19f050(0x10f)][_0x19f050(0x143)]['value']=_0x37a408[_0x19f050(0x143)],this[_0x19f050(0x10f)][_0x19f050(0x148)]['value']=_0x37a408[_0x19f050(0x148)]));const _0x1aa635=this[_0x19f050(0x123)](exports.PostProcessStepType[_0x19f050(0x14b)]);if(_0x1aa635&&this[_0x19f050(0x11f)]);const _0xf158a6=this[_0x19f050(0x123)](exports.PostProcessStepType[_0x19f050(0x149)]);_0xf158a6&&(_0x2b9741['dofFocus'][_0x19f050(0x140)]=_0xf158a6['focus'],_0x2b9741['dofAperture']['value']=_0xf158a6[_0x19f050(0x132)],_0x2b9741[_0x19f050(0x103)][_0x19f050(0x140)]=_0xf158a6[_0x19f050(0x15e)],this['dofPass']&&(this[_0x19f050(0x147)][_0x19f050(0x11b)][_0x19f050(0x140)]=_0xf158a6['focus'],this[_0x19f050(0x147)]['focalLengthNode']['value']=_0xf158a6[_0x19f050(0x132)],this[_0x19f050(0x147)][_0x19f050(0x152)][_0x19f050(0x140)]=_0xf158a6[_0x19f050(0x15e)]));const _0x1a9212=this[_0x19f050(0x123)](exports.PostProcessStepType[_0x19f050(0x109)]);_0x1a9212&&(_0x2b9741[_0x19f050(0x138)][_0x19f050(0x140)]=_0x1a9212['scale'],_0x2b9741[_0x19f050(0x144)][_0x19f050(0x140)]=_0x1a9212[_0x19f050(0x12c)],_0x2b9741['gtaoDistanceFallOff']['value']=_0x1a9212[_0x19f050(0x100)],_0x2b9741['gtaoRadius'][_0x19f050(0x140)]=_0x1a9212[_0x19f050(0x148)],_0x2b9741[_0x19f050(0xfb)]['value']=_0x1a9212[_0x19f050(0x153)],_0x2b9741[_0x19f050(0x128)][_0x19f050(0x140)]=_0x1a9212[_0x19f050(0x126)],this[_0x19f050(0x10a)]&&(this['gtaoPass'][_0x19f050(0x12c)][_0x19f050(0x140)]=_0x1a9212[_0x19f050(0x12c)],this[_0x19f050(0x10a)][_0x19f050(0x100)][_0x19f050(0x140)]=_0x1a9212[_0x19f050(0x100)],this[_0x19f050(0x10a)]['radius']['value']=_0x1a9212[_0x19f050(0x148)],this['gtaoPass'][_0x19f050(0x10b)]['value']=_0x1a9212[_0x19f050(0x10b)],this[_0x19f050(0x10a)]['thickness'][_0x19f050(0x140)]=_0x1a9212[_0x19f050(0x153)],this['gtaoPass'][_0x19f050(0x126)][_0x19f050(0x140)]=_0x1a9212[_0x19f050(0x126)],this['gtaoPass'][_0x19f050(0x15d)]=_0x1a9212[_0x19f050(0x15d)]));const _0x5341e9=this['getStepParam'](exports.PostProcessStepType[_0x19f050(0x122)]);_0x5341e9&&(_0x2b9741[_0x19f050(0x121)][_0x19f050(0x140)]=_0x5341e9['edgeStrength'],_0x2b9741[_0x19f050(0x12a)]['value']=_0x5341e9['edgeGlow'],_0x2b9741['outlineEdgeThickness'][_0x19f050(0x140)]=_0x5341e9['edgeThickness'],_0x2b9741[_0x19f050(0x108)][_0x19f050(0x140)]=_0x5341e9['pulsePeriod'],_0x2b9741[_0x19f050(0x11d)][_0x19f050(0x140)][_0x19f050(0x151)](_0x5341e9[_0x19f050(0x142)]),_0x2b9741[_0x19f050(0x14f)]['value'][_0x19f050(0x151)](_0x5341e9['hiddenEdgeColor']),this[_0x19f050(0x10e)]&&(this[_0x19f050(0x10e)][_0x19f050(0x116)]['value']=_0x5341e9[_0x19f050(0x14c)],this[_0x19f050(0x10e)]['edgeThicknessNode'][_0x19f050(0x140)]=_0x5341e9[_0x19f050(0xff)],this[_0x19f050(0x10e)][_0x19f050(0x162)]=this['outlineObjects']));}[_0x14f0d4(0x107)](_0x2c3cc7){const _0xc30042=_0x14f0d4;this[_0xc30042(0xfa)][_0xc30042(0x11a)]=_0x2c3cc7,(!this[_0xc30042(0x115)]||!this[_0xc30042(0x13e)])&&this[_0xc30042(0x169)](),this[_0xc30042(0x145)](),this[_0xc30042(0xf8)]();}[_0x14f0d4(0xf5)](_0x2bab39){const _0x57371c=_0x14f0d4;!this['outlineObjects'][_0x57371c(0x124)](_0x2bab39)&&(this['outlineObjects']['push'](_0x2bab39),this[_0x57371c(0x10e)]&&(this['outlinePass'][_0x57371c(0x162)]=this[_0x57371c(0x127)])),this['markDirty']();}[_0x14f0d4(0x15c)](_0x232d19){const _0x42b163=_0x14f0d4;this['outlineObjects']['length']=0x0,this['outlineObjects'][_0x42b163(0x104)](..._0x232d19),this[_0x42b163(0x10e)]&&(this['outlinePass']['selectedObjects']=this[_0x42b163(0x127)]),this['markDirty']();}[_0x14f0d4(0x117)](_0x193250){const _0xce803c=_0x14f0d4,_0x24689c=this[_0xce803c(0x127)][_0xce803c(0x14d)](_0x193250);_0x24689c>-1&&(this[_0xce803c(0x127)]['splice'](_0x24689c,0x1),this[_0xce803c(0x10e)]&&(this[_0xce803c(0x10e)][_0xce803c(0x162)]=this[_0xce803c(0x127)])),this[_0xce803c(0xf8)]();}['setLUT3DTexture'](_0x3d7fea){const _0x5291ea=_0x14f0d4;this['lut3dTexture']=_0x3d7fea,this[_0x5291ea(0x169)](),this[_0x5291ea(0x145)](),this[_0x5291ea(0xf8)]();}[_0x14f0d4(0x160)](){const _0x28aa23=_0x14f0d4;return this[_0x28aa23(0x119)];}['render'](){const _0x40300d=_0x14f0d4;if(this[_0x40300d(0x13e)])return this[_0x40300d(0x13e)][_0x40300d(0x13c)](),!![];return ![];}[_0x14f0d4(0xf7)](){const _0x32c033=_0x14f0d4;this[_0x32c033(0x127)]=[],this[_0x32c033(0x115)]=null,this[_0x32c033(0x10e)]=null,this['bloomPass']=null,this[_0x32c033(0x147)]=null,this[_0x32c033(0x10a)]=null,this[_0x32c033(0x11c)]=null,this[_0x32c033(0x11f)]=null,this[_0x32c033(0x119)]=null,this[_0x32c033(0x13e)]&&(this['postProcessing'][_0x32c033(0x101)](),this[_0x32c033(0x13e)]=null);}[_0x14f0d4(0xf8)](){const _0xa582c4=_0x14f0d4;this[_0xa582c4(0x110)]&&this['onDirtyCallback']();}}
|
|
1846
62
|
|
|
1847
|
-
class Viewport {
|
|
1848
|
-
get uiDom() {
|
|
1849
|
-
return this._uiDom;
|
|
1850
|
-
}
|
|
1851
|
-
get canvas() {
|
|
1852
|
-
return this._canvasContainer;
|
|
1853
|
-
}
|
|
1854
|
-
get outer() {
|
|
1855
|
-
return this._outerContainer;
|
|
1856
|
-
}
|
|
1857
|
-
get renderer() {
|
|
1858
|
-
if (!this._renderer) {
|
|
1859
|
-
throw Error("Renderer is not initialized");
|
|
1860
|
-
}
|
|
1861
|
-
return this._renderer;
|
|
1862
|
-
}
|
|
1863
|
-
get app() {
|
|
1864
|
-
if (!this._app) {
|
|
1865
|
-
throw Error("App is not initialized");
|
|
1866
|
-
}
|
|
1867
|
-
return this._app;
|
|
1868
|
-
}
|
|
1869
|
-
constructor(app, viewportParam, rendererParam, postProcessParam) {
|
|
1870
|
-
this._uiDom = null;
|
|
1871
|
-
this._renderer = null;
|
|
1872
|
-
this.labelRenderer = null;
|
|
1873
|
-
this._app = null;
|
|
1874
|
-
this.resizeObserver = null;
|
|
1875
|
-
this._outerContainer = null;
|
|
1876
|
-
this._canvasContainer = null;
|
|
1877
|
-
this.isRenderStateDirty = true;
|
|
1878
|
-
this.postProcessManager = null;
|
|
1879
|
-
this.postProcessParam = Object.assign({}, postProcessParam);
|
|
1880
|
-
this._app = app;
|
|
1881
|
-
if (viewportParam.elementId) {
|
|
1882
|
-
this._outerContainer = document.getElementById(viewportParam.elementId);
|
|
1883
|
-
}
|
|
1884
|
-
this.createRenderer(rendererParam);
|
|
1885
|
-
if (viewportParam.isLabelRendererNeeded) {
|
|
1886
|
-
this.createLabelRenderer();
|
|
1887
|
-
}
|
|
1888
|
-
if (viewportParam.isUILayerNeeded) {
|
|
1889
|
-
this.createUILayer();
|
|
1890
|
-
}
|
|
1891
|
-
if (this._outerContainer) {
|
|
1892
|
-
this.resizeObserver = new ResizeObserver((entries) => {
|
|
1893
|
-
for (let entry of entries) {
|
|
1894
|
-
if (entry.contentBoxSize) {
|
|
1895
|
-
this.onWindowResize();
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
});
|
|
1899
|
-
this.resizeObserver.observe(this._outerContainer);
|
|
1900
|
-
}
|
|
1901
|
-
this.app.onCameraChangedDelegate.add(() => {
|
|
1902
|
-
if (this.postProcessManager) {
|
|
1903
|
-
this.postProcessManager.updateCamera(this.app.camera);
|
|
1904
|
-
this.postProcessManager.setup();
|
|
1905
|
-
}
|
|
1906
|
-
});
|
|
1907
|
-
}
|
|
1908
|
-
createRenderer(rendererParam) {
|
|
1909
|
-
// 只在首次创建 canvasContainer,避免重复创建导致 DOM 泄漏
|
|
1910
|
-
if (this._outerContainer && !this._canvasContainer) {
|
|
1911
|
-
this._canvasContainer = document.createElement("div");
|
|
1912
|
-
this._canvasContainer.style.left = "0px";
|
|
1913
|
-
this._canvasContainer.style.top = "0px";
|
|
1914
|
-
this._canvasContainer.style.width = "100%";
|
|
1915
|
-
this._canvasContainer.style.height = "100%";
|
|
1916
|
-
this._outerContainer.appendChild(this._canvasContainer);
|
|
1917
|
-
}
|
|
1918
|
-
const element = this._canvasContainer;
|
|
1919
|
-
// 销毁旧渲染器
|
|
1920
|
-
if (this._renderer) {
|
|
1921
|
-
if (element) {
|
|
1922
|
-
element.removeChild(this._renderer.domElement);
|
|
1923
|
-
}
|
|
1924
|
-
this._renderer.dispose();
|
|
1925
|
-
}
|
|
1926
|
-
let width = element ? element.clientWidth : 512;
|
|
1927
|
-
let height = element ? element.clientHeight : 512;
|
|
1928
|
-
let renderP = {};
|
|
1929
|
-
renderP.forceWebGL = rendererParam.forceWebGL;
|
|
1930
|
-
renderP.antialias = rendererParam.antialias;
|
|
1931
|
-
renderP.depth = rendererParam.depth;
|
|
1932
|
-
renderP.stencil = rendererParam.stencil;
|
|
1933
|
-
renderP.alpha = rendererParam.alpha;
|
|
1934
|
-
renderP.logarithmicDepthBuffer = rendererParam.logarithmicDepthBuffer;
|
|
1935
|
-
renderP.samples = rendererParam.samples;
|
|
1936
|
-
renderP.outputBufferType = rendererParam.outputBufferType;
|
|
1937
|
-
this._renderer = new webgpu.WebGPURenderer(renderP);
|
|
1938
|
-
this._renderer.setPixelRatio(window.devicePixelRatio);
|
|
1939
|
-
this._renderer.setSize(width, height);
|
|
1940
|
-
this._renderer.shadowMap.enabled = rendererParam.shadowMapEnabled;
|
|
1941
|
-
this._renderer.shadowMap.type = rendererParam.shadowMapType;
|
|
1942
|
-
this._renderer.toneMapping = rendererParam.toneMapping;
|
|
1943
|
-
this._renderer.toneMappingExposure = rendererParam.toneMappingExposure;
|
|
1944
|
-
this._renderer.setClearAlpha(0);
|
|
1945
|
-
if (element) {
|
|
1946
|
-
element.appendChild(this._renderer.domElement);
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
createLabelRenderer() {
|
|
1950
|
-
const element = this._outerContainer;
|
|
1951
|
-
if (this.labelRenderer) {
|
|
1952
|
-
if (element) {
|
|
1953
|
-
element.removeChild(this.labelRenderer.domElement);
|
|
1954
|
-
}
|
|
1955
|
-
// this.labelRenderer.dispose();
|
|
1956
|
-
}
|
|
1957
|
-
let width = element ? element.clientWidth : 512;
|
|
1958
|
-
let height = element ? element.clientHeight : 512;
|
|
1959
|
-
this.labelRenderer = new Addons_js.CSS2DRenderer();
|
|
1960
|
-
this.labelRenderer.setSize(width, height);
|
|
1961
|
-
this.labelRenderer.domElement.style.pointerEvents = 'none';
|
|
1962
|
-
this.labelRenderer.domElement.style.position = 'absolute';
|
|
1963
|
-
this.labelRenderer.domElement.style.top = '0px';
|
|
1964
|
-
this.labelRenderer.domElement.className = 'scene-labelRenderer';
|
|
1965
|
-
if (element) {
|
|
1966
|
-
element.appendChild(this.labelRenderer.domElement);
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
createUILayer() {
|
|
1970
|
-
if (!this._outerContainer)
|
|
1971
|
-
return;
|
|
1972
|
-
// 检查是否已存在 UI 层,避免重复创建
|
|
1973
|
-
let uiLayer = this._outerContainer.querySelector('.scene-uiLayer');
|
|
1974
|
-
if (!uiLayer) {
|
|
1975
|
-
uiLayer = document.createElement('div');
|
|
1976
|
-
uiLayer.className = 'scene-uiLayer';
|
|
1977
|
-
uiLayer.id = "scene-uiLayer";
|
|
1978
|
-
uiLayer.style.position = 'absolute';
|
|
1979
|
-
uiLayer.style.left = '0';
|
|
1980
|
-
uiLayer.style.top = '0';
|
|
1981
|
-
uiLayer.style.width = '100%';
|
|
1982
|
-
uiLayer.style.height = '100%';
|
|
1983
|
-
uiLayer.style.pointerEvents = 'none'; // UI层默认不响应鼠标事件
|
|
1984
|
-
uiLayer.style.zIndex = '10'; // 保证在渲染层之上
|
|
1985
|
-
this._outerContainer.appendChild(uiLayer);
|
|
1986
|
-
this._uiDom = uiLayer;
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
init() {
|
|
1990
|
-
this.setupPostProcess();
|
|
1991
|
-
}
|
|
1992
|
-
setupPostProcess() {
|
|
1993
|
-
if (!this.postProcessManager) {
|
|
1994
|
-
this.postProcessManager = this.createPostProcessManager();
|
|
1995
|
-
}
|
|
1996
|
-
this.postProcessManager.setup();
|
|
1997
|
-
}
|
|
1998
|
-
/** Create the PostProcessManager instance. Override in subclass to use custom manager. */
|
|
1999
|
-
createPostProcessManager() {
|
|
2000
|
-
return new PostProcessManager(this.renderer, this.app.world.scene, this.app.camera, this.postProcessParam, () => this.markRenderStateDirty());
|
|
2001
|
-
}
|
|
2002
|
-
updatePostProcess(steps) {
|
|
2003
|
-
if (this.postProcessManager) {
|
|
2004
|
-
this.postProcessManager.updateSteps(steps);
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
updateRendererSettings(data) {
|
|
2008
|
-
this.createRenderer(data);
|
|
2009
|
-
this.markRenderStateDirty();
|
|
2010
|
-
}
|
|
2011
|
-
addOutlineObject(obj) {
|
|
2012
|
-
if (this.postProcessManager) {
|
|
2013
|
-
this.postProcessManager.addOutlineObject(obj);
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
setOutlineObjects(objects) {
|
|
2017
|
-
if (this.postProcessManager) {
|
|
2018
|
-
this.postProcessManager.setOutlineObjects(objects);
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
removeOutlineObject(obj) {
|
|
2022
|
-
if (this.postProcessManager) {
|
|
2023
|
-
this.postProcessManager.removeOutlineObject(obj);
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
destroyPostProcess() {
|
|
2027
|
-
if (this.postProcessManager) {
|
|
2028
|
-
this.postProcessManager.destroy();
|
|
2029
|
-
this.postProcessManager = null;
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
onWindowResize() {
|
|
2033
|
-
//console.log("resize")
|
|
2034
|
-
let ele = this._outerContainer;
|
|
2035
|
-
if (!ele) {
|
|
2036
|
-
return;
|
|
2037
|
-
}
|
|
2038
|
-
this.app.onWindowResize(ele.clientWidth, ele.clientHeight);
|
|
2039
|
-
this.renderer.setSize(ele.clientWidth, ele.clientHeight);
|
|
2040
|
-
if (this.labelRenderer)
|
|
2041
|
-
this.labelRenderer.setSize(ele.clientWidth, ele.clientHeight);
|
|
2042
|
-
this.markRenderStateDirty();
|
|
2043
|
-
}
|
|
2044
|
-
markRenderStateDirty() {
|
|
2045
|
-
this.isRenderStateDirty = true;
|
|
2046
|
-
}
|
|
2047
|
-
render() {
|
|
2048
|
-
if (!this.isRenderStateDirty) {
|
|
2049
|
-
return;
|
|
2050
|
-
}
|
|
2051
|
-
if (this.postProcessManager && this.postProcessManager.render()) ;
|
|
2052
|
-
else {
|
|
2053
|
-
this.renderer.render(this.app.world.scene, this.app.camera);
|
|
2054
|
-
}
|
|
2055
|
-
// Hook for subclasses to render additional content after post-processing
|
|
2056
|
-
this.onAfterPostProcessRender();
|
|
2057
|
-
if (this.labelRenderer) {
|
|
2058
|
-
this.labelRenderer.render(this.app.world.scene, this.app.camera);
|
|
2059
|
-
}
|
|
2060
|
-
this.isRenderStateDirty = false;
|
|
2061
|
-
}
|
|
2062
|
-
/** Called after post-processing render, before label renderer. Override in subclass to render additional content. */
|
|
2063
|
-
onAfterPostProcessRender() {
|
|
2064
|
-
// Override in subclass
|
|
2065
|
-
}
|
|
2066
|
-
async renderAsImage(width = 1024, height = 1024) {
|
|
2067
|
-
try {
|
|
2068
|
-
if (this.postProcessManager && this.postProcessManager.render()) {
|
|
2069
|
-
// Post processing rendered
|
|
2070
|
-
}
|
|
2071
|
-
else {
|
|
2072
|
-
await this.renderer.render(this.app.world.scene, this.app.camera);
|
|
2073
|
-
}
|
|
2074
|
-
// 检查 renderer.domElement 的尺寸
|
|
2075
|
-
const sourceWidth = this.renderer.domElement.width;
|
|
2076
|
-
const sourceHeight = this.renderer.domElement.height;
|
|
2077
|
-
// 如果源尺寸为0,则使用容器尺寸
|
|
2078
|
-
let actualWidth = sourceWidth || width;
|
|
2079
|
-
let actualHeight = sourceHeight || height;
|
|
2080
|
-
if (actualWidth <= 0 || actualHeight <= 0) {
|
|
2081
|
-
// 如果仍然无效,则使用默认值
|
|
2082
|
-
actualWidth = width;
|
|
2083
|
-
actualHeight = height;
|
|
2084
|
-
}
|
|
2085
|
-
const offscreenCanvas = document.createElement('canvas');
|
|
2086
|
-
offscreenCanvas.width = width;
|
|
2087
|
-
offscreenCanvas.height = height;
|
|
2088
|
-
const context = offscreenCanvas.getContext('2d');
|
|
2089
|
-
if (!context) {
|
|
2090
|
-
throw Error("Can not create context");
|
|
2091
|
-
}
|
|
2092
|
-
// 使用实际尺寸进行绘制
|
|
2093
|
-
context.drawImage(this.renderer.domElement, 0, 0, actualWidth, actualHeight, 0, 0, width, height);
|
|
2094
|
-
const ret = offscreenCanvas.toDataURL('image/jpeg');
|
|
2095
|
-
offscreenCanvas.remove();
|
|
2096
|
-
return ret;
|
|
2097
|
-
}
|
|
2098
|
-
catch (error) {
|
|
2099
|
-
return "";
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
setAlpha(alpha) {
|
|
2103
|
-
if (!this._renderer) {
|
|
2104
|
-
return;
|
|
2105
|
-
}
|
|
2106
|
-
this._renderer.alpha = alpha;
|
|
2107
|
-
}
|
|
2108
|
-
setShadowMapEnabled(enabled) {
|
|
2109
|
-
if (!this._renderer) {
|
|
2110
|
-
return;
|
|
2111
|
-
}
|
|
2112
|
-
this._renderer.shadowMap.enabled = enabled;
|
|
2113
|
-
}
|
|
2114
|
-
setShadowMapType(type) {
|
|
2115
|
-
if (!this._renderer) {
|
|
2116
|
-
return;
|
|
2117
|
-
}
|
|
2118
|
-
this._renderer.shadowMap.type = type;
|
|
2119
|
-
}
|
|
2120
|
-
setToneMapping(toneMapping) {
|
|
2121
|
-
if (!this._renderer) {
|
|
2122
|
-
return;
|
|
2123
|
-
}
|
|
2124
|
-
this._renderer.toneMapping = toneMapping;
|
|
2125
|
-
}
|
|
2126
|
-
setToneMappingExposure(exposure) {
|
|
2127
|
-
if (!this._renderer) {
|
|
2128
|
-
return;
|
|
2129
|
-
}
|
|
2130
|
-
this._renderer.toneMappingExposure = exposure;
|
|
2131
|
-
}
|
|
2132
|
-
setLogarithmicDepthBufferEnabled(enabled) {
|
|
2133
|
-
if (!this._renderer) {
|
|
2134
|
-
return;
|
|
2135
|
-
}
|
|
2136
|
-
this._renderer.logarithmicDepthBuffer = enabled;
|
|
2137
|
-
}
|
|
2138
|
-
setDepth(depth) {
|
|
2139
|
-
if (!this._renderer) {
|
|
2140
|
-
return;
|
|
2141
|
-
}
|
|
2142
|
-
this._renderer.depth = depth;
|
|
2143
|
-
}
|
|
2144
|
-
setStencil(stencil) {
|
|
2145
|
-
if (!this._renderer) {
|
|
2146
|
-
return;
|
|
2147
|
-
}
|
|
2148
|
-
this._renderer.stencil = stencil;
|
|
2149
|
-
}
|
|
2150
|
-
destroy() {
|
|
2151
|
-
this.destroyPostProcess();
|
|
2152
|
-
this.renderer.setAnimationLoop(null);
|
|
2153
|
-
if (this.resizeObserver) {
|
|
2154
|
-
this.resizeObserver.disconnect();
|
|
2155
|
-
this.resizeObserver = null;
|
|
2156
|
-
}
|
|
2157
|
-
if (this.labelRenderer) {
|
|
2158
|
-
this.labelRenderer.domElement.remove();
|
|
2159
|
-
this.labelRenderer = null;
|
|
2160
|
-
}
|
|
2161
|
-
if (this._renderer) {
|
|
2162
|
-
this.renderer.domElement.remove();
|
|
2163
|
-
this._renderer.dispose();
|
|
2164
|
-
this._renderer = null;
|
|
2165
|
-
}
|
|
2166
|
-
if (this._canvasContainer) {
|
|
2167
|
-
this._canvasContainer.remove();
|
|
2168
|
-
this._canvasContainer = null;
|
|
2169
|
-
}
|
|
2170
|
-
this._outerContainer = null;
|
|
2171
|
-
this._app = null;
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
63
|
+
const _0x3ffbbe=_0x26fc;(function(_0x49e01,_0x4c43e3){const _0x2a4c24=_0x26fc,_0x1b3093=_0x49e01();while(!![]){try{const _0xa85da0=parseInt(_0x2a4c24(0x23a))/0x1+parseInt(_0x2a4c24(0x231))/0x2+-parseInt(_0x2a4c24(0x244))/0x3*(-parseInt(_0x2a4c24(0x249))/0x4)+parseInt(_0x2a4c24(0x1fd))/0x5*(-parseInt(_0x2a4c24(0x1f2))/0x6)+parseInt(_0x2a4c24(0x236))/0x7+-parseInt(_0x2a4c24(0x20a))/0x8*(-parseInt(_0x2a4c24(0x22c))/0x9)+-parseInt(_0x2a4c24(0x21b))/0xa*(parseInt(_0x2a4c24(0x1de))/0xb);if(_0xa85da0===_0x4c43e3)break;else _0x1b3093['push'](_0x1b3093['shift']());}catch(_0x420337){_0x1b3093['push'](_0x1b3093['shift']());}}}(_0x1138,0x3a70d));function _0x26fc(_0x45e091,_0xe8cb34){_0x45e091=_0x45e091-0x1de;const _0x11387c=_0x1138();let _0x26fc2d=_0x11387c[_0x45e091];return _0x26fc2d;}function _0x1138(){const _0x5f0378=['postProcessManager','57KcHEbu','createElement','isRenderStateDirty','logarithmicDepthBuffer','_renderer','9904NwVzcU','toDataURL','contentBoxSize','setDepth','3990679hlGDmA','none','setOutlineObjects','add','position','renderAsImage','init','.scene-uiLayer','labelRenderer','createLabelRenderer','camera','updatePostProcess','left','clientWidth','setPixelRatio','setLogarithmicDepthBufferEnabled','elementId','destroyPostProcess','scene','createUILayer','696FXzOLc','world','App\x20is\x20not\x20initialized','pointerEvents','setupPostProcess','div','remove','canvas','100%','forceWebGL','stencil','10050reOKTA','shadowMap','0px','height','width','samples','isUILayerNeeded','renderer','style','_app','addOutlineObject','resizeObserver','shadowMapEnabled','523272fdDbIn','absolute','depth','updateSteps','antialias','destroy','Can\x20not\x20create\x20context','dispose','onCameraChangedDelegate','app','domElement','updateRendererSettings','Renderer\x20is\x20not\x20initialized','postProcessParam','_outerContainer','enabled','setToneMapping','10QtvuxZ','top','createPostProcessManager','setAlpha','scene-uiLayer','setup','setSize','removeChild','_uiDom','observe','markRenderStateDirty','setShadowMapType','onWindowResize','_canvasContainer','getContext','toneMapping','getElementById','63GbURmu','appendChild','alpha','querySelector','disconnect','56078LhITbT','image/jpeg','render','isLabelRendererNeeded','drawImage','1648080SFCvqZ','type','removeOutlineObject','setAnimationLoop','66936uWsGvD','onAfterPostProcessRender','createRenderer','clientHeight','shadowMapType','className','devicePixelRatio','toneMappingExposure','outputBufferType'];_0x1138=function(){return _0x5f0378;};return _0x1138();}class Viewport{get['uiDom'](){const _0x469331=_0x26fc;return this[_0x469331(0x223)];}get['canvas'](){const _0x16e89d=_0x26fc;return this[_0x16e89d(0x228)];}get['outer'](){const _0x3e1753=_0x26fc;return this[_0x3e1753(0x218)];}get['renderer'](){const _0x284821=_0x26fc;if(!this[_0x284821(0x248)])throw Error(_0x284821(0x216));return this[_0x284821(0x248)];}get[_0x3ffbbe(0x213)](){const _0x3c436f=_0x3ffbbe;if(!this[_0x3c436f(0x206)])throw Error(_0x3c436f(0x1f4));return this[_0x3c436f(0x206)];}constructor(_0x40fbce,_0x1fb730,_0x2d652f,_0x2a0c0d){const _0x3f6db4=_0x3ffbbe;this[_0x3f6db4(0x223)]=null,this[_0x3f6db4(0x248)]=null,this[_0x3f6db4(0x1e6)]=null,this[_0x3f6db4(0x206)]=null,this[_0x3f6db4(0x208)]=null,this['_outerContainer']=null,this[_0x3f6db4(0x228)]=null,this[_0x3f6db4(0x246)]=!![],this[_0x3f6db4(0x243)]=null,this[_0x3f6db4(0x217)]=Object['assign']({},_0x2a0c0d),this['_app']=_0x40fbce,_0x1fb730[_0x3f6db4(0x1ee)]&&(this['_outerContainer']=document[_0x3f6db4(0x22b)](_0x1fb730['elementId'])),this[_0x3f6db4(0x23c)](_0x2d652f),_0x1fb730[_0x3f6db4(0x234)]&&this[_0x3f6db4(0x1e7)](),_0x1fb730[_0x3f6db4(0x203)]&&this[_0x3f6db4(0x1f1)](),this['_outerContainer']&&(this[_0x3f6db4(0x208)]=new ResizeObserver(_0x1ca3db=>{const _0x383917=_0x3f6db4;for(let _0x1c70ef of _0x1ca3db){_0x1c70ef[_0x383917(0x24b)]&&this[_0x383917(0x227)]();}}),this['resizeObserver'][_0x3f6db4(0x224)](this[_0x3f6db4(0x218)])),this['app'][_0x3f6db4(0x212)][_0x3f6db4(0x1e1)](()=>{const _0x33cb1a=_0x3f6db4;this[_0x33cb1a(0x243)]&&(this[_0x33cb1a(0x243)]['updateCamera'](this[_0x33cb1a(0x213)]['camera']),this[_0x33cb1a(0x243)][_0x33cb1a(0x220)]());});}['createRenderer'](_0x47c286){const _0x570966=_0x3ffbbe;this[_0x570966(0x218)]&&!this['_canvasContainer']&&(this[_0x570966(0x228)]=document['createElement']('div'),this['_canvasContainer']['style'][_0x570966(0x1ea)]=_0x570966(0x1ff),this[_0x570966(0x228)]['style']['top']=_0x570966(0x1ff),this[_0x570966(0x228)][_0x570966(0x205)][_0x570966(0x201)]=_0x570966(0x1fa),this[_0x570966(0x228)]['style']['height']='100%',this[_0x570966(0x218)]['appendChild'](this[_0x570966(0x228)]));const _0x507a17=this[_0x570966(0x228)];this[_0x570966(0x248)]&&(_0x507a17&&_0x507a17[_0x570966(0x222)](this['_renderer'][_0x570966(0x214)]),this['_renderer'][_0x570966(0x211)]());let _0x1cc464=_0x507a17?_0x507a17[_0x570966(0x1eb)]:0x200,_0x4991a9=_0x507a17?_0x507a17[_0x570966(0x23d)]:0x200,_0x28ca2b={};_0x28ca2b[_0x570966(0x1fb)]=_0x47c286[_0x570966(0x1fb)],_0x28ca2b[_0x570966(0x20e)]=_0x47c286['antialias'],_0x28ca2b[_0x570966(0x20c)]=_0x47c286[_0x570966(0x20c)],_0x28ca2b[_0x570966(0x1fc)]=_0x47c286['stencil'],_0x28ca2b['alpha']=_0x47c286['alpha'],_0x28ca2b['logarithmicDepthBuffer']=_0x47c286[_0x570966(0x247)],_0x28ca2b[_0x570966(0x202)]=_0x47c286[_0x570966(0x202)],_0x28ca2b[_0x570966(0x242)]=_0x47c286['outputBufferType'],this['_renderer']=new webgpu.WebGPURenderer(_0x28ca2b),this[_0x570966(0x248)][_0x570966(0x1ec)](window[_0x570966(0x240)]),this[_0x570966(0x248)][_0x570966(0x221)](_0x1cc464,_0x4991a9),this['_renderer']['shadowMap'][_0x570966(0x219)]=_0x47c286[_0x570966(0x209)],this[_0x570966(0x248)]['shadowMap'][_0x570966(0x237)]=_0x47c286[_0x570966(0x23e)],this['_renderer'][_0x570966(0x22a)]=_0x47c286[_0x570966(0x22a)],this[_0x570966(0x248)]['toneMappingExposure']=_0x47c286[_0x570966(0x241)],this[_0x570966(0x248)]['setClearAlpha'](0x0),_0x507a17&&_0x507a17['appendChild'](this['_renderer'][_0x570966(0x214)]);}[_0x3ffbbe(0x1e7)](){const _0x3f68b9=_0x3ffbbe,_0x372a8b=this['_outerContainer'];this['labelRenderer']&&(_0x372a8b&&_0x372a8b['removeChild'](this[_0x3f68b9(0x1e6)][_0x3f68b9(0x214)]));let _0x52f6c1=_0x372a8b?_0x372a8b[_0x3f68b9(0x1eb)]:0x200,_0x3218e3=_0x372a8b?_0x372a8b['clientHeight']:0x200;this[_0x3f68b9(0x1e6)]=new Addons_js.CSS2DRenderer(),this[_0x3f68b9(0x1e6)]['setSize'](_0x52f6c1,_0x3218e3),this[_0x3f68b9(0x1e6)][_0x3f68b9(0x214)][_0x3f68b9(0x205)][_0x3f68b9(0x1f5)]=_0x3f68b9(0x1df),this[_0x3f68b9(0x1e6)]['domElement'][_0x3f68b9(0x205)][_0x3f68b9(0x1e2)]=_0x3f68b9(0x20b),this['labelRenderer'][_0x3f68b9(0x214)][_0x3f68b9(0x205)][_0x3f68b9(0x21c)]=_0x3f68b9(0x1ff),this[_0x3f68b9(0x1e6)][_0x3f68b9(0x214)]['className']='scene-labelRenderer',_0x372a8b&&_0x372a8b['appendChild'](this[_0x3f68b9(0x1e6)][_0x3f68b9(0x214)]);}[_0x3ffbbe(0x1f1)](){const _0x4552a4=_0x3ffbbe;if(!this[_0x4552a4(0x218)])return;let _0x1dfc84=this[_0x4552a4(0x218)][_0x4552a4(0x22f)](_0x4552a4(0x1e5));!_0x1dfc84&&(_0x1dfc84=document[_0x4552a4(0x245)](_0x4552a4(0x1f7)),_0x1dfc84[_0x4552a4(0x23f)]=_0x4552a4(0x21f),_0x1dfc84['id']='scene-uiLayer',_0x1dfc84[_0x4552a4(0x205)][_0x4552a4(0x1e2)]=_0x4552a4(0x20b),_0x1dfc84[_0x4552a4(0x205)][_0x4552a4(0x1ea)]='0',_0x1dfc84[_0x4552a4(0x205)][_0x4552a4(0x21c)]='0',_0x1dfc84['style'][_0x4552a4(0x201)]='100%',_0x1dfc84[_0x4552a4(0x205)][_0x4552a4(0x200)]='100%',_0x1dfc84[_0x4552a4(0x205)][_0x4552a4(0x1f5)]='none',_0x1dfc84['style']['zIndex']='10',this['_outerContainer'][_0x4552a4(0x22d)](_0x1dfc84),this[_0x4552a4(0x223)]=_0x1dfc84);}[_0x3ffbbe(0x1e4)](){const _0x2b72a4=_0x3ffbbe;this[_0x2b72a4(0x1f6)]();}[_0x3ffbbe(0x1f6)](){const _0x172a4a=_0x3ffbbe;!this[_0x172a4a(0x243)]&&(this[_0x172a4a(0x243)]=this[_0x172a4a(0x21d)]()),this[_0x172a4a(0x243)][_0x172a4a(0x220)]();}['createPostProcessManager'](){const _0x5b36d5=_0x3ffbbe;return new PostProcessManager(this[_0x5b36d5(0x204)],this[_0x5b36d5(0x213)][_0x5b36d5(0x1f3)]['scene'],this[_0x5b36d5(0x213)]['camera'],this[_0x5b36d5(0x217)],()=>this[_0x5b36d5(0x225)]());}[_0x3ffbbe(0x1e9)](_0x284f40){const _0x2e9f5b=_0x3ffbbe;this['postProcessManager']&&this[_0x2e9f5b(0x243)][_0x2e9f5b(0x20d)](_0x284f40);}[_0x3ffbbe(0x215)](_0x2a67f7){const _0x2355e2=_0x3ffbbe;this['createRenderer'](_0x2a67f7),this[_0x2355e2(0x225)]();}[_0x3ffbbe(0x207)](_0x2d4e8c){const _0x31427b=_0x3ffbbe;this['postProcessManager']&&this['postProcessManager'][_0x31427b(0x207)](_0x2d4e8c);}[_0x3ffbbe(0x1e0)](_0x2b9e23){const _0x21f6bf=_0x3ffbbe;this[_0x21f6bf(0x243)]&&this[_0x21f6bf(0x243)][_0x21f6bf(0x1e0)](_0x2b9e23);}['removeOutlineObject'](_0x5eac8d){const _0x5055bf=_0x3ffbbe;this[_0x5055bf(0x243)]&&this[_0x5055bf(0x243)][_0x5055bf(0x238)](_0x5eac8d);}[_0x3ffbbe(0x1ef)](){const _0x3c3423=_0x3ffbbe;this[_0x3c3423(0x243)]&&(this['postProcessManager'][_0x3c3423(0x20f)](),this['postProcessManager']=null);}['onWindowResize'](){const _0x259cca=_0x3ffbbe;let _0x4b38a9=this[_0x259cca(0x218)];if(!_0x4b38a9)return;this[_0x259cca(0x213)][_0x259cca(0x227)](_0x4b38a9['clientWidth'],_0x4b38a9[_0x259cca(0x23d)]),this[_0x259cca(0x204)][_0x259cca(0x221)](_0x4b38a9['clientWidth'],_0x4b38a9[_0x259cca(0x23d)]);if(this[_0x259cca(0x1e6)])this[_0x259cca(0x1e6)]['setSize'](_0x4b38a9[_0x259cca(0x1eb)],_0x4b38a9[_0x259cca(0x23d)]);this['markRenderStateDirty']();}[_0x3ffbbe(0x225)](){const _0x1ca8ac=_0x3ffbbe;this[_0x1ca8ac(0x246)]=!![];}['render'](){const _0x4052d4=_0x3ffbbe;if(!this[_0x4052d4(0x246)])return;if(this[_0x4052d4(0x243)]&&this[_0x4052d4(0x243)][_0x4052d4(0x233)]());else this[_0x4052d4(0x204)][_0x4052d4(0x233)](this[_0x4052d4(0x213)][_0x4052d4(0x1f3)][_0x4052d4(0x1f0)],this[_0x4052d4(0x213)][_0x4052d4(0x1e8)]);this[_0x4052d4(0x23b)](),this[_0x4052d4(0x1e6)]&&this['labelRenderer'][_0x4052d4(0x233)](this[_0x4052d4(0x213)][_0x4052d4(0x1f3)][_0x4052d4(0x1f0)],this['app']['camera']),this[_0x4052d4(0x246)]=![];}[_0x3ffbbe(0x23b)](){}async[_0x3ffbbe(0x1e3)](_0x2425ae=0x400,_0x146eb4=0x400){const _0x5a1ceb=_0x3ffbbe;try{if(this[_0x5a1ceb(0x243)]&&this[_0x5a1ceb(0x243)]['render']()){}else await this[_0x5a1ceb(0x204)][_0x5a1ceb(0x233)](this['app'][_0x5a1ceb(0x1f3)]['scene'],this[_0x5a1ceb(0x213)][_0x5a1ceb(0x1e8)]);const _0x2ad417=this[_0x5a1ceb(0x204)]['domElement'][_0x5a1ceb(0x201)],_0x3669db=this[_0x5a1ceb(0x204)][_0x5a1ceb(0x214)][_0x5a1ceb(0x200)];let _0x2ddab5=_0x2ad417||_0x2425ae,_0x24cf15=_0x3669db||_0x146eb4;(_0x2ddab5<=0x0||_0x24cf15<=0x0)&&(_0x2ddab5=_0x2425ae,_0x24cf15=_0x146eb4);const _0x45389f=document[_0x5a1ceb(0x245)](_0x5a1ceb(0x1f9));_0x45389f[_0x5a1ceb(0x201)]=_0x2425ae,_0x45389f[_0x5a1ceb(0x200)]=_0x146eb4;const _0x18ccb9=_0x45389f[_0x5a1ceb(0x229)]('2d');if(!_0x18ccb9)throw Error(_0x5a1ceb(0x210));_0x18ccb9[_0x5a1ceb(0x235)](this['renderer'][_0x5a1ceb(0x214)],0x0,0x0,_0x2ddab5,_0x24cf15,0x0,0x0,_0x2425ae,_0x146eb4);const _0x3dd181=_0x45389f[_0x5a1ceb(0x24a)](_0x5a1ceb(0x232));return _0x45389f[_0x5a1ceb(0x1f8)](),_0x3dd181;}catch(_0xf75e9f){return '';}}[_0x3ffbbe(0x21e)](_0x394c1a){const _0x588583=_0x3ffbbe;if(!this[_0x588583(0x248)])return;this[_0x588583(0x248)][_0x588583(0x22e)]=_0x394c1a;}['setShadowMapEnabled'](_0x539a87){const _0x46e944=_0x3ffbbe;if(!this[_0x46e944(0x248)])return;this[_0x46e944(0x248)][_0x46e944(0x1fe)]['enabled']=_0x539a87;}[_0x3ffbbe(0x226)](_0x23c52c){const _0x4e02f5=_0x3ffbbe;if(!this['_renderer'])return;this['_renderer'][_0x4e02f5(0x1fe)]['type']=_0x23c52c;}[_0x3ffbbe(0x21a)](_0x4cd621){const _0x109144=_0x3ffbbe;if(!this[_0x109144(0x248)])return;this[_0x109144(0x248)][_0x109144(0x22a)]=_0x4cd621;}['setToneMappingExposure'](_0x589665){const _0x2904b7=_0x3ffbbe;if(!this[_0x2904b7(0x248)])return;this[_0x2904b7(0x248)][_0x2904b7(0x241)]=_0x589665;}[_0x3ffbbe(0x1ed)](_0x26b500){const _0x3e178e=_0x3ffbbe;if(!this[_0x3e178e(0x248)])return;this[_0x3e178e(0x248)][_0x3e178e(0x247)]=_0x26b500;}[_0x3ffbbe(0x24c)](_0x26469e){const _0x3e0047=_0x3ffbbe;if(!this[_0x3e0047(0x248)])return;this[_0x3e0047(0x248)][_0x3e0047(0x20c)]=_0x26469e;}['setStencil'](_0x4ab1a1){const _0x184bdd=_0x3ffbbe;if(!this[_0x184bdd(0x248)])return;this[_0x184bdd(0x248)][_0x184bdd(0x1fc)]=_0x4ab1a1;}[_0x3ffbbe(0x20f)](){const _0x75bbf5=_0x3ffbbe;this[_0x75bbf5(0x1ef)](),this[_0x75bbf5(0x204)][_0x75bbf5(0x239)](null),this['resizeObserver']&&(this['resizeObserver'][_0x75bbf5(0x230)](),this['resizeObserver']=null),this['labelRenderer']&&(this['labelRenderer'][_0x75bbf5(0x214)][_0x75bbf5(0x1f8)](),this[_0x75bbf5(0x1e6)]=null),this[_0x75bbf5(0x248)]&&(this['renderer'][_0x75bbf5(0x214)][_0x75bbf5(0x1f8)](),this['_renderer'][_0x75bbf5(0x211)](),this['_renderer']=null),this[_0x75bbf5(0x228)]&&(this['_canvasContainer'][_0x75bbf5(0x1f8)](),this[_0x75bbf5(0x228)]=null),this[_0x75bbf5(0x218)]=null,this[_0x75bbf5(0x206)]=null;}}
|
|
2174
64
|
|
|
2175
|
-
class Pawn {
|
|
2176
|
-
get camera() {
|
|
2177
|
-
return this.controller.camera;
|
|
2178
|
-
}
|
|
2179
|
-
set enabled(value) {
|
|
2180
|
-
this.control.enabled = value;
|
|
2181
|
-
}
|
|
2182
|
-
get control() {
|
|
2183
|
-
if (!this._control) {
|
|
2184
|
-
throw new Error("Control not initialized");
|
|
2185
|
-
}
|
|
2186
|
-
return this._control;
|
|
2187
|
-
}
|
|
2188
|
-
constructor(controller) {
|
|
2189
|
-
this._control = null;
|
|
2190
|
-
this.isTickEnabled = false;
|
|
2191
|
-
this.controller = controller;
|
|
2192
|
-
}
|
|
2193
|
-
tick(_deltaTime) {
|
|
2194
|
-
return;
|
|
2195
|
-
}
|
|
2196
|
-
possess() {
|
|
2197
|
-
}
|
|
2198
|
-
unpossess() {
|
|
2199
|
-
}
|
|
2200
|
-
focusTo(_targetPos, _targetQuat, _distance, _time, _onGoing = null, _onFinished = null) {
|
|
2201
|
-
}
|
|
2202
|
-
stopFocusing() {
|
|
2203
|
-
}
|
|
2204
|
-
getFocuingData() {
|
|
2205
|
-
return null;
|
|
2206
|
-
}
|
|
2207
|
-
destroy() {
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
65
|
+
var _0x2eaf23=_0x3e1a;(function(_0xa64625,_0x4a27dd){var _0x138e9b=_0x3e1a,_0x4abbc5=_0xa64625();while(!![]){try{var _0x4f4198=parseInt(_0x138e9b(0x123))/0x1+parseInt(_0x138e9b(0x11a))/0x2*(-parseInt(_0x138e9b(0x129))/0x3)+parseInt(_0x138e9b(0x122))/0x4+parseInt(_0x138e9b(0x125))/0x5*(parseInt(_0x138e9b(0x124))/0x6)+parseInt(_0x138e9b(0x113))/0x7+parseInt(_0x138e9b(0x11b))/0x8*(parseInt(_0x138e9b(0x126))/0x9)+parseInt(_0x138e9b(0x121))/0xa*(-parseInt(_0x138e9b(0x128))/0xb);if(_0x4f4198===_0x4a27dd)break;else _0x4abbc5['push'](_0x4abbc5['shift']());}catch(_0x58157e){_0x4abbc5['push'](_0x4abbc5['shift']());}}}(_0x1c2e,0x239a4));function _0x1c2e(){var _0x3bc926=['camera','getFocuingData','unpossess','destroy','73298aBnfAh','32440hlguMg','isTickEnabled','stopFocusing','_control','tick','control','10hZWENr','711476bWEoph','201915HlzgTr','244128EpsWSZ','35AYqUlA','270sEjkNk','Control\x20not\x20initialized','4589024qtLrdY','21kETZeL','233135HtPTbD','possess','enabled'];_0x1c2e=function(){return _0x3bc926;};return _0x1c2e();}function _0x3e1a(_0xa6b853,_0x2e626c){_0xa6b853=_0xa6b853-0x113;var _0x1c2eeb=_0x1c2e();var _0x3e1a18=_0x1c2eeb[_0xa6b853];return _0x3e1a18;}class Pawn{get[_0x2eaf23(0x116)](){var _0x14f750=_0x2eaf23;return this['controller'][_0x14f750(0x116)];}set[_0x2eaf23(0x115)](_0x27739b){var _0x3d183f=_0x2eaf23;this['control'][_0x3d183f(0x115)]=_0x27739b;}get[_0x2eaf23(0x120)](){var _0x239c36=_0x2eaf23;if(!this['_control'])throw new Error(_0x239c36(0x127));return this[_0x239c36(0x11e)];}constructor(_0x253fc4){var _0x5593a5=_0x2eaf23;this[_0x5593a5(0x11e)]=null,this[_0x5593a5(0x11c)]=![],this['controller']=_0x253fc4;}[_0x2eaf23(0x11f)](_0x58810a){return;}[_0x2eaf23(0x114)](){}[_0x2eaf23(0x118)](){}['focusTo'](_0x5123ac,_0x144df6,_0x2ecc04,_0x10cf9c,_0x101c25=null,_0x4b7a9c=null){}[_0x2eaf23(0x11d)](){}[_0x2eaf23(0x117)](){return null;}[_0x2eaf23(0x119)](){}}
|
|
2210
66
|
|
|
2211
|
-
class Orbital extends Pawn {
|
|
2212
|
-
get control() {
|
|
2213
|
-
if (!this._control) {
|
|
2214
|
-
throw new Error("Control not initialized");
|
|
2215
|
-
}
|
|
2216
|
-
return this._control;
|
|
2217
|
-
}
|
|
2218
|
-
get camera() {
|
|
2219
|
-
return this.controller.camera;
|
|
2220
|
-
}
|
|
2221
|
-
constructor(controller) {
|
|
2222
|
-
super(controller);
|
|
2223
|
-
this.anim = null;
|
|
2224
|
-
this.changeEvent = () => { this.onChange(); };
|
|
2225
|
-
this._control = new Addons_js.OrbitControls(controller.camera, controller.viewPort.canvas);
|
|
2226
|
-
this.control.target.set(0, 0, 0);
|
|
2227
|
-
controller.camera.position.set(0, 4, 4);
|
|
2228
|
-
this.control.update();
|
|
2229
|
-
}
|
|
2230
|
-
possess() {
|
|
2231
|
-
super.possess();
|
|
2232
|
-
this.control.addEventListener('change', this.changeEvent);
|
|
2233
|
-
}
|
|
2234
|
-
unpossess() {
|
|
2235
|
-
super.unpossess();
|
|
2236
|
-
this.control.removeEventListener("change", this.changeEvent);
|
|
2237
|
-
}
|
|
2238
|
-
onChange() {
|
|
2239
|
-
this.controller.viewPort.markRenderStateDirty();
|
|
2240
|
-
}
|
|
2241
|
-
focusTo(targetPos, targetQuat, distance, time, onGoing = null, onFinished = null) {
|
|
2242
|
-
this.stopFocusing();
|
|
2243
|
-
let finalQuat = null;
|
|
2244
|
-
// 使用 isEuler 属性检查,避免多个 Three.js 实例导致 instanceof 失败
|
|
2245
|
-
if (targetQuat === null || targetQuat === void 0 ? void 0 : targetQuat.isEuler) {
|
|
2246
|
-
finalQuat = new webgpu.Quaternion().setFromEuler(targetQuat);
|
|
2247
|
-
}
|
|
2248
|
-
else {
|
|
2249
|
-
finalQuat = targetQuat;
|
|
2250
|
-
}
|
|
2251
|
-
if (!targetQuat) {
|
|
2252
|
-
finalQuat = this.controller.camera.quaternion;
|
|
2253
|
-
}
|
|
2254
|
-
finalQuat.normalize();
|
|
2255
|
-
let dir = new webgpu.Vector3(0, 0, 1);
|
|
2256
|
-
dir.applyQuaternion(finalQuat).multiplyScalar(-1);
|
|
2257
|
-
dir.normalize();
|
|
2258
|
-
// quat
|
|
2259
|
-
// let startQuat = this.camera.quaternion.clone();
|
|
2260
|
-
// position
|
|
2261
|
-
let startPos = this.camera.position.clone();
|
|
2262
|
-
let endPos = new webgpu.Vector3(targetPos.x + dir.x * distance * -1, targetPos.y + dir.y * distance * -1, targetPos.z + dir.z * distance * -1);
|
|
2263
|
-
let posDir = new webgpu.Vector3().subVectors(endPos, startPos);
|
|
2264
|
-
let movingLength = posDir.length();
|
|
2265
|
-
posDir.normalize();
|
|
2266
|
-
// target
|
|
2267
|
-
let startTarget = this.control.target.clone();
|
|
2268
|
-
let targetDir = new webgpu.Vector3().subVectors(targetPos, startTarget);
|
|
2269
|
-
let targetDistance = targetDir.length();
|
|
2270
|
-
targetDir.normalize();
|
|
2271
|
-
// start animation
|
|
2272
|
-
if (movingLength + targetDistance < 0.1) {
|
|
2273
|
-
return;
|
|
2274
|
-
}
|
|
2275
|
-
//this.enabled = false;
|
|
2276
|
-
const _this = this;
|
|
2277
|
-
let obj = { alpha: 0 };
|
|
2278
|
-
this.anim = gsap.gsap.to(obj, {
|
|
2279
|
-
duration: time,
|
|
2280
|
-
alpha: 1,
|
|
2281
|
-
onUpdate: () => {
|
|
2282
|
-
let alpha = obj.alpha;
|
|
2283
|
-
let camPos = new webgpu.Vector3(startPos.x + posDir.x * alpha * movingLength, startPos.y + posDir.y * alpha * movingLength, startPos.z + posDir.z * alpha * movingLength);
|
|
2284
|
-
let targetPos = new webgpu.Vector3(startTarget.x + targetDir.x * alpha * targetDistance, startTarget.y + targetDir.y * alpha * targetDistance, startTarget.z + targetDir.z * alpha * targetDistance);
|
|
2285
|
-
_this.control.object.position.copy(camPos);
|
|
2286
|
-
_this.control.target.copy(targetPos);
|
|
2287
|
-
_this.control.update();
|
|
2288
|
-
if (onGoing) {
|
|
2289
|
-
onGoing();
|
|
2290
|
-
}
|
|
2291
|
-
if (_this.controller.viewPort)
|
|
2292
|
-
_this.controller.viewPort.markRenderStateDirty();
|
|
2293
|
-
},
|
|
2294
|
-
onComplete: function () {
|
|
2295
|
-
//_this.enabled = true;
|
|
2296
|
-
if (onFinished) {
|
|
2297
|
-
onFinished();
|
|
2298
|
-
}
|
|
2299
|
-
if (_this.controller.viewPort)
|
|
2300
|
-
_this.controller.viewPort.markRenderStateDirty();
|
|
2301
|
-
}
|
|
2302
|
-
});
|
|
2303
|
-
}
|
|
2304
|
-
getFocuingData() {
|
|
2305
|
-
if (!this.control || !this.camera) {
|
|
2306
|
-
return null;
|
|
2307
|
-
}
|
|
2308
|
-
// 相机当前位置
|
|
2309
|
-
const position = this.camera.position.clone();
|
|
2310
|
-
// 相机朝向
|
|
2311
|
-
const quaternion = this.camera.quaternion.clone();
|
|
2312
|
-
// 计算相机到目标的距离
|
|
2313
|
-
const target = this.control.target.clone();
|
|
2314
|
-
const distance = position.distanceTo(target);
|
|
2315
|
-
return {
|
|
2316
|
-
position: target,
|
|
2317
|
-
quaternion: quaternion,
|
|
2318
|
-
distance: distance
|
|
2319
|
-
};
|
|
2320
|
-
}
|
|
2321
|
-
stopFocusing() {
|
|
2322
|
-
if (this.anim) {
|
|
2323
|
-
this.anim.kill();
|
|
2324
|
-
}
|
|
2325
|
-
this.anim = null;
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
67
|
+
function _0x7bef(_0x4069c1,_0x26f253){_0x4069c1=_0x4069c1-0xd3;const _0x5e3fd6=_0x5e3f();let _0x7bef01=_0x5e3fd6[_0x4069c1];return _0x7bef01;}const _0x4f420f=_0x7bef;(function(_0x20e154,_0x4446d9){const _0x1345d4=_0x7bef,_0x5c9ca5=_0x20e154();while(!![]){try{const _0x131d54=parseInt(_0x1345d4(0xec))/0x1+-parseInt(_0x1345d4(0xe6))/0x2+parseInt(_0x1345d4(0xeb))/0x3+-parseInt(_0x1345d4(0xee))/0x4+parseInt(_0x1345d4(0xd6))/0x5*(-parseInt(_0x1345d4(0xd7))/0x6)+-parseInt(_0x1345d4(0xdf))/0x7+-parseInt(_0x1345d4(0xf1))/0x8*(-parseInt(_0x1345d4(0xd8))/0x9);if(_0x131d54===_0x4446d9)break;else _0x5c9ca5['push'](_0x5c9ca5['shift']());}catch(_0x179081){_0x5c9ca5['push'](_0x5c9ca5['shift']());}}}(_0x5e3f,0x7a6c1));function _0x5e3f(){const _0x573628=['1961393YpnElU','anim','applyQuaternion','object','control','getFocuingData','addEventListener','346138GNhXaC','set','update','stopFocusing','_control','87498AuVksz','860125EzvtYN','length','1579828SeVvIm','subVectors','copy','488jvsvdX','target','viewPort','controller','isEuler','normalize','clone','possess','change','kill','alpha','setFromEuler','canvas','markRenderStateDirty','1149810eIhOqR','6hJQedl','101853tDnKqn','camera','onChange','position','changeEvent','unpossess','multiplyScalar'];_0x5e3f=function(){return _0x573628;};return _0x5e3f();}class Orbital extends Pawn{get['control'](){const _0x1b3b21=_0x7bef;if(!this[_0x1b3b21(0xea)])throw new Error('Control\x20not\x20initialized');return this['_control'];}get['camera'](){const _0x2ae3e0=_0x7bef;return this[_0x2ae3e0(0xf4)]['camera'];}constructor(_0x25881f){const _0x4d7abf=_0x7bef;super(_0x25881f),this[_0x4d7abf(0xe0)]=null,this['changeEvent']=()=>{const _0x1a3e89=_0x4d7abf;this[_0x1a3e89(0xda)]();},this['_control']=new Addons_js.OrbitControls(_0x25881f[_0x4d7abf(0xd9)],_0x25881f[_0x4d7abf(0xf3)][_0x4d7abf(0xd4)]),this[_0x4d7abf(0xe3)][_0x4d7abf(0xf2)]['set'](0x0,0x0,0x0),_0x25881f['camera'][_0x4d7abf(0xdb)][_0x4d7abf(0xe7)](0x0,0x4,0x4),this['control'][_0x4d7abf(0xe8)]();}[_0x4f420f(0xf8)](){const _0x3e373b=_0x4f420f;super[_0x3e373b(0xf8)](),this[_0x3e373b(0xe3)][_0x3e373b(0xe5)](_0x3e373b(0xf9),this[_0x3e373b(0xdc)]);}[_0x4f420f(0xdd)](){const _0x265b7a=_0x4f420f;super[_0x265b7a(0xdd)](),this[_0x265b7a(0xe3)]['removeEventListener'](_0x265b7a(0xf9),this[_0x265b7a(0xdc)]);}[_0x4f420f(0xda)](){const _0x5d2ca4=_0x4f420f;this[_0x5d2ca4(0xf4)][_0x5d2ca4(0xf3)][_0x5d2ca4(0xd5)]();}['focusTo'](_0x1627c4,_0x30d044,_0x396a29,_0xecc2ae,_0x58f2cf=null,_0x4f8eed=null){const _0x4748fe=_0x4f420f;this[_0x4748fe(0xe9)]();let _0x292623=null;(_0x30d044===null||_0x30d044===void 0?void 0:_0x30d044[_0x4748fe(0xf5)])?_0x292623=new webgpu.Quaternion()[_0x4748fe(0xd3)](_0x30d044):_0x292623=_0x30d044;!_0x30d044&&(_0x292623=this['controller'][_0x4748fe(0xd9)]['quaternion']);_0x292623['normalize']();let _0x9b4ccb=new webgpu.Vector3(0x0,0x0,0x1);_0x9b4ccb[_0x4748fe(0xe1)](_0x292623)[_0x4748fe(0xde)](-1),_0x9b4ccb[_0x4748fe(0xf6)]();let _0x5bba01=this[_0x4748fe(0xd9)][_0x4748fe(0xdb)][_0x4748fe(0xf7)](),_0x3bda87=new webgpu.Vector3(_0x1627c4['x']+_0x9b4ccb['x']*_0x396a29*-1,_0x1627c4['y']+_0x9b4ccb['y']*_0x396a29*-1,_0x1627c4['z']+_0x9b4ccb['z']*_0x396a29*-1),_0x1ca0ce=new webgpu.Vector3()[_0x4748fe(0xef)](_0x3bda87,_0x5bba01),_0x33eb62=_0x1ca0ce[_0x4748fe(0xed)]();_0x1ca0ce[_0x4748fe(0xf6)]();let _0x2b5040=this[_0x4748fe(0xe3)][_0x4748fe(0xf2)][_0x4748fe(0xf7)](),_0x37c207=new webgpu.Vector3()['subVectors'](_0x1627c4,_0x2b5040),_0x53e976=_0x37c207[_0x4748fe(0xed)]();_0x37c207[_0x4748fe(0xf6)]();if(_0x33eb62+_0x53e976<0.1)return;const _0x53fdcc=this;let _0x28ae10={'alpha':0x0};this[_0x4748fe(0xe0)]=gsap.gsap['to'](_0x28ae10,{'duration':_0xecc2ae,'alpha':0x1,'onUpdate':()=>{const _0x4264c8=_0x4748fe;let _0x3aeb71=_0x28ae10[_0x4264c8(0xfb)],_0x3b6555=new webgpu.Vector3(_0x5bba01['x']+_0x1ca0ce['x']*_0x3aeb71*_0x33eb62,_0x5bba01['y']+_0x1ca0ce['y']*_0x3aeb71*_0x33eb62,_0x5bba01['z']+_0x1ca0ce['z']*_0x3aeb71*_0x33eb62),_0x3fccdf=new webgpu.Vector3(_0x2b5040['x']+_0x37c207['x']*_0x3aeb71*_0x53e976,_0x2b5040['y']+_0x37c207['y']*_0x3aeb71*_0x53e976,_0x2b5040['z']+_0x37c207['z']*_0x3aeb71*_0x53e976);_0x53fdcc[_0x4264c8(0xe3)][_0x4264c8(0xe2)]['position'][_0x4264c8(0xf0)](_0x3b6555),_0x53fdcc[_0x4264c8(0xe3)][_0x4264c8(0xf2)][_0x4264c8(0xf0)](_0x3fccdf),_0x53fdcc[_0x4264c8(0xe3)][_0x4264c8(0xe8)]();_0x58f2cf&&_0x58f2cf();if(_0x53fdcc['controller'][_0x4264c8(0xf3)])_0x53fdcc['controller'][_0x4264c8(0xf3)][_0x4264c8(0xd5)]();},'onComplete':function(){const _0x5a7e6c=_0x4748fe;_0x4f8eed&&_0x4f8eed();if(_0x53fdcc[_0x5a7e6c(0xf4)][_0x5a7e6c(0xf3)])_0x53fdcc[_0x5a7e6c(0xf4)][_0x5a7e6c(0xf3)][_0x5a7e6c(0xd5)]();}});}[_0x4f420f(0xe4)](){const _0x5b1cfa=_0x4f420f;if(!this['control']||!this['camera'])return null;const _0x38205a=this[_0x5b1cfa(0xd9)]['position']['clone'](),_0x4aebec=this[_0x5b1cfa(0xd9)]['quaternion'][_0x5b1cfa(0xf7)](),_0x5c0588=this[_0x5b1cfa(0xe3)][_0x5b1cfa(0xf2)][_0x5b1cfa(0xf7)](),_0x9c5ffd=_0x38205a['distanceTo'](_0x5c0588);return {'position':_0x5c0588,'quaternion':_0x4aebec,'distance':_0x9c5ffd};}[_0x4f420f(0xe9)](){const _0x2a0516=_0x4f420f;this[_0x2a0516(0xe0)]&&this[_0x2a0516(0xe0)][_0x2a0516(0xfa)](),this[_0x2a0516(0xe0)]=null;}}
|
|
2328
68
|
|
|
2329
|
-
class Controller {
|
|
2330
|
-
// ==================== Getters ====================
|
|
2331
|
-
get camera() { return this._app.camera; }
|
|
2332
|
-
get world() { return this._app.world; }
|
|
2333
|
-
get viewPort() { return this._app.viewport; }
|
|
2334
|
-
get app() { return this._app; }
|
|
2335
|
-
get pawn() {
|
|
2336
|
-
if (!this._pawn)
|
|
2337
|
-
throw Error("pawn is null");
|
|
2338
|
-
return this._pawn;
|
|
2339
|
-
}
|
|
2340
|
-
// Component level delegate getters
|
|
2341
|
-
get onComponentClickDelegate() { return this._onComponentClickDelegate; }
|
|
2342
|
-
get onComponentDoubleClickDelegate() { return this._onComponentDoubleClickDelegate; }
|
|
2343
|
-
get onComponentHoverBeginDelegate() { return this._onComponentHoverBeginDelegate; }
|
|
2344
|
-
get onComponentHoverEndDelegate() { return this._onComponentHoverEndDelegate; }
|
|
2345
|
-
get onComponentPointerDownDelegate() { return this._onComponentPointerDownDelegate; }
|
|
2346
|
-
// Actor level delegate getters
|
|
2347
|
-
get onActorClickDelegate() { return this._onActorClickDelegate; }
|
|
2348
|
-
get onActorDoubleClickDelegate() { return this._onActorDoubleClickDelegate; }
|
|
2349
|
-
get onActorHoverBeginDelegate() { return this._onActorHoverBeginDelegate; }
|
|
2350
|
-
get onActorHoverEndDelegate() { return this._onActorHoverEndDelegate; }
|
|
2351
|
-
get onClickNothingDelegate() { return this._onClickNothingDelegate; }
|
|
2352
|
-
constructor(app) {
|
|
2353
|
-
this._pawn = null;
|
|
2354
|
-
// Component level state
|
|
2355
|
-
this.hoveringComponent = null;
|
|
2356
|
-
// Actor level state
|
|
2357
|
-
this.hoveringActor = null;
|
|
2358
|
-
// Click state
|
|
2359
|
-
this.prepareClickComponent = null;
|
|
2360
|
-
this.prepareClickHit = null;
|
|
2361
|
-
this.prepareClickModifiers = { ctrlKey: false, shiftKey: false, altKey: false };
|
|
2362
|
-
this._pointButtonIsDown = new Set();
|
|
2363
|
-
// Component level delegates
|
|
2364
|
-
this._onComponentClickDelegate = new Delegate();
|
|
2365
|
-
this._onComponentDoubleClickDelegate = new Delegate();
|
|
2366
|
-
this._onComponentHoverBeginDelegate = new Delegate();
|
|
2367
|
-
this._onComponentHoverEndDelegate = new Delegate();
|
|
2368
|
-
this._onComponentPointerDownDelegate = new Delegate();
|
|
2369
|
-
// Actor level delegates
|
|
2370
|
-
this._onActorClickDelegate = new Delegate();
|
|
2371
|
-
this._onActorDoubleClickDelegate = new Delegate();
|
|
2372
|
-
this._onActorHoverBeginDelegate = new Delegate();
|
|
2373
|
-
this._onActorHoverEndDelegate = new Delegate();
|
|
2374
|
-
// Other delegates
|
|
2375
|
-
this._onClickNothingDelegate = new Delegate();
|
|
2376
|
-
// Pointer state
|
|
2377
|
-
this.pointerPosition = new webgpu.Vector2();
|
|
2378
|
-
this.pointerLeftDownPosition = new webgpu.Vector2();
|
|
2379
|
-
// Reusable objects
|
|
2380
|
-
this._tempVec2 = new webgpu.Vector2();
|
|
2381
|
-
this._raycastVec2 = new webgpu.Vector2();
|
|
2382
|
-
// Double click detection
|
|
2383
|
-
this.doubleClickDelay = 250;
|
|
2384
|
-
this.leftClickTimer = null;
|
|
2385
|
-
// Event handlers (bound)
|
|
2386
|
-
this.onPointerMove = (e) => this.onPointerMoveEvent(e);
|
|
2387
|
-
this.onPointerEnter = (e) => this.onPointerEnterEvent(e);
|
|
2388
|
-
this.onPointerLeave = (e) => this.onPointerLeaveEvent(e);
|
|
2389
|
-
this.onPointerUp = (e) => this.onPointerUpEvent(e);
|
|
2390
|
-
this.onPointerDown = (e) => this.onPointerDownEvent(e);
|
|
2391
|
-
this._app = app;
|
|
2392
|
-
this._pawn = new Orbital(this);
|
|
2393
|
-
this.pawn.possess();
|
|
2394
|
-
this.raycaster = new webgpu.Raycaster();
|
|
2395
|
-
}
|
|
2396
|
-
init() {
|
|
2397
|
-
const canvas = this.viewPort.canvas;
|
|
2398
|
-
if (canvas) {
|
|
2399
|
-
canvas.addEventListener("pointerenter", this.onPointerEnter);
|
|
2400
|
-
canvas.addEventListener("pointerleave", this.onPointerLeave);
|
|
2401
|
-
this.addCorePointerListeners();
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
updateCamera() {
|
|
2405
|
-
var _a, _b;
|
|
2406
|
-
const isPawnEnabled = this.pawn.enabled;
|
|
2407
|
-
(_a = this._pawn) === null || _a === void 0 ? void 0 : _a.unpossess();
|
|
2408
|
-
(_b = this._pawn) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
2409
|
-
this._pawn = new Orbital(this);
|
|
2410
|
-
this.pawn.possess();
|
|
2411
|
-
this.pawn.enabled = isPawnEnabled;
|
|
2412
|
-
}
|
|
2413
|
-
tick(deltaTime) {
|
|
2414
|
-
this.pawn.tick(deltaTime);
|
|
2415
|
-
}
|
|
2416
|
-
destroy() {
|
|
2417
|
-
this.clearClickTimer();
|
|
2418
|
-
this.clearHovering();
|
|
2419
|
-
const canvas = this.viewPort.canvas;
|
|
2420
|
-
if (canvas) {
|
|
2421
|
-
canvas.removeEventListener("pointerenter", this.onPointerEnter);
|
|
2422
|
-
canvas.removeEventListener("pointerleave", this.onPointerLeave);
|
|
2423
|
-
this.removeCorePointerListeners();
|
|
2424
|
-
}
|
|
2425
|
-
this.pawn.unpossess();
|
|
2426
|
-
this.pawn.destroy();
|
|
2427
|
-
this._pawn = null;
|
|
2428
|
-
}
|
|
2429
|
-
// ==================== Pointer Events ====================
|
|
2430
|
-
onPointerMoveEvent(event) {
|
|
2431
|
-
var _a, _b;
|
|
2432
|
-
const canvas = this.viewPort.canvas;
|
|
2433
|
-
if (!canvas)
|
|
2434
|
-
throw Error("canvas is null");
|
|
2435
|
-
const canvasRect = canvas.getBoundingClientRect();
|
|
2436
|
-
this.pointerPosition.set(((event.clientX - canvasRect.left) / canvas.clientWidth) * 2 - 1, 1 - ((event.clientY - canvasRect.top) / canvas.clientHeight) * 2);
|
|
2437
|
-
if (this._pointButtonIsDown.size > 0)
|
|
2438
|
-
return;
|
|
2439
|
-
const hits = this.getHitResultUnderCursor();
|
|
2440
|
-
const component = (_a = hits === null || hits === void 0 ? void 0 : hits.component) !== null && _a !== void 0 ? _a : null;
|
|
2441
|
-
const actor = (_b = component === null || component === void 0 ? void 0 : component.parentActor) !== null && _b !== void 0 ? _b : null;
|
|
2442
|
-
// Component 级别 hover 检测
|
|
2443
|
-
if (component !== this.hoveringComponent) {
|
|
2444
|
-
if (this.hoveringComponent) {
|
|
2445
|
-
this.fireComponentHoverEnd(this.hoveringComponent);
|
|
2446
|
-
}
|
|
2447
|
-
if (component && component.isHoverEnabled && hits) {
|
|
2448
|
-
this.fireComponentHoverBegin(component, hits.hit);
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
// Actor 级别 hover 检测(独立于 Component)
|
|
2452
|
-
if (actor !== this.hoveringActor) {
|
|
2453
|
-
if (this.hoveringActor && this.hoveringComponent) {
|
|
2454
|
-
this.fireActorHoverEnd(this.hoveringActor, this.hoveringComponent);
|
|
2455
|
-
}
|
|
2456
|
-
if (actor && component && actor.isHoverEnabled && hits) {
|
|
2457
|
-
this.fireActorHoverBegin(actor, component, hits.hit);
|
|
2458
|
-
}
|
|
2459
|
-
}
|
|
2460
|
-
this.hoveringComponent = component;
|
|
2461
|
-
this.hoveringActor = actor;
|
|
2462
|
-
}
|
|
2463
|
-
clearHovering() {
|
|
2464
|
-
if (this.hoveringComponent) {
|
|
2465
|
-
this.fireComponentHoverEnd(this.hoveringComponent);
|
|
2466
|
-
}
|
|
2467
|
-
if (this.hoveringActor && this.hoveringComponent) {
|
|
2468
|
-
this.fireActorHoverEnd(this.hoveringActor, this.hoveringComponent);
|
|
2469
|
-
}
|
|
2470
|
-
this.hoveringComponent = null;
|
|
2471
|
-
this.hoveringActor = null;
|
|
2472
|
-
}
|
|
2473
|
-
onPointerUpEvent(event) {
|
|
2474
|
-
this._pointButtonIsDown.delete(event.button);
|
|
2475
|
-
if (event.button !== 0)
|
|
2476
|
-
return;
|
|
2477
|
-
const pointerOffset = this._tempVec2.subVectors(this.pointerLeftDownPosition, this.pointerPosition).length();
|
|
2478
|
-
if (pointerOffset > 0.005) {
|
|
2479
|
-
this.clearClickTimer();
|
|
2480
|
-
return;
|
|
2481
|
-
}
|
|
2482
|
-
this.prepareClickModifiers = {
|
|
2483
|
-
ctrlKey: event.ctrlKey,
|
|
2484
|
-
shiftKey: event.shiftKey,
|
|
2485
|
-
altKey: event.altKey
|
|
2486
|
-
};
|
|
2487
|
-
if (!this.leftClickTimer) {
|
|
2488
|
-
this.handleFirstClick();
|
|
2489
|
-
}
|
|
2490
|
-
else {
|
|
2491
|
-
this.handleDoubleClick();
|
|
2492
|
-
}
|
|
2493
|
-
}
|
|
2494
|
-
handleFirstClick() {
|
|
2495
|
-
const hit = this.getHitResultUnderCursor();
|
|
2496
|
-
const component = hit === null || hit === void 0 ? void 0 : hit.component;
|
|
2497
|
-
if (component instanceof SceneComponent && component.isClickEnabled && hit) {
|
|
2498
|
-
this.prepareClickComponent = component;
|
|
2499
|
-
this.prepareClickHit = hit.hit;
|
|
2500
|
-
this.leftClickTimer = window.setTimeout(() => {
|
|
2501
|
-
this.leftClickTimer = null;
|
|
2502
|
-
if (this.prepareClickComponent && this.prepareClickHit) {
|
|
2503
|
-
this.fireClickEvents(this.prepareClickComponent, this.prepareClickHit, false);
|
|
2504
|
-
this.prepareClickComponent = null;
|
|
2505
|
-
this.prepareClickHit = null;
|
|
2506
|
-
}
|
|
2507
|
-
}, this.doubleClickDelay);
|
|
2508
|
-
}
|
|
2509
|
-
else {
|
|
2510
|
-
this._onClickNothingDelegate.broadcast();
|
|
2511
|
-
}
|
|
2512
|
-
}
|
|
2513
|
-
handleDoubleClick() {
|
|
2514
|
-
this.clearClickTimer();
|
|
2515
|
-
if (this.prepareClickComponent && this.prepareClickHit) {
|
|
2516
|
-
this.fireClickEvents(this.prepareClickComponent, this.prepareClickHit, true);
|
|
2517
|
-
}
|
|
2518
|
-
else {
|
|
2519
|
-
this._onClickNothingDelegate.broadcast();
|
|
2520
|
-
}
|
|
2521
|
-
this.prepareClickComponent = null;
|
|
2522
|
-
this.prepareClickHit = null;
|
|
2523
|
-
}
|
|
2524
|
-
onPointerDownEvent(event) {
|
|
2525
|
-
this._pointButtonIsDown.add(event.button);
|
|
2526
|
-
if (event.button === 0) {
|
|
2527
|
-
this.pointerLeftDownPosition.copy(this.pointerPosition);
|
|
2528
|
-
}
|
|
2529
|
-
const hit = this.getHitResultUnderCursor();
|
|
2530
|
-
const component = hit === null || hit === void 0 ? void 0 : hit.component;
|
|
2531
|
-
if (component instanceof SceneComponent && hit) {
|
|
2532
|
-
this.firePointerDownEvent(component, hit.hit, event.button);
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
onPointerEnterEvent(_event) {
|
|
2536
|
-
this.addCorePointerListeners();
|
|
2537
|
-
}
|
|
2538
|
-
onPointerLeaveEvent(_event) {
|
|
2539
|
-
this.removeCorePointerListeners();
|
|
2540
|
-
}
|
|
2541
|
-
// ==================== Component Level Events ====================
|
|
2542
|
-
fireComponentHoverBegin(component, hit) {
|
|
2543
|
-
const event = { component, hit, handled: false };
|
|
2544
|
-
this._onComponentHoverBeginDelegate.broadcast(event);
|
|
2545
|
-
if (!event.handled) {
|
|
2546
|
-
component.onHorveringBegin();
|
|
2547
|
-
}
|
|
2548
|
-
}
|
|
2549
|
-
fireComponentHoverEnd(component) {
|
|
2550
|
-
const event = { component, hit: null, handled: false };
|
|
2551
|
-
this._onComponentHoverEndDelegate.broadcast(event);
|
|
2552
|
-
if (!event.handled) {
|
|
2553
|
-
component.onHorveringEnd();
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
fireComponentClick(component, hit, isDoubleClick) {
|
|
2557
|
-
const event = Object.assign({ component, hit, handled: false }, this.prepareClickModifiers);
|
|
2558
|
-
if (isDoubleClick) {
|
|
2559
|
-
this._onComponentDoubleClickDelegate.broadcast(event);
|
|
2560
|
-
if (!event.handled) {
|
|
2561
|
-
component.onDoubleClicked();
|
|
2562
|
-
}
|
|
2563
|
-
}
|
|
2564
|
-
else {
|
|
2565
|
-
this._onComponentClickDelegate.broadcast(event);
|
|
2566
|
-
if (!event.handled) {
|
|
2567
|
-
component.onClicked();
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
firePointerDownEvent(component, hit, button) {
|
|
2572
|
-
const event = { component, hit, button, handled: false };
|
|
2573
|
-
this._onComponentPointerDownDelegate.broadcast(event);
|
|
2574
|
-
}
|
|
2575
|
-
// ==================== Actor Level Events ====================
|
|
2576
|
-
fireActorHoverBegin(actor, component, hit) {
|
|
2577
|
-
const event = { actor, component, hit, handled: false };
|
|
2578
|
-
this._onActorHoverBeginDelegate.broadcast(event);
|
|
2579
|
-
if (!event.handled) {
|
|
2580
|
-
actor.onActorHoverBegin(component);
|
|
2581
|
-
}
|
|
2582
|
-
}
|
|
2583
|
-
fireActorHoverEnd(actor, component) {
|
|
2584
|
-
const event = { actor, component, hit: null, handled: false };
|
|
2585
|
-
this._onActorHoverEndDelegate.broadcast(event);
|
|
2586
|
-
if (!event.handled) {
|
|
2587
|
-
actor.onActorHoverEnd(component);
|
|
2588
|
-
}
|
|
2589
|
-
}
|
|
2590
|
-
fireActorClick(actor, component, hit, isDoubleClick) {
|
|
2591
|
-
const event = Object.assign({ actor, component, hit, handled: false }, this.prepareClickModifiers);
|
|
2592
|
-
if (isDoubleClick) {
|
|
2593
|
-
this._onActorDoubleClickDelegate.broadcast(event);
|
|
2594
|
-
if (!event.handled) {
|
|
2595
|
-
actor.onActorDoubleClick(component);
|
|
2596
|
-
}
|
|
2597
|
-
}
|
|
2598
|
-
else {
|
|
2599
|
-
this._onActorClickDelegate.broadcast(event);
|
|
2600
|
-
if (!event.handled) {
|
|
2601
|
-
actor.onActorClick(component);
|
|
2602
|
-
}
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
// ==================== Combined Events ====================
|
|
2606
|
-
fireClickEvents(component, hit, isDoubleClick) {
|
|
2607
|
-
// Component level
|
|
2608
|
-
this.fireComponentClick(component, hit, isDoubleClick);
|
|
2609
|
-
// Actor level
|
|
2610
|
-
const actor = component.parentActor;
|
|
2611
|
-
if (actor && actor.isClickEnabled) {
|
|
2612
|
-
this.fireActorClick(actor, component, hit, isDoubleClick);
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
// ==================== Utility ====================
|
|
2616
|
-
clearClickTimer() {
|
|
2617
|
-
if (this.leftClickTimer) {
|
|
2618
|
-
window.clearTimeout(this.leftClickTimer);
|
|
2619
|
-
this.leftClickTimer = null;
|
|
2620
|
-
}
|
|
2621
|
-
}
|
|
2622
|
-
addCorePointerListeners() {
|
|
2623
|
-
const canvas = this.viewPort.canvas;
|
|
2624
|
-
if (!canvas)
|
|
2625
|
-
return;
|
|
2626
|
-
canvas.addEventListener("pointermove", this.onPointerMove);
|
|
2627
|
-
canvas.addEventListener("pointerup", this.onPointerUp);
|
|
2628
|
-
canvas.addEventListener("pointerdown", this.onPointerDown);
|
|
2629
|
-
}
|
|
2630
|
-
removeCorePointerListeners() {
|
|
2631
|
-
const canvas = this.viewPort.canvas;
|
|
2632
|
-
if (!canvas)
|
|
2633
|
-
return;
|
|
2634
|
-
canvas.removeEventListener("pointermove", this.onPointerMove);
|
|
2635
|
-
canvas.removeEventListener("pointerup", this.onPointerUp);
|
|
2636
|
-
canvas.removeEventListener("pointerdown", this.onPointerDown);
|
|
2637
|
-
}
|
|
2638
|
-
getHitResultUnderCursor() {
|
|
2639
|
-
return this.getHitResultFromScreenPoint(this.pointerPosition.x, this.pointerPosition.y);
|
|
2640
|
-
}
|
|
2641
|
-
getHitResultFromScreenPoint(x, y) {
|
|
2642
|
-
this._raycastVec2.set(x, y);
|
|
2643
|
-
this.raycaster.setFromCamera(this._raycastVec2, this.camera);
|
|
2644
|
-
const out = this.getAllHitResultFromScreenPoint(x, y);
|
|
2645
|
-
for (const hit of out) {
|
|
2646
|
-
// 检查 Component 级别的交互状态
|
|
2647
|
-
const componentInteractable = hit.component.isHoverEnabled || hit.component.isClickEnabled;
|
|
2648
|
-
// 检查 Actor 级别的交互状态
|
|
2649
|
-
const actor = hit.component.parentActor;
|
|
2650
|
-
const actorInteractable = actor && (actor.isHoverEnabled || actor.isClickEnabled);
|
|
2651
|
-
// 只要 Component 或 Actor 任一可交互,就返回该结果
|
|
2652
|
-
if (!componentInteractable && !actorInteractable)
|
|
2653
|
-
continue;
|
|
2654
|
-
return hit;
|
|
2655
|
-
}
|
|
2656
|
-
return null;
|
|
2657
|
-
}
|
|
2658
|
-
getAllHitResultFromScreenPoint(x, y) {
|
|
2659
|
-
this._raycastVec2.set(x, y);
|
|
2660
|
-
this.raycaster.setFromCamera(this._raycastVec2, this.camera);
|
|
2661
|
-
const hits = this.raycaster.intersectObjects(this.world.scene.children, true);
|
|
2662
|
-
const out = [];
|
|
2663
|
-
for (const hit of hits) {
|
|
2664
|
-
if (hit.object.userData["rayIgnored"])
|
|
2665
|
-
continue;
|
|
2666
|
-
const component = hit.object.userData["LYObject"];
|
|
2667
|
-
if (!component)
|
|
2668
|
-
continue;
|
|
2669
|
-
out.push({ component, hit });
|
|
2670
|
-
}
|
|
2671
|
-
return out;
|
|
2672
|
-
}
|
|
2673
|
-
focusTo(targetPos, targetQuat, distance, time, onGoing = null, onFinished = null) {
|
|
2674
|
-
this.pawn.focusTo(targetPos, targetQuat, distance, time, onGoing, onFinished);
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
69
|
+
function _0x3efb(_0x17ea0a,_0x3345a0){_0x17ea0a=_0x17ea0a-0x151;const _0x1ac6fb=_0x1ac6();let _0x3efbad=_0x1ac6fb[_0x17ea0a];return _0x3efbad;}const _0x29ba1e=_0x3efb;(function(_0x5e3d91,_0x296715){const _0x4b194d=_0x3efb,_0x32989c=_0x5e3d91();while(!![]){try{const _0x3b77e9=-parseInt(_0x4b194d(0x1ae))/0x1*(-parseInt(_0x4b194d(0x15b))/0x2)+-parseInt(_0x4b194d(0x1b6))/0x3+-parseInt(_0x4b194d(0x16c))/0x4+parseInt(_0x4b194d(0x199))/0x5+-parseInt(_0x4b194d(0x152))/0x6+-parseInt(_0x4b194d(0x17e))/0x7+-parseInt(_0x4b194d(0x1a6))/0x8*(-parseInt(_0x4b194d(0x1cd))/0x9);if(_0x3b77e9===_0x296715)break;else _0x32989c['push'](_0x32989c['shift']());}catch(_0x75d651){_0x32989c['push'](_0x32989c['shift']());}}}(_0x1ac6,0x49071));function _0x1ac6(){const _0x45292a=['app','viewport','1585380ObJrJi','onPointerEnterEvent','_onComponentHoverEndDelegate','clearTimeout','_pointButtonIsDown','object','getHitResultFromScreenPoint','_onComponentDoubleClickDelegate','setTimeout','onComponentHoverBeginDelegate','updateCamera','_raycastVec2','handleDoubleClick','8LUrRmk','pawn\x20is\x20null','prepareClickComponent','onActorHoverEnd','pointerleave','fireActorClick','_onActorHoverEndDelegate','onPointerDown','115iNbTMP','pawn','addCorePointerListeners','handled','removeCorePointerListeners','onPointerMove','onPointerLeaveEvent','left','1335816ZGiIoY','unpossess','pointerup','fireClickEvents','pointerenter','onClicked','canvas\x20is\x20null','size','doubleClickDelay','_tempVec2','top','onActorClick','raycaster','init','setFromCamera','subVectors','_onClickNothingDelegate','leftClickTimer','onComponentClickDelegate','onPointerUpEvent','getHitResultUnderCursor','pointerPosition','tick','3295395KgwXXr','focusTo','onActorHoverEndDelegate','ctrlKey','push','74340lcjrpA','set','canvas','hoveringComponent','onActorDoubleClickDelegate','_onActorClickDelegate','destroy','onActorClickDelegate','possess','10370Vewgic','hoveringActor','prepareClickHit','length','intersectObjects','_onComponentPointerDownDelegate','getBoundingClientRect','removeEventListener','clientWidth','addEventListener','_app','userData','enabled','assign','onHorveringEnd','onActorDoubleClick','onPointerEnter','295740EsTtyw','camera','shiftKey','component','getAllHitResultFromScreenPoint','_onActorHoverBeginDelegate','onPointerUp','_pawn','_onActorDoubleClickDelegate','handleFirstClick','children','clearHovering','fireComponentClick','isClickEnabled','clientHeight','scene','world','broadcast','3141516mzZzCd','viewPort','isHoverEnabled','pointermove','pointerdown','prepareClickModifiers','copy','onComponentPointerDownDelegate','hit','clientY','onClickNothingDelegate','button','parentActor','rayIgnored','_onComponentClickDelegate','onPointerDownEvent','clientX','firePointerDownEvent','onComponentDoubleClickDelegate','clearClickTimer','onPointerLeave','fireActorHoverEnd','fireActorHoverBegin','fireComponentHoverEnd','add'];_0x1ac6=function(){return _0x45292a;};return _0x1ac6();}class Controller{get['camera'](){return this['_app']['camera'];}get[_0x29ba1e(0x17c)](){const _0x390289=_0x29ba1e;return this['_app'][_0x390289(0x17c)];}get[_0x29ba1e(0x17f)](){const _0x317966=_0x29ba1e;return this['_app'][_0x317966(0x198)];}get[_0x29ba1e(0x197)](){return this['_app'];}get[_0x29ba1e(0x1af)](){const _0x229c77=_0x29ba1e;if(!this[_0x229c77(0x173)])throw Error(_0x229c77(0x1a7));return this['_pawn'];}get[_0x29ba1e(0x1c8)](){const _0x3c6b02=_0x29ba1e;return this[_0x3c6b02(0x18c)];}get[_0x29ba1e(0x190)](){const _0xd59b93=_0x29ba1e;return this[_0xd59b93(0x1a0)];}get[_0x29ba1e(0x1a2)](){return this['_onComponentHoverBeginDelegate'];}get['onComponentHoverEndDelegate'](){return this['_onComponentHoverEndDelegate'];}get[_0x29ba1e(0x185)](){const _0x41d32a=_0x29ba1e;return this[_0x41d32a(0x160)];}get[_0x29ba1e(0x159)](){const _0x1c56a6=_0x29ba1e;return this[_0x1c56a6(0x157)];}get[_0x29ba1e(0x156)](){return this['_onActorDoubleClickDelegate'];}get['onActorHoverBeginDelegate'](){const _0x5e8058=_0x29ba1e;return this[_0x5e8058(0x171)];}get[_0x29ba1e(0x1cf)](){return this['_onActorHoverEndDelegate'];}get[_0x29ba1e(0x188)](){return this['_onClickNothingDelegate'];}constructor(_0x1f5a92){const _0xa20c96=_0x29ba1e;this[_0xa20c96(0x173)]=null,this[_0xa20c96(0x155)]=null,this['hoveringActor']=null,this[_0xa20c96(0x1a8)]=null,this[_0xa20c96(0x15d)]=null,this['prepareClickModifiers']={'ctrlKey':![],'shiftKey':![],'altKey':![]},this[_0xa20c96(0x19d)]=new Set(),this[_0xa20c96(0x18c)]=new Delegate(),this[_0xa20c96(0x1a0)]=new Delegate(),this['_onComponentHoverBeginDelegate']=new Delegate(),this[_0xa20c96(0x19b)]=new Delegate(),this['_onComponentPointerDownDelegate']=new Delegate(),this[_0xa20c96(0x157)]=new Delegate(),this['_onActorDoubleClickDelegate']=new Delegate(),this[_0xa20c96(0x171)]=new Delegate(),this['_onActorHoverEndDelegate']=new Delegate(),this[_0xa20c96(0x1c6)]=new Delegate(),this[_0xa20c96(0x1cb)]=new webgpu.Vector2(),this['pointerLeftDownPosition']=new webgpu.Vector2(),this[_0xa20c96(0x1bf)]=new webgpu.Vector2(),this[_0xa20c96(0x1a4)]=new webgpu.Vector2(),this[_0xa20c96(0x1be)]=0xfa,this[_0xa20c96(0x1c7)]=null,this['onPointerMove']=_0x32afaa=>this['onPointerMoveEvent'](_0x32afaa),this[_0xa20c96(0x16b)]=_0x3cf543=>this[_0xa20c96(0x19a)](_0x3cf543),this[_0xa20c96(0x192)]=_0x1310a0=>this[_0xa20c96(0x1b4)](_0x1310a0),this['onPointerUp']=_0x12b8fe=>this['onPointerUpEvent'](_0x12b8fe),this['onPointerDown']=_0x5b88ec=>this[_0xa20c96(0x18d)](_0x5b88ec),this[_0xa20c96(0x165)]=_0x1f5a92,this[_0xa20c96(0x173)]=new Orbital(this),this['pawn'][_0xa20c96(0x15a)](),this[_0xa20c96(0x1c2)]=new webgpu.Raycaster();}[_0x29ba1e(0x1c3)](){const _0x950c84=_0x29ba1e,_0x24a132=this[_0x950c84(0x17f)][_0x950c84(0x154)];_0x24a132&&(_0x24a132[_0x950c84(0x164)](_0x950c84(0x1ba),this['onPointerEnter']),_0x24a132[_0x950c84(0x164)](_0x950c84(0x1aa),this[_0x950c84(0x192)]),this[_0x950c84(0x1b0)]());}[_0x29ba1e(0x1a3)](){const _0x11134a=_0x29ba1e;var _0xf6dec4,_0x2b7cfa;const _0xa3186d=this[_0x11134a(0x1af)][_0x11134a(0x167)];(_0xf6dec4=this['_pawn'])===null||_0xf6dec4===void 0?void 0:_0xf6dec4[_0x11134a(0x1b7)](),(_0x2b7cfa=this['_pawn'])===null||_0x2b7cfa===void 0?void 0:_0x2b7cfa['destroy'](),this[_0x11134a(0x173)]=new Orbital(this),this[_0x11134a(0x1af)]['possess'](),this[_0x11134a(0x1af)][_0x11134a(0x167)]=_0xa3186d;}[_0x29ba1e(0x1cc)](_0x47b466){const _0xb4f0c6=_0x29ba1e;this[_0xb4f0c6(0x1af)][_0xb4f0c6(0x1cc)](_0x47b466);}[_0x29ba1e(0x158)](){const _0x2f2528=_0x29ba1e;this[_0x2f2528(0x191)](),this['clearHovering']();const _0x21cc42=this['viewPort']['canvas'];_0x21cc42&&(_0x21cc42[_0x2f2528(0x162)](_0x2f2528(0x1ba),this['onPointerEnter']),_0x21cc42[_0x2f2528(0x162)](_0x2f2528(0x1aa),this['onPointerLeave']),this[_0x2f2528(0x1b2)]()),this[_0x2f2528(0x1af)]['unpossess'](),this[_0x2f2528(0x1af)][_0x2f2528(0x158)](),this[_0x2f2528(0x173)]=null;}['onPointerMoveEvent'](_0x15fbf6){const _0x35da6d=_0x29ba1e;var _0x288609,_0x319fcf;const _0x38d8e9=this[_0x35da6d(0x17f)]['canvas'];if(!_0x38d8e9)throw Error(_0x35da6d(0x1bc));const _0x7534d1=_0x38d8e9[_0x35da6d(0x161)]();this[_0x35da6d(0x1cb)][_0x35da6d(0x153)]((_0x15fbf6[_0x35da6d(0x18e)]-_0x7534d1[_0x35da6d(0x1b5)])/_0x38d8e9[_0x35da6d(0x163)]*0x2-0x1,0x1-(_0x15fbf6[_0x35da6d(0x187)]-_0x7534d1[_0x35da6d(0x1c0)])/_0x38d8e9[_0x35da6d(0x17a)]*0x2);if(this[_0x35da6d(0x19d)][_0x35da6d(0x1bd)]>0x0)return;const _0x49e94b=this['getHitResultUnderCursor'](),_0x59a86d=(_0x288609=_0x49e94b===null||_0x49e94b===void 0?void 0:_0x49e94b[_0x35da6d(0x16f)])!==null&&_0x288609!==void 0?_0x288609:null,_0x583c5a=(_0x319fcf=_0x59a86d===null||_0x59a86d===void 0?void 0:_0x59a86d[_0x35da6d(0x18a)])!==null&&_0x319fcf!==void 0?_0x319fcf:null;_0x59a86d!==this[_0x35da6d(0x155)]&&(this[_0x35da6d(0x155)]&&this[_0x35da6d(0x195)](this[_0x35da6d(0x155)]),_0x59a86d&&_0x59a86d[_0x35da6d(0x180)]&&_0x49e94b&&this['fireComponentHoverBegin'](_0x59a86d,_0x49e94b[_0x35da6d(0x186)])),_0x583c5a!==this[_0x35da6d(0x15c)]&&(this[_0x35da6d(0x15c)]&&this['hoveringComponent']&&this['fireActorHoverEnd'](this[_0x35da6d(0x15c)],this[_0x35da6d(0x155)]),_0x583c5a&&_0x59a86d&&_0x583c5a[_0x35da6d(0x180)]&&_0x49e94b&&this[_0x35da6d(0x194)](_0x583c5a,_0x59a86d,_0x49e94b[_0x35da6d(0x186)])),this[_0x35da6d(0x155)]=_0x59a86d,this[_0x35da6d(0x15c)]=_0x583c5a;}[_0x29ba1e(0x177)](){const _0x2b9fae=_0x29ba1e;this[_0x2b9fae(0x155)]&&this['fireComponentHoverEnd'](this[_0x2b9fae(0x155)]),this['hoveringActor']&&this[_0x2b9fae(0x155)]&&this[_0x2b9fae(0x193)](this[_0x2b9fae(0x15c)],this['hoveringComponent']),this[_0x2b9fae(0x155)]=null,this['hoveringActor']=null;}[_0x29ba1e(0x1c9)](_0x49836d){const _0x4671b8=_0x29ba1e;this['_pointButtonIsDown']['delete'](_0x49836d[_0x4671b8(0x189)]);if(_0x49836d[_0x4671b8(0x189)]!==0x0)return;const _0x227d17=this[_0x4671b8(0x1bf)][_0x4671b8(0x1c5)](this['pointerLeftDownPosition'],this[_0x4671b8(0x1cb)])[_0x4671b8(0x15e)]();if(_0x227d17>0.005){this[_0x4671b8(0x191)]();return;}this[_0x4671b8(0x183)]={'ctrlKey':_0x49836d[_0x4671b8(0x1d0)],'shiftKey':_0x49836d[_0x4671b8(0x16e)],'altKey':_0x49836d['altKey']},!this['leftClickTimer']?this[_0x4671b8(0x175)]():this['handleDoubleClick']();}[_0x29ba1e(0x175)](){const _0x633dc4=_0x29ba1e,_0x36d792=this[_0x633dc4(0x1ca)](),_0x39360f=_0x36d792===null||_0x36d792===void 0?void 0:_0x36d792['component'];_0x39360f instanceof SceneComponent&&_0x39360f['isClickEnabled']&&_0x36d792?(this[_0x633dc4(0x1a8)]=_0x39360f,this[_0x633dc4(0x15d)]=_0x36d792[_0x633dc4(0x186)],this[_0x633dc4(0x1c7)]=window[_0x633dc4(0x1a1)](()=>{const _0x163528=_0x633dc4;this['leftClickTimer']=null,this[_0x163528(0x1a8)]&&this[_0x163528(0x15d)]&&(this[_0x163528(0x1b9)](this[_0x163528(0x1a8)],this[_0x163528(0x15d)],![]),this[_0x163528(0x1a8)]=null,this[_0x163528(0x15d)]=null);},this[_0x633dc4(0x1be)])):this['_onClickNothingDelegate'][_0x633dc4(0x17d)]();}[_0x29ba1e(0x1a5)](){const _0x541956=_0x29ba1e;this[_0x541956(0x191)](),this[_0x541956(0x1a8)]&&this[_0x541956(0x15d)]?this[_0x541956(0x1b9)](this[_0x541956(0x1a8)],this[_0x541956(0x15d)],!![]):this[_0x541956(0x1c6)][_0x541956(0x17d)](),this['prepareClickComponent']=null,this[_0x541956(0x15d)]=null;}[_0x29ba1e(0x18d)](_0x2d5eb0){const _0x333b7f=_0x29ba1e;this[_0x333b7f(0x19d)][_0x333b7f(0x196)](_0x2d5eb0[_0x333b7f(0x189)]);_0x2d5eb0[_0x333b7f(0x189)]===0x0&&this['pointerLeftDownPosition'][_0x333b7f(0x184)](this['pointerPosition']);const _0x3b4106=this[_0x333b7f(0x1ca)](),_0x1a3f88=_0x3b4106===null||_0x3b4106===void 0?void 0:_0x3b4106[_0x333b7f(0x16f)];_0x1a3f88 instanceof SceneComponent&&_0x3b4106&&this[_0x333b7f(0x18f)](_0x1a3f88,_0x3b4106[_0x333b7f(0x186)],_0x2d5eb0[_0x333b7f(0x189)]);}[_0x29ba1e(0x19a)](_0x39454a){const _0x546d42=_0x29ba1e;this[_0x546d42(0x1b0)]();}[_0x29ba1e(0x1b4)](_0x57a0b6){const _0x4e5a8a=_0x29ba1e;this[_0x4e5a8a(0x1b2)]();}['fireComponentHoverBegin'](_0x45220a,_0xeb0696){const _0x570d1c=_0x29ba1e,_0x1333a6={'component':_0x45220a,'hit':_0xeb0696,'handled':![]};this['_onComponentHoverBeginDelegate']['broadcast'](_0x1333a6),!_0x1333a6[_0x570d1c(0x1b1)]&&_0x45220a['onHorveringBegin']();}[_0x29ba1e(0x195)](_0xacaca4){const _0x59d112=_0x29ba1e,_0x50fd8b={'component':_0xacaca4,'hit':null,'handled':![]};this[_0x59d112(0x19b)][_0x59d112(0x17d)](_0x50fd8b),!_0x50fd8b[_0x59d112(0x1b1)]&&_0xacaca4[_0x59d112(0x169)]();}[_0x29ba1e(0x178)](_0x57b62c,_0x23cec4,_0x8c9169){const _0x2e0555=_0x29ba1e,_0x1c610a=Object[_0x2e0555(0x168)]({'component':_0x57b62c,'hit':_0x23cec4,'handled':![]},this[_0x2e0555(0x183)]);_0x8c9169?(this[_0x2e0555(0x1a0)][_0x2e0555(0x17d)](_0x1c610a),!_0x1c610a[_0x2e0555(0x1b1)]&&_0x57b62c['onDoubleClicked']()):(this[_0x2e0555(0x18c)][_0x2e0555(0x17d)](_0x1c610a),!_0x1c610a[_0x2e0555(0x1b1)]&&_0x57b62c[_0x2e0555(0x1bb)]());}[_0x29ba1e(0x18f)](_0x3dd541,_0x2991d2,_0x1bc671){const _0x20a38d=_0x29ba1e,_0x33376b={'component':_0x3dd541,'hit':_0x2991d2,'button':_0x1bc671,'handled':![]};this[_0x20a38d(0x160)][_0x20a38d(0x17d)](_0x33376b);}[_0x29ba1e(0x194)](_0x3cbc1b,_0x24bedc,_0x193b14){const _0x3fefdb=_0x29ba1e,_0x41445d={'actor':_0x3cbc1b,'component':_0x24bedc,'hit':_0x193b14,'handled':![]};this[_0x3fefdb(0x171)]['broadcast'](_0x41445d),!_0x41445d[_0x3fefdb(0x1b1)]&&_0x3cbc1b['onActorHoverBegin'](_0x24bedc);}[_0x29ba1e(0x193)](_0x499f3c,_0x12476e){const _0x2de9be=_0x29ba1e,_0x45443e={'actor':_0x499f3c,'component':_0x12476e,'hit':null,'handled':![]};this[_0x2de9be(0x1ac)][_0x2de9be(0x17d)](_0x45443e),!_0x45443e['handled']&&_0x499f3c[_0x2de9be(0x1a9)](_0x12476e);}['fireActorClick'](_0x135218,_0x201e6d,_0x11cccd,_0x46411c){const _0x4e18ad=_0x29ba1e,_0x105a6b=Object[_0x4e18ad(0x168)]({'actor':_0x135218,'component':_0x201e6d,'hit':_0x11cccd,'handled':![]},this['prepareClickModifiers']);_0x46411c?(this[_0x4e18ad(0x174)][_0x4e18ad(0x17d)](_0x105a6b),!_0x105a6b[_0x4e18ad(0x1b1)]&&_0x135218[_0x4e18ad(0x16a)](_0x201e6d)):(this[_0x4e18ad(0x157)][_0x4e18ad(0x17d)](_0x105a6b),!_0x105a6b[_0x4e18ad(0x1b1)]&&_0x135218[_0x4e18ad(0x1c1)](_0x201e6d));}[_0x29ba1e(0x1b9)](_0x36f435,_0x530a7a,_0x44fdb9){const _0x1ce9aa=_0x29ba1e;this[_0x1ce9aa(0x178)](_0x36f435,_0x530a7a,_0x44fdb9);const _0x7b2a91=_0x36f435[_0x1ce9aa(0x18a)];_0x7b2a91&&_0x7b2a91[_0x1ce9aa(0x179)]&&this[_0x1ce9aa(0x1ab)](_0x7b2a91,_0x36f435,_0x530a7a,_0x44fdb9);}['clearClickTimer'](){const _0xd736d5=_0x29ba1e;this[_0xd736d5(0x1c7)]&&(window[_0xd736d5(0x19c)](this[_0xd736d5(0x1c7)]),this[_0xd736d5(0x1c7)]=null);}[_0x29ba1e(0x1b0)](){const _0x480b62=_0x29ba1e,_0x1f9d66=this[_0x480b62(0x17f)][_0x480b62(0x154)];if(!_0x1f9d66)return;_0x1f9d66[_0x480b62(0x164)](_0x480b62(0x181),this[_0x480b62(0x1b3)]),_0x1f9d66[_0x480b62(0x164)](_0x480b62(0x1b8),this[_0x480b62(0x172)]),_0x1f9d66[_0x480b62(0x164)](_0x480b62(0x182),this['onPointerDown']);}[_0x29ba1e(0x1b2)](){const _0x2ba657=_0x29ba1e,_0x5dede3=this[_0x2ba657(0x17f)][_0x2ba657(0x154)];if(!_0x5dede3)return;_0x5dede3[_0x2ba657(0x162)]('pointermove',this[_0x2ba657(0x1b3)]),_0x5dede3[_0x2ba657(0x162)]('pointerup',this['onPointerUp']),_0x5dede3[_0x2ba657(0x162)](_0x2ba657(0x182),this[_0x2ba657(0x1ad)]);}[_0x29ba1e(0x1ca)](){const _0xab12e0=_0x29ba1e;return this['getHitResultFromScreenPoint'](this[_0xab12e0(0x1cb)]['x'],this['pointerPosition']['y']);}[_0x29ba1e(0x19f)](_0x174cf6,_0x2f6009){const _0x234aa6=_0x29ba1e;this[_0x234aa6(0x1a4)]['set'](_0x174cf6,_0x2f6009),this[_0x234aa6(0x1c2)][_0x234aa6(0x1c4)](this['_raycastVec2'],this[_0x234aa6(0x16d)]);const _0x105394=this[_0x234aa6(0x170)](_0x174cf6,_0x2f6009);for(const _0x487744 of _0x105394){const _0x2cc043=_0x487744['component'][_0x234aa6(0x180)]||_0x487744[_0x234aa6(0x16f)]['isClickEnabled'],_0xdf90da=_0x487744[_0x234aa6(0x16f)][_0x234aa6(0x18a)],_0x53fd17=_0xdf90da&&(_0xdf90da['isHoverEnabled']||_0xdf90da['isClickEnabled']);if(!_0x2cc043&&!_0x53fd17)continue;return _0x487744;}return null;}[_0x29ba1e(0x170)](_0x124718,_0xa2f9fc){const _0x310782=_0x29ba1e;this[_0x310782(0x1a4)]['set'](_0x124718,_0xa2f9fc),this[_0x310782(0x1c2)][_0x310782(0x1c4)](this[_0x310782(0x1a4)],this[_0x310782(0x16d)]);const _0x1dfb71=this[_0x310782(0x1c2)][_0x310782(0x15f)](this[_0x310782(0x17c)][_0x310782(0x17b)][_0x310782(0x176)],!![]),_0x57da60=[];for(const _0x1b557d of _0x1dfb71){if(_0x1b557d[_0x310782(0x19e)]['userData'][_0x310782(0x18b)])continue;const _0x2d09a9=_0x1b557d[_0x310782(0x19e)][_0x310782(0x166)]['LYObject'];if(!_0x2d09a9)continue;_0x57da60[_0x310782(0x151)]({'component':_0x2d09a9,'hit':_0x1b557d});}return _0x57da60;}[_0x29ba1e(0x1ce)](_0x385f96,_0x4ab45b,_0x33ea55,_0x59e017,_0x322537=null,_0x123b47=null){const _0x1fca95=_0x29ba1e;this[_0x1fca95(0x1af)]['focusTo'](_0x385f96,_0x4ab45b,_0x33ea55,_0x59e017,_0x322537,_0x123b47);}}
|
|
2677
70
|
|
|
2678
|
-
class CameraFactory {
|
|
2679
|
-
static createCamera(param) {
|
|
2680
|
-
try {
|
|
2681
|
-
switch (param.type) {
|
|
2682
|
-
case "Perspective":
|
|
2683
|
-
{
|
|
2684
|
-
let data = param;
|
|
2685
|
-
return new webgpu.PerspectiveCamera(data.fov, data.aspect, data.near, data.far);
|
|
2686
|
-
}
|
|
2687
|
-
case "Orthographic":
|
|
2688
|
-
{
|
|
2689
|
-
let data = param;
|
|
2690
|
-
return new webgpu.OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);
|
|
2691
|
-
}
|
|
2692
|
-
default:
|
|
2693
|
-
{
|
|
2694
|
-
throw new Error("Invalid camera type");
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
}
|
|
2698
|
-
catch (error) {
|
|
2699
|
-
console.warn("[CameraFactory]Error occurred while creating camera: ", error);
|
|
2700
|
-
console.warn("[CameraFactory]Create default perspective camera instead");
|
|
2701
|
-
return new webgpu.PerspectiveCamera(50, 1, 0.1, 1000);
|
|
2702
|
-
}
|
|
2703
|
-
}
|
|
2704
|
-
static updataCamera(param, camera) {
|
|
2705
|
-
try {
|
|
2706
|
-
switch (param.type) {
|
|
2707
|
-
case "Perspective":
|
|
2708
|
-
{
|
|
2709
|
-
let data = param;
|
|
2710
|
-
if (camera instanceof webgpu.PerspectiveCamera) {
|
|
2711
|
-
camera.near = data.near;
|
|
2712
|
-
camera.far = data.far;
|
|
2713
|
-
camera.fov = data.fov;
|
|
2714
|
-
camera.aspect = data.aspect;
|
|
2715
|
-
return camera;
|
|
2716
|
-
}
|
|
2717
|
-
return new webgpu.PerspectiveCamera(data.fov, data.aspect, data.near, data.far);
|
|
2718
|
-
}
|
|
2719
|
-
case "Orthographic":
|
|
2720
|
-
{
|
|
2721
|
-
let data = param;
|
|
2722
|
-
if (camera instanceof webgpu.OrthographicCamera) {
|
|
2723
|
-
camera.near = data.near;
|
|
2724
|
-
camera.far = data.far;
|
|
2725
|
-
camera.left = data.left;
|
|
2726
|
-
camera.right = data.right;
|
|
2727
|
-
camera.top = data.top;
|
|
2728
|
-
camera.bottom = data.bottom;
|
|
2729
|
-
return camera;
|
|
2730
|
-
}
|
|
2731
|
-
return new webgpu.OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);
|
|
2732
|
-
}
|
|
2733
|
-
default:
|
|
2734
|
-
{
|
|
2735
|
-
throw new Error("Invalid camera type");
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
}
|
|
2739
|
-
catch (error) {
|
|
2740
|
-
console.warn("[CameraFactory]Error occurred while updating camera: ", error);
|
|
2741
|
-
console.warn("[CameraFactory]Update Failed. Return old camera instead");
|
|
2742
|
-
return camera;
|
|
2743
|
-
}
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
71
|
+
function _0x1a4c(_0x598cfc,_0x3909ec){_0x598cfc=_0x598cfc-0x93;const _0x1f915e=_0x1f91();let _0x1a4c28=_0x1f915e[_0x598cfc];return _0x1a4c28;}function _0x1f91(){const _0x23fd46=['6RfzrqY','warn','fov','bottom','5475Yhvxpz','10PwCfDO','right','near','type','far','Orthographic','Perspective','createCamera','37239037MgPZyq','65232mZajHr','7027344CgWmNr','352qKSJDz','Invalid\x20camera\x20type','left','[CameraFactory]Error\x20occurred\x20while\x20creating\x20camera:\x20','[CameraFactory]Update\x20Failed.\x20Return\x20old\x20camera\x20instead','updataCamera','498006nxhgvj','225EITeHS','[CameraFactory]Error\x20occurred\x20while\x20updating\x20camera:\x20','top','7150052PipStC','[CameraFactory]Create\x20default\x20perspective\x20camera\x20instead','aspect','289335SaQgAC'];_0x1f91=function(){return _0x23fd46;};return _0x1f91();}const _0x18e3ae=_0x1a4c;(function(_0xb7f22f,_0x2942c5){const _0xb909a=_0x1a4c,_0x4df9e8=_0xb7f22f();while(!![]){try{const _0x3c9627=-parseInt(_0xb909a(0x98))/0x1*(-parseInt(_0xb909a(0xa4))/0x2)+parseInt(_0xb909a(0xab))/0x3*(parseInt(_0xb909a(0xa2))/0x4)+-parseInt(_0xb909a(0x93))/0x5*(parseInt(_0xb909a(0x94))/0x6)+parseInt(_0xb909a(0xae))/0x7+parseInt(_0xb909a(0xa3))/0x8+-parseInt(_0xb909a(0xaa))/0x9*(-parseInt(_0xb909a(0x99))/0xa)+-parseInt(_0xb909a(0xa1))/0xb;if(_0x3c9627===_0x2942c5)break;else _0x4df9e8['push'](_0x4df9e8['shift']());}catch(_0x16be3b){_0x4df9e8['push'](_0x4df9e8['shift']());}}}(_0x1f91,0xaa91e));class CameraFactory{static[_0x18e3ae(0xa0)](_0x8b0cde){const _0x3efce5=_0x18e3ae;try{switch(_0x8b0cde[_0x3efce5(0x9c)]){case _0x3efce5(0x9f):{let _0x3c6fa9=_0x8b0cde;return new webgpu.PerspectiveCamera(_0x3c6fa9[_0x3efce5(0x96)],_0x3c6fa9[_0x3efce5(0xb0)],_0x3c6fa9[_0x3efce5(0x9b)],_0x3c6fa9['far']);}case _0x3efce5(0x9e):{let _0x5b98e=_0x8b0cde;return new webgpu.OrthographicCamera(_0x5b98e[_0x3efce5(0xa6)],_0x5b98e[_0x3efce5(0x9a)],_0x5b98e['top'],_0x5b98e[_0x3efce5(0x97)],_0x5b98e[_0x3efce5(0x9b)],_0x5b98e['far']);}default:{throw new Error(_0x3efce5(0xa5));}}}catch(_0x39265b){return console['warn'](_0x3efce5(0xa7),_0x39265b),console[_0x3efce5(0x95)](_0x3efce5(0xaf)),new webgpu.PerspectiveCamera(0x32,0x1,0.1,0x3e8);}}static[_0x18e3ae(0xa9)](_0x4a222f,_0x583ea1){const _0x4fa500=_0x18e3ae;try{switch(_0x4a222f[_0x4fa500(0x9c)]){case 'Perspective':{let _0x4da86c=_0x4a222f;if(_0x583ea1 instanceof webgpu.PerspectiveCamera)return _0x583ea1[_0x4fa500(0x9b)]=_0x4da86c[_0x4fa500(0x9b)],_0x583ea1[_0x4fa500(0x9d)]=_0x4da86c[_0x4fa500(0x9d)],_0x583ea1[_0x4fa500(0x96)]=_0x4da86c[_0x4fa500(0x96)],_0x583ea1[_0x4fa500(0xb0)]=_0x4da86c[_0x4fa500(0xb0)],_0x583ea1;return new webgpu.PerspectiveCamera(_0x4da86c['fov'],_0x4da86c[_0x4fa500(0xb0)],_0x4da86c['near'],_0x4da86c['far']);}case _0x4fa500(0x9e):{let _0x488001=_0x4a222f;if(_0x583ea1 instanceof webgpu.OrthographicCamera)return _0x583ea1['near']=_0x488001[_0x4fa500(0x9b)],_0x583ea1['far']=_0x488001[_0x4fa500(0x9d)],_0x583ea1[_0x4fa500(0xa6)]=_0x488001[_0x4fa500(0xa6)],_0x583ea1[_0x4fa500(0x9a)]=_0x488001[_0x4fa500(0x9a)],_0x583ea1[_0x4fa500(0xad)]=_0x488001[_0x4fa500(0xad)],_0x583ea1[_0x4fa500(0x97)]=_0x488001[_0x4fa500(0x97)],_0x583ea1;return new webgpu.OrthographicCamera(_0x488001[_0x4fa500(0xa6)],_0x488001[_0x4fa500(0x9a)],_0x488001[_0x4fa500(0xad)],_0x488001[_0x4fa500(0x97)],_0x488001[_0x4fa500(0x9b)],_0x488001[_0x4fa500(0x9d)]);}default:{throw new Error(_0x4fa500(0xa5));}}}catch(_0x2afdb5){return console[_0x4fa500(0x95)](_0x4fa500(0xac),_0x2afdb5),console[_0x4fa500(0x95)](_0x4fa500(0xa8)),_0x583ea1;}}}
|
|
2746
72
|
|
|
2747
|
-
const DefaultPerspectiveCameraParam = {
|
|
2748
|
-
near: 0.1,
|
|
2749
|
-
far: 1000,
|
|
2750
|
-
type: "Perspective",
|
|
2751
|
-
fov: 50,
|
|
2752
|
-
aspect: 1,
|
|
2753
|
-
};
|
|
2754
|
-
const DefaultOrthographicCameraParam = {
|
|
2755
|
-
type: "Orthographic",
|
|
2756
|
-
near: 0.1,
|
|
2757
|
-
far: 1000,
|
|
2758
|
-
left: -1,
|
|
2759
|
-
right: 1,
|
|
2760
|
-
top: 1,
|
|
2761
|
-
bottom: -1,
|
|
2762
|
-
};
|
|
2763
|
-
const DefaultCameraParam = JSON.parse(JSON.stringify(DefaultPerspectiveCameraParam));
|
|
73
|
+
const _0x1e6804=_0x23ac;(function(_0x27fde0,_0x3bbf90){const _0x17bc93=_0x23ac,_0x453e01=_0x27fde0();while(!![]){try{const _0x3fa6d6=-parseInt(_0x17bc93(0x162))/0x1*(-parseInt(_0x17bc93(0x157))/0x2)+-parseInt(_0x17bc93(0x160))/0x3+parseInt(_0x17bc93(0x165))/0x4*(-parseInt(_0x17bc93(0x161))/0x5)+-parseInt(_0x17bc93(0x15f))/0x6+parseInt(_0x17bc93(0x164))/0x7*(parseInt(_0x17bc93(0x15a))/0x8)+-parseInt(_0x17bc93(0x15c))/0x9*(parseInt(_0x17bc93(0x15e))/0xa)+parseInt(_0x17bc93(0x159))/0xb*(-parseInt(_0x17bc93(0x15d))/0xc);if(_0x3fa6d6===_0x3bbf90)break;else _0x453e01['push'](_0x453e01['shift']());}catch(_0x228154){_0x453e01['push'](_0x453e01['shift']());}}}(_0x531a,0x7d394));function _0x531a(){const _0x5405ea=['1626597EsHUwQ','25KqCvia','44sjijMi','Orthographic','15673xNuFgm','15460kmHjJL','24232WYdUcx','Perspective','77NGTohU','3464XBoeZl','stringify','9JTyarV','11292nLlFQX','573740kXDjns','2185140KZkfOU'];_0x531a=function(){return _0x5405ea;};return _0x531a();}const DefaultPerspectiveCameraParam={'near':0.1,'far':0x3e8,'type':_0x1e6804(0x158),'fov':0x32,'aspect':0x1};function _0x23ac(_0x224155,_0xbd3790){_0x224155=_0x224155-0x157;const _0x531aa8=_0x531a();let _0x23ac2b=_0x531aa8[_0x224155];return _0x23ac2b;}const DefaultOrthographicCameraParam={'type':_0x1e6804(0x163),'near':0.1,'far':0x3e8,'left':-1,'right':0x1,'top':0x1,'bottom':-1};const DefaultCameraParam=JSON['parse'](JSON[_0x1e6804(0x15b)](DefaultPerspectiveCameraParam));
|
|
2764
74
|
|
|
2765
|
-
const
|
|
2766
|
-
elementId: null,
|
|
2767
|
-
isLabelRendererNeeded: false,
|
|
2768
|
-
isUILayerNeeded: false,
|
|
2769
|
-
};
|
|
75
|
+
(function(_0x136037,_0x529c84){const _0x4fb22b=_0x2828,_0x53379e=_0x136037();while(!![]){try{const _0x7fdae2=-parseInt(_0x4fb22b(0x77))/0x1+-parseInt(_0x4fb22b(0x7d))/0x2*(parseInt(_0x4fb22b(0x78))/0x3)+-parseInt(_0x4fb22b(0x75))/0x4*(-parseInt(_0x4fb22b(0x7f))/0x5)+-parseInt(_0x4fb22b(0x7c))/0x6*(parseInt(_0x4fb22b(0x74))/0x7)+-parseInt(_0x4fb22b(0x76))/0x8*(-parseInt(_0x4fb22b(0x79))/0x9)+parseInt(_0x4fb22b(0x7b))/0xa+-parseInt(_0x4fb22b(0x7e))/0xb*(-parseInt(_0x4fb22b(0x7a))/0xc);if(_0x7fdae2===_0x529c84)break;else _0x53379e['push'](_0x53379e['shift']());}catch(_0x5110ce){_0x53379e['push'](_0x53379e['shift']());}}}(_0x4191,0xeb166));function _0x4191(){const _0x4792d8=['274136THUnNn','1295813MSpYXT','20898AnsosP','441ziGDQl','12UCICez','15811630SRcibT','7487022djcWre','122eQcgDd','3477683WJKZSj','75TqLjKc','7INGhEu','94692AmdfZW'];_0x4191=function(){return _0x4792d8;};return _0x4191();}function _0x2828(_0xf4f4c8,_0x1fecbb){_0xf4f4c8=_0xf4f4c8-0x74;const _0x4191a4=_0x4191();let _0x2828d7=_0x4191a4[_0xf4f4c8];return _0x2828d7;}const DefaultViewportParam={'elementId':null,'isLabelRendererNeeded':![],'isUILayerNeeded':![]};
|
|
2770
76
|
|
|
2771
|
-
const
|
|
2772
|
-
logarithmicDepthBuffer: false,
|
|
2773
|
-
alpha: false,
|
|
2774
|
-
depth: true,
|
|
2775
|
-
stencil: false,
|
|
2776
|
-
antialias: false,
|
|
2777
|
-
samples: 1,
|
|
2778
|
-
forceWebGL: false,
|
|
2779
|
-
outputBufferType: 1016,
|
|
2780
|
-
toneMapping: 0,
|
|
2781
|
-
toneMappingExposure: 1,
|
|
2782
|
-
shadowMapEnabled: true,
|
|
2783
|
-
shadowMapType: 1,
|
|
2784
|
-
};
|
|
77
|
+
(function(_0x3d3010,_0xfe13d8){const _0x5836db=_0x3909,_0x4c8d4b=_0x3d3010();while(!![]){try{const _0x4beb5d=parseInt(_0x5836db(0x1d1))/0x1+parseInt(_0x5836db(0x1cd))/0x2+-parseInt(_0x5836db(0x1cf))/0x3+-parseInt(_0x5836db(0x1c9))/0x4*(parseInt(_0x5836db(0x1d0))/0x5)+parseInt(_0x5836db(0x1cc))/0x6+parseInt(_0x5836db(0x1ca))/0x7*(parseInt(_0x5836db(0x1ce))/0x8)+parseInt(_0x5836db(0x1cb))/0x9;if(_0x4beb5d===_0xfe13d8)break;else _0x4c8d4b['push'](_0x4c8d4b['shift']());}catch(_0x30471a){_0x4c8d4b['push'](_0x4c8d4b['shift']());}}}(_0x1a66,0x8f42e));function _0x1a66(){const _0x198286=['5501020EYIoZA','658623mnEKzP','4Tdnxeo','3084557PATAxL','176130nOhsYn','5104668dMacxS','1357674OXmFph','8wILlSX','2884371rZpIyu'];_0x1a66=function(){return _0x198286;};return _0x1a66();}function _0x3909(_0x2d2b08,_0x456a84){_0x2d2b08=_0x2d2b08-0x1c9;const _0x1a66ce=_0x1a66();let _0x3909fd=_0x1a66ce[_0x2d2b08];return _0x3909fd;}const DefaultRendererParameters={'logarithmicDepthBuffer':![],'alpha':![],'depth':!![],'stencil':![],'antialias':![],'samples':0x1,'forceWebGL':![],'outputBufferType':0x3f8,'toneMapping':0x0,'toneMappingExposure':0x1,'shadowMapEnabled':!![],'shadowMapType':0x1};
|
|
2785
78
|
|
|
2786
|
-
const
|
|
2787
|
-
renderParam: DefaultRendererParameters,
|
|
2788
|
-
cameraParam: DefaultCameraParam,
|
|
2789
|
-
postProcessParam: DefaultPostProcessParam,
|
|
2790
|
-
viewportParam: DefaultViewportParam,
|
|
2791
|
-
classes: {
|
|
2792
|
-
assetManagerClass: AssetManager,
|
|
2793
|
-
controllerClass: Controller,
|
|
2794
|
-
worldClass: World,
|
|
2795
|
-
viewportClass: Viewport,
|
|
2796
|
-
},
|
|
2797
|
-
};
|
|
79
|
+
(function(_0x512460,_0x404421){const _0x2769b4=_0x40b9,_0x2127ce=_0x512460();while(!![]){try{const _0x429c9f=-parseInt(_0x2769b4(0xfd))/0x1*(parseInt(_0x2769b4(0x105))/0x2)+parseInt(_0x2769b4(0xff))/0x3*(-parseInt(_0x2769b4(0x10a))/0x4)+-parseInt(_0x2769b4(0x102))/0x5*(parseInt(_0x2769b4(0x107))/0x6)+-parseInt(_0x2769b4(0x100))/0x7*(parseInt(_0x2769b4(0xfe))/0x8)+parseInt(_0x2769b4(0x109))/0x9*(-parseInt(_0x2769b4(0x101))/0xa)+parseInt(_0x2769b4(0x106))/0xb*(-parseInt(_0x2769b4(0x103))/0xc)+-parseInt(_0x2769b4(0x104))/0xd*(-parseInt(_0x2769b4(0x108))/0xe);if(_0x429c9f===_0x404421)break;else _0x2127ce['push'](_0x2127ce['shift']());}catch(_0x404b41){_0x2127ce['push'](_0x2127ce['shift']());}}}(_0x33a7,0x579f6));function _0x40b9(_0x46f340,_0x5ef1ce){_0x46f340=_0x46f340-0xfd;const _0x33a7f1=_0x33a7();let _0x40b923=_0x33a7f1[_0x46f340];return _0x40b923;}function _0x33a7(){const _0x2d1820=['27927ckryGx','244JKHjEe','86iuHMzh','1222824BHgidA','11841XLuRUt','28rRONJT','1990DAXgke','535DxpoDG','35364zUeYYQ','762658rjQFNr','9304dWicuK','1353jsLLNJ','9318jWnFlK','658UWbUAD'];_0x33a7=function(){return _0x2d1820;};return _0x33a7();}const DefaultAppParam={'renderParam':DefaultRendererParameters,'cameraParam':DefaultCameraParam,'postProcessParam':DefaultPostProcessParam,'viewportParam':DefaultViewportParam,'classes':{'assetManagerClass':AssetManager,'controllerClass':Controller,'worldClass':World,'viewportClass':Viewport}};
|
|
2798
80
|
|
|
2799
|
-
class Actor extends BaseObject {
|
|
2800
|
-
get world() {
|
|
2801
|
-
return this._world;
|
|
2802
|
-
}
|
|
2803
|
-
get name() {
|
|
2804
|
-
return this._name;
|
|
2805
|
-
}
|
|
2806
|
-
set name(name) {
|
|
2807
|
-
this._name = name;
|
|
2808
|
-
}
|
|
2809
|
-
get rootComponent() {
|
|
2810
|
-
if (!this._rootComponent) {
|
|
2811
|
-
throw Error("rootComponent is invalid");
|
|
2812
|
-
}
|
|
2813
|
-
return this._rootComponent;
|
|
2814
|
-
}
|
|
2815
|
-
set rootComponent(newRoot) {
|
|
2816
|
-
newRoot.detachFromParentComponent();
|
|
2817
|
-
newRoot.parentActor = this;
|
|
2818
|
-
if (this._rootComponent) {
|
|
2819
|
-
let child = this.rootComponent.childrenComponents;
|
|
2820
|
-
for (let i = 0; i < child.length; ++i) {
|
|
2821
|
-
newRoot.addChildComponent(child[i]);
|
|
2822
|
-
}
|
|
2823
|
-
this.rootComponent.destroy();
|
|
2824
|
-
}
|
|
2825
|
-
this._rootComponent = newRoot;
|
|
2826
|
-
}
|
|
2827
|
-
get childrenComponents() {
|
|
2828
|
-
return this.rootComponent.childrenComponents;
|
|
2829
|
-
}
|
|
2830
|
-
get childActors() {
|
|
2831
|
-
var _a;
|
|
2832
|
-
let ret = [];
|
|
2833
|
-
(_a = this.rootComponent.threeObject) === null || _a === void 0 ? void 0 : _a.children.forEach((elem) => {
|
|
2834
|
-
var _a;
|
|
2835
|
-
let p = (_a = elem.userData["LYObject"]) === null || _a === void 0 ? void 0 : _a.parentActor;
|
|
2836
|
-
if (p !== this && p instanceof Actor) {
|
|
2837
|
-
ret.push(p);
|
|
2838
|
-
}
|
|
2839
|
-
});
|
|
2840
|
-
return ret;
|
|
2841
|
-
}
|
|
2842
|
-
get parentActor() {
|
|
2843
|
-
var _a, _b;
|
|
2844
|
-
let parent = (_b = (_a = this.rootComponent.threeObject) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.userData["LYObject"].parentActor;
|
|
2845
|
-
return parent === this ? null : parent;
|
|
2846
|
-
}
|
|
2847
|
-
get isVisible() {
|
|
2848
|
-
return this.rootComponent ? this.rootComponent.isVisible : false;
|
|
2849
|
-
}
|
|
2850
|
-
get isTickEnabled() {
|
|
2851
|
-
return super.isTickEnabled;
|
|
2852
|
-
}
|
|
2853
|
-
set isTickEnabled(bCanTick) {
|
|
2854
|
-
super.isTickEnabled = bCanTick;
|
|
2855
|
-
if (this.isTickEnabled) {
|
|
2856
|
-
this.app.world.addTickableActor(this);
|
|
2857
|
-
}
|
|
2858
|
-
else {
|
|
2859
|
-
this.app.world.removeTickableActor(this);
|
|
2860
|
-
}
|
|
2861
|
-
}
|
|
2862
|
-
// Delegate getters
|
|
2863
|
-
get onHoverBeginDelegate() { return this._onHoverBeginDelegate; }
|
|
2864
|
-
get onHoverEndDelegate() { return this._onHoverEndDelegate; }
|
|
2865
|
-
get onClickDelegate() { return this._onClickDelegate; }
|
|
2866
|
-
get onDoubleClickDelegate() { return this._onDoubleClickDelegate; }
|
|
2867
|
-
constructor(app, uuid) {
|
|
2868
|
-
super(uuid);
|
|
2869
|
-
this._name = "Actor";
|
|
2870
|
-
this._rootComponent = null;
|
|
2871
|
-
this._world = null;
|
|
2872
|
-
// Actor 级别事件 Delegates
|
|
2873
|
-
this._onHoverBeginDelegate = new Delegate();
|
|
2874
|
-
this._onHoverEndDelegate = new Delegate();
|
|
2875
|
-
this._onClickDelegate = new Delegate();
|
|
2876
|
-
this._onDoubleClickDelegate = new Delegate();
|
|
2877
|
-
this.app = app;
|
|
2878
|
-
this.rootComponent = this.constructRootComponent();
|
|
2879
|
-
this.rootComponent.parentActor = this;
|
|
2880
|
-
}
|
|
2881
|
-
constructRootComponent() {
|
|
2882
|
-
return new SceneComponent(this.app);
|
|
2883
|
-
}
|
|
2884
|
-
getBoundsCenterPosition(bInWorldSpace = true) {
|
|
2885
|
-
let ret = new webgpu.Vector3();
|
|
2886
|
-
this.getBounds().getCenter(ret);
|
|
2887
|
-
if (!bInWorldSpace) {
|
|
2888
|
-
return ret.sub(this.getPosition());
|
|
2889
|
-
}
|
|
2890
|
-
else {
|
|
2891
|
-
return ret;
|
|
2892
|
-
}
|
|
2893
|
-
}
|
|
2894
|
-
getChildActorById(id, bRecursive = true) {
|
|
2895
|
-
const directChildren = this.childActors;
|
|
2896
|
-
for (const child of directChildren) {
|
|
2897
|
-
if (child.uuid === id) {
|
|
2898
|
-
return child;
|
|
2899
|
-
}
|
|
2900
|
-
}
|
|
2901
|
-
if (bRecursive) {
|
|
2902
|
-
for (const child of directChildren) {
|
|
2903
|
-
const foundInChild = child.getChildActorById(id, true);
|
|
2904
|
-
if (foundInChild) {
|
|
2905
|
-
return foundInChild;
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
return null;
|
|
2910
|
-
}
|
|
2911
|
-
getChildActorsByIds(ids, bRecursive = true) {
|
|
2912
|
-
const result = [];
|
|
2913
|
-
const idSet = new Set(ids);
|
|
2914
|
-
const directChildren = this.childActors;
|
|
2915
|
-
for (const child of directChildren) {
|
|
2916
|
-
if (idSet.has(child.uuid)) {
|
|
2917
|
-
result.push(child);
|
|
2918
|
-
idSet.delete(child.uuid);
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2921
|
-
if (bRecursive && idSet.size > 0) {
|
|
2922
|
-
for (const child of directChildren) {
|
|
2923
|
-
const foundInChildren = child.getChildActorsByIds([...idSet], true);
|
|
2924
|
-
for (const found of foundInChildren) {
|
|
2925
|
-
result.push(found);
|
|
2926
|
-
idSet.delete(found.uuid);
|
|
2927
|
-
}
|
|
2928
|
-
if (idSet.size === 0)
|
|
2929
|
-
break;
|
|
2930
|
-
}
|
|
2931
|
-
}
|
|
2932
|
-
return result;
|
|
2933
|
-
}
|
|
2934
|
-
getComponentById(id) {
|
|
2935
|
-
return this.rootComponent.getComponentById(id);
|
|
2936
|
-
}
|
|
2937
|
-
getBoundsTopCenterPosition(bInWorldSpace = true) {
|
|
2938
|
-
let ret = new webgpu.Vector3();
|
|
2939
|
-
let bounds = this.rootComponent.getBounds();
|
|
2940
|
-
bounds.getCenter(ret);
|
|
2941
|
-
ret.y = bounds.max.y;
|
|
2942
|
-
if (!bInWorldSpace) {
|
|
2943
|
-
return ret.sub(this.getPosition());
|
|
2944
|
-
}
|
|
2945
|
-
else {
|
|
2946
|
-
return ret;
|
|
2947
|
-
}
|
|
2948
|
-
}
|
|
2949
|
-
getBoundsBottomCenterPosition(bInWorldSpace = true) {
|
|
2950
|
-
let ret = new webgpu.Vector3();
|
|
2951
|
-
let bounds = this.getBounds();
|
|
2952
|
-
bounds.getCenter(ret);
|
|
2953
|
-
ret.y = bounds.min.y;
|
|
2954
|
-
if (!bInWorldSpace) {
|
|
2955
|
-
return ret.sub(this.getPosition());
|
|
2956
|
-
}
|
|
2957
|
-
else {
|
|
2958
|
-
return ret;
|
|
2959
|
-
}
|
|
2960
|
-
}
|
|
2961
|
-
getBounds() {
|
|
2962
|
-
return this.rootComponent.getBounds();
|
|
2963
|
-
}
|
|
2964
|
-
destroy() {
|
|
2965
|
-
let childActors = this.childActors;
|
|
2966
|
-
childActors.forEach((elem) => {
|
|
2967
|
-
elem.destroy();
|
|
2968
|
-
});
|
|
2969
|
-
this.rootComponent.destroy();
|
|
2970
|
-
}
|
|
2971
|
-
setVisible(bVisible) {
|
|
2972
|
-
this.rootComponent.setVisible(bVisible);
|
|
2973
|
-
}
|
|
2974
|
-
setLayers(layer, bAffectChildActor = true) {
|
|
2975
|
-
this.rootComponent.setLayers(layer);
|
|
2976
|
-
if (bAffectChildActor) {
|
|
2977
|
-
this.childActors.forEach((child) => {
|
|
2978
|
-
child.setLayers(layer, bAffectChildActor);
|
|
2979
|
-
});
|
|
2980
|
-
}
|
|
2981
|
-
}
|
|
2982
|
-
tick(deltaTime) {
|
|
2983
|
-
if (!this.isTickEnabled) {
|
|
2984
|
-
return;
|
|
2985
|
-
}
|
|
2986
|
-
super.tick(deltaTime);
|
|
2987
|
-
this.rootComponent.tick(deltaTime);
|
|
2988
|
-
}
|
|
2989
|
-
// Local Transforms
|
|
2990
|
-
// // Position
|
|
2991
|
-
getPosition() {
|
|
2992
|
-
return this.rootComponent.getPosition();
|
|
2993
|
-
}
|
|
2994
|
-
setPosition(...args) {
|
|
2995
|
-
if (args.length === 1) {
|
|
2996
|
-
this.rootComponent.setPosition(args[0]);
|
|
2997
|
-
}
|
|
2998
|
-
else {
|
|
2999
|
-
this.rootComponent.setPosition(args[0], args[1], args[2]);
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
// // Rotation (euler)
|
|
3003
|
-
getRotation() {
|
|
3004
|
-
return this.rootComponent.getRotation();
|
|
3005
|
-
}
|
|
3006
|
-
setRotation(...args) {
|
|
3007
|
-
if (args.length === 1) {
|
|
3008
|
-
this.rootComponent.setRotation(args[0]);
|
|
3009
|
-
}
|
|
3010
|
-
else {
|
|
3011
|
-
this.rootComponent.setRotation(args[0], args[1], args[2]);
|
|
3012
|
-
}
|
|
3013
|
-
}
|
|
3014
|
-
// // quat
|
|
3015
|
-
getQuaternion() {
|
|
3016
|
-
return this.rootComponent.getQuaternion();
|
|
3017
|
-
}
|
|
3018
|
-
setQuaternion(...args) {
|
|
3019
|
-
if (args.length === 1) {
|
|
3020
|
-
this.rootComponent.setQuaternion(args[0]);
|
|
3021
|
-
}
|
|
3022
|
-
else {
|
|
3023
|
-
this.rootComponent.setQuaternion(args[0], args[1], args[2], args[3]);
|
|
3024
|
-
}
|
|
3025
|
-
}
|
|
3026
|
-
// // Scale
|
|
3027
|
-
getScale() {
|
|
3028
|
-
return this.rootComponent.getScale();
|
|
3029
|
-
}
|
|
3030
|
-
setScale(...args) {
|
|
3031
|
-
if (args.length === 1) {
|
|
3032
|
-
this.rootComponent.setScale(args[0]);
|
|
3033
|
-
}
|
|
3034
|
-
else {
|
|
3035
|
-
this.rootComponent.setScale(args[0], args[1], args[2]);
|
|
3036
|
-
}
|
|
3037
|
-
}
|
|
3038
|
-
// World Transform
|
|
3039
|
-
// // Matrix
|
|
3040
|
-
getWorldMatrix() {
|
|
3041
|
-
return this.rootComponent.getWorldMatrix();
|
|
3042
|
-
}
|
|
3043
|
-
setWorldMatrix(newMatrix) {
|
|
3044
|
-
this.rootComponent.setWorldMatrix(newMatrix);
|
|
3045
|
-
}
|
|
3046
|
-
// // WorldPosition
|
|
3047
|
-
getWorldPosition() {
|
|
3048
|
-
return this.rootComponent.getWorldPosition();
|
|
3049
|
-
}
|
|
3050
|
-
// setWorldPosition(param1, param2 = undefined, param3 = undefined)
|
|
3051
|
-
// {
|
|
3052
|
-
// }
|
|
3053
|
-
// // rotation(euler)
|
|
3054
|
-
getWorldRotation() {
|
|
3055
|
-
return this.rootComponent.getWorldRotation();
|
|
3056
|
-
}
|
|
3057
|
-
// // rotation(quat)
|
|
3058
|
-
getWorldQuaternion() {
|
|
3059
|
-
return this.rootComponent.getWorldQuaternion();
|
|
3060
|
-
}
|
|
3061
|
-
// // Scale
|
|
3062
|
-
getWorldScale() {
|
|
3063
|
-
return this.rootComponent.getWorldScale();
|
|
3064
|
-
}
|
|
3065
|
-
getWorldForwardDirection() {
|
|
3066
|
-
return this.rootComponent.getWorldForwardDirection();
|
|
3067
|
-
}
|
|
3068
|
-
getWorldUpDirection() {
|
|
3069
|
-
return this.rootComponent.getWorldUpDirection();
|
|
3070
|
-
}
|
|
3071
|
-
getWorldRightDirection() {
|
|
3072
|
-
return this.rootComponent.getWorldRightDirection();
|
|
3073
|
-
}
|
|
3074
|
-
addLocalOffset(axis, value) {
|
|
3075
|
-
let pos = this.getPosition();
|
|
3076
|
-
this.setPosition(pos.x + axis.x * value, pos.y + axis.y * value, pos.z + axis.z * value);
|
|
3077
|
-
}
|
|
3078
|
-
worldToLocal(vec) {
|
|
3079
|
-
return this.rootComponent.worldToLocal(vec);
|
|
3080
|
-
}
|
|
3081
|
-
localToWorld(vec) {
|
|
3082
|
-
return this.rootComponent.localToWorld(vec);
|
|
3083
|
-
}
|
|
3084
|
-
getComponents() {
|
|
3085
|
-
return this.rootComponent.childrenComponents;
|
|
3086
|
-
}
|
|
3087
|
-
addComponent(newComponent, attachmentRule = exports.AttachmentRules.KeepRelative) {
|
|
3088
|
-
this.rootComponent.addChildComponent(newComponent, attachmentRule);
|
|
3089
|
-
if (this._world) {
|
|
3090
|
-
newComponent.onAddedToWorld(this._world);
|
|
3091
|
-
}
|
|
3092
|
-
}
|
|
3093
|
-
removeComponent(targetComponent) {
|
|
3094
|
-
if (targetComponent === this._rootComponent) {
|
|
3095
|
-
return;
|
|
3096
|
-
}
|
|
3097
|
-
this.rootComponent.removeChildComponent(targetComponent);
|
|
3098
|
-
}
|
|
3099
|
-
clearComponent() {
|
|
3100
|
-
this.rootComponent.destroyChildren();
|
|
3101
|
-
}
|
|
3102
|
-
addChildActor(newActor, attachmentRule = exports.AttachmentRules.KeepWorld) {
|
|
3103
|
-
if (!(newActor.rootComponent)) {
|
|
3104
|
-
console.error("Actor :: addChildActor : the 'newActor' you want to add has no rootcomponent");
|
|
3105
|
-
return;
|
|
3106
|
-
}
|
|
3107
|
-
if (newActor.parentActor === this) {
|
|
3108
|
-
return;
|
|
3109
|
-
}
|
|
3110
|
-
if (attachmentRule === exports.AttachmentRules.KeepRelative) {
|
|
3111
|
-
this.rootComponent.attachComponent(newActor.rootComponent);
|
|
3112
|
-
}
|
|
3113
|
-
if (attachmentRule === exports.AttachmentRules.KeepWorld) {
|
|
3114
|
-
let worldMatrix = newActor.getWorldMatrix();
|
|
3115
|
-
this.rootComponent.attachComponent(newActor.rootComponent);
|
|
3116
|
-
newActor.setWorldMatrix(worldMatrix);
|
|
3117
|
-
}
|
|
3118
|
-
if (this._world) {
|
|
3119
|
-
this._world.viewport.markRenderStateDirty();
|
|
3120
|
-
}
|
|
3121
|
-
}
|
|
3122
|
-
removeChildActor(target) {
|
|
3123
|
-
let worldMatrix = target.getWorldMatrix();
|
|
3124
|
-
this.rootComponent.detachComponent(target.rootComponent);
|
|
3125
|
-
target.setWorldMatrix(worldMatrix);
|
|
3126
|
-
}
|
|
3127
|
-
removeFromParent() {
|
|
3128
|
-
if (this.parentActor) {
|
|
3129
|
-
this.parentActor.removeChildActor(this);
|
|
3130
|
-
}
|
|
3131
|
-
}
|
|
3132
|
-
onAddedToWorld(world) {
|
|
3133
|
-
this._world = world;
|
|
3134
|
-
this.rootComponent.onAddedToWorld(this._world);
|
|
3135
|
-
this.childActors.forEach((elem) => {
|
|
3136
|
-
elem.onAddedToWorld(world);
|
|
3137
|
-
});
|
|
3138
|
-
}
|
|
3139
|
-
onRemovedFromWorld() {
|
|
3140
|
-
this._world = null;
|
|
3141
|
-
}
|
|
3142
|
-
get isHoverEnabled() {
|
|
3143
|
-
return this.rootComponent.isHoverEnabled;
|
|
3144
|
-
}
|
|
3145
|
-
set isHoverEnabled(bCanHorver) {
|
|
3146
|
-
this.rootComponent.isHoverEnabled = bCanHorver;
|
|
3147
|
-
}
|
|
3148
|
-
get isClickEnabled() {
|
|
3149
|
-
return this.rootComponent.isClickEnabled;
|
|
3150
|
-
}
|
|
3151
|
-
set isClickEnabled(bCanHorver) {
|
|
3152
|
-
this.rootComponent.isClickEnabled = bCanHorver;
|
|
3153
|
-
}
|
|
3154
|
-
// ==================== Actor Events ====================
|
|
3155
|
-
onActorHoverBegin(component) {
|
|
3156
|
-
this._onHoverBeginDelegate.broadcast(component);
|
|
3157
|
-
}
|
|
3158
|
-
onActorHoverEnd(component) {
|
|
3159
|
-
this._onHoverEndDelegate.broadcast(component);
|
|
3160
|
-
}
|
|
3161
|
-
onActorClick(component) {
|
|
3162
|
-
this._onClickDelegate.broadcast(component);
|
|
3163
|
-
}
|
|
3164
|
-
onActorDoubleClick(component) {
|
|
3165
|
-
this._onDoubleClickDelegate.broadcast(component);
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
81
|
+
function _0x2f0e(){const _0x33e42e=['app','KeepWorld','getWorldRightDirection','destroyChildren','getChildActorById','length','getBounds','_world','addChildComponent','2087864ItjPjc','delete','setQuaternion','getComponents','setWorldMatrix','onActorClick','1655920SgvUzv','min','push','2jkPBzY','onHoverEndDelegate','worldToLocal','removeTickableActor','removeChildActor','getCenter','forEach','size','markRenderStateDirty','onAddedToWorld','getWorldPosition','_rootComponent','getScale','getWorldForwardDirection','sub','addChildActor','onActorDoubleClick','isTickEnabled','LYObject','getWorldRotation','tick','_onClickDelegate','threeObject','6RqpqLe','parentActor','getComponentById','uuid','10016axMSJR','Actor\x20::\x20addChildActor\x20:\x20the\x20\x27newActor\x27\x20you\x20want\x20to\x20add\x20has\x20no\x20rootcomponent','setRotation','has','478834YMwgCO','getBoundsBottomCenterPosition','4260003PQKJBi','removeFromParent','2979ofwSJk','clearComponent','_onHoverEndDelegate','error','parent','attachComponent','10jHzATU','rootComponent\x20is\x20invalid','onClickDelegate','getRotation','4129489jaqslr','detachComponent','setPosition','viewport','detachFromParentComponent','rootComponent','broadcast','name','onHoverBeginDelegate','destroy','setVisible','getWorldUpDirection','removeComponent','getWorldMatrix','getPosition','_name','KeepRelative','max','isHoverEnabled','getWorldScale','getQuaternion','setScale','isClickEnabled','onDoubleClickDelegate','_onHoverBeginDelegate','childActors','childrenComponents','world','addComponent','getChildActorsByIds','constructRootComponent','addLocalOffset','removeChildComponent','localToWorld','onActorHoverEnd','1657737iOVaDP','setLayers'];_0x2f0e=function(){return _0x33e42e;};return _0x2f0e();}const _0x563800=_0x5421;(function(_0x4f09d4,_0x25bf4f){const _0xf5343=_0x5421,_0x3d1c70=_0x4f09d4();while(!![]){try{const _0x10d56b=-parseInt(_0xf5343(0x16f))/0x1*(-parseInt(_0xf5343(0x18e))/0x2)+-parseInt(_0xf5343(0x15b))/0x3+-parseInt(_0xf5343(0x166))/0x4+parseInt(_0xf5343(0x16c))/0x5+-parseInt(_0xf5343(0x186))/0x6*(-parseInt(_0xf5343(0x138))/0x7)+parseInt(_0xf5343(0x18a))/0x8*(-parseInt(_0xf5343(0x192))/0x9)+parseInt(_0xf5343(0x134))/0xa*(parseInt(_0xf5343(0x190))/0xb);if(_0x10d56b===_0x25bf4f)break;else _0x3d1c70['push'](_0x3d1c70['shift']());}catch(_0x117e77){_0x3d1c70['push'](_0x3d1c70['shift']());}}}(_0x2f0e,0x48d15));function _0x5421(_0x1f0380,_0x3f51e4){_0x1f0380=_0x1f0380-0x134;const _0x2f0e65=_0x2f0e();let _0x54218a=_0x2f0e65[_0x1f0380];return _0x54218a;}class Actor extends BaseObject{get[_0x563800(0x153)](){return this['_world'];}get[_0x563800(0x13f)](){const _0x17a046=_0x563800;return this[_0x17a046(0x147)];}set[_0x563800(0x13f)](_0x469f76){const _0x2a9133=_0x563800;this[_0x2a9133(0x147)]=_0x469f76;}get[_0x563800(0x13d)](){const _0x57e370=_0x563800;if(!this['_rootComponent'])throw Error(_0x57e370(0x135));return this[_0x57e370(0x17a)];}set[_0x563800(0x13d)](_0x1b5b9d){const _0x327285=_0x563800;_0x1b5b9d[_0x327285(0x13c)](),_0x1b5b9d[_0x327285(0x187)]=this;if(this[_0x327285(0x17a)]){let _0x28d86d=this['rootComponent'][_0x327285(0x152)];for(let _0x44d203=0x0;_0x44d203<_0x28d86d['length'];++_0x44d203){_0x1b5b9d[_0x327285(0x165)](_0x28d86d[_0x44d203]);}this['rootComponent']['destroy']();}this[_0x327285(0x17a)]=_0x1b5b9d;}get[_0x563800(0x152)](){const _0x36511c=_0x563800;return this['rootComponent'][_0x36511c(0x152)];}get['childActors'](){const _0x107ebf=_0x563800;var _0x2e8b95;let _0x4d9056=[];return (_0x2e8b95=this[_0x107ebf(0x13d)][_0x107ebf(0x185)])===null||_0x2e8b95===void 0?void 0:_0x2e8b95['children'][_0x107ebf(0x175)](_0x12e721=>{const _0xe81c18=_0x107ebf;var _0xd4118c;let _0xed0516=(_0xd4118c=_0x12e721['userData'][_0xe81c18(0x181)])===null||_0xd4118c===void 0?void 0:_0xd4118c['parentActor'];_0xed0516!==this&&_0xed0516 instanceof Actor&&_0x4d9056[_0xe81c18(0x16e)](_0xed0516);}),_0x4d9056;}get[_0x563800(0x187)](){const _0x1aeb97=_0x563800;var _0x3399f9,_0x47bab1;let _0x24c28a=(_0x47bab1=(_0x3399f9=this[_0x1aeb97(0x13d)]['threeObject'])===null||_0x3399f9===void 0?void 0:_0x3399f9[_0x1aeb97(0x196)])===null||_0x47bab1===void 0?void 0:_0x47bab1['userData'][_0x1aeb97(0x181)][_0x1aeb97(0x187)];return _0x24c28a===this?null:_0x24c28a;}get['isVisible'](){const _0x44e178=_0x563800;return this[_0x44e178(0x13d)]?this[_0x44e178(0x13d)]['isVisible']:![];}get['isTickEnabled'](){const _0x4d9ee0=_0x563800;return super[_0x4d9ee0(0x180)];}set['isTickEnabled'](_0x76fdd2){const _0x2a8565=_0x563800;super[_0x2a8565(0x180)]=_0x76fdd2,this[_0x2a8565(0x180)]?this[_0x2a8565(0x15d)][_0x2a8565(0x153)]['addTickableActor'](this):this['app'][_0x2a8565(0x153)][_0x2a8565(0x172)](this);}get[_0x563800(0x140)](){const _0x5edbf6=_0x563800;return this[_0x5edbf6(0x150)];}get[_0x563800(0x170)](){const _0x4b20ac=_0x563800;return this[_0x4b20ac(0x194)];}get[_0x563800(0x136)](){const _0x456c0e=_0x563800;return this[_0x456c0e(0x184)];}get[_0x563800(0x14f)](){return this['_onDoubleClickDelegate'];}constructor(_0x1a04fd,_0xc329ad){const _0x29527c=_0x563800;super(_0xc329ad),this[_0x29527c(0x147)]='Actor',this[_0x29527c(0x17a)]=null,this['_world']=null,this[_0x29527c(0x150)]=new Delegate(),this[_0x29527c(0x194)]=new Delegate(),this[_0x29527c(0x184)]=new Delegate(),this['_onDoubleClickDelegate']=new Delegate(),this['app']=_0x1a04fd,this[_0x29527c(0x13d)]=this[_0x29527c(0x156)](),this['rootComponent'][_0x29527c(0x187)]=this;}[_0x563800(0x156)](){return new SceneComponent(this['app']);}['getBoundsCenterPosition'](_0x1afd71=!![]){const _0x47f072=_0x563800;let _0x28bdff=new webgpu.Vector3();return this[_0x47f072(0x163)]()['getCenter'](_0x28bdff),!_0x1afd71?_0x28bdff[_0x47f072(0x17d)](this[_0x47f072(0x146)]()):_0x28bdff;}['getChildActorById'](_0x8928e6,_0x41214c=!![]){const _0x38ba51=_0x563800,_0x3f9129=this[_0x38ba51(0x151)];for(const _0x461fb0 of _0x3f9129){if(_0x461fb0['uuid']===_0x8928e6)return _0x461fb0;}if(_0x41214c)for(const _0x10ff40 of _0x3f9129){const _0x22c430=_0x10ff40[_0x38ba51(0x161)](_0x8928e6,!![]);if(_0x22c430)return _0x22c430;}return null;}[_0x563800(0x155)](_0x47ab2a,_0x19aafe=!![]){const _0x5a67f5=_0x563800,_0x34c482=[],_0x593367=new Set(_0x47ab2a),_0x54b0e3=this[_0x5a67f5(0x151)];for(const _0x1f365f of _0x54b0e3){_0x593367[_0x5a67f5(0x18d)](_0x1f365f[_0x5a67f5(0x189)])&&(_0x34c482['push'](_0x1f365f),_0x593367['delete'](_0x1f365f[_0x5a67f5(0x189)]));}if(_0x19aafe&&_0x593367[_0x5a67f5(0x176)]>0x0)for(const _0x2466e2 of _0x54b0e3){const _0x5d223e=_0x2466e2['getChildActorsByIds']([..._0x593367],!![]);for(const _0x10985a of _0x5d223e){_0x34c482[_0x5a67f5(0x16e)](_0x10985a),_0x593367[_0x5a67f5(0x167)](_0x10985a['uuid']);}if(_0x593367[_0x5a67f5(0x176)]===0x0)break;}return _0x34c482;}[_0x563800(0x188)](_0xc3dfe1){const _0x14ab52=_0x563800;return this['rootComponent'][_0x14ab52(0x188)](_0xc3dfe1);}['getBoundsTopCenterPosition'](_0x1e8bcf=!![]){const _0x4540ec=_0x563800;let _0x272b3e=new webgpu.Vector3(),_0x2fd331=this['rootComponent'][_0x4540ec(0x163)]();return _0x2fd331['getCenter'](_0x272b3e),_0x272b3e['y']=_0x2fd331[_0x4540ec(0x149)]['y'],!_0x1e8bcf?_0x272b3e[_0x4540ec(0x17d)](this['getPosition']()):_0x272b3e;}[_0x563800(0x18f)](_0x4c3970=!![]){const _0x2112e7=_0x563800;let _0x543724=new webgpu.Vector3(),_0xa016a7=this[_0x2112e7(0x163)]();return _0xa016a7[_0x2112e7(0x174)](_0x543724),_0x543724['y']=_0xa016a7[_0x2112e7(0x16d)]['y'],!_0x4c3970?_0x543724[_0x2112e7(0x17d)](this[_0x2112e7(0x146)]()):_0x543724;}['getBounds'](){const _0x2a922f=_0x563800;return this[_0x2a922f(0x13d)]['getBounds']();}[_0x563800(0x141)](){const _0x8ec32=_0x563800;let _0x39b968=this[_0x8ec32(0x151)];_0x39b968[_0x8ec32(0x175)](_0x41cc65=>{const _0x3f1f99=_0x8ec32;_0x41cc65[_0x3f1f99(0x141)]();}),this[_0x8ec32(0x13d)]['destroy']();}[_0x563800(0x142)](_0x5150e7){const _0x2d6c22=_0x563800;this[_0x2d6c22(0x13d)][_0x2d6c22(0x142)](_0x5150e7);}[_0x563800(0x15c)](_0x3b0236,_0x163fd2=!![]){const _0x14ef86=_0x563800;this[_0x14ef86(0x13d)][_0x14ef86(0x15c)](_0x3b0236),_0x163fd2&&this[_0x14ef86(0x151)][_0x14ef86(0x175)](_0x5e632b=>{const _0x133435=_0x14ef86;_0x5e632b[_0x133435(0x15c)](_0x3b0236,_0x163fd2);});}[_0x563800(0x183)](_0x2e11d1){const _0x19e322=_0x563800;if(!this[_0x19e322(0x180)])return;super['tick'](_0x2e11d1),this[_0x19e322(0x13d)]['tick'](_0x2e11d1);}[_0x563800(0x146)](){return this['rootComponent']['getPosition']();}[_0x563800(0x13a)](..._0x16eec1){const _0x3a99b6=_0x563800;_0x16eec1[_0x3a99b6(0x162)]===0x1?this[_0x3a99b6(0x13d)][_0x3a99b6(0x13a)](_0x16eec1[0x0]):this[_0x3a99b6(0x13d)][_0x3a99b6(0x13a)](_0x16eec1[0x0],_0x16eec1[0x1],_0x16eec1[0x2]);}[_0x563800(0x137)](){return this['rootComponent']['getRotation']();}[_0x563800(0x18c)](..._0x3ac44f){const _0x41bf0a=_0x563800;_0x3ac44f[_0x41bf0a(0x162)]===0x1?this[_0x41bf0a(0x13d)][_0x41bf0a(0x18c)](_0x3ac44f[0x0]):this['rootComponent'][_0x41bf0a(0x18c)](_0x3ac44f[0x0],_0x3ac44f[0x1],_0x3ac44f[0x2]);}[_0x563800(0x14c)](){const _0x137223=_0x563800;return this[_0x137223(0x13d)][_0x137223(0x14c)]();}['setQuaternion'](..._0x5dfab7){const _0x40af83=_0x563800;_0x5dfab7[_0x40af83(0x162)]===0x1?this[_0x40af83(0x13d)][_0x40af83(0x168)](_0x5dfab7[0x0]):this[_0x40af83(0x13d)][_0x40af83(0x168)](_0x5dfab7[0x0],_0x5dfab7[0x1],_0x5dfab7[0x2],_0x5dfab7[0x3]);}[_0x563800(0x17b)](){const _0x1a9a28=_0x563800;return this['rootComponent'][_0x1a9a28(0x17b)]();}[_0x563800(0x14d)](..._0xd2cf04){const _0x1f88b6=_0x563800;_0xd2cf04['length']===0x1?this[_0x1f88b6(0x13d)][_0x1f88b6(0x14d)](_0xd2cf04[0x0]):this[_0x1f88b6(0x13d)][_0x1f88b6(0x14d)](_0xd2cf04[0x0],_0xd2cf04[0x1],_0xd2cf04[0x2]);}[_0x563800(0x145)](){const _0x1921bc=_0x563800;return this['rootComponent'][_0x1921bc(0x145)]();}[_0x563800(0x16a)](_0x48a3fb){const _0x3d13a4=_0x563800;this[_0x3d13a4(0x13d)][_0x3d13a4(0x16a)](_0x48a3fb);}[_0x563800(0x179)](){const _0xd1e866=_0x563800;return this[_0xd1e866(0x13d)][_0xd1e866(0x179)]();}[_0x563800(0x182)](){const _0x45f490=_0x563800;return this[_0x45f490(0x13d)][_0x45f490(0x182)]();}['getWorldQuaternion'](){const _0x570b5d=_0x563800;return this[_0x570b5d(0x13d)]['getWorldQuaternion']();}['getWorldScale'](){const _0x5910b3=_0x563800;return this[_0x5910b3(0x13d)][_0x5910b3(0x14b)]();}[_0x563800(0x17c)](){const _0x36e758=_0x563800;return this[_0x36e758(0x13d)]['getWorldForwardDirection']();}['getWorldUpDirection'](){const _0x1c8e0c=_0x563800;return this[_0x1c8e0c(0x13d)][_0x1c8e0c(0x143)]();}[_0x563800(0x15f)](){const _0x354291=_0x563800;return this[_0x354291(0x13d)]['getWorldRightDirection']();}[_0x563800(0x157)](_0x25af0e,_0x268c7f){const _0x111f74=_0x563800;let _0x1e6ecb=this[_0x111f74(0x146)]();this[_0x111f74(0x13a)](_0x1e6ecb['x']+_0x25af0e['x']*_0x268c7f,_0x1e6ecb['y']+_0x25af0e['y']*_0x268c7f,_0x1e6ecb['z']+_0x25af0e['z']*_0x268c7f);}[_0x563800(0x171)](_0x574b8e){const _0x5cb66c=_0x563800;return this[_0x5cb66c(0x13d)][_0x5cb66c(0x171)](_0x574b8e);}[_0x563800(0x159)](_0x5dc7ba){return this['rootComponent']['localToWorld'](_0x5dc7ba);}[_0x563800(0x169)](){const _0x4d4756=_0x563800;return this[_0x4d4756(0x13d)][_0x4d4756(0x152)];}[_0x563800(0x154)](_0x264578,_0x2f0b85=exports.AttachmentRules[_0x563800(0x148)]){const _0x9ef972=_0x563800;this['rootComponent'][_0x9ef972(0x165)](_0x264578,_0x2f0b85),this[_0x9ef972(0x164)]&&_0x264578[_0x9ef972(0x178)](this[_0x9ef972(0x164)]);}[_0x563800(0x144)](_0x5679ff){const _0x4f7207=_0x563800;if(_0x5679ff===this['_rootComponent'])return;this[_0x4f7207(0x13d)][_0x4f7207(0x158)](_0x5679ff);}[_0x563800(0x193)](){const _0x5cf69a=_0x563800;this['rootComponent'][_0x5cf69a(0x160)]();}[_0x563800(0x17e)](_0x234fb7,_0x52c02b=exports.AttachmentRules[_0x563800(0x15e)]){const _0xd40d40=_0x563800;if(!_0x234fb7['rootComponent']){console[_0xd40d40(0x195)](_0xd40d40(0x18b));return;}if(_0x234fb7[_0xd40d40(0x187)]===this)return;_0x52c02b===exports.AttachmentRules['KeepRelative']&&this[_0xd40d40(0x13d)][_0xd40d40(0x197)](_0x234fb7[_0xd40d40(0x13d)]);if(_0x52c02b===exports.AttachmentRules['KeepWorld']){let _0x5d9089=_0x234fb7[_0xd40d40(0x145)]();this['rootComponent'][_0xd40d40(0x197)](_0x234fb7[_0xd40d40(0x13d)]),_0x234fb7['setWorldMatrix'](_0x5d9089);}this['_world']&&this[_0xd40d40(0x164)][_0xd40d40(0x13b)][_0xd40d40(0x177)]();}[_0x563800(0x173)](_0x2884a3){const _0x57cf9d=_0x563800;let _0x5674b1=_0x2884a3['getWorldMatrix']();this['rootComponent'][_0x57cf9d(0x139)](_0x2884a3[_0x57cf9d(0x13d)]),_0x2884a3[_0x57cf9d(0x16a)](_0x5674b1);}[_0x563800(0x191)](){const _0x1865a3=_0x563800;this[_0x1865a3(0x187)]&&this[_0x1865a3(0x187)]['removeChildActor'](this);}['onAddedToWorld'](_0x3523a1){const _0x4d9dce=_0x563800;this[_0x4d9dce(0x164)]=_0x3523a1,this[_0x4d9dce(0x13d)]['onAddedToWorld'](this[_0x4d9dce(0x164)]),this[_0x4d9dce(0x151)]['forEach'](_0x4302db=>{const _0x14f5a7=_0x4d9dce;_0x4302db[_0x14f5a7(0x178)](_0x3523a1);});}['onRemovedFromWorld'](){const _0x14d7ef=_0x563800;this[_0x14d7ef(0x164)]=null;}get[_0x563800(0x14a)](){const _0x1d34c2=_0x563800;return this[_0x1d34c2(0x13d)]['isHoverEnabled'];}set[_0x563800(0x14a)](_0xc96b4){const _0x3c5681=_0x563800;this[_0x3c5681(0x13d)][_0x3c5681(0x14a)]=_0xc96b4;}get[_0x563800(0x14e)](){const _0x37ed3b=_0x563800;return this[_0x37ed3b(0x13d)][_0x37ed3b(0x14e)];}set[_0x563800(0x14e)](_0x40abd9){const _0x1091af=_0x563800;this[_0x1091af(0x13d)][_0x1091af(0x14e)]=_0x40abd9;}['onActorHoverBegin'](_0x386145){const _0x4bff55=_0x563800;this[_0x4bff55(0x150)]['broadcast'](_0x386145);}[_0x563800(0x15a)](_0x394783){const _0x317352=_0x563800;this[_0x317352(0x194)]['broadcast'](_0x394783);}[_0x563800(0x16b)](_0x234d8f){this['_onClickDelegate']['broadcast'](_0x234d8f);}[_0x563800(0x17f)](_0x4fd43a){const _0x15ba03=_0x563800;this['_onDoubleClickDelegate'][_0x15ba03(0x13e)](_0x4fd43a);}}
|
|
3168
82
|
|
|
3169
|
-
class ThreeObjectLibrary {
|
|
3170
|
-
static disposeMaterialTextures(material) {
|
|
3171
|
-
Object.keys(material).forEach((key) => {
|
|
3172
|
-
const value = material[key];
|
|
3173
|
-
if (value && typeof value === 'object' && 'isTexture' in value) {
|
|
3174
|
-
value.dispose();
|
|
3175
|
-
}
|
|
3176
|
-
});
|
|
3177
|
-
}
|
|
3178
|
-
static disposeMeshMaterial(mesh) {
|
|
3179
|
-
let mats = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
|
|
3180
|
-
mats.forEach((elem) => {
|
|
3181
|
-
ThreeObjectLibrary.disposeMaterialTextures(elem);
|
|
3182
|
-
elem.dispose();
|
|
3183
|
-
});
|
|
3184
|
-
}
|
|
3185
|
-
static disposeMeshResource(mesh, recursive = false) {
|
|
3186
|
-
ThreeObjectLibrary.disposeMeshMaterial(mesh);
|
|
3187
|
-
mesh.geometry.dispose();
|
|
3188
|
-
if (recursive) {
|
|
3189
|
-
mesh.children.forEach((child) => {
|
|
3190
|
-
if (child instanceof webgpu.Mesh) {
|
|
3191
|
-
ThreeObjectLibrary.disposeMeshResource(child, true);
|
|
3192
|
-
}
|
|
3193
|
-
});
|
|
3194
|
-
}
|
|
3195
|
-
}
|
|
3196
|
-
static disposeObject3DResource(object) {
|
|
3197
|
-
object.traverse((child) => {
|
|
3198
|
-
if (child instanceof webgpu.Mesh) {
|
|
3199
|
-
ThreeObjectLibrary.disposeMeshResource(child);
|
|
3200
|
-
}
|
|
3201
|
-
});
|
|
3202
|
-
}
|
|
3203
|
-
}
|
|
83
|
+
const _0x3d9f1d=_0x2ce6;(function(_0x26a812,_0x27ed52){const _0x585a5f=_0x2ce6,_0x113107=_0x26a812();while(!![]){try{const _0x8dfa76=parseInt(_0x585a5f(0xf4))/0x1*(parseInt(_0x585a5f(0xf8))/0x2)+parseInt(_0x585a5f(0xfc))/0x3*(-parseInt(_0x585a5f(0xf7))/0x4)+parseInt(_0x585a5f(0xf3))/0x5+parseInt(_0x585a5f(0x106))/0x6*(parseInt(_0x585a5f(0x107))/0x7)+parseInt(_0x585a5f(0xfd))/0x8*(-parseInt(_0x585a5f(0xff))/0x9)+-parseInt(_0x585a5f(0x102))/0xa+parseInt(_0x585a5f(0x101))/0xb;if(_0x8dfa76===_0x27ed52)break;else _0x113107['push'](_0x113107['shift']());}catch(_0x21f5d4){_0x113107['push'](_0x113107['shift']());}}}(_0x3eec,0x804db));function _0x2ce6(_0x136a07,_0x5538fe){_0x136a07=_0x136a07-0xf2;const _0x3eec78=_0x3eec();let _0x2ce6ba=_0x3eec78[_0x136a07];return _0x2ce6ba;}function _0x3eec(){const _0x4741e1=['disposeMeshMaterial','1767VEgBeC','8QZMlYj','material','5524353IGoMYV','disposeMeshResource','6624299CvxuLb','9819300OXFruh','isTexture','dispose','disposeMaterialTextures','6HSotqs','6374291jVLbAo','disposeObject3DResource','4447990erAIwg','1213RboVVJ','geometry','children','4776RRVeDF','696nCbCfU','forEach','object'];_0x3eec=function(){return _0x4741e1;};return _0x3eec();}class ThreeObjectLibrary{static[_0x3d9f1d(0x105)](_0x103f7b){const _0xd5f32b=_0x3d9f1d;Object['keys'](_0x103f7b)[_0xd5f32b(0xf9)](_0x3364ae=>{const _0x2d9b16=_0xd5f32b,_0x47ee6d=_0x103f7b[_0x3364ae];_0x47ee6d&&typeof _0x47ee6d===_0x2d9b16(0xfa)&&_0x2d9b16(0x103)in _0x47ee6d&&_0x47ee6d[_0x2d9b16(0x104)]();});}static['disposeMeshMaterial'](_0x3f88f6){const _0x5268a4=_0x3d9f1d;let _0xb419a6=Array['isArray'](_0x3f88f6[_0x5268a4(0xfe)])?_0x3f88f6['material']:[_0x3f88f6[_0x5268a4(0xfe)]];_0xb419a6[_0x5268a4(0xf9)](_0x77760f=>{const _0x204e43=_0x5268a4;ThreeObjectLibrary[_0x204e43(0x105)](_0x77760f),_0x77760f[_0x204e43(0x104)]();});}static[_0x3d9f1d(0x100)](_0x586eee,_0x5ad0db=![]){const _0x3da5bc=_0x3d9f1d;ThreeObjectLibrary[_0x3da5bc(0xfb)](_0x586eee),_0x586eee[_0x3da5bc(0xf5)][_0x3da5bc(0x104)](),_0x5ad0db&&_0x586eee[_0x3da5bc(0xf6)][_0x3da5bc(0xf9)](_0x2ce883=>{_0x2ce883 instanceof webgpu.Mesh&&ThreeObjectLibrary['disposeMeshResource'](_0x2ce883,!![]);});}static[_0x3d9f1d(0xf2)](_0x351c4e){_0x351c4e['traverse'](_0x2548b6=>{const _0x499c56=_0x2ce6;_0x2548b6 instanceof webgpu.Mesh&&ThreeObjectLibrary[_0x499c56(0x100)](_0x2548b6);});}}
|
|
3204
84
|
|
|
3205
|
-
class LevelComponent extends SceneComponent {
|
|
3206
|
-
get threeObject() {
|
|
3207
|
-
if (!this.obj) {
|
|
3208
|
-
throw Error("three object is invalid");
|
|
3209
|
-
}
|
|
3210
|
-
return this.obj;
|
|
3211
|
-
}
|
|
3212
|
-
set threeObject(newThreeObject) {
|
|
3213
|
-
this.obj = newThreeObject;
|
|
3214
|
-
if (this.obj) {
|
|
3215
|
-
this.obj.userData["LYObject"] = this;
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
constructor(app, uuid) {
|
|
3219
|
-
super(app, uuid);
|
|
3220
|
-
}
|
|
3221
|
-
createDefaultObject() {
|
|
3222
|
-
return new three.Scene();
|
|
3223
|
-
}
|
|
3224
|
-
}
|
|
85
|
+
var _0x4f8957=_0x3c71;function _0x3c71(_0x18b06d,_0x57835d){_0x18b06d=_0x18b06d-0x101;var _0x8f0f15=_0x8f0f();var _0x3c7147=_0x8f0f15[_0x18b06d];return _0x3c7147;}(function(_0x2f303f,_0x44f745){var _0x5d38fb=_0x3c71,_0x108c4b=_0x2f303f();while(!![]){try{var _0xc22636=parseInt(_0x5d38fb(0x101))/0x1*(-parseInt(_0x5d38fb(0x110))/0x2)+-parseInt(_0x5d38fb(0x102))/0x3*(-parseInt(_0x5d38fb(0x105))/0x4)+parseInt(_0x5d38fb(0x10b))/0x5*(parseInt(_0x5d38fb(0x106))/0x6)+parseInt(_0x5d38fb(0x111))/0x7*(-parseInt(_0x5d38fb(0x109))/0x8)+-parseInt(_0x5d38fb(0x112))/0x9*(parseInt(_0x5d38fb(0x10f))/0xa)+-parseInt(_0x5d38fb(0x104))/0xb+parseInt(_0x5d38fb(0x107))/0xc*(parseInt(_0x5d38fb(0x108))/0xd);if(_0xc22636===_0x44f745)break;else _0x108c4b['push'](_0x108c4b['shift']());}catch(_0x5082e7){_0x108c4b['push'](_0x108c4b['shift']());}}}(_0x8f0f,0xbc9fb));function _0x8f0f(){var _0x493764=['1NGkMJd','190386dZplfo','createDefaultObject','15538501AFsOlY','4cTwwqX','37458ZRXqYe','4668ysRSIB','124514tOnvih','1468648TYiTKg','LYObject','265gGuHXq','userData','threeObject','obj','5872690OHTsXp','419416TiAsfv','21zlsueZ','18gnUMll'];_0x8f0f=function(){return _0x493764;};return _0x8f0f();}class LevelComponent extends SceneComponent{get[_0x4f8957(0x10d)](){var _0x3a6ac7=_0x4f8957;if(!this[_0x3a6ac7(0x10e)])throw Error('three\x20object\x20is\x20invalid');return this[_0x3a6ac7(0x10e)];}set[_0x4f8957(0x10d)](_0x489985){var _0x4c65b6=_0x4f8957;this[_0x4c65b6(0x10e)]=_0x489985,this['obj']&&(this[_0x4c65b6(0x10e)][_0x4c65b6(0x10c)][_0x4c65b6(0x10a)]=this);}constructor(_0x383d68,_0x5c2f20){super(_0x383d68,_0x5c2f20);}[_0x4f8957(0x103)](){return new three.Scene();}}
|
|
3225
86
|
|
|
3226
|
-
class LevelActor extends Actor {
|
|
3227
|
-
get scene() {
|
|
3228
|
-
if (!this._scene) {
|
|
3229
|
-
throw new Error("scene is null");
|
|
3230
|
-
}
|
|
3231
|
-
return this._scene;
|
|
3232
|
-
}
|
|
3233
|
-
constructor(app, uuid) {
|
|
3234
|
-
super(app, uuid);
|
|
3235
|
-
this._scene = null;
|
|
3236
|
-
this._scene = this.rootComponent.threeObject;
|
|
3237
|
-
this.isTickEnabled = false;
|
|
3238
|
-
}
|
|
3239
|
-
constructRootComponent() {
|
|
3240
|
-
return new LevelComponent(this.app, this.uuid);
|
|
3241
|
-
}
|
|
3242
|
-
tick(_deltaTime) {
|
|
3243
|
-
if (!this.isTickEnabled) {
|
|
3244
|
-
return;
|
|
3245
|
-
}
|
|
3246
|
-
super.tick(_deltaTime);
|
|
3247
|
-
}
|
|
3248
|
-
destroy() {
|
|
3249
|
-
this.clearLevel();
|
|
3250
|
-
super.destroy();
|
|
3251
|
-
}
|
|
3252
|
-
clearLevel() {
|
|
3253
|
-
this.childActors.forEach((elem) => {
|
|
3254
|
-
elem.destroy();
|
|
3255
|
-
});
|
|
3256
|
-
this.scene.traverse((child) => {
|
|
3257
|
-
if (child instanceof webgpu.Mesh) {
|
|
3258
|
-
ThreeObjectLibrary.disposeMeshResource(child);
|
|
3259
|
-
}
|
|
3260
|
-
});
|
|
3261
|
-
}
|
|
3262
|
-
}
|
|
87
|
+
function _0x69f0(_0x48c9e1,_0xd83e23){_0x48c9e1=_0x48c9e1-0x1b6;var _0x2cb787=_0x2cb7();var _0x69f0b5=_0x2cb787[_0x48c9e1];return _0x69f0b5;}var _0x5df6e5=_0x69f0;(function(_0x4dd27e,_0x2e6ee1){var _0x50cf98=_0x69f0,_0x373eb1=_0x4dd27e();while(!![]){try{var _0x4dbaaf=-parseInt(_0x50cf98(0x1c1))/0x1*(-parseInt(_0x50cf98(0x1c6))/0x2)+parseInt(_0x50cf98(0x1bc))/0x3+parseInt(_0x50cf98(0x1cb))/0x4+-parseInt(_0x50cf98(0x1bb))/0x5*(parseInt(_0x50cf98(0x1c7))/0x6)+-parseInt(_0x50cf98(0x1bd))/0x7+-parseInt(_0x50cf98(0x1c9))/0x8*(parseInt(_0x50cf98(0x1c4))/0x9)+parseInt(_0x50cf98(0x1ca))/0xa;if(_0x4dbaaf===_0x2e6ee1)break;else _0x373eb1['push'](_0x373eb1['shift']());}catch(_0x59d715){_0x373eb1['push'](_0x373eb1['shift']());}}}(_0x2cb7,0x5973f));class LevelActor extends Actor{get['scene'](){var _0x1feb0d=_0x69f0;if(!this[_0x1feb0d(0x1b6)])throw new Error(_0x1feb0d(0x1cc));return this['_scene'];}constructor(_0x4a49dc,_0xcdd4da){var _0x50f24e=_0x69f0;super(_0x4a49dc,_0xcdd4da),this[_0x50f24e(0x1b6)]=null,this[_0x50f24e(0x1b6)]=this['rootComponent'][_0x50f24e(0x1c2)],this[_0x50f24e(0x1ba)]=![];}['constructRootComponent'](){var _0x55e069=_0x69f0;return new LevelComponent(this[_0x55e069(0x1c8)],this[_0x55e069(0x1b8)]);}[_0x5df6e5(0x1c5)](_0x1ae1fc){var _0x3f4ff2=_0x5df6e5;if(!this['isTickEnabled'])return;super[_0x3f4ff2(0x1c5)](_0x1ae1fc);}[_0x5df6e5(0x1b9)](){var _0x3adab3=_0x5df6e5;this[_0x3adab3(0x1bf)](),super['destroy']();}[_0x5df6e5(0x1bf)](){var _0x31dd8d=_0x5df6e5;this[_0x31dd8d(0x1c3)][_0x31dd8d(0x1b7)](_0x203619=>{_0x203619['destroy']();}),this[_0x31dd8d(0x1c0)][_0x31dd8d(0x1be)](_0x5657d3=>{_0x5657d3 instanceof webgpu.Mesh&&ThreeObjectLibrary['disposeMeshResource'](_0x5657d3);});}}function _0x2cb7(){var _0x1fc4f1=['uuid','destroy','isTickEnabled','5VEPEhp','908658HPRBhz','3251598ybYuPm','traverse','clearLevel','scene','521838yVAQZm','threeObject','childActors','36kYAyHu','tick','2roIKSt','152400zeeZpy','app','866736LWZupE','3198320JmyIEd','580500BMIodu','scene\x20is\x20null','_scene','forEach'];_0x2cb7=function(){return _0x1fc4f1;};return _0x2cb7();}
|
|
3263
88
|
|
|
3264
|
-
const
|
|
3265
|
-
levelActorClass: LevelActor,
|
|
3266
|
-
};
|
|
89
|
+
function _0x44a7(){const _0x6801f3=['2316192xVvVhl','21EmuvFv','9535275mAkZeg','408169wuoEQT','49272qEePke','966dYMNHa','4aoNvjH','19477360lIOGGe','460270gDViAA','2985605gLiQse'];_0x44a7=function(){return _0x6801f3;};return _0x44a7();}(function(_0xa6b8bc,_0x403e65){const _0x439e39=_0x38f1,_0x16d9eb=_0xa6b8bc();while(!![]){try{const _0x126bd1=parseInt(_0x439e39(0x176))/0x1+parseInt(_0x439e39(0x171))/0x2*(parseInt(_0x439e39(0x174))/0x3)+parseInt(_0x439e39(0x179))/0x4*(parseInt(_0x439e39(0x172))/0x5)+parseInt(_0x439e39(0x177))/0x6*(-parseInt(_0x439e39(0x178))/0x7)+parseInt(_0x439e39(0x173))/0x8+parseInt(_0x439e39(0x175))/0x9+-parseInt(_0x439e39(0x170))/0xa;if(_0x126bd1===_0x403e65)break;else _0x16d9eb['push'](_0x16d9eb['shift']());}catch(_0x359dd1){_0x16d9eb['push'](_0x16d9eb['shift']());}}}(_0x44a7,0xd7e12));function _0x38f1(_0x42f174,_0x5f2fe8){_0x42f174=_0x42f174-0x170;const _0x44a740=_0x44a7();let _0x38f10b=_0x44a740[_0x42f174];return _0x38f10b;}const DefaultWorldParam={'levelActorClass':LevelActor};
|
|
3267
90
|
|
|
3268
|
-
class ThreeJsApp {
|
|
3269
|
-
get camera() {
|
|
3270
|
-
return this._camera;
|
|
3271
|
-
}
|
|
3272
|
-
get clock() {
|
|
3273
|
-
return this._clock;
|
|
3274
|
-
}
|
|
3275
|
-
get world() {
|
|
3276
|
-
return this._world;
|
|
3277
|
-
}
|
|
3278
|
-
get viewport() {
|
|
3279
|
-
return this._viewport;
|
|
3280
|
-
}
|
|
3281
|
-
get controller() {
|
|
3282
|
-
return this._controller;
|
|
3283
|
-
}
|
|
3284
|
-
get assetManager() {
|
|
3285
|
-
return this._assetManager;
|
|
3286
|
-
}
|
|
3287
|
-
get appParam() {
|
|
3288
|
-
return this._appParam;
|
|
3289
|
-
}
|
|
3290
|
-
get onCameraChangedDelegate() {
|
|
3291
|
-
return this._onCameraChangedDelegate;
|
|
3292
|
-
}
|
|
3293
|
-
constructor(appParam = DefaultAppParam) {
|
|
3294
|
-
this._tickingFunctions = [];
|
|
3295
|
-
this._appParam = { viewportParam: DefaultViewportParam };
|
|
3296
|
-
this._onCameraChangedDelegate = new Delegate();
|
|
3297
|
-
this._appParam.cameraParam = appParam.cameraParam ? appParam.cameraParam : DefaultCameraParam;
|
|
3298
|
-
this._appParam.renderParam = appParam.renderParam ? appParam.renderParam : DefaultRendererParameters;
|
|
3299
|
-
this._appParam.postProcessParam = appParam.postProcessParam ? appParam.postProcessParam : DefaultPostProcessParam;
|
|
3300
|
-
this._appParam.viewportParam = appParam.viewportParam ? appParam.viewportParam : DefaultViewportParam;
|
|
3301
|
-
this._appParam.classes = appParam.classes ? appParam.classes : {
|
|
3302
|
-
assetManagerClass: AssetManager,
|
|
3303
|
-
controllerClass: Controller,
|
|
3304
|
-
worldClass: World,
|
|
3305
|
-
viewportClass: Viewport,
|
|
3306
|
-
};
|
|
3307
|
-
this._appParam.isRenderEveryFrame = appParam.isRenderEveryFrame;
|
|
3308
|
-
this._clock = new webgpu.Clock();
|
|
3309
|
-
this._camera = CameraFactory.createCamera(this._appParam.cameraParam);
|
|
3310
|
-
this._world = new this._appParam.classes.worldClass(this, this._appParam.worldParam ? this._appParam.worldParam : DefaultWorldParam);
|
|
3311
|
-
this._viewport = new this._appParam.classes.viewportClass(this, this._appParam.viewportParam, this._appParam.renderParam, this._appParam.postProcessParam);
|
|
3312
|
-
this._controller = new this._appParam.classes.controllerClass(this);
|
|
3313
|
-
this._assetManager = new this._appParam.classes.assetManagerClass(this);
|
|
3314
|
-
this.viewport.renderer.setAnimationLoop(() => {
|
|
3315
|
-
const delta = this._clock.getDelta();
|
|
3316
|
-
this.tick(delta);
|
|
3317
|
-
});
|
|
3318
|
-
this.postConstruct();
|
|
3319
|
-
}
|
|
3320
|
-
postConstruct() {
|
|
3321
|
-
this.controller.init();
|
|
3322
|
-
this.world.init();
|
|
3323
|
-
this.viewport.init();
|
|
3324
|
-
}
|
|
3325
|
-
init() {
|
|
3326
|
-
}
|
|
3327
|
-
tick(deltaTime) {
|
|
3328
|
-
this._controller.tick(deltaTime);
|
|
3329
|
-
this.world.tick(deltaTime);
|
|
3330
|
-
this._tickingFunctions.forEach(func => {
|
|
3331
|
-
func(deltaTime);
|
|
3332
|
-
});
|
|
3333
|
-
if (this._appParam.isRenderEveryFrame) {
|
|
3334
|
-
this.viewport.markRenderStateDirty();
|
|
3335
|
-
}
|
|
3336
|
-
this.viewport.render();
|
|
3337
|
-
}
|
|
3338
|
-
addTickingFunction(func) {
|
|
3339
|
-
this._tickingFunctions.push(func);
|
|
3340
|
-
}
|
|
3341
|
-
removeTickingFunction(func) {
|
|
3342
|
-
const index = this._tickingFunctions.indexOf(func);
|
|
3343
|
-
if (index >= 0) {
|
|
3344
|
-
this._tickingFunctions.splice(index, 1);
|
|
3345
|
-
}
|
|
3346
|
-
}
|
|
3347
|
-
destroy() {
|
|
3348
|
-
this.onCameraChangedDelegate.clear();
|
|
3349
|
-
this.controller.destroy();
|
|
3350
|
-
this.world.destroy();
|
|
3351
|
-
this.viewport.destroy();
|
|
3352
|
-
this._assetManager.clearAssets();
|
|
3353
|
-
}
|
|
3354
|
-
updateCamera(param) {
|
|
3355
|
-
const previousCam = this.camera;
|
|
3356
|
-
this._camera = CameraFactory.updataCamera(param, this.camera);
|
|
3357
|
-
if (previousCam !== this.camera) {
|
|
3358
|
-
this._onCameraChangedDelegate.broadcast();
|
|
3359
|
-
this.controller.updateCamera();
|
|
3360
|
-
}
|
|
3361
|
-
this._camera.updateProjectionMatrix();
|
|
3362
|
-
this.viewport.markRenderStateDirty();
|
|
3363
|
-
}
|
|
3364
|
-
onWindowResize(width, height) {
|
|
3365
|
-
if (this.camera instanceof webgpu.PerspectiveCamera) {
|
|
3366
|
-
this.camera.aspect = width / height;
|
|
3367
|
-
}
|
|
3368
|
-
// if(this.camera instanceof OrthographicCamera)
|
|
3369
|
-
// {
|
|
3370
|
-
// // to do
|
|
3371
|
-
// }
|
|
3372
|
-
this.camera.updateProjectionMatrix();
|
|
3373
|
-
}
|
|
3374
|
-
async renderAsImage(width = 1024, height = 1024) {
|
|
3375
|
-
return await this.viewport.renderAsImage(width, height);
|
|
3376
|
-
}
|
|
3377
|
-
}
|
|
91
|
+
const _0x55b4ea=_0x32c1;(function(_0x58c63c,_0x42d19c){const _0x2cfb02=_0x32c1,_0x2d417d=_0x58c63c();while(!![]){try{const _0x53d130=-parseInt(_0x2cfb02(0xf1))/0x1+parseInt(_0x2cfb02(0x108))/0x2*(parseInt(_0x2cfb02(0x107))/0x3)+-parseInt(_0x2cfb02(0xd9))/0x4+parseInt(_0x2cfb02(0x103))/0x5*(parseInt(_0x2cfb02(0xf7))/0x6)+parseInt(_0x2cfb02(0x105))/0x7*(parseInt(_0x2cfb02(0x100))/0x8)+parseInt(_0x2cfb02(0xec))/0x9*(-parseInt(_0x2cfb02(0xfc))/0xa)+parseInt(_0x2cfb02(0xe3))/0xb*(-parseInt(_0x2cfb02(0xe9))/0xc);if(_0x53d130===_0x42d19c)break;else _0x2d417d['push'](_0x2d417d['shift']());}catch(_0x2fc013){_0x2d417d['push'](_0x2d417d['shift']());}}}(_0x149f,0xe775f));function _0x32c1(_0x4a0488,_0x3546aa){_0x4a0488=_0x4a0488-0xd8;const _0x149f21=_0x149f();let _0x32c134=_0x149f21[_0x4a0488];return _0x32c134;}function _0x149f(){const _0x31c460=['_appParam','assetManagerClass','60048xhxWuY','_viewport','removeTickingFunction','_tickingFunctions','postProcessParam','486770wXiuWe','onCameraChangedDelegate','renderParam','destroy','544760CDpLcY','render','forEach','650DXGftl','indexOf','175KRjvTl','addTickingFunction','1427253KUhCVr','2jaYFSB','updateProjectionMatrix','_assetManager','worldClass','postConstruct','createCamera','_onCameraChangedDelegate','camera','isRenderEveryFrame','push','5625504PqlSVI','_camera','tick','markRenderStateDirty','controllerClass','viewport','splice','appParam','_world','controller','33aBxGcP','worldParam','assetManager','world','onWindowResize','updateCamera','3190476gKhtoe','clear','viewportParam','36koaKyT','_clock','cameraParam','classes','viewportClass','132400nhMnBO','renderAsImage','_controller','init'];_0x149f=function(){return _0x31c460;};return _0x149f();}class ThreeJsApp{get[_0x55b4ea(0x10f)](){const _0x20eb4e=_0x55b4ea;return this[_0x20eb4e(0xda)];}get['clock'](){const _0x5ada94=_0x55b4ea;return this[_0x5ada94(0xed)];}get[_0x55b4ea(0xe6)](){return this['_world'];}get['viewport'](){const _0x43255e=_0x55b4ea;return this[_0x43255e(0xf8)];}get[_0x55b4ea(0xe2)](){const _0x1a2807=_0x55b4ea;return this[_0x1a2807(0xf3)];}get[_0x55b4ea(0xe5)](){const _0x49a84b=_0x55b4ea;return this[_0x49a84b(0x10a)];}get[_0x55b4ea(0xe0)](){const _0x5e721b=_0x55b4ea;return this[_0x5e721b(0xf5)];}get[_0x55b4ea(0xfd)](){return this['_onCameraChangedDelegate'];}constructor(_0x21e6ab=DefaultAppParam){const _0x2019ef=_0x55b4ea;this[_0x2019ef(0xfa)]=[],this[_0x2019ef(0xf5)]={'viewportParam':DefaultViewportParam},this[_0x2019ef(0x10e)]=new Delegate(),this['_appParam'][_0x2019ef(0xee)]=_0x21e6ab[_0x2019ef(0xee)]?_0x21e6ab[_0x2019ef(0xee)]:DefaultCameraParam,this['_appParam'][_0x2019ef(0xfe)]=_0x21e6ab[_0x2019ef(0xfe)]?_0x21e6ab[_0x2019ef(0xfe)]:DefaultRendererParameters,this['_appParam'][_0x2019ef(0xfb)]=_0x21e6ab[_0x2019ef(0xfb)]?_0x21e6ab[_0x2019ef(0xfb)]:DefaultPostProcessParam,this[_0x2019ef(0xf5)][_0x2019ef(0xeb)]=_0x21e6ab['viewportParam']?_0x21e6ab[_0x2019ef(0xeb)]:DefaultViewportParam,this[_0x2019ef(0xf5)][_0x2019ef(0xef)]=_0x21e6ab[_0x2019ef(0xef)]?_0x21e6ab[_0x2019ef(0xef)]:{'assetManagerClass':AssetManager,'controllerClass':Controller,'worldClass':World,'viewportClass':Viewport},this[_0x2019ef(0xf5)][_0x2019ef(0x110)]=_0x21e6ab[_0x2019ef(0x110)],this[_0x2019ef(0xed)]=new webgpu.Clock(),this['_camera']=CameraFactory[_0x2019ef(0x10d)](this[_0x2019ef(0xf5)][_0x2019ef(0xee)]),this[_0x2019ef(0xe1)]=new this[(_0x2019ef(0xf5))][(_0x2019ef(0xef))][(_0x2019ef(0x10b))](this,this[_0x2019ef(0xf5)][_0x2019ef(0xe4)]?this[_0x2019ef(0xf5)][_0x2019ef(0xe4)]:DefaultWorldParam),this['_viewport']=new this[(_0x2019ef(0xf5))][(_0x2019ef(0xef))][(_0x2019ef(0xf0))](this,this[_0x2019ef(0xf5)][_0x2019ef(0xeb)],this[_0x2019ef(0xf5)]['renderParam'],this[_0x2019ef(0xf5)][_0x2019ef(0xfb)]),this[_0x2019ef(0xf3)]=new this[(_0x2019ef(0xf5))][(_0x2019ef(0xef))][(_0x2019ef(0xdd))](this),this['_assetManager']=new this[(_0x2019ef(0xf5))][(_0x2019ef(0xef))][(_0x2019ef(0xf6))](this),this['viewport']['renderer']['setAnimationLoop'](()=>{const _0x1d59a0=_0x2019ef,_0x7fe3f9=this[_0x1d59a0(0xed)]['getDelta']();this[_0x1d59a0(0xdb)](_0x7fe3f9);}),this[_0x2019ef(0x10c)]();}[_0x55b4ea(0x10c)](){const _0x2a5376=_0x55b4ea;this[_0x2a5376(0xe2)][_0x2a5376(0xf4)](),this[_0x2a5376(0xe6)][_0x2a5376(0xf4)](),this[_0x2a5376(0xde)][_0x2a5376(0xf4)]();}[_0x55b4ea(0xf4)](){}[_0x55b4ea(0xdb)](_0x32a089){const _0x38c1cd=_0x55b4ea;this[_0x38c1cd(0xf3)][_0x38c1cd(0xdb)](_0x32a089),this['world'][_0x38c1cd(0xdb)](_0x32a089),this[_0x38c1cd(0xfa)][_0x38c1cd(0x102)](_0x191c74=>{_0x191c74(_0x32a089);}),this[_0x38c1cd(0xf5)][_0x38c1cd(0x110)]&&this[_0x38c1cd(0xde)][_0x38c1cd(0xdc)](),this['viewport'][_0x38c1cd(0x101)]();}[_0x55b4ea(0x106)](_0x46dcae){const _0x93bd6b=_0x55b4ea;this['_tickingFunctions'][_0x93bd6b(0xd8)](_0x46dcae);}[_0x55b4ea(0xf9)](_0x5df3d5){const _0x7da528=_0x55b4ea,_0x2f1ec9=this[_0x7da528(0xfa)][_0x7da528(0x104)](_0x5df3d5);_0x2f1ec9>=0x0&&this[_0x7da528(0xfa)][_0x7da528(0xdf)](_0x2f1ec9,0x1);}[_0x55b4ea(0xff)](){const _0x3054a9=_0x55b4ea;this['onCameraChangedDelegate'][_0x3054a9(0xea)](),this[_0x3054a9(0xe2)]['destroy'](),this[_0x3054a9(0xe6)][_0x3054a9(0xff)](),this[_0x3054a9(0xde)][_0x3054a9(0xff)](),this['_assetManager']['clearAssets']();}[_0x55b4ea(0xe8)](_0x4439cd){const _0x2f7f05=_0x55b4ea,_0x48028b=this[_0x2f7f05(0x10f)];this[_0x2f7f05(0xda)]=CameraFactory['updataCamera'](_0x4439cd,this['camera']),_0x48028b!==this[_0x2f7f05(0x10f)]&&(this[_0x2f7f05(0x10e)]['broadcast'](),this[_0x2f7f05(0xe2)][_0x2f7f05(0xe8)]()),this[_0x2f7f05(0xda)][_0x2f7f05(0x109)](),this[_0x2f7f05(0xde)][_0x2f7f05(0xdc)]();}[_0x55b4ea(0xe7)](_0x2ef8c0,_0x5d3908){const _0x19e60b=_0x55b4ea;this[_0x19e60b(0x10f)]instanceof webgpu.PerspectiveCamera&&(this[_0x19e60b(0x10f)]['aspect']=_0x2ef8c0/_0x5d3908),this[_0x19e60b(0x10f)][_0x19e60b(0x109)]();}async[_0x55b4ea(0xf2)](_0x2e34ab=0x400,_0x3feaca=0x400){const _0x43ab0b=_0x55b4ea;return await this[_0x43ab0b(0xde)][_0x43ab0b(0xf2)](_0x2e34ab,_0x3feaca);}}
|
|
3378
92
|
|
|
3379
|
-
|
|
3380
|
-
* virtual class of light, should not be use directly.
|
|
3381
|
-
*/
|
|
3382
|
-
class LightComponent extends SceneComponent {
|
|
3383
|
-
get threeObject() {
|
|
3384
|
-
if (!this.obj) {
|
|
3385
|
-
throw Error("three object is invalid");
|
|
3386
|
-
}
|
|
3387
|
-
return this.obj;
|
|
3388
|
-
}
|
|
3389
|
-
set threeObject(newThreeObject) {
|
|
3390
|
-
this.obj = newThreeObject;
|
|
3391
|
-
if (this.obj) {
|
|
3392
|
-
this.obj.userData["LYObject"] = this;
|
|
3393
|
-
}
|
|
3394
|
-
}
|
|
3395
|
-
get color() {
|
|
3396
|
-
return this.threeObject.color.getHex();
|
|
3397
|
-
}
|
|
3398
|
-
set color(color) {
|
|
3399
|
-
this.threeObject.color.set(color);
|
|
3400
|
-
}
|
|
3401
|
-
get intensity() {
|
|
3402
|
-
return this.threeObject.intensity;
|
|
3403
|
-
}
|
|
3404
|
-
set intensity(intensity) {
|
|
3405
|
-
this.threeObject.intensity = intensity;
|
|
3406
|
-
}
|
|
3407
|
-
constructor(app, uuid) {
|
|
3408
|
-
super(app, uuid);
|
|
3409
|
-
}
|
|
3410
|
-
}
|
|
93
|
+
var _0x3ec3e2=_0x1404$1;function _0x3a0d(){var _0x1ae141=['getHex','36595PkAGRm','intensity','userData','set','5410930gloUBa','LYObject','10589856VMLOVs','three\x20object\x20is\x20invalid','obj','170cHdfbK','773480rHUnNB','color','threeObject','3piyeMi','1014YdVuLx','5402564nYCcKy','449407drICHD','1724913MyaECq'];_0x3a0d=function(){return _0x1ae141;};return _0x3a0d();}function _0x1404$1(_0x445d4b,_0x3e9ae7){_0x445d4b=_0x445d4b-0x9d;var _0x3a0dee=_0x3a0d();var _0x14046d=_0x3a0dee[_0x445d4b];return _0x14046d;}(function(_0x15620a,_0x3a7aa7){var _0x3665f8=_0x1404$1,_0x318322=_0x15620a();while(!![]){try{var _0x1553cc=parseInt(_0x3665f8(0xab))/0x1+-parseInt(_0x3665f8(0xa5))/0x2*(-parseInt(_0x3665f8(0xa8))/0x3)+parseInt(_0x3665f8(0xaa))/0x4+-parseInt(_0x3665f8(0xae))/0x5*(-parseInt(_0x3665f8(0xa9))/0x6)+-parseInt(_0x3665f8(0x9f))/0x7+parseInt(_0x3665f8(0xa1))/0x8+-parseInt(_0x3665f8(0xac))/0x9*(parseInt(_0x3665f8(0xa4))/0xa);if(_0x1553cc===_0x3a7aa7)break;else _0x318322['push'](_0x318322['shift']());}catch(_0x1f887c){_0x318322['push'](_0x318322['shift']());}}}(_0x3a0d,0xaedf0));class LightComponent extends SceneComponent{get[_0x3ec3e2(0xa7)](){var _0x511d3a=_0x3ec3e2;if(!this['obj'])throw Error(_0x511d3a(0xa2));return this[_0x511d3a(0xa3)];}set[_0x3ec3e2(0xa7)](_0x13cc7b){var _0x8103b9=_0x3ec3e2;this['obj']=_0x13cc7b,this[_0x8103b9(0xa3)]&&(this[_0x8103b9(0xa3)][_0x8103b9(0x9d)][_0x8103b9(0xa0)]=this);}get[_0x3ec3e2(0xa6)](){var _0x1d8001=_0x3ec3e2;return this[_0x1d8001(0xa7)][_0x1d8001(0xa6)][_0x1d8001(0xad)]();}set[_0x3ec3e2(0xa6)](_0x4eedec){var _0x1cb1be=_0x3ec3e2;this[_0x1cb1be(0xa7)][_0x1cb1be(0xa6)][_0x1cb1be(0x9e)](_0x4eedec);}get[_0x3ec3e2(0xaf)](){var _0x3beae4=_0x3ec3e2;return this[_0x3beae4(0xa7)]['intensity'];}set['intensity'](_0x316527){var _0x4d7734=_0x3ec3e2;this[_0x4d7734(0xa7)][_0x4d7734(0xaf)]=_0x316527;}constructor(_0x3a922e,_0x47878d){super(_0x3a922e,_0x47878d);}}
|
|
3411
94
|
|
|
3412
|
-
class DirectionalLightComponent extends LightComponent {
|
|
3413
|
-
get threeObject() {
|
|
3414
|
-
if (!this.obj) {
|
|
3415
|
-
throw Error("three object is invalid");
|
|
3416
|
-
}
|
|
3417
|
-
return this.obj;
|
|
3418
|
-
}
|
|
3419
|
-
set threeObject(newThreeObject) {
|
|
3420
|
-
this.obj = newThreeObject;
|
|
3421
|
-
if (this.obj) {
|
|
3422
|
-
this.obj.userData["LYObject"] = this;
|
|
3423
|
-
}
|
|
3424
|
-
}
|
|
3425
|
-
get castShadow() {
|
|
3426
|
-
return this.threeObject.castShadow;
|
|
3427
|
-
}
|
|
3428
|
-
set castShadow(value) {
|
|
3429
|
-
this.threeObject.castShadow = value;
|
|
3430
|
-
}
|
|
3431
|
-
constructor(app, color = 0xffffff, intensity = 10, uuid) {
|
|
3432
|
-
super(app, uuid);
|
|
3433
|
-
this.threeObject.color.set(color);
|
|
3434
|
-
this.threeObject.intensity = intensity;
|
|
3435
|
-
}
|
|
3436
|
-
createDefaultObject() {
|
|
3437
|
-
return new webgpu.DirectionalLight(0xffffff, 10);
|
|
3438
|
-
}
|
|
3439
|
-
setPosition(...args) {
|
|
3440
|
-
if (args.length === 1) {
|
|
3441
|
-
super.setPosition(args[0]);
|
|
3442
|
-
}
|
|
3443
|
-
else {
|
|
3444
|
-
super.setPosition(args[0], args[1], args[2]);
|
|
3445
|
-
}
|
|
3446
|
-
this.update();
|
|
3447
|
-
}
|
|
3448
|
-
update() {
|
|
3449
|
-
if (this.world)
|
|
3450
|
-
this.world.viewport.markRenderStateDirty();
|
|
3451
|
-
}
|
|
3452
|
-
onAddedToWorld(world) {
|
|
3453
|
-
if (!this.threeObject) {
|
|
3454
|
-
throw Error("three object is invalid");
|
|
3455
|
-
}
|
|
3456
|
-
super.onAddedToWorld(world);
|
|
3457
|
-
}
|
|
3458
|
-
destroy() {
|
|
3459
|
-
super.destroy();
|
|
3460
|
-
}
|
|
3461
|
-
}
|
|
95
|
+
function _0x2b24(_0x53adfb,_0x328619){_0x53adfb=_0x53adfb-0xc6;var _0xf77111=_0xf771();var _0x2b249b=_0xf77111[_0x53adfb];return _0x2b249b;}var _0x57a7b9=_0x2b24;(function(_0x457dd2,_0x27c664){var _0x49d412=_0x2b24,_0xdf5ed6=_0x457dd2();while(!![]){try{var _0x21bd99=parseInt(_0x49d412(0xd8))/0x1+parseInt(_0x49d412(0xdb))/0x2*(-parseInt(_0x49d412(0xcb))/0x3)+parseInt(_0x49d412(0xcc))/0x4*(parseInt(_0x49d412(0xc6))/0x5)+parseInt(_0x49d412(0xd6))/0x6+parseInt(_0x49d412(0xcd))/0x7+-parseInt(_0x49d412(0xd1))/0x8*(-parseInt(_0x49d412(0xd5))/0x9)+-parseInt(_0x49d412(0xca))/0xa;if(_0x21bd99===_0x27c664)break;else _0xdf5ed6['push'](_0xdf5ed6['shift']());}catch(_0x52e06d){_0xdf5ed6['push'](_0xdf5ed6['shift']());}}}(_0xf771,0xe4e19));function _0xf771(){var _0x1506d1=['2529WXaZPU','794204tuHHvi','642362LumRuz','castShadow','setPosition','world','8VGidex','markRenderStateDirty','onAddedToWorld','userData','15704559DSTZWW','3291168JeNawT','set','617731IADHWB','viewport','obj','1550lKQDqt','threeObject','length','20eGqTkJ','update','three\x20object\x20is\x20invalid','LYObject','22063580xSwiOF'];_0xf771=function(){return _0x1506d1;};return _0xf771();}class DirectionalLightComponent extends LightComponent{get['threeObject'](){var _0x17a776=_0x2b24;if(!this[_0x17a776(0xda)])throw Error(_0x17a776(0xc8));return this[_0x17a776(0xda)];}set[_0x57a7b9(0xdc)](_0xd20618){var _0x9a7c9e=_0x57a7b9;this[_0x9a7c9e(0xda)]=_0xd20618,this[_0x9a7c9e(0xda)]&&(this[_0x9a7c9e(0xda)][_0x9a7c9e(0xd4)][_0x9a7c9e(0xc9)]=this);}get[_0x57a7b9(0xce)](){var _0x203810=_0x57a7b9;return this[_0x203810(0xdc)][_0x203810(0xce)];}set[_0x57a7b9(0xce)](_0x25c62b){this['threeObject']['castShadow']=_0x25c62b;}constructor(_0x4ecd4e,_0x17386e=0xffffff,_0x205ef5=0xa,_0x1a1b57){var _0x26c841=_0x57a7b9;super(_0x4ecd4e,_0x1a1b57),this['threeObject']['color'][_0x26c841(0xd7)](_0x17386e),this['threeObject']['intensity']=_0x205ef5;}['createDefaultObject'](){return new webgpu.DirectionalLight(0xffffff,0xa);}[_0x57a7b9(0xcf)](..._0x15a8f0){var _0x17786f=_0x57a7b9;_0x15a8f0[_0x17786f(0xdd)]===0x1?super[_0x17786f(0xcf)](_0x15a8f0[0x0]):super[_0x17786f(0xcf)](_0x15a8f0[0x0],_0x15a8f0[0x1],_0x15a8f0[0x2]),this['update']();}[_0x57a7b9(0xc7)](){var _0x372dca=_0x57a7b9;if(this[_0x372dca(0xd0)])this[_0x372dca(0xd0)][_0x372dca(0xd9)][_0x372dca(0xd2)]();}['onAddedToWorld'](_0x31339d){var _0x1b5cc9=_0x57a7b9;if(!this['threeObject'])throw Error(_0x1b5cc9(0xc8));super[_0x1b5cc9(0xd3)](_0x31339d);}['destroy'](){super['destroy']();}}
|
|
3462
96
|
|
|
3463
|
-
class DirectionalLightActor extends Actor {
|
|
3464
|
-
constructor(app, color = 0xffffff, intensity = 1, uuid) {
|
|
3465
|
-
super(app, uuid);
|
|
3466
|
-
this.lightComponent = null;
|
|
3467
|
-
this.lightComponent = this.rootComponent;
|
|
3468
|
-
if (this.lightComponent) {
|
|
3469
|
-
this.lightComponent.color = color;
|
|
3470
|
-
this.lightComponent.intensity = intensity;
|
|
3471
|
-
this.lightComponent.castShadow = true;
|
|
3472
|
-
}
|
|
3473
|
-
this.lightComponent.castShadow = true;
|
|
3474
|
-
}
|
|
3475
|
-
constructRootComponent() {
|
|
3476
|
-
return new DirectionalLightComponent(this.app);
|
|
3477
|
-
}
|
|
3478
|
-
}
|
|
97
|
+
function _0x29bf(_0xf4d138,_0x2b1cf2){_0xf4d138=_0xf4d138-0x1c4;var _0x457021=_0x4570();var _0x29bfe9=_0x457021[_0xf4d138];return _0x29bfe9;}var _0x56de05=_0x29bf;(function(_0x14f097,_0x3da417){var _0x28048d=_0x29bf,_0x3cd4de=_0x14f097();while(!![]){try{var _0x1c9a9d=parseInt(_0x28048d(0x1d0))/0x1+-parseInt(_0x28048d(0x1cf))/0x2*(-parseInt(_0x28048d(0x1c4))/0x3)+parseInt(_0x28048d(0x1c5))/0x4*(-parseInt(_0x28048d(0x1cb))/0x5)+parseInt(_0x28048d(0x1d1))/0x6+parseInt(_0x28048d(0x1cd))/0x7*(-parseInt(_0x28048d(0x1c7))/0x8)+-parseInt(_0x28048d(0x1cc))/0x9+-parseInt(_0x28048d(0x1c9))/0xa;if(_0x1c9a9d===_0x3da417)break;else _0x3cd4de['push'](_0x3cd4de['shift']());}catch(_0xdfc919){_0x3cd4de['push'](_0x3cd4de['shift']());}}}(_0x4570,0x515fe));function _0x4570(){var _0x1e259b=['constructRootComponent','lightComponent','1938537NvyWOK','20PzvnkB','castShadow','24pGpjWi','intensity','664830htWIRX','rootComponent','276015PIjFjL','3331557xcCwtu','80129fuAbGN','app','2oCkYHA','227573RFNhTh','1239420ZeWOya'];_0x4570=function(){return _0x1e259b;};return _0x4570();}class DirectionalLightActor extends Actor{constructor(_0x5c41da,_0x3a8f5b=0xffffff,_0x7f831c=0x1,_0x3680d7){var _0x47bf60=_0x29bf;super(_0x5c41da,_0x3680d7),this[_0x47bf60(0x1d3)]=null,this[_0x47bf60(0x1d3)]=this[_0x47bf60(0x1ca)],this[_0x47bf60(0x1d3)]&&(this['lightComponent']['color']=_0x3a8f5b,this[_0x47bf60(0x1d3)][_0x47bf60(0x1c8)]=_0x7f831c,this[_0x47bf60(0x1d3)]['castShadow']=!![]),this[_0x47bf60(0x1d3)][_0x47bf60(0x1c6)]=!![];}[_0x56de05(0x1d2)](){var _0x509469=_0x56de05;return new DirectionalLightComponent(this[_0x509469(0x1ce)]);}}
|
|
3479
98
|
|
|
3480
|
-
class AmbientLightComponent extends LightComponent {
|
|
3481
|
-
get threeObject() {
|
|
3482
|
-
if (!this.obj) {
|
|
3483
|
-
throw Error("three object is invalid");
|
|
3484
|
-
}
|
|
3485
|
-
return this.obj;
|
|
3486
|
-
}
|
|
3487
|
-
set threeObject(newThreeObject) {
|
|
3488
|
-
this.obj = newThreeObject;
|
|
3489
|
-
if (this.obj) {
|
|
3490
|
-
this.obj.userData["LYObject"] = this;
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
|
-
get castShadow() {
|
|
3494
|
-
return this.threeObject.castShadow;
|
|
3495
|
-
}
|
|
3496
|
-
set castShadow(value) {
|
|
3497
|
-
this.threeObject.castShadow = value;
|
|
3498
|
-
}
|
|
3499
|
-
constructor(app, color = 0xffffff, intensity = 10, uuid) {
|
|
3500
|
-
super(app, uuid);
|
|
3501
|
-
this.threeObject.color.set(color);
|
|
3502
|
-
this.threeObject.intensity = intensity;
|
|
3503
|
-
}
|
|
3504
|
-
createDefaultObject() {
|
|
3505
|
-
return new webgpu.AmbientLight(0xffffff, 10);
|
|
3506
|
-
}
|
|
3507
|
-
setPosition(...args) {
|
|
3508
|
-
if (args.length === 1) {
|
|
3509
|
-
super.setPosition(args[0]);
|
|
3510
|
-
}
|
|
3511
|
-
else {
|
|
3512
|
-
super.setPosition(args[0], args[1], args[2]);
|
|
3513
|
-
}
|
|
3514
|
-
this.update();
|
|
3515
|
-
}
|
|
3516
|
-
update() {
|
|
3517
|
-
if (this.world)
|
|
3518
|
-
this.world.viewport.markRenderStateDirty();
|
|
3519
|
-
}
|
|
3520
|
-
onAddedToWorld(world) {
|
|
3521
|
-
if (!this.threeObject) {
|
|
3522
|
-
throw Error("three object is invalid");
|
|
3523
|
-
}
|
|
3524
|
-
super.onAddedToWorld(world);
|
|
3525
|
-
}
|
|
3526
|
-
destroy() {
|
|
3527
|
-
super.destroy();
|
|
3528
|
-
}
|
|
3529
|
-
}
|
|
99
|
+
var _0x2bb4c5=_0x3a4a;(function(_0x2f6a81,_0x27a560){var _0x139dc9=_0x3a4a,_0x4bbf70=_0x2f6a81();while(!![]){try{var _0x201b8b=-parseInt(_0x139dc9(0xf3))/0x1*(parseInt(_0x139dc9(0x10e))/0x2)+-parseInt(_0x139dc9(0xfe))/0x3*(-parseInt(_0x139dc9(0x102))/0x4)+-parseInt(_0x139dc9(0x105))/0x5*(parseInt(_0x139dc9(0xfc))/0x6)+parseInt(_0x139dc9(0xf0))/0x7*(parseInt(_0x139dc9(0xf4))/0x8)+-parseInt(_0x139dc9(0x101))/0x9+parseInt(_0x139dc9(0x10c))/0xa*(parseInt(_0x139dc9(0xfd))/0xb)+-parseInt(_0x139dc9(0xfb))/0xc*(-parseInt(_0x139dc9(0x103))/0xd);if(_0x201b8b===_0x27a560)break;else _0x4bbf70['push'](_0x4bbf70['shift']());}catch(_0x3fc227){_0x4bbf70['push'](_0x4bbf70['shift']());}}}(_0x1404,0xc3096));function _0x3a4a(_0x2f55a8,_0x19847e){_0x2f55a8=_0x2f55a8-0xf0;var _0x140428=_0x1404();var _0x3a4afa=_0x140428[_0x2f55a8];return _0x3a4afa;}class AmbientLightComponent extends LightComponent{get['threeObject'](){var _0x23d3eb=_0x3a4a;if(!this[_0x23d3eb(0xf9)])throw Error('three\x20object\x20is\x20invalid');return this[_0x23d3eb(0xf9)];}set[_0x2bb4c5(0xf2)](_0x23f06d){var _0x263cae=_0x2bb4c5;this['obj']=_0x23f06d,this[_0x263cae(0xf9)]&&(this['obj'][_0x263cae(0x104)][_0x263cae(0x100)]=this);}get['castShadow'](){var _0x4eed47=_0x2bb4c5;return this[_0x4eed47(0xf2)][_0x4eed47(0x109)];}set[_0x2bb4c5(0x109)](_0x314ebf){var _0x13ad56=_0x2bb4c5;this[_0x13ad56(0xf2)][_0x13ad56(0x109)]=_0x314ebf;}constructor(_0x25c258,_0x5df69c=0xffffff,_0x180e61=0xa,_0x38e117){var _0x4b42f8=_0x2bb4c5;super(_0x25c258,_0x38e117),this[_0x4b42f8(0xf2)][_0x4b42f8(0xff)][_0x4b42f8(0x10d)](_0x5df69c),this[_0x4b42f8(0xf2)][_0x4b42f8(0x10b)]=_0x180e61;}[_0x2bb4c5(0xfa)](){return new webgpu.AmbientLight(0xffffff,0xa);}[_0x2bb4c5(0xf1)](..._0x6f7932){var _0x378603=_0x2bb4c5;_0x6f7932[_0x378603(0x108)]===0x1?super[_0x378603(0xf1)](_0x6f7932[0x0]):super[_0x378603(0xf1)](_0x6f7932[0x0],_0x6f7932[0x1],_0x6f7932[0x2]),this[_0x378603(0xf5)]();}['update'](){var _0x5d1d15=_0x2bb4c5;if(this[_0x5d1d15(0xf7)])this['world'][_0x5d1d15(0x106)][_0x5d1d15(0xf8)]();}[_0x2bb4c5(0x107)](_0xff344c){var _0x5653dc=_0x2bb4c5;if(!this[_0x5653dc(0xf2)])throw Error(_0x5653dc(0x10a));super['onAddedToWorld'](_0xff344c);}[_0x2bb4c5(0xf6)](){var _0x321043=_0x2bb4c5;super[_0x321043(0xf6)]();}}function _0x1404(){var _0x5849b7=['setPosition','threeObject','1332636GvxmDP','1256umfOyL','update','destroy','world','markRenderStateDirty','obj','createDefaultObject','480OnVcZM','450DfpubU','143zmiddu','796701YyxVug','color','LYObject','450648kQPYOv','4FJLmkV','400426MKbQBJ','userData','7630SIPkUZ','viewport','onAddedToWorld','length','castShadow','three\x20object\x20is\x20invalid','intensity','337940ExjhsB','set','2LbJkYh','16009tIJgjk'];_0x1404=function(){return _0x5849b7;};return _0x1404();}
|
|
3530
100
|
|
|
3531
|
-
class AmbientLightActor extends Actor {
|
|
3532
|
-
constructor(app, color = 0xffffff, intensity = 1, uuid) {
|
|
3533
|
-
super(app, uuid);
|
|
3534
|
-
this.lightComponent = null;
|
|
3535
|
-
this.lightComponent = this.rootComponent;
|
|
3536
|
-
if (this.lightComponent) {
|
|
3537
|
-
this.lightComponent.color = color;
|
|
3538
|
-
this.lightComponent.intensity = intensity;
|
|
3539
|
-
this.lightComponent.castShadow = true;
|
|
3540
|
-
}
|
|
3541
|
-
this.lightComponent.castShadow = true;
|
|
3542
|
-
}
|
|
3543
|
-
constructRootComponent() {
|
|
3544
|
-
return new AmbientLightComponent(this.app);
|
|
3545
|
-
}
|
|
3546
|
-
}
|
|
101
|
+
var _0x16f1ba=_0x549e;(function(_0x3e8c5d,_0x59a960){var _0x4338a5=_0x549e,_0x19aae6=_0x3e8c5d();while(!![]){try{var _0x5132fe=-parseInt(_0x4338a5(0x1ce))/0x1+-parseInt(_0x4338a5(0x1d8))/0x2*(-parseInt(_0x4338a5(0x1d4))/0x3)+parseInt(_0x4338a5(0x1d5))/0x4*(-parseInt(_0x4338a5(0x1d9))/0x5)+parseInt(_0x4338a5(0x1df))/0x6+-parseInt(_0x4338a5(0x1dd))/0x7*(parseInt(_0x4338a5(0x1d1))/0x8)+parseInt(_0x4338a5(0x1cf))/0x9*(-parseInt(_0x4338a5(0x1db))/0xa)+-parseInt(_0x4338a5(0x1de))/0xb*(-parseInt(_0x4338a5(0x1d0))/0xc);if(_0x5132fe===_0x59a960)break;else _0x19aae6['push'](_0x19aae6['shift']());}catch(_0x3be1b7){_0x19aae6['push'](_0x19aae6['shift']());}}}(_0x4334,0xc8787));function _0x4334(){var _0x29f6f9=['11rjcxOb','3093480gnzbWB','color','536240QgQuEY','9EhOMbW','40695276Spsmlh','1192GkRTXn','constructRootComponent','castShadow','1374798OTXtIB','1688056RpmWkm','rootComponent','intensity','2hInElj','10qDxOxY','lightComponent','9227030heabLN','app','58303VMtypj'];_0x4334=function(){return _0x29f6f9;};return _0x4334();}function _0x549e(_0x3f9beb,_0x119fa0){_0x3f9beb=_0x3f9beb-0x1cd;var _0x43342b=_0x4334();var _0x549e55=_0x43342b[_0x3f9beb];return _0x549e55;}class AmbientLightActor extends Actor{constructor(_0x337a5b,_0xd2054=0xffffff,_0x52811a=0x1,_0x1f60c7){var _0x5eb0f8=_0x549e;super(_0x337a5b,_0x1f60c7),this[_0x5eb0f8(0x1da)]=null,this[_0x5eb0f8(0x1da)]=this[_0x5eb0f8(0x1d6)],this[_0x5eb0f8(0x1da)]&&(this[_0x5eb0f8(0x1da)][_0x5eb0f8(0x1cd)]=_0xd2054,this['lightComponent'][_0x5eb0f8(0x1d7)]=_0x52811a,this[_0x5eb0f8(0x1da)][_0x5eb0f8(0x1d3)]=!![]),this[_0x5eb0f8(0x1da)][_0x5eb0f8(0x1d3)]=!![];}[_0x16f1ba(0x1d2)](){var _0x470ecc=_0x16f1ba;return new AmbientLightComponent(this[_0x470ecc(0x1dc)]);}}
|
|
3547
102
|
|
|
3548
|
-
class BoxComponent extends MeshComponent {
|
|
3549
|
-
constructor(app, width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1, material = new webgpu.MeshStandardMaterial(), uuid) {
|
|
3550
|
-
super(app, new webgpu.BoxGeometry(width, height, depth, widthSegments, heightSegments, depthSegments), material, uuid);
|
|
3551
|
-
}
|
|
3552
|
-
}
|
|
103
|
+
(function(_0x20d940,_0x3c85a6){var _0x3309b8=_0x1eb0,_0x1db128=_0x20d940();while(!![]){try{var _0x4bca83=parseInt(_0x3309b8(0x1ae))/0x1+parseInt(_0x3309b8(0x1b1))/0x2*(-parseInt(_0x3309b8(0x1b2))/0x3)+-parseInt(_0x3309b8(0x1b7))/0x4*(-parseInt(_0x3309b8(0x1b4))/0x5)+-parseInt(_0x3309b8(0x1ac))/0x6+-parseInt(_0x3309b8(0x1af))/0x7*(-parseInt(_0x3309b8(0x1ad))/0x8)+parseInt(_0x3309b8(0x1b6))/0x9*(-parseInt(_0x3309b8(0x1b0))/0xa)+-parseInt(_0x3309b8(0x1b5))/0xb*(-parseInt(_0x3309b8(0x1b3))/0xc);if(_0x4bca83===_0x3c85a6)break;else _0x1db128['push'](_0x1db128['shift']());}catch(_0x21ee5e){_0x1db128['push'](_0x1db128['shift']());}}}(_0x5506,0xc44a3));function _0x1eb0(_0x19c0ee,_0x340e14){_0x19c0ee=_0x19c0ee-0x1ac;var _0x5506ef=_0x5506();var _0x1eb046=_0x5506ef[_0x19c0ee];return _0x1eb046;}function _0x5506(){var _0x3c5bd2=['6483528occVSc','27016ETQKQo','221629dNBXVQ','3227vqCKQM','8935350InRxbb','2oRiXgX','3348264IzMJmb','72960spkxLM','51580wofSdL','3212HyQOgg','9JhACBU','132QrgbOC'];_0x5506=function(){return _0x3c5bd2;};return _0x5506();}class BoxComponent extends MeshComponent{constructor(_0x452dd4,_0x134a9e=0x1,_0x2905d9=0x1,_0xe9030e=0x1,_0xe0da89=0x1,_0x13bf01=0x1,_0x21a6ae=0x1,_0x3bba87=new webgpu.MeshStandardMaterial(),_0x15d151){super(_0x452dd4,new webgpu.BoxGeometry(_0x134a9e,_0x2905d9,_0xe9030e,_0xe0da89,_0x13bf01,_0x21a6ae),_0x3bba87,_0x15d151);}}
|
|
3553
104
|
|
|
3554
|
-
class BoxActor extends Actor
|
|
3555
|
-
constructor(app, uuid) {
|
|
3556
|
-
super(app, uuid);
|
|
3557
|
-
}
|
|
3558
|
-
constructRootComponent() {
|
|
3559
|
-
return new BoxComponent(this.app, 1, 1, 1, 1, 1, 1, new webgpu.MeshBasicMaterial(), this.uuid);
|
|
3560
|
-
}
|
|
3561
|
-
}
|
|
105
|
+
function _0x4881(){var _0x2c9c5b=['837440YySBqI','294740QhhbZN','app','7770FZBiok','1002554lZxuFZ','413431oZFFpN','40FalxWJ','2hnHuvf','2463801DQVzSG','constructRootComponent','13480155ROBCdv','uuid'];_0x4881=function(){return _0x2c9c5b;};return _0x4881();}var _0x471d9b=_0x2029;(function(_0x42e7e1,_0xc85ecd){var _0x24078a=_0x2029,_0x1b884f=_0x42e7e1();while(!![]){try{var _0x993698=-parseInt(_0x24078a(0x144))/0x1*(-parseInt(_0x24078a(0x13a))/0x2)+-parseInt(_0x24078a(0x13b))/0x3+-parseInt(_0x24078a(0x145))/0x4*(parseInt(_0x24078a(0x140))/0x5)+parseInt(_0x24078a(0x142))/0x6+-parseInt(_0x24078a(0x143))/0x7+parseInt(_0x24078a(0x13f))/0x8+parseInt(_0x24078a(0x13d))/0x9;if(_0x993698===_0xc85ecd)break;else _0x1b884f['push'](_0x1b884f['shift']());}catch(_0x20c9c1){_0x1b884f['push'](_0x1b884f['shift']());}}}(_0x4881,0x71180));function _0x2029(_0x6ee6e8,_0xb28fb9){_0x6ee6e8=_0x6ee6e8-0x13a;var _0x488131=_0x4881();var _0x202921=_0x488131[_0x6ee6e8];return _0x202921;}class BoxActor extends Actor{constructor(_0x445544,_0x153366){super(_0x445544,_0x153366);}[_0x471d9b(0x13c)](){var _0x3d8941=_0x471d9b;return new BoxComponent(this[_0x3d8941(0x141)],0x1,0x1,0x1,0x1,0x1,0x1,new webgpu.MeshBasicMaterial(),this[_0x3d8941(0x13e)]);}}
|
|
3562
106
|
|
|
3563
|
-
const DefaultSkyParam = {
|
|
3564
|
-
turbidity: 10,
|
|
3565
|
-
rayleigh: 3,
|
|
3566
|
-
mieCoefficient: 0.005,
|
|
3567
|
-
mieDirectionalG: 0.7,
|
|
3568
|
-
elevation: 2,
|
|
3569
|
-
azimuth: 135,
|
|
3570
|
-
};
|
|
3571
|
-
class SkyComponent extends SceneComponent {
|
|
3572
|
-
get threeObject() {
|
|
3573
|
-
if (!this.obj) {
|
|
3574
|
-
throw Error("three object is invalid");
|
|
3575
|
-
}
|
|
3576
|
-
return this.obj;
|
|
3577
|
-
}
|
|
3578
|
-
set threeObject(newThreeObject) {
|
|
3579
|
-
this.obj = newThreeObject;
|
|
3580
|
-
if (this.obj) {
|
|
3581
|
-
this.obj.userData["LYObject"] = this;
|
|
3582
|
-
}
|
|
3583
|
-
}
|
|
3584
|
-
constructor(app, skyparam, uuid) {
|
|
3585
|
-
super(app, uuid);
|
|
3586
|
-
this.skyParam = DefaultSkyParam;
|
|
3587
|
-
this.sunPosition = new webgpu.Vector3();
|
|
3588
|
-
if (skyparam) {
|
|
3589
|
-
this.skyParam = skyparam;
|
|
3590
|
-
}
|
|
3591
|
-
this.updateSky();
|
|
3592
|
-
}
|
|
3593
|
-
createDefaultObject() {
|
|
3594
|
-
return new SkyMesh_js.SkyMesh();
|
|
3595
|
-
}
|
|
3596
|
-
updateSky() {
|
|
3597
|
-
var _a, _b;
|
|
3598
|
-
this.threeObject.turbidity.value = this.skyParam.turbidity;
|
|
3599
|
-
this.threeObject.rayleigh.value = this.skyParam.rayleigh;
|
|
3600
|
-
this.threeObject.mieCoefficient.value = this.skyParam.mieCoefficient;
|
|
3601
|
-
this.threeObject.mieDirectionalG.value = this.skyParam.mieDirectionalG;
|
|
3602
|
-
const phi = webgpu.MathUtils.degToRad(90 - this.skyParam.elevation);
|
|
3603
|
-
const theta = webgpu.MathUtils.degToRad(this.skyParam.azimuth);
|
|
3604
|
-
this.sunPosition.setFromSphericalCoords(1, phi, theta);
|
|
3605
|
-
this.threeObject.sunPosition.value.copy(this.sunPosition);
|
|
3606
|
-
(_b = (_a = this.world) === null || _a === void 0 ? void 0 : _a.viewport) === null || _b === void 0 ? void 0 : _b.markRenderStateDirty();
|
|
3607
|
-
}
|
|
3608
|
-
destroyObject() {
|
|
3609
|
-
if (this.obj) {
|
|
3610
|
-
ThreeObjectLibrary.disposeMeshResource(this.threeObject);
|
|
3611
|
-
}
|
|
3612
|
-
}
|
|
3613
|
-
}
|
|
107
|
+
function _0xab55(_0x3ecfde,_0x30e705){_0x3ecfde=_0x3ecfde-0x105;const _0x3533c8=_0x3533();let _0xab55f5=_0x3533c8[_0x3ecfde];return _0xab55f5;}const _0x1242f9=_0xab55;(function(_0x4f3cbf,_0x341d82){const _0x1ae8a1=_0xab55,_0x46baff=_0x4f3cbf();while(!![]){try{const _0x370fe9=-parseInt(_0x1ae8a1(0x117))/0x1+parseInt(_0x1ae8a1(0x113))/0x2*(-parseInt(_0x1ae8a1(0x108))/0x3)+-parseInt(_0x1ae8a1(0x118))/0x4*(-parseInt(_0x1ae8a1(0x10b))/0x5)+parseInt(_0x1ae8a1(0x11b))/0x6+parseInt(_0x1ae8a1(0x107))/0x7+parseInt(_0x1ae8a1(0x10d))/0x8*(parseInt(_0x1ae8a1(0x11a))/0x9)+-parseInt(_0x1ae8a1(0x106))/0xa;if(_0x370fe9===_0x341d82)break;else _0x46baff['push'](_0x46baff['shift']());}catch(_0x24ed5e){_0x46baff['push'](_0x46baff['shift']());}}}(_0x3533,0x45f9a));function _0x3533(){const _0x40a6f6=['degToRad','value','viewport','obj','5217680oiuWzJ','1054970GzvazL','2043CTBjPx','destroyObject','mieCoefficient','1581880wdRHIl','createDefaultObject','19256eiYcDy','disposeMeshResource','turbidity','skyParam','sunPosition','markRenderStateDirty','112QtlYrr','LYObject','userData','mieDirectionalG','532621LkMtqu','4TPMJHZ','threeObject','1332sarLvS','3334926xqnfqN','rayleigh','setFromSphericalCoords'];_0x3533=function(){return _0x40a6f6;};return _0x3533();}const DefaultSkyParam={'turbidity':0xa,'rayleigh':0x3,'mieCoefficient':0.005,'mieDirectionalG':0.7,'elevation':0x2,'azimuth':0x87};class SkyComponent extends SceneComponent{get[_0x1242f9(0x119)](){const _0x15633a=_0x1242f9;if(!this[_0x15633a(0x105)])throw Error('three\x20object\x20is\x20invalid');return this[_0x15633a(0x105)];}set['threeObject'](_0x4c717f){const _0x21cf23=_0x1242f9;this['obj']=_0x4c717f,this[_0x21cf23(0x105)]&&(this['obj'][_0x21cf23(0x115)][_0x21cf23(0x114)]=this);}constructor(_0x184ccc,_0x5183ae,_0x4defdd){const _0x213ee8=_0x1242f9;super(_0x184ccc,_0x4defdd),this['skyParam']=DefaultSkyParam,this[_0x213ee8(0x111)]=new webgpu.Vector3(),_0x5183ae&&(this[_0x213ee8(0x110)]=_0x5183ae),this['updateSky']();}[_0x1242f9(0x10c)](){return new SkyMesh_js.SkyMesh();}['updateSky'](){const _0x263ee=_0x1242f9;var _0x364050,_0xbfad69;this[_0x263ee(0x119)]['turbidity'][_0x263ee(0x11f)]=this[_0x263ee(0x110)][_0x263ee(0x10f)],this[_0x263ee(0x119)][_0x263ee(0x11c)][_0x263ee(0x11f)]=this[_0x263ee(0x110)][_0x263ee(0x11c)],this['threeObject'][_0x263ee(0x10a)][_0x263ee(0x11f)]=this[_0x263ee(0x110)][_0x263ee(0x10a)],this['threeObject'][_0x263ee(0x116)][_0x263ee(0x11f)]=this[_0x263ee(0x110)]['mieDirectionalG'];const _0x367e7e=webgpu.MathUtils['degToRad'](0x5a-this['skyParam']['elevation']),_0x1f4d32=webgpu.MathUtils[_0x263ee(0x11e)](this[_0x263ee(0x110)]['azimuth']);this[_0x263ee(0x111)][_0x263ee(0x11d)](0x1,_0x367e7e,_0x1f4d32),this[_0x263ee(0x119)]['sunPosition'][_0x263ee(0x11f)]['copy'](this[_0x263ee(0x111)]),(_0xbfad69=(_0x364050=this['world'])===null||_0x364050===void 0?void 0:_0x364050[_0x263ee(0x120)])===null||_0xbfad69===void 0?void 0:_0xbfad69[_0x263ee(0x112)]();}[_0x1242f9(0x109)](){const _0x51dec1=_0x1242f9;this['obj']&&ThreeObjectLibrary[_0x51dec1(0x10e)](this['threeObject']);}}
|
|
3614
108
|
|
|
3615
|
-
class SkyActor extends Actor {
|
|
3616
|
-
constructor(app, uuid) {
|
|
3617
|
-
super(app, uuid);
|
|
3618
|
-
this._name = "SkyActor";
|
|
3619
|
-
this.skyComponent = null;
|
|
3620
|
-
this.name = "SkyActor";
|
|
3621
|
-
this.skyComponent = this.rootComponent;
|
|
3622
|
-
this.rootComponent.name = `${this.rootComponent.name}(Root)`;
|
|
3623
|
-
this.setScale(45000, 45000, 45000);
|
|
3624
|
-
}
|
|
3625
|
-
constructRootComponent() {
|
|
3626
|
-
return new SkyComponent(this.app);
|
|
3627
|
-
}
|
|
3628
|
-
}
|
|
109
|
+
function _0xafe1(_0x40d61a,_0x2d8c13){_0x40d61a=_0x40d61a-0x7d;var _0x156431=_0x1564();var _0xafe18=_0x156431[_0x40d61a];return _0xafe18;}var _0x1c1129=_0xafe1;(function(_0x111d94,_0x5d1d9b){var _0x303e1c=_0xafe1,_0x591f8c=_0x111d94();while(!![]){try{var _0x53bae6=-parseInt(_0x303e1c(0x7d))/0x1*(parseInt(_0x303e1c(0x89))/0x2)+parseInt(_0x303e1c(0x86))/0x3+parseInt(_0x303e1c(0x87))/0x4*(-parseInt(_0x303e1c(0x8a))/0x5)+parseInt(_0x303e1c(0x82))/0x6+-parseInt(_0x303e1c(0x7e))/0x7*(parseInt(_0x303e1c(0x7f))/0x8)+parseInt(_0x303e1c(0x88))/0x9+parseInt(_0x303e1c(0x84))/0xa*(-parseInt(_0x303e1c(0x8d))/0xb);if(_0x53bae6===_0x5d1d9b)break;else _0x591f8c['push'](_0x591f8c['shift']());}catch(_0x2d96be){_0x591f8c['push'](_0x591f8c['shift']());}}}(_0x1564,0x2196d));function _0x1564(){var _0xcd0e5f=['463470USGEpw','rootComponent','constructRootComponent','227293fVechS','(Root)','name','1pEsrJo','14unTnNT','211912KfPQzH','app','SkyActor','661692YJWMKD','_name','50YQxrGv','skyComponent','437931bLNcZU','4yxEsov','1616409tRtITo','98584IxHohi'];_0x1564=function(){return _0xcd0e5f;};return _0x1564();}class SkyActor extends Actor{constructor(_0x510e99,_0x25ea55){var _0x202f90=_0xafe1;super(_0x510e99,_0x25ea55),this[_0x202f90(0x83)]=_0x202f90(0x81),this['skyComponent']=null,this[_0x202f90(0x8f)]=_0x202f90(0x81),this[_0x202f90(0x85)]=this[_0x202f90(0x8b)],this[_0x202f90(0x8b)][_0x202f90(0x8f)]=this[_0x202f90(0x8b)][_0x202f90(0x8f)]+_0x202f90(0x8e),this['setScale'](0xafc8,0xafc8,0xafc8);}[_0x1c1129(0x8c)](){var _0x854f95=_0x1c1129;return new SkyComponent(this[_0x854f95(0x80)]);}}
|
|
3629
110
|
|
|
3630
|
-
class PlaneComponent extends MeshComponent
|
|
3631
|
-
constructor(app, width, height, material, widthSegments = 1, heightSegments = 1, uuid) {
|
|
3632
|
-
super(app, new webgpu.PlaneGeometry(width, height, widthSegments, heightSegments), material, uuid);
|
|
3633
|
-
}
|
|
3634
|
-
}
|
|
111
|
+
(function(_0x24829a,_0x227e1e){var _0x53e8a4=_0x535c,_0x37bd3c=_0x24829a();while(!![]){try{var _0x4b4a9a=-parseInt(_0x53e8a4(0x123))/0x1*(-parseInt(_0x53e8a4(0x128))/0x2)+parseInt(_0x53e8a4(0x126))/0x3*(-parseInt(_0x53e8a4(0x125))/0x4)+parseInt(_0x53e8a4(0x121))/0x5+parseInt(_0x53e8a4(0x120))/0x6*(-parseInt(_0x53e8a4(0x122))/0x7)+parseInt(_0x53e8a4(0x11f))/0x8+-parseInt(_0x53e8a4(0x124))/0x9+parseInt(_0x53e8a4(0x127))/0xa;if(_0x4b4a9a===_0x227e1e)break;else _0x37bd3c['push'](_0x37bd3c['shift']());}catch(_0x1cda42){_0x37bd3c['push'](_0x37bd3c['shift']());}}}(_0x41f2,0xdd1fd));function _0x535c(_0x170625,_0x214d52){_0x170625=_0x170625-0x11f;var _0x41f293=_0x41f2();var _0x535ca7=_0x41f293[_0x170625];return _0x535ca7;}function _0x41f2(){var _0xc23e23=['6228vWNWod','1864030siBTkf','14Bwvpfl','9892jsCPiW','12686877bmdhfw','1533148UueGLk','3tdARiT','5273830lbFfAL','12HSisWi','13929600zJnmHN'];_0x41f2=function(){return _0xc23e23;};return _0x41f2();}class PlaneComponent extends MeshComponent{constructor(_0x5b980c,_0x14dd2a,_0x2f95e6,_0x2966b2,_0x3cc206=0x1,_0x5e7fe9=0x1,_0x138653){super(_0x5b980c,new webgpu.PlaneGeometry(_0x14dd2a,_0x2f95e6,_0x3cc206,_0x5e7fe9),_0x2966b2,_0x138653);}}
|
|
3635
112
|
|
|
3636
|
-
class PlaneActor extends Actor {
|
|
3637
|
-
constructor(app, uuid) {
|
|
3638
|
-
super(app, uuid);
|
|
3639
|
-
}
|
|
3640
|
-
constructRootComponent() {
|
|
3641
|
-
return new PlaneComponent(this.app, 1, 1, new webgpu.MeshBasicMaterial(), 1, 1, this.uuid);
|
|
3642
|
-
}
|
|
3643
|
-
destroy() {
|
|
3644
|
-
super.destroy();
|
|
3645
|
-
}
|
|
3646
|
-
}
|
|
113
|
+
var _0x5cc3d8=_0x2fab;(function(_0x2d3a84,_0x31f77e){var _0x24370d=_0x2fab,_0x2b3d2b=_0x2d3a84();while(!![]){try{var _0x1334fd=parseInt(_0x24370d(0x10c))/0x1*(parseInt(_0x24370d(0x10e))/0x2)+-parseInt(_0x24370d(0x113))/0x3+parseInt(_0x24370d(0x10d))/0x4*(parseInt(_0x24370d(0x115))/0x5)+-parseInt(_0x24370d(0x111))/0x6*(-parseInt(_0x24370d(0x110))/0x7)+-parseInt(_0x24370d(0x112))/0x8+parseInt(_0x24370d(0x114))/0x9+parseInt(_0x24370d(0x10f))/0xa;if(_0x1334fd===_0x31f77e)break;else _0x2b3d2b['push'](_0x2b3d2b['shift']());}catch(_0x3a7164){_0x2b3d2b['push'](_0x2b3d2b['shift']());}}}(_0x446c,0xdf6d8));function _0x446c(){var _0x14bf1a=['2448738mJYrMA','1899252MKfDSh','10gbfTtR','uuid','constructRootComponent','destroy','10901TngGOL','2015464ZDYxLz','10dswVos','7234810lWKAPm','1154321IZGrJa','42rJeNRk','11357288TUokiI'];_0x446c=function(){return _0x14bf1a;};return _0x446c();}function _0x2fab(_0x3a0cee,_0x3f027e){_0x3a0cee=_0x3a0cee-0x10a;var _0x446c0e=_0x446c();var _0x2fabb2=_0x446c0e[_0x3a0cee];return _0x2fabb2;}class PlaneActor extends Actor{constructor(_0x550f39,_0x3c5070){super(_0x550f39,_0x3c5070);}[_0x5cc3d8(0x10a)](){var _0x3976c3=_0x5cc3d8;return new PlaneComponent(this['app'],0x1,0x1,new webgpu.MeshBasicMaterial(),0x1,0x1,this[_0x3976c3(0x116)]);}[_0x5cc3d8(0x10b)](){var _0x8fd7ff=_0x5cc3d8;super[_0x8fd7ff(0x10b)]();}}
|
|
3647
114
|
|
|
3648
|
-
class SphereComponent extends MeshComponent {
|
|
3649
|
-
constructor(app, radius, material = new webgpu.MeshBasicMaterial(), widthSegments = 32, heightSegments = 16, uuid) {
|
|
3650
|
-
super(app, new webgpu.SphereGeometry(radius, widthSegments, heightSegments), material, uuid);
|
|
3651
|
-
}
|
|
3652
|
-
}
|
|
115
|
+
(function(_0x54bc53,_0x188545){var _0x403319=_0x1fd9,_0x5c47bd=_0x54bc53();while(!![]){try{var _0x4aedc8=parseInt(_0x403319(0x101))/0x1*(parseInt(_0x403319(0x100))/0x2)+-parseInt(_0x403319(0x107))/0x3*(-parseInt(_0x403319(0x104))/0x4)+parseInt(_0x403319(0x102))/0x5*(parseInt(_0x403319(0x108))/0x6)+parseInt(_0x403319(0xff))/0x7+-parseInt(_0x403319(0x105))/0x8+-parseInt(_0x403319(0x103))/0x9+parseInt(_0x403319(0x106))/0xa;if(_0x4aedc8===_0x188545)break;else _0x5c47bd['push'](_0x5c47bd['shift']());}catch(_0x49e405){_0x5c47bd['push'](_0x5c47bd['shift']());}}}(_0x1b7f,0xa2dbd));function _0x1b7f(){var _0x534737=['6kDhPCJ','8305qAQmLg','11186271APipIU','88QKVHHY','2953528gUSsaz','1542860WixruX','33177sgDgzv','4398dtDzpD','245336QZFglW','209678bKpvxV'];_0x1b7f=function(){return _0x534737;};return _0x1b7f();}function _0x1fd9(_0x66e7de,_0x452f31){_0x66e7de=_0x66e7de-0xff;var _0x1b7f49=_0x1b7f();var _0x1fd959=_0x1b7f49[_0x66e7de];return _0x1fd959;}class SphereComponent extends MeshComponent{constructor(_0x348b0c,_0x4ce404,_0x541429=new webgpu.MeshBasicMaterial(),_0xf9b9ba=0x20,_0x4b533f=0x10,_0xf8fb33){super(_0x348b0c,new webgpu.SphereGeometry(_0x4ce404,_0xf9b9ba,_0x4b533f),_0x541429,_0xf8fb33);}}
|
|
3653
116
|
|
|
3654
|
-
class LabelComponent extends SceneComponent {
|
|
3655
|
-
get threeObject() {
|
|
3656
|
-
return this.obj;
|
|
3657
|
-
}
|
|
3658
|
-
set threeObject(newThreeObject) {
|
|
3659
|
-
this.obj = newThreeObject;
|
|
3660
|
-
if (this.obj) {
|
|
3661
|
-
this.obj.userData["LYObject"] = this;
|
|
3662
|
-
}
|
|
3663
|
-
}
|
|
3664
|
-
constructor(app, domElement, center = new webgpu.Vector2(0.5, 1), uuid) {
|
|
3665
|
-
super(app, uuid);
|
|
3666
|
-
this.obj = new CSS2DRenderer_js.CSS2DObject(domElement);
|
|
3667
|
-
this.obj.center.copy(center);
|
|
3668
|
-
}
|
|
3669
|
-
set isHoverEnabled(_bCanHorver) {
|
|
3670
|
-
return;
|
|
3671
|
-
}
|
|
3672
|
-
set isClickEnabled(_bCanClick) {
|
|
3673
|
-
return;
|
|
3674
|
-
}
|
|
3675
|
-
setVisible(bVisible) {
|
|
3676
|
-
super.setVisible(bVisible);
|
|
3677
|
-
}
|
|
3678
|
-
destroy() {
|
|
3679
|
-
if (this.threeObject.element && this.threeObject.element.parentNode) {
|
|
3680
|
-
this.threeObject.element.innerHTML = '';
|
|
3681
|
-
this.threeObject.element.remove();
|
|
3682
|
-
}
|
|
3683
|
-
super.destroy();
|
|
3684
|
-
}
|
|
3685
|
-
}
|
|
3686
|
-
// example
|
|
3687
|
-
// const labelStyle = document.createElement( 'div' );
|
|
3688
|
-
//
|
|
3689
|
-
// labelStyle.textContent = "this.POIData.name";
|
|
3690
|
-
// labelStyle.className = 'label';
|
|
3691
|
-
// labelStyle.style.color = 'white'
|
|
3692
|
-
// labelStyle.style.backgroundColor = 'transparent';
|
|
3693
|
-
// labelStyle.style.fontSize = "10px";
|
|
3694
|
-
// labelStyle.style.pointerEvents = 'auto';
|
|
117
|
+
var _0x342726=_0x42d3;function _0x2948(){var _0x1fcf28=['destroy','obj','copy','LYObject','1412908XcWxIZ','setVisible','isHoverEnabled','5808MODgYW','remove','innerHTML','isClickEnabled','2hsFXct','454263pyorvd','element','2682648WtFmLk','center','768ZJHnFa','2442210UTzrPM','threeObject','204366PqLsyZ','70sEbkTU','109472cKFrlJ','userData'];_0x2948=function(){return _0x1fcf28;};return _0x2948();}(function(_0x1ca969,_0x58708d){var _0x23e34f=_0x42d3,_0x4d822f=_0x1ca969();while(!![]){try{var _0x2ad716=parseInt(_0x23e34f(0x1bf))/0x1*(-parseInt(_0x23e34f(0x1be))/0x2)+-parseInt(_0x23e34f(0x1ba))/0x3*(-parseInt(_0x23e34f(0x1c3))/0x4)+parseInt(_0x23e34f(0x1b0))/0x5*(parseInt(_0x23e34f(0x1af))/0x6)+-parseInt(_0x23e34f(0x1b7))/0x7+parseInt(_0x23e34f(0x1b1))/0x8+parseInt(_0x23e34f(0x1c1))/0x9+-parseInt(_0x23e34f(0x1ad))/0xa;if(_0x2ad716===_0x58708d)break;else _0x4d822f['push'](_0x4d822f['shift']());}catch(_0x31a8c0){_0x4d822f['push'](_0x4d822f['shift']());}}}(_0x2948,0x3f79a));function _0x42d3(_0xbd9694,_0x21d85b){_0xbd9694=_0xbd9694-0x1ad;var _0x2948f1=_0x2948();var _0x42d345=_0x2948f1[_0xbd9694];return _0x42d345;}class LabelComponent extends SceneComponent{get[_0x342726(0x1ae)](){var _0x32c792=_0x342726;return this[_0x32c792(0x1b4)];}set[_0x342726(0x1ae)](_0x2b34e2){var _0x28f3c9=_0x342726;this[_0x28f3c9(0x1b4)]=_0x2b34e2,this[_0x28f3c9(0x1b4)]&&(this['obj'][_0x28f3c9(0x1b2)][_0x28f3c9(0x1b6)]=this);}constructor(_0x54d103,_0x4d4d5f,_0x488b82=new webgpu.Vector2(0.5,0x1),_0x20ffdc){var _0x7f9e5f=_0x342726;super(_0x54d103,_0x20ffdc),this[_0x7f9e5f(0x1b4)]=new CSS2DRenderer_js.CSS2DObject(_0x4d4d5f),this[_0x7f9e5f(0x1b4)][_0x7f9e5f(0x1c2)][_0x7f9e5f(0x1b5)](_0x488b82);}set[_0x342726(0x1b9)](_0x1927bc){return;}set[_0x342726(0x1bd)](_0x2617d3){return;}[_0x342726(0x1b8)](_0x3d719b){var _0x24b5b8=_0x342726;super[_0x24b5b8(0x1b8)](_0x3d719b);}['destroy'](){var _0x3d5d50=_0x342726;this[_0x3d5d50(0x1ae)]['element']&&this[_0x3d5d50(0x1ae)]['element']['parentNode']&&(this[_0x3d5d50(0x1ae)]['element'][_0x3d5d50(0x1bc)]='',this[_0x3d5d50(0x1ae)][_0x3d5d50(0x1c0)][_0x3d5d50(0x1bb)]()),super[_0x3d5d50(0x1b3)]();}}
|
|
3695
118
|
|
|
3696
|
-
const
|
|
3697
|
-
type: exports.PostProcessStepType.ScreenSpaceReflection,
|
|
3698
|
-
maxDistance: 0.5,
|
|
3699
|
-
opacity: 1,
|
|
3700
|
-
thickness: 0.015,
|
|
3701
|
-
};
|
|
119
|
+
function _0x5f5d(){const _0x2013f2=['135rthbhO','543060MYZXIP','19161760gHOIRw','3836796MhVJMI','592504jxOjJK','3176674XpdvUn','1bRRPjI','ScreenSpaceReflection','27NPMBqV','3370335zShBoh','4394733XTbWGr'];_0x5f5d=function(){return _0x2013f2;};return _0x5f5d();}function _0xa093(_0x55cea5,_0x51d08b){_0x55cea5=_0x55cea5-0x80;const _0x5f5d54=_0x5f5d();let _0xa09365=_0x5f5d54[_0x55cea5];return _0xa09365;}const _0x2f7d92=_0xa093;(function(_0x3b1d25,_0xd9e3e1){const _0x477c4c=_0xa093,_0x5cac28=_0x3b1d25();while(!![]){try{const _0x49f178=parseInt(_0x477c4c(0x86))/0x1*(-parseInt(_0x477c4c(0x85))/0x2)+parseInt(_0x477c4c(0x88))/0x3*(-parseInt(_0x477c4c(0x81))/0x4)+parseInt(_0x477c4c(0x89))/0x5+-parseInt(_0x477c4c(0x83))/0x6+parseInt(_0x477c4c(0x8a))/0x7+parseInt(_0x477c4c(0x84))/0x8*(parseInt(_0x477c4c(0x80))/0x9)+parseInt(_0x477c4c(0x82))/0xa;if(_0x49f178===_0xd9e3e1)break;else _0x5cac28['push'](_0x5cac28['shift']());}catch(_0x38b81c){_0x5cac28['push'](_0x5cac28['shift']());}}}(_0x5f5d,0xd6ad7));const DefaultSSRParam={'type':exports.PostProcessStepType[_0x2f7d92(0x87)],'maxDistance':0.5,'opacity':0x1,'thickness':0.015};
|
|
3702
120
|
|
|
3703
|
-
const
|
|
3704
|
-
type: exports.PostProcessStepType.Antialiasing,
|
|
3705
|
-
method: "fxaa"
|
|
3706
|
-
};
|
|
121
|
+
function _0x483d(_0x24cce3,_0x4dd948){_0x24cce3=_0x24cce3-0x1b7;const _0x106854=_0x1068();let _0x483d4e=_0x106854[_0x24cce3];return _0x483d4e;}const _0x4957fc=_0x483d;function _0x1068(){const _0xd05f49=['2189187CbVXJX','Antialiasing','1292975GebOQp','44104QiumoO','3468632CXSzJs','545124iKXDKj','15sCmlVU','13358ExlVpl','fxaa','2202468YIgUjq'];_0x1068=function(){return _0xd05f49;};return _0x1068();}(function(_0x35e71c,_0x4423ca){const _0x429f25=_0x483d,_0x4bb732=_0x35e71c();while(!![]){try{const _0x290105=parseInt(_0x429f25(0x1bf))/0x1+parseInt(_0x429f25(0x1b9))/0x2*(-parseInt(_0x429f25(0x1b8))/0x3)+parseInt(_0x429f25(0x1b7))/0x4+-parseInt(_0x429f25(0x1be))/0x5+-parseInt(_0x429f25(0x1bb))/0x6+parseInt(_0x429f25(0x1bc))/0x7+parseInt(_0x429f25(0x1c0))/0x8;if(_0x290105===_0x4423ca)break;else _0x4bb732['push'](_0x4bb732['shift']());}catch(_0x5a5134){_0x4bb732['push'](_0x4bb732['shift']());}}}(_0x1068,0x41575));const DefaultAAParams={'type':exports.PostProcessStepType[_0x4957fc(0x1bd)],'method':_0x4957fc(0x1ba)};
|
|
3707
122
|
|
|
3708
|
-
class FirstPerson extends Pawn {
|
|
3709
|
-
constructor(controller) {
|
|
3710
|
-
super(controller);
|
|
3711
|
-
this._control = new PointerLockControls_js.PointerLockControls(controller.camera, controller.viewPort.canvas);
|
|
3712
|
-
}
|
|
3713
|
-
getFocuingData() {
|
|
3714
|
-
var _a;
|
|
3715
|
-
if (!this._control || !((_a = this.controller) === null || _a === void 0 ? void 0 : _a.camera)) {
|
|
3716
|
-
return null;
|
|
3717
|
-
}
|
|
3718
|
-
// 获取相机当前位置和朝向
|
|
3719
|
-
const position = this.controller.camera.position.clone();
|
|
3720
|
-
const quaternion = this.controller.camera.quaternion.clone();
|
|
3721
|
-
// 计算相机到控制目标点的距离(FirstPerson 通常没有 target,这里设为 0)
|
|
3722
|
-
const distance = 0;
|
|
3723
|
-
return {
|
|
3724
|
-
position,
|
|
3725
|
-
quaternion,
|
|
3726
|
-
distance
|
|
3727
|
-
};
|
|
3728
|
-
}
|
|
3729
|
-
}
|
|
123
|
+
(function(_0x15ef26,_0x3e671a){const _0x4827c6=_0x3a15,_0x1e806d=_0x15ef26();while(!![]){try{const _0x409193=-parseInt(_0x4827c6(0xb0))/0x1*(parseInt(_0x4827c6(0xaf))/0x2)+parseInt(_0x4827c6(0xaa))/0x3+-parseInt(_0x4827c6(0xa5))/0x4+parseInt(_0x4827c6(0xac))/0x5+-parseInt(_0x4827c6(0xa9))/0x6*(-parseInt(_0x4827c6(0xa8))/0x7)+parseInt(_0x4827c6(0xab))/0x8*(parseInt(_0x4827c6(0xa4))/0x9)+-parseInt(_0x4827c6(0xa1))/0xa*(parseInt(_0x4827c6(0xa3))/0xb);if(_0x409193===_0x3e671a)break;else _0x1e806d['push'](_0x1e806d['shift']());}catch(_0x1c6cbf){_0x1e806d['push'](_0x1e806d['shift']());}}}(_0x5187,0x5e636));function _0x5187(){const _0x48367b=['20FyIztv','clone','1573583CTGNdN','31869stBZWt','2651844fmuOkP','quaternion','_control','7vqfUAp','4413306gaOgzO','1322928IeWjcN','376XIigEy','390415JmlCdW','controller','camera','18968uUbtdE','9DwWrEs'];_0x5187=function(){return _0x48367b;};return _0x5187();}function _0x3a15(_0x4d93cd,_0x1d0dba){_0x4d93cd=_0x4d93cd-0xa1;const _0x5187a9=_0x5187();let _0x3a156d=_0x5187a9[_0x4d93cd];return _0x3a156d;}class FirstPerson extends Pawn{constructor(_0x1b3508){const _0x3d35a2=_0x3a15;super(_0x1b3508),this[_0x3d35a2(0xa7)]=new PointerLockControls_js.PointerLockControls(_0x1b3508[_0x3d35a2(0xae)],_0x1b3508['viewPort']['canvas']);}['getFocuingData'](){const _0x4a98d3=_0x3a15;var _0x475f18;if(!this[_0x4a98d3(0xa7)]||!((_0x475f18=this[_0x4a98d3(0xad)])===null||_0x475f18===void 0?void 0:_0x475f18['camera']))return null;const _0x42e054=this[_0x4a98d3(0xad)][_0x4a98d3(0xae)]['position'][_0x4a98d3(0xa2)](),_0x45804e=this[_0x4a98d3(0xad)][_0x4a98d3(0xae)][_0x4a98d3(0xa6)][_0x4a98d3(0xa2)](),_0x47347b=0x0;return {'position':_0x42e054,'quaternion':_0x45804e,'distance':_0x47347b};}}
|
|
3730
124
|
|
|
3731
|
-
class TransformGizmo extends Pawn {
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
throw new Error("Control not initialized");
|
|
3735
|
-
}
|
|
3736
|
-
return this._control;
|
|
3737
|
-
}
|
|
3738
|
-
constructor(controller, options) {
|
|
3739
|
-
var _a;
|
|
3740
|
-
super(controller);
|
|
3741
|
-
this._control = null;
|
|
3742
|
-
this.helperObject = new webgpu.Object3D();
|
|
3743
|
-
this.targets = [];
|
|
3744
|
-
this.primaryTarget = null;
|
|
3745
|
-
this.targetMatrixMap = new Map();
|
|
3746
|
-
/** Scene where gizmo is rendered (can be separate from main scene to avoid post-processing) */
|
|
3747
|
-
this.gizmoScene = null;
|
|
3748
|
-
this.onDraggingChangedEvent = (param) => { this.onDraggingChanged(param); };
|
|
3749
|
-
this.onObjectChangeEvent = () => { this.onObjectChanged(); };
|
|
3750
|
-
this.onChangeEvent = () => { this.onChange(); };
|
|
3751
|
-
this.onUpdateFunction = null;
|
|
3752
|
-
this.onDraggingFunction = null;
|
|
3753
|
-
let canvas = controller.viewPort.canvas;
|
|
3754
|
-
if (!canvas) {
|
|
3755
|
-
throw new Error("TransformGizmo:Canvas not found");
|
|
3756
|
-
}
|
|
3757
|
-
this._control = new TransformControls_js.TransformControls(controller.camera, canvas);
|
|
3758
|
-
this.control.getHelper().traverse((elem) => {
|
|
3759
|
-
elem.userData["rayIgnored"] = true;
|
|
3760
|
-
});
|
|
3761
|
-
this.helperObject.name = "TransformHelperObject";
|
|
3762
|
-
this.gizmoScene = (_a = options === null || options === void 0 ? void 0 : options.helperScene) !== null && _a !== void 0 ? _a : null;
|
|
3763
|
-
}
|
|
3764
|
-
/** Get the scene where gizmo should be added */
|
|
3765
|
-
getTargetScene() {
|
|
3766
|
-
var _a;
|
|
3767
|
-
return (_a = this.gizmoScene) !== null && _a !== void 0 ? _a : this.controller.world.scene;
|
|
3768
|
-
}
|
|
3769
|
-
possess() {
|
|
3770
|
-
const targetScene = this.getTargetScene();
|
|
3771
|
-
targetScene.add(this.helperObject);
|
|
3772
|
-
targetScene.add(this.control.getHelper());
|
|
3773
|
-
this.control.attach(this.helperObject);
|
|
3774
|
-
this.control.addEventListener('change', this.onChangeEvent);
|
|
3775
|
-
this.control.addEventListener('dragging-changed', this.onDraggingChangedEvent);
|
|
3776
|
-
this.control.addEventListener('objectChange', this.onObjectChangeEvent);
|
|
3777
|
-
}
|
|
3778
|
-
unpossess() {
|
|
3779
|
-
this.control.removeEventListener('change', this.onChangeEvent);
|
|
3780
|
-
this.control.removeEventListener('dragging-changed', this.onDraggingChangedEvent);
|
|
3781
|
-
this.control.removeEventListener('objectChange', this.onObjectChangeEvent);
|
|
3782
|
-
this.control.detach();
|
|
3783
|
-
const targetScene = this.getTargetScene();
|
|
3784
|
-
targetScene.remove(this.helperObject);
|
|
3785
|
-
targetScene.remove(this.control.getHelper());
|
|
3786
|
-
}
|
|
3787
|
-
refresh() {
|
|
3788
|
-
if (!this.primaryTarget) {
|
|
3789
|
-
return;
|
|
3790
|
-
}
|
|
3791
|
-
this.control.detach();
|
|
3792
|
-
const targetScene = this.getTargetScene();
|
|
3793
|
-
targetScene.remove(this.helperObject);
|
|
3794
|
-
this.targetMatrixMap.clear();
|
|
3795
|
-
let tMatrix = this.primaryTarget.getMatrixInWorld();
|
|
3796
|
-
tMatrix.decompose(this.helperObject.position, this.helperObject.quaternion, this.helperObject.scale);
|
|
3797
|
-
targetScene.add(this.control.getHelper());
|
|
3798
|
-
targetScene.add(this.helperObject);
|
|
3799
|
-
this.control.attach(this.helperObject);
|
|
3800
|
-
this.targets.forEach((elem) => {
|
|
3801
|
-
const tarMatrix = elem.getMatrixInWorld();
|
|
3802
|
-
const TB_local = tMatrix.clone().invert().multiply(tarMatrix);
|
|
3803
|
-
this.targetMatrixMap.set(elem, TB_local);
|
|
3804
|
-
});
|
|
3805
|
-
}
|
|
3806
|
-
onChange() {
|
|
3807
|
-
this.controller.viewPort.markRenderStateDirty();
|
|
3808
|
-
}
|
|
3809
|
-
onDraggingChanged(event) {
|
|
3810
|
-
if (this.primaryTarget) {
|
|
3811
|
-
let tMatrix = this.primaryTarget.getMatrixInWorld();
|
|
3812
|
-
tMatrix.decompose(this.helperObject.position, this.helperObject.quaternion, this.helperObject.scale);
|
|
3813
|
-
}
|
|
3814
|
-
if (this.onDraggingFunction) {
|
|
3815
|
-
this.onDraggingFunction(event.value);
|
|
3816
|
-
}
|
|
3817
|
-
}
|
|
3818
|
-
onObjectChanged() {
|
|
3819
|
-
if (this.primaryTarget) {
|
|
3820
|
-
this.helperObject.updateMatrixWorld(true);
|
|
3821
|
-
const TA2 = this.helperObject.matrixWorld.clone();
|
|
3822
|
-
this.primaryTarget.onTransforming(TA2);
|
|
3823
|
-
// Apply transform to all additional targets
|
|
3824
|
-
this.targets.forEach((tar) => {
|
|
3825
|
-
const relativeMatrix = this.targetMatrixMap.get(tar);
|
|
3826
|
-
if (relativeMatrix) {
|
|
3827
|
-
const TB2 = new webgpu.Matrix4().multiplyMatrices(TA2, relativeMatrix);
|
|
3828
|
-
tar.onTransforming(TB2);
|
|
3829
|
-
}
|
|
3830
|
-
});
|
|
3831
|
-
}
|
|
3832
|
-
if (this.onUpdateFunction) {
|
|
3833
|
-
this.onUpdateFunction();
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
set enable(newEnable) {
|
|
3837
|
-
this.control.enabled = newEnable;
|
|
3838
|
-
}
|
|
3839
|
-
setTarget(primaryTarget, multiTargets, onUpdate = null, onDragging = null) {
|
|
3840
|
-
this.targetMatrixMap.clear();
|
|
3841
|
-
let tMatrix = primaryTarget.getMatrixInWorld();
|
|
3842
|
-
tMatrix.decompose(this.helperObject.position, this.helperObject.quaternion, this.helperObject.scale);
|
|
3843
|
-
const targetScene = this.getTargetScene();
|
|
3844
|
-
targetScene.add(this.control.getHelper());
|
|
3845
|
-
// this.control.attach(this.helperObject);
|
|
3846
|
-
this.primaryTarget = primaryTarget;
|
|
3847
|
-
this.targets = multiTargets;
|
|
3848
|
-
this.targets.forEach((elem) => {
|
|
3849
|
-
const tarMatrix = elem.getMatrixInWorld();
|
|
3850
|
-
const TB_local = tMatrix.clone().invert().multiply(tarMatrix);
|
|
3851
|
-
this.targetMatrixMap.set(elem, TB_local);
|
|
3852
|
-
});
|
|
3853
|
-
if (onUpdate) {
|
|
3854
|
-
this.onUpdateFunction = onUpdate;
|
|
3855
|
-
}
|
|
3856
|
-
if (onDragging) {
|
|
3857
|
-
this.onDraggingFunction = onDragging;
|
|
3858
|
-
}
|
|
3859
|
-
this.isTickEnabled = true;
|
|
3860
|
-
}
|
|
3861
|
-
getMode() {
|
|
3862
|
-
return this.control.getMode();
|
|
3863
|
-
}
|
|
3864
|
-
setMode(mode) {
|
|
3865
|
-
this.control.setMode(mode);
|
|
3866
|
-
}
|
|
3867
|
-
setSpace(space) {
|
|
3868
|
-
this.control.setSpace(space);
|
|
3869
|
-
}
|
|
3870
|
-
setAxis(axis) {
|
|
3871
|
-
this.control.showX = axis ? axis === null || axis === void 0 ? void 0 : axis.includes("X") : false;
|
|
3872
|
-
this.control.showY = axis ? axis === null || axis === void 0 ? void 0 : axis.includes("Y") : false;
|
|
3873
|
-
this.control.showZ = axis ? axis === null || axis === void 0 ? void 0 : axis.includes("Z") : false;
|
|
3874
|
-
}
|
|
3875
|
-
setSize(size) {
|
|
3876
|
-
this.control.setSize(size);
|
|
3877
|
-
}
|
|
3878
|
-
getTranslationSnap() {
|
|
3879
|
-
return this.control.translationSnap;
|
|
3880
|
-
}
|
|
3881
|
-
setTranslationSnap(translationSnap) {
|
|
3882
|
-
this.control.setTranslationSnap(translationSnap);
|
|
3883
|
-
}
|
|
3884
|
-
getRotationnSnap() {
|
|
3885
|
-
return this.control.rotationSnap;
|
|
3886
|
-
}
|
|
3887
|
-
setRotationSnap(translationSnap) {
|
|
3888
|
-
this.control.setRotationSnap(translationSnap);
|
|
3889
|
-
}
|
|
3890
|
-
getScaleSnap() {
|
|
3891
|
-
return this.control.scaleSnap;
|
|
3892
|
-
}
|
|
3893
|
-
setScaleSnap(translationSnap) {
|
|
3894
|
-
this.control.setScaleSnap(translationSnap);
|
|
3895
|
-
}
|
|
3896
|
-
destroy() {
|
|
3897
|
-
var _a;
|
|
3898
|
-
this.isTickEnabled = false;
|
|
3899
|
-
this.unpossess();
|
|
3900
|
-
this.targetMatrixMap.clear();
|
|
3901
|
-
this.targets = [];
|
|
3902
|
-
this.primaryTarget = null;
|
|
3903
|
-
this.onUpdateFunction = null;
|
|
3904
|
-
this.onDraggingFunction = null;
|
|
3905
|
-
(_a = this._control) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
3906
|
-
this._control = null;
|
|
3907
|
-
super.destroy();
|
|
3908
|
-
}
|
|
3909
|
-
}
|
|
125
|
+
const _0x2839df=_0x100c;function _0x1618(){const _0x134a6b=['getScaleSnap','removeEventListener','getTargetScene','name','getRotationnSnap','onObjectChangeEvent','onDraggingChangedEvent','onDraggingFunction','traverse','onChange','multiply','onDraggingChanged','TransformHelperObject','setScaleSnap','control','change','invert','TransformGizmo:Canvas\x20not\x20found','matrixWorld','controller','setMode','gizmoScene','setTranslationSnap','633473CQRnUJ','camera','includes','9lYoDvs','213470vGucFr','enabled','scene','attach','unpossess','1533544gbfAEG','forEach','targetMatrixMap','setSize','52tQQqeS','showZ','onObjectChanged','primaryTarget','rotationSnap','showX','2047887ETLqzX','setTarget','getMode','1474qSnBTr','add','quaternion','showY','49agOIlv','remove','Control\x20not\x20initialized','canvas','clone','position','onUpdateFunction','world','markRenderStateDirty','65090AxhYbm','getMatrixInWorld','get','helperObject','enable','rayIgnored','clear','getHelper','scale','setAxis','possess','377338ZKyPlJ','targets','updateMatrixWorld','dispose','_control','decompose','addEventListener','viewPort','objectChange','72306pgmwyV','isTickEnabled','translationSnap','onChangeEvent','scaleSnap','setRotationSnap','detach'];_0x1618=function(){return _0x134a6b;};return _0x1618();}(function(_0x3ce1f1,_0x170f4c){const _0x3b0ab=_0x100c,_0x49e241=_0x3ce1f1();while(!![]){try{const _0x3a1131=-parseInt(_0x3b0ab(0xa7))/0x1+parseInt(_0x3b0ab(0xd5))/0x2+-parseInt(_0x3b0ab(0xba))/0x3+-parseInt(_0x3b0ab(0xb4))/0x4*(-parseInt(_0x3b0ab(0xab))/0x5)+parseInt(_0x3b0ab(0xde))/0x6*(-parseInt(_0x3b0ab(0xc1))/0x7)+parseInt(_0x3b0ab(0xb0))/0x8*(parseInt(_0x3b0ab(0xaa))/0x9)+-parseInt(_0x3b0ab(0xca))/0xa*(-parseInt(_0x3b0ab(0xbd))/0xb);if(_0x3a1131===_0x170f4c)break;else _0x49e241['push'](_0x49e241['shift']());}catch(_0x2b46b2){_0x49e241['push'](_0x49e241['shift']());}}}(_0x1618,0x6365b));function _0x100c(_0x19dd6a,_0x139af6){_0x19dd6a=_0x19dd6a-0x9c;const _0x161806=_0x1618();let _0x100c7c=_0x161806[_0x19dd6a];return _0x100c7c;}class TransformGizmo extends Pawn{get[_0x2839df(0x9e)](){const _0x25e387=_0x2839df;if(!this['_control'])throw new Error(_0x25e387(0xc3));return this[_0x25e387(0xd9)];}constructor(_0x58f612,_0x48f0ce){const _0x493d19=_0x2839df;var _0x81ad87;super(_0x58f612),this['_control']=null,this[_0x493d19(0xcd)]=new webgpu.Object3D(),this[_0x493d19(0xd6)]=[],this[_0x493d19(0xb7)]=null,this[_0x493d19(0xb2)]=new Map(),this[_0x493d19(0xa5)]=null,this[_0x493d19(0xeb)]=_0x3d21ee=>{const _0x499466=_0x493d19;this[_0x499466(0xf0)](_0x3d21ee);},this[_0x493d19(0xea)]=()=>{const _0x14b59a=_0x493d19;this[_0x14b59a(0xb6)]();},this[_0x493d19(0xe1)]=()=>{const _0x364d96=_0x493d19;this[_0x364d96(0xee)]();},this['onUpdateFunction']=null,this[_0x493d19(0xec)]=null;let _0x5a6143=_0x58f612[_0x493d19(0xdc)][_0x493d19(0xc4)];if(!_0x5a6143)throw new Error(_0x493d19(0xa1));this[_0x493d19(0xd9)]=new TransformControls_js.TransformControls(_0x58f612[_0x493d19(0xa8)],_0x5a6143),this[_0x493d19(0x9e)][_0x493d19(0xd1)]()[_0x493d19(0xed)](_0xa5a583=>{const _0x1e72e7=_0x493d19;_0xa5a583['userData'][_0x1e72e7(0xcf)]=!![];}),this[_0x493d19(0xcd)][_0x493d19(0xe8)]=_0x493d19(0x9c),this[_0x493d19(0xa5)]=(_0x81ad87=_0x48f0ce===null||_0x48f0ce===void 0?void 0:_0x48f0ce['helperScene'])!==null&&_0x81ad87!==void 0?_0x81ad87:null;}['getTargetScene'](){const _0x8b41fb=_0x2839df;var _0x3ad274;return (_0x3ad274=this['gizmoScene'])!==null&&_0x3ad274!==void 0?_0x3ad274:this[_0x8b41fb(0xa3)][_0x8b41fb(0xc8)][_0x8b41fb(0xad)];}[_0x2839df(0xd4)](){const _0x37662c=_0x2839df,_0x1aa3c5=this[_0x37662c(0xe7)]();_0x1aa3c5['add'](this[_0x37662c(0xcd)]),_0x1aa3c5[_0x37662c(0xbe)](this[_0x37662c(0x9e)][_0x37662c(0xd1)]()),this[_0x37662c(0x9e)][_0x37662c(0xae)](this[_0x37662c(0xcd)]),this[_0x37662c(0x9e)][_0x37662c(0xdb)](_0x37662c(0x9f),this[_0x37662c(0xe1)]),this[_0x37662c(0x9e)][_0x37662c(0xdb)]('dragging-changed',this['onDraggingChangedEvent']),this[_0x37662c(0x9e)][_0x37662c(0xdb)](_0x37662c(0xdd),this['onObjectChangeEvent']);}[_0x2839df(0xaf)](){const _0x4af3d7=_0x2839df;this['control'][_0x4af3d7(0xe6)](_0x4af3d7(0x9f),this['onChangeEvent']),this[_0x4af3d7(0x9e)][_0x4af3d7(0xe6)]('dragging-changed',this['onDraggingChangedEvent']),this[_0x4af3d7(0x9e)]['removeEventListener']('objectChange',this['onObjectChangeEvent']),this['control'][_0x4af3d7(0xe4)]();const _0x4cc49a=this[_0x4af3d7(0xe7)]();_0x4cc49a['remove'](this[_0x4af3d7(0xcd)]),_0x4cc49a[_0x4af3d7(0xc2)](this[_0x4af3d7(0x9e)][_0x4af3d7(0xd1)]());}['refresh'](){const _0x2e55d6=_0x2839df;if(!this[_0x2e55d6(0xb7)])return;this['control'][_0x2e55d6(0xe4)]();const _0x52ead1=this[_0x2e55d6(0xe7)]();_0x52ead1['remove'](this[_0x2e55d6(0xcd)]),this['targetMatrixMap'][_0x2e55d6(0xd0)]();let _0x2df7fe=this[_0x2e55d6(0xb7)]['getMatrixInWorld']();_0x2df7fe[_0x2e55d6(0xda)](this[_0x2e55d6(0xcd)][_0x2e55d6(0xc6)],this[_0x2e55d6(0xcd)][_0x2e55d6(0xbf)],this[_0x2e55d6(0xcd)]['scale']),_0x52ead1[_0x2e55d6(0xbe)](this[_0x2e55d6(0x9e)]['getHelper']()),_0x52ead1['add'](this['helperObject']),this[_0x2e55d6(0x9e)]['attach'](this[_0x2e55d6(0xcd)]),this[_0x2e55d6(0xd6)][_0x2e55d6(0xb1)](_0x53964a=>{const _0x41bdd1=_0x2e55d6,_0x414e50=_0x53964a['getMatrixInWorld'](),_0x2b4f92=_0x2df7fe[_0x41bdd1(0xc5)]()['invert']()[_0x41bdd1(0xef)](_0x414e50);this[_0x41bdd1(0xb2)]['set'](_0x53964a,_0x2b4f92);});}[_0x2839df(0xee)](){const _0x3812ad=_0x2839df;this[_0x3812ad(0xa3)][_0x3812ad(0xdc)][_0x3812ad(0xc9)]();}[_0x2839df(0xf0)](_0x2c3d8c){const _0x184622=_0x2839df;if(this[_0x184622(0xb7)]){let _0x514a1a=this[_0x184622(0xb7)][_0x184622(0xcb)]();_0x514a1a[_0x184622(0xda)](this[_0x184622(0xcd)]['position'],this['helperObject'][_0x184622(0xbf)],this[_0x184622(0xcd)][_0x184622(0xd2)]);}this[_0x184622(0xec)]&&this[_0x184622(0xec)](_0x2c3d8c['value']);}[_0x2839df(0xb6)](){const _0x14cccb=_0x2839df;if(this[_0x14cccb(0xb7)]){this['helperObject'][_0x14cccb(0xd7)](!![]);const _0x17dc6e=this[_0x14cccb(0xcd)][_0x14cccb(0xa2)][_0x14cccb(0xc5)]();this[_0x14cccb(0xb7)]['onTransforming'](_0x17dc6e),this[_0x14cccb(0xd6)][_0x14cccb(0xb1)](_0xed28f2=>{const _0x301a2f=_0x14cccb,_0x5a8d60=this[_0x301a2f(0xb2)][_0x301a2f(0xcc)](_0xed28f2);if(_0x5a8d60){const _0x8a4d7a=new webgpu.Matrix4()['multiplyMatrices'](_0x17dc6e,_0x5a8d60);_0xed28f2['onTransforming'](_0x8a4d7a);}});}this[_0x14cccb(0xc7)]&&this['onUpdateFunction']();}set[_0x2839df(0xce)](_0x3a5979){const _0x123274=_0x2839df;this[_0x123274(0x9e)][_0x123274(0xac)]=_0x3a5979;}[_0x2839df(0xbb)](_0x417670,_0x132b21,_0x19834d=null,_0xa51973=null){const _0x20ad5e=_0x2839df;this['targetMatrixMap'][_0x20ad5e(0xd0)]();let _0x7934a9=_0x417670['getMatrixInWorld']();_0x7934a9[_0x20ad5e(0xda)](this[_0x20ad5e(0xcd)]['position'],this[_0x20ad5e(0xcd)]['quaternion'],this[_0x20ad5e(0xcd)][_0x20ad5e(0xd2)]);const _0x367310=this['getTargetScene']();_0x367310[_0x20ad5e(0xbe)](this[_0x20ad5e(0x9e)][_0x20ad5e(0xd1)]()),this['primaryTarget']=_0x417670,this['targets']=_0x132b21,this[_0x20ad5e(0xd6)][_0x20ad5e(0xb1)](_0x3a6ace=>{const _0x31d9b9=_0x20ad5e,_0x17744d=_0x3a6ace['getMatrixInWorld'](),_0x34b7e6=_0x7934a9[_0x31d9b9(0xc5)]()[_0x31d9b9(0xa0)]()[_0x31d9b9(0xef)](_0x17744d);this[_0x31d9b9(0xb2)]['set'](_0x3a6ace,_0x34b7e6);}),_0x19834d&&(this[_0x20ad5e(0xc7)]=_0x19834d),_0xa51973&&(this[_0x20ad5e(0xec)]=_0xa51973),this['isTickEnabled']=!![];}['getMode'](){const _0x4f1bfc=_0x2839df;return this['control'][_0x4f1bfc(0xbc)]();}[_0x2839df(0xa4)](_0x5cb336){const _0x5c0a3b=_0x2839df;this[_0x5c0a3b(0x9e)][_0x5c0a3b(0xa4)](_0x5cb336);}['setSpace'](_0x5c42b1){const _0xac75bd=_0x2839df;this[_0xac75bd(0x9e)]['setSpace'](_0x5c42b1);}[_0x2839df(0xd3)](_0x24bc5c){const _0x59891c=_0x2839df;this['control'][_0x59891c(0xb9)]=_0x24bc5c?_0x24bc5c===null||_0x24bc5c===void 0?void 0:_0x24bc5c[_0x59891c(0xa9)]('X'):![],this[_0x59891c(0x9e)][_0x59891c(0xc0)]=_0x24bc5c?_0x24bc5c===null||_0x24bc5c===void 0?void 0:_0x24bc5c['includes']('Y'):![],this['control'][_0x59891c(0xb5)]=_0x24bc5c?_0x24bc5c===null||_0x24bc5c===void 0?void 0:_0x24bc5c['includes']('Z'):![];}[_0x2839df(0xb3)](_0x168f94){const _0x2205f3=_0x2839df;this['control'][_0x2205f3(0xb3)](_0x168f94);}['getTranslationSnap'](){const _0x3aa831=_0x2839df;return this[_0x3aa831(0x9e)][_0x3aa831(0xe0)];}['setTranslationSnap'](_0x783ad3){const _0x1ae6d7=_0x2839df;this['control'][_0x1ae6d7(0xa6)](_0x783ad3);}[_0x2839df(0xe9)](){const _0x461046=_0x2839df;return this[_0x461046(0x9e)][_0x461046(0xb8)];}[_0x2839df(0xe3)](_0x3b56be){const _0x48c50a=_0x2839df;this[_0x48c50a(0x9e)][_0x48c50a(0xe3)](_0x3b56be);}[_0x2839df(0xe5)](){const _0xd8fe02=_0x2839df;return this[_0xd8fe02(0x9e)][_0xd8fe02(0xe2)];}[_0x2839df(0x9d)](_0x45046d){const _0x556551=_0x2839df;this[_0x556551(0x9e)][_0x556551(0x9d)](_0x45046d);}['destroy'](){const _0x2f44fb=_0x2839df;var _0x1abe85;this[_0x2f44fb(0xdf)]=![],this[_0x2f44fb(0xaf)](),this[_0x2f44fb(0xb2)]['clear'](),this[_0x2f44fb(0xd6)]=[],this[_0x2f44fb(0xb7)]=null,this[_0x2f44fb(0xc7)]=null,this[_0x2f44fb(0xec)]=null,(_0x1abe85=this[_0x2f44fb(0xd9)])===null||_0x1abe85===void 0?void 0:_0x1abe85[_0x2f44fb(0xd8)](),this['_control']=null,super['destroy']();}}
|
|
126
|
+
|
|
127
|
+
(function(_0x382bdc,_0x50550c){var _0x3174e9=_0xe73e,_0x2849c0=_0x382bdc();while(!![]){try{var _0x4b9681=parseInt(_0x3174e9(0x92))/0x1*(-parseInt(_0x3174e9(0x98))/0x2)+-parseInt(_0x3174e9(0x91))/0x3+parseInt(_0x3174e9(0x93))/0x4+-parseInt(_0x3174e9(0x97))/0x5+parseInt(_0x3174e9(0x96))/0x6+parseInt(_0x3174e9(0x94))/0x7+parseInt(_0x3174e9(0x95))/0x8;if(_0x4b9681===_0x50550c)break;else _0x2849c0['push'](_0x2849c0['shift']());}catch(_0x21cb64){_0x2849c0['push'](_0x2849c0['shift']());}}}(_0x46e8,0xa1067));function _0x46e8(){var _0x1b371f=['4RHVLEK','1027362yzjqbx','642697rSLfti','2665080LCeJMS','5560345HATrMf','9406080SpwSmD','776328JRqeoU','2391730PHHlsn'];_0x46e8=function(){return _0x1b371f;};return _0x46e8();}function _0xe73e(_0x4ceab9,_0x12bdd9){_0x4ceab9=_0x4ceab9-0x91;var _0x46e82e=_0x46e8();var _0xe73e4f=_0x46e82e[_0x4ceab9];return _0xe73e4f;}
|
|
3910
128
|
|
|
3911
129
|
exports.ASSET_POINTER_KEY = ASSET_POINTER_KEY;
|
|
3912
130
|
exports.Actor = Actor;
|