lythreeframe 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/bundle.cjs.js +59 -3837
  2. package/dist/bundle.cjs.js.map +1 -1
  3. package/dist/bundle.esm.js +60 -3839
  4. package/dist/bundle.esm.js.map +1 -1
  5. package/dist/index.d.ts +72 -70
  6. package/dist/src/AssetManagement/AssetDefines.d.ts +65 -0
  7. package/dist/src/AssetManagement/AssetManager.d.ts +35 -0
  8. package/dist/src/AssetManagement/AssetPointer/AssetPointer.d.ts +20 -0
  9. package/dist/src/AssetManagement/AssetPointer/Assets/GeometryAssetPointer.d.ts +5 -0
  10. package/dist/src/AssetManagement/AssetPointer/Assets/MaterialAssetPointer.d.ts +24 -0
  11. package/dist/src/AssetManagement/AssetPointer/Assets/TextureAssetPointer.d.ts +5 -0
  12. package/dist/src/Container/SmartPointer.d.ts +15 -0
  13. package/dist/src/Defines.d.ts +4 -0
  14. package/dist/src/Delegate.d.ts +8 -0
  15. package/dist/src/Factory/CameraFactory.d.ts +6 -0
  16. package/dist/src/Factory/RendererFactory.d.ts +2 -0
  17. package/dist/src/Frame/Controller.d.ts +130 -0
  18. package/dist/src/Frame/Parameters/AppParameter.d.ts +25 -0
  19. package/dist/src/Frame/Parameters/CameraParameter.d.ts +22 -0
  20. package/dist/src/Frame/Parameters/RendererParameters.d.ts +17 -0
  21. package/dist/src/Frame/Parameters/ViewportParameters.d.ts +6 -0
  22. package/dist/src/Frame/Parameters/WorldParameter.d.ts +5 -0
  23. package/dist/src/Frame/Rendering/PostProcess.d.ts +45 -0
  24. package/dist/src/Frame/Viewport.d.ts +52 -0
  25. package/dist/src/Frame/World.d.ts +29 -0
  26. package/dist/src/Geometry/PlaneGeometry.d.ts +3 -0
  27. package/dist/src/Geometry/TriangleGeometry.d.ts +3 -0
  28. package/dist/src/Library/ContainerLibrary.d.ts +3 -0
  29. package/dist/src/Library/Debounce.d.ts +1 -0
  30. package/dist/src/Library/Math.d.ts +27 -0
  31. package/dist/src/Library/ResourceLibrary.d.ts +7 -0
  32. package/dist/src/Object/Actor.d.ts +86 -0
  33. package/dist/src/Object/Actors/Level/LevelActor.d.ts +13 -0
  34. package/dist/src/Object/Actors/Light/AmbientLightActor.d.ts +9 -0
  35. package/dist/src/Object/Actors/Light/DirectionalLightActor.d.ts +9 -0
  36. package/dist/src/Object/Actors/Shape/BoxActor.d.ts +7 -0
  37. package/dist/src/Object/Actors/Shape/PlaneActor.d.ts +8 -0
  38. package/dist/src/Object/Actors/Sky/SkyActor.d.ts +9 -0
  39. package/dist/src/Object/BaseObject.d.ts +14 -0
  40. package/dist/src/Object/Components/2D/2DComponent.d.ts +14 -0
  41. package/dist/src/Object/Components/Component.d.ts +18 -0
  42. package/dist/src/Object/Components/Level/LevelComponent.d.ts +9 -0
  43. package/dist/src/Object/Components/Light/AmbientLight/AmbientLightComponent.d.ts +16 -0
  44. package/dist/src/Object/Components/Light/DirectionalLight/DirectionalLightComponent.d.ts +16 -0
  45. package/dist/src/Object/Components/Light/LightComponent.d.ts +12 -0
  46. package/dist/src/Object/Components/Mesh/CustomMeshComponent.d.ts +63 -0
  47. package/dist/src/Object/Components/Mesh/MeshComponent.d.ts +28 -0
  48. package/dist/src/Object/Components/Mesh/Shape/BoxComponent.d.ts +6 -0
  49. package/dist/src/Object/Components/Mesh/Shape/PlaneComponent.d.ts +6 -0
  50. package/dist/src/Object/Components/Mesh/Shape/SphereComponent.d.ts +6 -0
  51. package/dist/src/Object/Components/Mesh/Sprite/SpriteComponent.d.ts +9 -0
  52. package/dist/src/Object/Components/SceneComponent.d.ts +79 -0
  53. package/dist/src/Object/Components/Sky/SkyComponent.d.ts +22 -0
  54. package/dist/src/Object/PawnV2/FirstPerson.d.ts +11 -0
  55. package/dist/src/Object/PawnV2/Oribital.d.ts +22 -0
  56. package/dist/src/Object/PawnV2/Pawn.d.ts +22 -0
  57. package/dist/src/Object/PawnV2/TransformControl.d.ts +62 -0
  58. package/dist/src/PostProcess/Param/AAParam.d.ts +6 -0
  59. package/dist/src/PostProcess/Param/Bloom.d.ts +8 -0
  60. package/dist/src/PostProcess/Param/DOF.d.ts +8 -0
  61. package/dist/src/PostProcess/Param/GTAO.d.ts +12 -0
  62. package/dist/src/PostProcess/Param/LensFlare.d.ts +11 -0
  63. package/dist/src/PostProcess/Param/MotionBlur.d.ts +4 -0
  64. package/dist/src/PostProcess/Param/Outline.d.ts +12 -0
  65. package/dist/src/PostProcess/Param/SSR.d.ts +8 -0
  66. package/dist/src/PostProcess/PostProcessParam.d.ts +16 -0
  67. package/dist/src/Shader/Postprocess/ColorShader.d.ts +29 -0
  68. package/dist/src/ThreeJsApp.d.ts +37 -0
  69. package/package.json +5 -2
@@ -14,3899 +14,120 @@ var LensflareNode_js = require('three/examples/jsm/tsl/display/LensflareNode.js'
14
14
  var gsap = require('gsap');
15
15
  var three = require('three');
16
16
  var SkyMesh_js = require('three/examples/jsm/objects/SkyMesh.js');
17
+ var _0x430ee4 = require('earcut');
17
18
  var CSS2DRenderer_js = require('three/examples/jsm/renderers/CSS2DRenderer.js');
18
19
  var PointerLockControls_js = require('three/examples/jsm/controls/PointerLockControls.js');
19
20
  var TransformControls_js = require('three/examples/jsm/controls/TransformControls.js');
20
21
 
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
- }
22
+ function _0xf619(_0x11051f,_0x3361b0){_0x11051f=_0x11051f-0xf5;const _0x4fc475=_0x4fc4();let _0xf6196b=_0x4fc475[_0x11051f];return _0xf6196b;}function _0x4fc4(){const _0x104dd9=['indexOf','addTickEvent','894429mRRaax','211822sOPjNh','clearTickEvents','1973855ogTHzG','_uuid','6835250uBCOpm','2615604xbSDni','uuid','isTickEnabled','removeTickEvent','bCanTick','3GyOloy','forEach','tickEvents','173708OUoXem','destroy','push','3uEvPXg','7WRHjRk','generateUUID','6744awTJcc'];_0x4fc4=function(){return _0x104dd9;};return _0x4fc4();}const _0x25aa7d=_0xf619;(function(_0x38465a,_0x1c7865){const _0x1d85e1=_0xf619,_0x2a7dbd=_0x38465a();while(!![]){try{const _0x3d55ac=parseInt(_0x1d85e1(0x104))/0x1*(-parseInt(_0x1d85e1(0x10b))/0x2)+-parseInt(_0x1d85e1(0xfe))/0x3*(parseInt(_0x1d85e1(0x101))/0x4)+parseInt(_0x1d85e1(0xf6))/0x5+-parseInt(_0x1d85e1(0xf9))/0x6+parseInt(_0x1d85e1(0x105))/0x7*(-parseInt(_0x1d85e1(0x107))/0x8)+parseInt(_0x1d85e1(0x10a))/0x9+parseInt(_0x1d85e1(0xf8))/0xa;if(_0x3d55ac===_0x1c7865)break;else _0x2a7dbd['push'](_0x2a7dbd['shift']());}catch(_0x5baac7){_0x2a7dbd['push'](_0x2a7dbd['shift']());}}}(_0x4fc4,0x5cb5c));class BaseObject{get['isTickEnabled'](){const _0x140693=_0xf619;return this[_0x140693(0xfd)];}set[_0x25aa7d(0xfb)](_0x26f1b6){const _0x15c0ff=_0x25aa7d;this[_0x15c0ff(0xfd)]=_0x26f1b6;}get[_0x25aa7d(0xfa)](){const _0x538f36=_0x25aa7d;return this[_0x538f36(0xf7)];}constructor(_0x113d7b=webgpu.MathUtils[_0x25aa7d(0x106)]()){const _0x54d0fb=_0x25aa7d;this['bCanTick']=![],this[_0x54d0fb(0x100)]=[],this['bCanTick']=![],this['_uuid']=_0x113d7b;}['tick'](_0x5be300){const _0x18482c=_0x25aa7d;if(!this[_0x18482c(0xfd)])return;this[_0x18482c(0x100)][_0x18482c(0xff)](_0xba4b4d=>{_0xba4b4d(_0x5be300);});}[_0x25aa7d(0x109)](_0x4685f1){const _0x19d634=_0x25aa7d;this[_0x19d634(0x100)][_0x19d634(0x103)](_0x4685f1);}[_0x25aa7d(0xfc)](_0x43cb01){const _0x4009d4=_0x25aa7d;let _0x2ea0e0=this[_0x4009d4(0x100)][_0x4009d4(0x108)](_0x43cb01);_0x2ea0e0!=-1&&this[_0x4009d4(0x100)]['splice'](_0x2ea0e0,0x1);}[_0x25aa7d(0xf5)](){const _0x3a8845=_0x25aa7d;this[_0x3a8845(0x100)]=[];}[_0x25aa7d(0x102)](){}}
63
23
 
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
- }
24
+ const _0x45f472=_0x5d33;function _0x351c(){const _0x266c1f=['obj','parentActor','type','generateUUID','15199290pDmQYj','10550939gBDPnR','warn','threeObject','LYObject','destroy','224ENGuLh','2830947qZkZpX','422046dsUpUo','1168836bRrLTa','destroyObject','Component\x20createDefaultObject\x20return\x20null','createDefaultObject','_name','5278572coyEAx','2miWuTz','5IrNYoO','_parentActor','name','6006486VKrTSz'];_0x351c=function(){return _0x266c1f;};return _0x351c();}function _0x5d33(_0x38ecee,_0x27d8d4){_0x38ecee=_0x38ecee-0x1e4;const _0x351c43=_0x351c();let _0x5d33a5=_0x351c43[_0x38ecee];return _0x5d33a5;}(function(_0x5310c3,_0xca7289){const _0x2891ef=_0x5d33,_0x4f5be9=_0x5310c3();while(!![]){try{const _0x52716b=-parseInt(_0x2891ef(0x1ec))/0x1+-parseInt(_0x2891ef(0x1f2))/0x2*(-parseInt(_0x2891ef(0x1ea))/0x3)+-parseInt(_0x2891ef(0x1f1))/0x4+parseInt(_0x2891ef(0x1f3))/0x5*(parseInt(_0x2891ef(0x1f6))/0x6)+parseInt(_0x2891ef(0x1e4))/0x7+parseInt(_0x2891ef(0x1e9))/0x8*(parseInt(_0x2891ef(0x1eb))/0x9)+-parseInt(_0x2891ef(0x1fb))/0xa;if(_0x52716b===_0xca7289)break;else _0x4f5be9['push'](_0x4f5be9['shift']());}catch(_0x3ed268){_0x4f5be9['push'](_0x4f5be9['shift']());}}}(_0x351c,0xb8b97));class Component extends BaseObject{set[_0x45f472(0x1f8)](_0x200993){const _0x1cbf37=_0x45f472;this[_0x1cbf37(0x1f4)]=_0x200993;}get[_0x45f472(0x1f8)](){const _0x1a0c85=_0x45f472;return this[_0x1a0c85(0x1f4)];}get[_0x45f472(0x1e6)](){return this['obj'];}set[_0x45f472(0x1e6)](_0x19274a){const _0xda800b=_0x45f472;this['obj']=_0x19274a,this[_0xda800b(0x1f7)]&&(this['obj']['userData'][_0xda800b(0x1e7)]=this);}get['name'](){return this['_name'];}set[_0x45f472(0x1f5)](_0x19205c){const _0x113cef=_0x45f472;this[_0x113cef(0x1f0)]=_0x19205c,this['obj']&&(this[_0x113cef(0x1f7)][_0x113cef(0x1f5)]=_0x19205c);}constructor(_0x16dcf2){const _0x2cd78f=_0x45f472;super(_0x16dcf2?_0x16dcf2:webgpu.MathUtils[_0x2cd78f(0x1fa)]()),this['obj']=null,this[_0x2cd78f(0x1f4)]=null,this['_name']='Component',this[_0x2cd78f(0x1f4)]=null;let _0x55f75f=this[_0x2cd78f(0x1ef)]();_0x55f75f?(this[_0x2cd78f(0x1e6)]=_0x55f75f,this[_0x2cd78f(0x1f0)]=this[_0x2cd78f(0x1e6)][_0x2cd78f(0x1f9)]+'Component'):console[_0x2cd78f(0x1e5)](_0x2cd78f(0x1ee));}[_0x45f472(0x1ef)](_0x177549){return null;}['destroyObject'](){if(!this['obj'])return;}[_0x45f472(0x1e8)](){const _0x55ea31=_0x45f472;this[_0x55ea31(0x1ed)]();}}
116
25
 
117
- // export const LYAttachmentRules =
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 = {}));
26
+ (function(_0x5cdbfd,_0x123d1c){var _0x50322f=_0x39f8,_0x2fc481=_0x5cdbfd();while(!![]){try{var _0x300b45=-parseInt(_0x50322f(0x196))/0x1*(-parseInt(_0x50322f(0x191))/0x2)+-parseInt(_0x50322f(0x18f))/0x3*(parseInt(_0x50322f(0x194))/0x4)+-parseInt(_0x50322f(0x197))/0x5+-parseInt(_0x50322f(0x18c))/0x6*(parseInt(_0x50322f(0x18e))/0x7)+-parseInt(_0x50322f(0x193))/0x8+parseInt(_0x50322f(0x18a))/0x9*(-parseInt(_0x50322f(0x18d))/0xa)+-parseInt(_0x50322f(0x192))/0xb*(-parseInt(_0x50322f(0x190))/0xc);if(_0x300b45===_0x123d1c)break;else _0x2fc481['push'](_0x2fc481['shift']());}catch(_0xbe8766){_0x2fc481['push'](_0x2fc481['shift']());}}}(_0x217f,0x67059));exports.AttachmentRules = void 0;function _0x39f8(_0xd38539,_0x49eba6){_0xd38539=_0xd38539-0x18a;var _0x217f77=_0x217f();var _0x39f8e5=_0x217f77[_0xd38539];return _0x39f8e5;}function _0x217f(){var _0x124830=['3VdEhxa','12MOhWRa','2066ZTEeLk','15990447wWCMkj','619352pTqdfh','2973884kvhjjp','KeepRelative','465XVfNxm','1433645XUPrJm','1101393xbRSmP','KeepWorld','44754PFfNFP','30nxtkBn','35gVDwLE'];_0x217f=function(){return _0x124830;};return _0x217f();}(function(_0x466b1e){var _0x1d4eef=_0x39f8;_0x466b1e[_0x466b1e[_0x1d4eef(0x18b)]=0x1]=_0x1d4eef(0x18b),_0x466b1e[_0x466b1e[_0x1d4eef(0x195)]=0x2]=_0x1d4eef(0x195);}(exports.AttachmentRules||(exports.AttachmentRules={})));
127
27
 
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
- }
28
+ function _0x2855(_0x281aa8,_0x276d91){_0x281aa8=_0x281aa8-0xa4;const _0x1f97e4=_0x1f97();let _0x2855e1=_0x1f97e4[_0x281aa8];return _0x2855e1;}const _0x5f97e4=_0x2855;(function(_0x10ceb9,_0x7d5ce6){const _0x11aa51=_0x2855,_0x56efd0=_0x10ceb9();while(!![]){try{const _0xce983c=parseInt(_0x11aa51(0xab))/0x1*(parseInt(_0x11aa51(0xac))/0x2)+-parseInt(_0x11aa51(0xb7))/0x3*(-parseInt(_0x11aa51(0xb2))/0x4)+parseInt(_0x11aa51(0xa6))/0x5*(-parseInt(_0x11aa51(0xa8))/0x6)+parseInt(_0x11aa51(0xb5))/0x7+-parseInt(_0x11aa51(0xb1))/0x8+-parseInt(_0x11aa51(0xa5))/0x9+parseInt(_0x11aa51(0xa4))/0xa;if(_0xce983c===_0x7d5ce6)break;else _0x56efd0['push'](_0x56efd0['shift']());}catch(_0x48b637){_0x56efd0['push'](_0x56efd0['shift']());}}}(_0x1f97,0xad257));function _0x1f97(){const _0x3cbafe=['18858rloEQS','remove','function\x20not\x20found','819244KWQSbS','2AvYKYU','clear','indexOf','broadcast','splice','11285920VxuOgo','1388FpABtl','functions','add','8467480bLnFOm','forEach','3525wbpEMY','7296380THbHWb','7917489SDBlWd','265QfnYZY','warn'];_0x1f97=function(){return _0x3cbafe;};return _0x1f97();}class Delegate{constructor(){const _0x4da042=_0x2855;this[_0x4da042(0xb3)]=[];}[_0x5f97e4(0xaf)](..._0x301494){const _0x2d7e21=_0x5f97e4;this[_0x2d7e21(0xb3)][_0x2d7e21(0xb6)](_0x1e9913=>_0x1e9913(..._0x301494));}[_0x5f97e4(0xb4)](_0x566b3b){const _0x3f63e5=_0x5f97e4;this[_0x3f63e5(0xb3)]['push'](_0x566b3b);}[_0x5f97e4(0xa9)](_0x24601f){const _0x33eb59=_0x5f97e4,_0x14f94f=this[_0x33eb59(0xb3)][_0x33eb59(0xae)](_0x24601f);_0x14f94f>=0x0?this['functions'][_0x33eb59(0xb0)](_0x14f94f,0x1):console[_0x33eb59(0xa7)](_0x33eb59(0xaa));}[_0x5f97e4(0xad)](){const _0x6718b2=_0x5f97e4;this[_0x6718b2(0xb3)]=[];}}
151
29
 
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
- }
30
+ function _0x3773(){const _0x19916d=['setFromObject','max','target\x20threeObject\x20is\x20invalid','bCanClick','setPosition','_onHoverEndDelegate','parent','getWorldMatrix','setRotation','getWorldScale','obj','getMatrix','localToWorld','children','threeObject\x20is\x20invalid','tick','getRotation','onClicked','onDoubleClickDelegate','position','detachFromParentActor','48HOWLVz','copy','remove','setMatrix','11AAbdvL','applyQuaternion','markRenderStateDirty','decompose','viewport','onHoverBeginDelegate','bCanHover','updateMatrix','layers','createDefaultObject','uuid','length','735iSUbNc','parentActor','_onHoverBeginDelegate','getPosition','isVector3','isVisible','multiplyMatrices','compose','min','push','getComponentById','rotation','9985810nJaVLr','820939NhndHH','getScale','userData','getCenter','addChildComponent','clone','SceneComponent','childrenComponents','946283tzMhly','invert','onAddedToWorld','getWorldRotation','add','matrixAutoUpdate','removeChildComponent','1083NyaROR','_onClickDelegate','scale','threeObject','getBoundsBottomCenterPositionWS','setFromQuaternion','onClickDelegate','702ACFSZI','onDoubleClicked','quaternion','getBounds','39966pHVkTr','error','worldToLocal','1177479ibfIZe','newComponent\x20threeObject\x20is\x20invalid','targetComponent\x20threeObject\x20is\x20invalid','getBoundsTopCenterPositionWS','isQuaternion','visible','app','forEach','KeepWorld','onHoverEndDelegate','destroy','isHoverEnabled','world','isClickEnabled','_onDoubleClickDelegate','getWorldDirection','setVisible','LYObject','updateMatrixWorld','getWorldForwardDirection','number','matrix','onHorveringEnd','getWorldPosition','destroyObject','2503948IoqUxh','getWorldQuaternion','onHorveringBegin','matrixWorld','_parentActor','parentComponent','getBoundsCenterPositionWS','setQuaternion\x20failed,param\x20is\x20invalid','setWorldMatrix','set','broadcast','detachFromParentComponent'];_0x3773=function(){return _0x19916d;};return _0x3773();}const _0x1cddba=_0x16fa;(function(_0x236fab,_0x17de1c){const _0x12921a=_0x16fa,_0x351bfb=_0x236fab();while(!![]){try{const _0x3855e9=parseInt(_0x12921a(0x130))/0x1+parseInt(_0x12921a(0x13e))/0x2*(parseInt(_0x12921a(0x137))/0x3)+parseInt(_0x12921a(0x15e))/0x4+parseInt(_0x12921a(0x11b))/0x5*(-parseInt(_0x12921a(0x142))/0x6)+parseInt(_0x12921a(0x128))/0x7*(parseInt(_0x12921a(0x17f))/0x8)+parseInt(_0x12921a(0x145))/0x9+parseInt(_0x12921a(0x127))/0xa*(-parseInt(_0x12921a(0x183))/0xb);if(_0x3855e9===_0x17de1c)break;else _0x351bfb['push'](_0x351bfb['shift']());}catch(_0x56feec){_0x351bfb['push'](_0x351bfb['shift']());}}}(_0x3773,0x87ace));function _0x16fa(_0x9ba0a2,_0x305e8f){_0x9ba0a2=_0x9ba0a2-0x116;const _0x3773d4=_0x3773();let _0x16fa87=_0x3773d4[_0x9ba0a2];return _0x16fa87;}class SceneComponent extends Component{set[_0x1cddba(0x11c)](_0x1982f1){const _0x7ae172=_0x1cddba;this[_0x7ae172(0x12f)]['forEach'](_0x5024b9=>{const _0x135e05=_0x7ae172;_0x5024b9[_0x135e05(0x11c)]=_0x1982f1;}),this[_0x7ae172(0x162)]=_0x1982f1;}get[_0x1cddba(0x11c)](){const _0x2922ca=_0x1cddba;return this[_0x2922ca(0x162)];}get[_0x1cddba(0x188)](){const _0x3c2ec3=_0x1cddba;return this[_0x3c2ec3(0x11d)];}get[_0x1cddba(0x14e)](){const _0x5e01de=_0x1cddba;return this[_0x5e01de(0x16f)];}get[_0x1cddba(0x13d)](){return this['_onClickDelegate'];}get[_0x1cddba(0x17c)](){return this['_onDoubleClickDelegate'];}get[_0x1cddba(0x151)](){const _0x4d1c32=_0x1cddba;return this['app'][_0x4d1c32(0x151)];}constructor(_0x452632,_0xad038c){const _0x51b698=_0x1cddba;super(_0xad038c),this['bCanHover']=![],this[_0x51b698(0x16d)]=![],this['_onHoverBeginDelegate']=new Delegate(),this['_onHoverEndDelegate']=new Delegate(),this[_0x51b698(0x138)]=new Delegate(),this[_0x51b698(0x153)]=new Delegate(),this[_0x51b698(0x14b)]=_0x452632,this['name']=_0x51b698(0x12e);}[_0x1cddba(0x118)](){return new webgpu.Object3D();}[_0x1cddba(0x179)](_0x27c316){const _0x41c8f1=_0x1cddba;super['tick'](_0x27c316),this[_0x41c8f1(0x12f)][_0x41c8f1(0x14c)](_0x5171ea=>{const _0x4d4dfd=_0x41c8f1;_0x5171ea[_0x4d4dfd(0x179)](_0x27c316);});}get[_0x1cddba(0x120)](){const _0xeeca93=_0x1cddba;if(!this[_0xeeca93(0x174)])return ![];return this[_0xeeca93(0x174)][_0xeeca93(0x14a)];}[_0x1cddba(0x155)](_0x4f1251){const _0x3067b1=_0x1cddba;if(!this['obj'])throw Error(_0x3067b1(0x178));this[_0x3067b1(0x174)][_0x3067b1(0x14a)]=_0x4f1251,this[_0x3067b1(0x151)]&&this[_0x3067b1(0x151)][_0x3067b1(0x187)][_0x3067b1(0x185)]();}['setLayers'](_0x217f42){const _0x4747e3=_0x1cddba;if(!this[_0x4747e3(0x174)])throw Error(_0x4747e3(0x178));this[_0x4747e3(0x174)][_0x4747e3(0x117)][_0x4747e3(0x167)](_0x217f42);let _0x9585aa=this[_0x4747e3(0x12f)];_0x9585aa[_0x4747e3(0x14c)](_0x57abd9=>{_0x57abd9['setLayers'](_0x217f42);});}[_0x1cddba(0x125)](_0x112c99,_0xfd2f76=!![]){const _0x23e74c=_0x1cddba;if(this[_0x23e74c(0x119)]===_0x112c99)return this;if(_0xfd2f76){let _0x3a4949=this['childrenComponents'];for(let _0x4aca91=0x0;_0x4aca91<_0x3a4949[_0x23e74c(0x11a)];++_0x4aca91){let _0x357d8b=_0x3a4949[_0x4aca91][_0x23e74c(0x125)](_0x112c99,_0xfd2f76);if(_0x357d8b)return _0x357d8b;}}else {let _0x132f64=this[_0x23e74c(0x12f)];for(let _0x45fdcb=0x0;_0x45fdcb<_0x132f64[_0x23e74c(0x11a)];++_0x45fdcb){let _0x5983ac=_0x132f64[_0x45fdcb];if(_0x5983ac[_0x23e74c(0x119)]===_0x112c99)return _0x5983ac;}}return null;}[_0x1cddba(0x164)](){const _0x5d7a88=_0x1cddba;let _0x1f9632=new webgpu.Vector3();return this[_0x5d7a88(0x141)]()['getCenter'](_0x1f9632),this[_0x5d7a88(0x15c)]();}[_0x1cddba(0x148)](){const _0x34e079=_0x1cddba;let _0x4cfb26=new webgpu.Vector3(),_0x1effb7=this[_0x34e079(0x141)]();return _0x1effb7[_0x34e079(0x12b)](_0x4cfb26),_0x4cfb26['y']=_0x1effb7[_0x34e079(0x16b)]['y'],_0x4cfb26;}[_0x1cddba(0x13b)](){const _0x361aed=_0x1cddba;let _0x409363=new webgpu.Vector3(),_0x3c2d04=this[_0x361aed(0x141)]();return _0x3c2d04[_0x361aed(0x12b)](_0x409363),_0x409363['y']=_0x3c2d04[_0x361aed(0x123)]['y'],_0x409363;}['getBounds'](){const _0x47f791=_0x1cddba;if(!this[_0x47f791(0x174)])throw Error(_0x47f791(0x178));let _0x5ddb73=new webgpu.Box3();return _0x5ddb73[_0x47f791(0x16a)](this[_0x47f791(0x174)],![]),_0x5ddb73['isEmpty']()&&(_0x5ddb73[_0x47f791(0x123)]=_0x5ddb73[_0x47f791(0x16b)]=this[_0x47f791(0x15c)]()),_0x5ddb73;}get[_0x1cddba(0x163)](){const _0x8a9e92=_0x1cddba;var _0x8c7684,_0x39699b;if(!this['obj'])throw Error(_0x8a9e92(0x178));let _0x1595bc=(_0x39699b=(_0x8c7684=this[_0x8a9e92(0x174)])===null||_0x8c7684===void 0?void 0:_0x8c7684[_0x8a9e92(0x170)])===null||_0x39699b===void 0?void 0:_0x39699b['userData'][_0x8a9e92(0x156)];if(!_0x1595bc)return null;if(!(_0x1595bc instanceof SceneComponent))return null;if(_0x1595bc[_0x8a9e92(0x11c)]!==this[_0x8a9e92(0x11c)])return null;return _0x1595bc;}get[_0x1cddba(0x12f)](){const _0x403209=_0x1cddba;if(!this[_0x403209(0x174)])throw Error(_0x403209(0x178));let _0x291d93=[];for(let _0x302db4=0x0;_0x302db4<this[_0x403209(0x174)]['children'][_0x403209(0x11a)];++_0x302db4){if(!this[_0x403209(0x174)]['children'][_0x302db4][_0x403209(0x12a)]['LYObject'])continue;this['obj'][_0x403209(0x177)][_0x302db4][_0x403209(0x12a)][_0x403209(0x156)][_0x403209(0x11c)]===this[_0x403209(0x11c)]&&_0x291d93['push'](this['obj'][_0x403209(0x177)][_0x302db4]['userData'][_0x403209(0x156)]);}return _0x291d93;}[_0x1cddba(0x132)](_0x492ffa){const _0x290ec8=_0x1cddba;let _0x5503d1=this[_0x290ec8(0x12f)];for(let _0x576f52=0x0;_0x576f52<_0x5503d1[_0x290ec8(0x11a)];++_0x576f52){_0x5503d1[_0x576f52]['onAddedToWorld'](_0x492ffa);}}[_0x1cddba(0x14f)](){const _0x20ad15=_0x1cddba;this['isHoverEnabled']=![],this[_0x20ad15(0x152)]=![],this['detachFromParentActor'](),this[_0x20ad15(0x169)](),this['destroyChildren'](),this[_0x20ad15(0x15d)](),this[_0x20ad15(0x151)]&&this['world'][_0x20ad15(0x187)][_0x20ad15(0x185)]();}[_0x1cddba(0x15d)](){const _0x450196=_0x1cddba;if(!this[_0x450196(0x174)])return;this[_0x450196(0x174)][_0x450196(0x170)]&&this[_0x450196(0x174)]['parent'][_0x450196(0x181)](this[_0x450196(0x174)]),super['destroyObject']();}[_0x1cddba(0x11e)](){const _0x3fea45=_0x1cddba;if(!this['obj'])throw Error(_0x3fea45(0x178));if(this['obj']['matrixAutoUpdate'])return this[_0x3fea45(0x174)][_0x3fea45(0x17d)][_0x3fea45(0x12d)]();else {const _0x207aa3=new webgpu.Vector3(),_0x1791d1=new webgpu.Quaternion(),_0x2f60a3=new webgpu.Vector3();return this[_0x3fea45(0x174)][_0x3fea45(0x15a)]['decompose'](_0x207aa3,_0x1791d1,_0x2f60a3),_0x207aa3;}}[_0x1cddba(0x16e)](..._0x5a85da){const _0x23d7b7=_0x1cddba;var _0x2015d0;if(!this[_0x23d7b7(0x174)])throw Error(_0x23d7b7(0x178));let _0x4a4986=null;if(_0x5a85da[_0x23d7b7(0x11a)]===0x1&&((_0x2015d0=_0x5a85da[0x0])===null||_0x2015d0===void 0?void 0:_0x2015d0[_0x23d7b7(0x11f)])){const _0x48b7d5=_0x5a85da[0x0];_0x4a4986=new webgpu.Vector3(_0x48b7d5['x'],_0x48b7d5['y'],_0x48b7d5['z']);}else _0x5a85da[_0x23d7b7(0x11a)]===0x3&&typeof _0x5a85da[0x0]===_0x23d7b7(0x159)&&typeof _0x5a85da[0x1]===_0x23d7b7(0x159)&&typeof _0x5a85da[0x2]===_0x23d7b7(0x159)&&(_0x4a4986=new webgpu.Vector3(_0x5a85da[0x0],_0x5a85da[0x1],_0x5a85da[0x2]));if(!_0x4a4986)return;this[_0x23d7b7(0x174)][_0x23d7b7(0x17d)]['copy'](_0x4a4986),!this[_0x23d7b7(0x174)][_0x23d7b7(0x135)]&&this[_0x23d7b7(0x174)][_0x23d7b7(0x15a)][_0x23d7b7(0x16e)](_0x4a4986['x'],_0x4a4986['y'],_0x4a4986['z']),this['obj'][_0x23d7b7(0x116)](),this[_0x23d7b7(0x174)]['updateMatrixWorld'](!![]),this[_0x23d7b7(0x151)]&&this[_0x23d7b7(0x151)][_0x23d7b7(0x187)][_0x23d7b7(0x185)]();}[_0x1cddba(0x17a)](){const _0x5d86dd=_0x1cddba;if(!this['obj'])throw Error(_0x5d86dd(0x178));if(this[_0x5d86dd(0x174)]['matrixAutoUpdate'])return this[_0x5d86dd(0x174)]['rotation'][_0x5d86dd(0x12d)]();else {const _0x3d0d30=new webgpu.Vector3(),_0xa4c659=new webgpu.Quaternion(),_0x4101f8=new webgpu.Vector3();return this[_0x5d86dd(0x174)][_0x5d86dd(0x15a)][_0x5d86dd(0x186)](_0x3d0d30,_0xa4c659,_0x4101f8),new webgpu.Euler()[_0x5d86dd(0x13c)](_0xa4c659);}}[_0x1cddba(0x172)](..._0x25c8d3){const _0x2f3805=_0x1cddba;var _0x29c63f;if(!this['obj'])throw Error(_0x2f3805(0x178));let _0x16bae9=null;if((_0x29c63f=_0x25c8d3[0x0])===null||_0x29c63f===void 0?void 0:_0x29c63f['isEuler']){const _0x2bde12=_0x25c8d3[0x0];_0x16bae9=new webgpu.Euler(_0x2bde12['x'],_0x2bde12['y'],_0x2bde12['z'],_0x2bde12['order']);}else typeof _0x25c8d3[0x0]===_0x2f3805(0x159)&&typeof _0x25c8d3[0x1]===_0x2f3805(0x159)&&typeof _0x25c8d3[0x2]===_0x2f3805(0x159)&&(_0x16bae9=new webgpu.Euler(_0x25c8d3[0x0],_0x25c8d3[0x1],_0x25c8d3[0x2]));if(!_0x16bae9)return;this[_0x2f3805(0x174)][_0x2f3805(0x126)][_0x2f3805(0x180)](_0x16bae9),this[_0x2f3805(0x174)][_0x2f3805(0x116)](),this[_0x2f3805(0x174)][_0x2f3805(0x157)](!![]),this[_0x2f3805(0x151)]&&this[_0x2f3805(0x151)]['viewport']['markRenderStateDirty']();}['getQuaternion'](){const _0x37d840=_0x1cddba;if(!this[_0x37d840(0x174)])throw Error(_0x37d840(0x178));if(this['obj'][_0x37d840(0x135)])return this[_0x37d840(0x174)][_0x37d840(0x140)]['clone']();else {const _0x59378f=new webgpu.Vector3(),_0x14c11d=new webgpu.Quaternion(),_0x1f622b=new webgpu.Vector3();return this[_0x37d840(0x174)][_0x37d840(0x15a)][_0x37d840(0x186)](_0x59378f,_0x14c11d,_0x1f622b),_0x14c11d;}}['setQuaternion'](..._0x57cbdc){const _0x1dc98f=_0x1cddba;var _0x489c3f;if(!this['obj'])throw Error(_0x1dc98f(0x178));let _0x17af68=null;if((_0x489c3f=_0x57cbdc[0x0])===null||_0x489c3f===void 0?void 0:_0x489c3f[_0x1dc98f(0x149)]){const _0x4b3546=_0x57cbdc[0x0];_0x17af68=new webgpu.Quaternion(_0x4b3546['x'],_0x4b3546['y'],_0x4b3546['z'],_0x4b3546['w']);}else typeof _0x57cbdc[0x0]===_0x1dc98f(0x159)&&typeof _0x57cbdc[0x1]===_0x1dc98f(0x159)&&typeof _0x57cbdc[0x2]==='number'&&typeof _0x57cbdc[0x3]===_0x1dc98f(0x159)&&(_0x17af68=new webgpu.Quaternion(_0x57cbdc[0x0],_0x57cbdc[0x1],_0x57cbdc[0x2],_0x57cbdc[0x3]));if(!_0x17af68){console[_0x1dc98f(0x143)](_0x1dc98f(0x165),_0x57cbdc);return;}this[_0x1dc98f(0x174)]['quaternion'][_0x1dc98f(0x180)](_0x17af68);if(!this[_0x1dc98f(0x174)]['matrixAutoUpdate']){const _0xc049cc=new webgpu.Vector3(),_0x3d8254=new webgpu.Quaternion(),_0x454bbb=new webgpu.Vector3();this[_0x1dc98f(0x174)]['matrix'][_0x1dc98f(0x186)](_0xc049cc,_0x3d8254,_0x454bbb),this[_0x1dc98f(0x174)][_0x1dc98f(0x15a)][_0x1dc98f(0x122)](_0xc049cc,_0x17af68,_0x454bbb);}this[_0x1dc98f(0x151)]&&this['world'][_0x1dc98f(0x187)]['markRenderStateDirty'](),this['obj']['updateMatrix'](),this[_0x1dc98f(0x174)][_0x1dc98f(0x157)](!![]);}[_0x1cddba(0x129)](){const _0x5c2ee6=_0x1cddba;if(!this['obj'])throw Error(_0x5c2ee6(0x178));if(this[_0x5c2ee6(0x174)][_0x5c2ee6(0x135)])return this[_0x5c2ee6(0x174)][_0x5c2ee6(0x139)][_0x5c2ee6(0x12d)]();else {const _0xa07c47=new webgpu.Vector3(),_0x75b33a=new webgpu.Quaternion(),_0x583981=new webgpu.Vector3();return this[_0x5c2ee6(0x174)][_0x5c2ee6(0x15a)][_0x5c2ee6(0x186)](_0xa07c47,_0x75b33a,_0x583981),_0x583981;}}['setScale'](..._0x9c1808){const _0x4cdfd0=_0x1cddba;var _0x1ca530;if(!this['obj'])throw Error(_0x4cdfd0(0x178));let _0x9f8c6f=null;if((_0x1ca530=_0x9c1808[0x0])===null||_0x1ca530===void 0?void 0:_0x1ca530[_0x4cdfd0(0x11f)]){const _0x3973c0=_0x9c1808[0x0];_0x9f8c6f=new webgpu.Vector3(_0x3973c0['x'],_0x3973c0['y'],_0x3973c0['z']);}else typeof _0x9c1808[0x0]===_0x4cdfd0(0x159)&&typeof _0x9c1808[0x1]===_0x4cdfd0(0x159)&&typeof _0x9c1808[0x2]===_0x4cdfd0(0x159)&&(_0x9f8c6f=new webgpu.Vector3(_0x9c1808[0x0],_0x9c1808[0x1],_0x9c1808[0x2]));if(!_0x9f8c6f)return;this[_0x4cdfd0(0x174)][_0x4cdfd0(0x139)][_0x4cdfd0(0x180)](_0x9f8c6f),this[_0x4cdfd0(0x174)]['updateMatrix'](),this[_0x4cdfd0(0x174)][_0x4cdfd0(0x157)](!![]),this['world']&&this[_0x4cdfd0(0x151)][_0x4cdfd0(0x187)][_0x4cdfd0(0x185)]();}[_0x1cddba(0x175)](){const _0x5d7782=_0x1cddba;if(!this['obj'])throw Error(_0x5d7782(0x178));return this[_0x5d7782(0x174)][_0x5d7782(0x15a)];}[_0x1cddba(0x182)](_0x328963){const _0x41f272=_0x1cddba;var _0x1f9c85;if(!this[_0x41f272(0x174)])throw Error(_0x41f272(0x178));_0x328963[_0x41f272(0x186)](this[_0x41f272(0x174)][_0x41f272(0x17d)],this[_0x41f272(0x174)][_0x41f272(0x140)],this[_0x41f272(0x174)][_0x41f272(0x139)]),this[_0x41f272(0x174)]['updateMatrix'](),this['obj'][_0x41f272(0x157)](!![]),(_0x1f9c85=this['world'])===null||_0x1f9c85===void 0?void 0:_0x1f9c85[_0x41f272(0x187)]['markRenderStateDirty']();}[_0x1cddba(0x15c)](){const _0x104713=_0x1cddba;if(!this[_0x104713(0x174)])throw Error(_0x104713(0x178));let _0x286caa=new webgpu.Vector3();return this['obj']['getWorldPosition'](_0x286caa),_0x286caa;}[_0x1cddba(0x133)](){const _0x371f92=_0x1cddba;if(!this[_0x371f92(0x174)])throw Error(_0x371f92(0x178));let _0x480e12=new webgpu.Quaternion();return this[_0x371f92(0x174)][_0x371f92(0x15f)](_0x480e12),new webgpu.Euler()[_0x371f92(0x13c)](_0x480e12);}[_0x1cddba(0x15f)](){const _0x45bfcd=_0x1cddba;if(!this[_0x45bfcd(0x174)])throw Error(_0x45bfcd(0x178));let _0x213eb9=new webgpu.Quaternion();return this[_0x45bfcd(0x174)][_0x45bfcd(0x15f)](_0x213eb9),_0x213eb9;}[_0x1cddba(0x173)](){const _0x3449fe=_0x1cddba;if(!this[_0x3449fe(0x174)])throw Error(_0x3449fe(0x178));let _0x3cf529=new webgpu.Vector3();return this[_0x3449fe(0x174)][_0x3449fe(0x173)](_0x3cf529),_0x3cf529;}['getWorldMatrix'](){const _0x3ef6d8=_0x1cddba;if(!this[_0x3ef6d8(0x174)])throw Error('threeObject\x20is\x20invalid');return this[_0x3ef6d8(0x174)]['updateMatrixWorld'](!![]),this[_0x3ef6d8(0x174)][_0x3ef6d8(0x161)][_0x3ef6d8(0x12d)]();}[_0x1cddba(0x166)](_0x2ccd42){const _0x56dc4b=_0x1cddba;if(!this[_0x56dc4b(0x174)])throw Error(_0x56dc4b(0x178));if(this['obj'][_0x56dc4b(0x170)]){this[_0x56dc4b(0x174)][_0x56dc4b(0x170)][_0x56dc4b(0x157)](!![]);const _0x542d56=this[_0x56dc4b(0x174)][_0x56dc4b(0x170)][_0x56dc4b(0x161)]['clone']()[_0x56dc4b(0x131)](),_0x487038=new webgpu.Matrix4()[_0x56dc4b(0x121)](_0x542d56,_0x2ccd42);this[_0x56dc4b(0x182)](_0x487038);}else this['setMatrix'](_0x2ccd42);this[_0x56dc4b(0x174)][_0x56dc4b(0x157)](!![]),this[_0x56dc4b(0x151)]&&this[_0x56dc4b(0x151)][_0x56dc4b(0x187)][_0x56dc4b(0x185)]();}[_0x1cddba(0x158)](){const _0x4038a7=_0x1cddba;if(!this[_0x4038a7(0x174)])throw Error(_0x4038a7(0x178));let _0x3a810a=new webgpu.Vector3();return this[_0x4038a7(0x174)][_0x4038a7(0x154)](_0x3a810a),_0x3a810a;}['getWorldUpDirection'](){const _0x50358a=_0x1cddba;if(!this[_0x50358a(0x174)])throw Error('threeObject\x20is\x20invalid');let _0x57d7b0=new webgpu.Vector3(0x0,0x1,0x0);return _0x57d7b0[_0x50358a(0x184)](this['getWorldQuaternion']()),_0x57d7b0;}['getWorldRightDirection'](){const _0x7b6107=_0x1cddba;if(!this[_0x7b6107(0x174)])throw Error(_0x7b6107(0x178));let _0xec5acd=new webgpu.Vector3(0x1,0x0,0x0);return _0xec5acd[_0x7b6107(0x184)](this['getWorldQuaternion']()),_0xec5acd;}[_0x1cddba(0x144)](_0x50004e){const _0x1c141d=_0x1cddba;if(!this[_0x1c141d(0x174)])throw Error(_0x1c141d(0x178));return this[_0x1c141d(0x174)][_0x1c141d(0x144)](_0x50004e);}[_0x1cddba(0x176)](_0x5b5b74){const _0x40a588=_0x1cddba;if(!this[_0x40a588(0x174)])throw Error(_0x40a588(0x178));return this[_0x40a588(0x174)][_0x40a588(0x176)](_0x5b5b74);}['attachComponent'](_0x110f64){const _0x6f4609=_0x1cddba;if(!this['obj'])throw Error(_0x6f4609(0x178));if(!_0x110f64[_0x6f4609(0x13a)])throw Error(_0x6f4609(0x146));this['obj'][_0x6f4609(0x134)](_0x110f64[_0x6f4609(0x13a)]),this[_0x6f4609(0x151)]&&_0x110f64[_0x6f4609(0x132)](this['world']);}['detachComponent'](_0x296153){const _0x5bb72d=_0x1cddba;if(!this[_0x5bb72d(0x174)])throw Error(_0x5bb72d(0x178));if(!_0x296153[_0x5bb72d(0x13a)])throw Error(_0x5bb72d(0x16c));this['obj'][_0x5bb72d(0x181)](_0x296153[_0x5bb72d(0x13a)]);}[_0x1cddba(0x12c)](_0x58b634,_0x5a376f=exports.AttachmentRules['KeepRelative']){const _0x1327b7=_0x1cddba;if(!this[_0x1327b7(0x174)])throw Error(_0x1327b7(0x178));if(!_0x58b634[_0x1327b7(0x13a)])throw Error(_0x1327b7(0x146));_0x58b634['parentActor']=this[_0x1327b7(0x11c)];if(_0x5a376f===exports.AttachmentRules[_0x1327b7(0x14d)]){let _0x5d5c08=_0x58b634[_0x1327b7(0x171)]();this[_0x1327b7(0x174)][_0x1327b7(0x134)](_0x58b634[_0x1327b7(0x13a)]),_0x58b634[_0x1327b7(0x166)](_0x5d5c08);}else this[_0x1327b7(0x174)]['add'](_0x58b634['threeObject']);this[_0x1327b7(0x151)]&&_0x58b634[_0x1327b7(0x132)](this[_0x1327b7(0x151)]),this['obj'][_0x1327b7(0x116)](),this['obj'][_0x1327b7(0x157)](!![]);}[_0x1cddba(0x136)](_0x86f6c7){const _0x38fe23=_0x1cddba;if(!this[_0x38fe23(0x174)])throw Error(_0x38fe23(0x178));if(!_0x86f6c7[_0x38fe23(0x13a)])throw Error(_0x38fe23(0x147));this[_0x38fe23(0x174)][_0x38fe23(0x181)](_0x86f6c7[_0x38fe23(0x13a)]);}[_0x1cddba(0x169)](){const _0xcbe4af=_0x1cddba;this['parentComponent']&&this[_0xcbe4af(0x163)][_0xcbe4af(0x136)](this);}[_0x1cddba(0x17e)](){const _0xd5ab65=_0x1cddba;this[_0xd5ab65(0x11c)]&&(this['parentActor']=null);}['destroyChildren'](){const _0x579475=_0x1cddba;var _0x597d1c;if(!this[_0x579475(0x174)])return;let _0x7d2c3b=[];for(let _0x5ba1ee=0x0;_0x5ba1ee<this[_0x579475(0x174)][_0x579475(0x177)][_0x579475(0x11a)];++_0x5ba1ee){let _0x8162a7=(_0x597d1c=this[_0x579475(0x174)][_0x579475(0x177)][_0x5ba1ee][_0x579475(0x12a)])===null||_0x597d1c===void 0?void 0:_0x597d1c[_0x579475(0x156)];_0x8162a7&&_0x7d2c3b[_0x579475(0x124)](_0x8162a7);}_0x7d2c3b[_0x579475(0x14c)](_0x184a3e=>{const _0x37d3b8=_0x579475;_0x184a3e[_0x37d3b8(0x14f)]();}),_0x7d2c3b=[];}set[_0x1cddba(0x150)](_0x43191c){const _0x141576=_0x1cddba;this[_0x141576(0x189)]=_0x43191c;let _0x218eda=this[_0x141576(0x12f)];for(let _0x9f1a7d=0x0;_0x9f1a7d<_0x218eda['length'];++_0x9f1a7d){_0x218eda[_0x9f1a7d][_0x141576(0x150)]=this[_0x141576(0x189)];}}get[_0x1cddba(0x150)](){return this['bCanHover'];}set[_0x1cddba(0x152)](_0x1e1ddc){const _0x4a3eae=_0x1cddba;this['bCanClick']=_0x1e1ddc;let _0x2ef8ee=this['childrenComponents'];for(let _0x433dd3=0x0;_0x433dd3<_0x2ef8ee['length'];++_0x433dd3){_0x2ef8ee[_0x433dd3][_0x4a3eae(0x152)]=this[_0x4a3eae(0x16d)];}}get[_0x1cddba(0x152)](){return this['bCanClick'];}[_0x1cddba(0x160)](){const _0x523986=_0x1cddba;this['_onHoverBeginDelegate'][_0x523986(0x168)]();}[_0x1cddba(0x15b)](){const _0x5bb9d3=_0x1cddba;this[_0x5bb9d3(0x16f)][_0x5bb9d3(0x168)]();}[_0x1cddba(0x17b)](){const _0x444d03=_0x1cddba;this[_0x444d03(0x138)][_0x444d03(0x168)]();}[_0x1cddba(0x13f)](){const _0x24491d=_0x1cddba;this[_0x24491d(0x153)][_0x24491d(0x168)]();}}
760
31
 
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
- }
32
+ const _0x28d22b=_0x3266;(function(_0x3a600a,_0x2598b7){const _0x2fda07=_0x3266,_0x24ea0=_0x3a600a();while(!![]){try{const _0xc0c201=-parseInt(_0x2fda07(0x132))/0x1*(parseInt(_0x2fda07(0x14d))/0x2)+-parseInt(_0x2fda07(0x155))/0x3*(parseInt(_0x2fda07(0x130))/0x4)+parseInt(_0x2fda07(0x136))/0x5+-parseInt(_0x2fda07(0x152))/0x6*(parseInt(_0x2fda07(0x147))/0x7)+parseInt(_0x2fda07(0x138))/0x8*(parseInt(_0x2fda07(0x141))/0x9)+parseInt(_0x2fda07(0x131))/0xa+parseInt(_0x2fda07(0x14f))/0xb;if(_0xc0c201===_0x2598b7)break;else _0x24ea0['push'](_0x24ea0['shift']());}catch(_0xb853f3){_0x24ea0['push'](_0x24ea0['shift']());}}}(_0x2249,0x7c691));function _0x3266(_0x1ed344,_0x181ae4){_0x1ed344=_0x1ed344-0x12d;const _0x224988=_0x2249();let _0x326651=_0x224988[_0x1ed344];return _0x326651;}function _0x2249(){const _0x3308b2=['release','geometryPtr','15306aomKBB','max','threeObject\x20is\x20null','6bZYJiN','threeObject','materialPtr','castShadow','material','1091848siFkEf','9092420DIJtka','1909ZLDkZF','min','createDefaultObject','forEach','282995ekirVU','geometryPtr\x20is\x20null','2703392deuqfU','getValue','obj','userData','_materialPtr','isArray','geometry','app','getCenter','18lzdldn','LYObject','push','assetManager','receiveShadow','getBoundsBottomCenterPosition','1673oeiLio','addGeometryAsset','length','getBounds','_geometryPtr','getBoundsCenterPosition','50ILamaK','getBoundsTopCenterPosition','783574rPutil'];_0x2249=function(){return _0x3308b2;};return _0x2249();}class MeshComponent extends SceneComponent{get[_0x28d22b(0x156)](){const _0x5eb2b5=_0x28d22b;if(!this[_0x5eb2b5(0x13a)])throw new Error(_0x5eb2b5(0x154));return this['obj'];}set[_0x28d22b(0x156)](_0xd28413){const _0x4f1e33=_0x28d22b;this[_0x4f1e33(0x13a)]=_0xd28413,this['obj']&&(this['obj'][_0x4f1e33(0x13b)][_0x4f1e33(0x142)]=this);}get['geometry'](){const _0x3dfd8c=_0x28d22b;if(!this[_0x3dfd8c(0x14b)])throw new Error(_0x3dfd8c(0x137));return this[_0x3dfd8c(0x14b)][_0x3dfd8c(0x139)]();}set[_0x28d22b(0x13e)](_0x1f7b43){const _0x2f9fd7=_0x28d22b;let _0x568168=this['app'][_0x2f9fd7(0x144)][_0x2f9fd7(0x148)](_0x1f7b43);this['geometryPtr']=_0x568168;}get[_0x28d22b(0x151)](){const _0x39a448=_0x28d22b;if(!this[_0x39a448(0x14b)])throw new Error(_0x39a448(0x137));return this[_0x39a448(0x14b)];}set['geometryPtr'](_0x182bcf){const _0x2b94e1=_0x28d22b;this[_0x2b94e1(0x14b)]&&(this[_0x2b94e1(0x14b)][_0x2b94e1(0x150)](),this['_geometryPtr']=null);this['_geometryPtr']=_0x182bcf;let _0x57c126=_0x182bcf[_0x2b94e1(0x139)]();this[_0x2b94e1(0x156)]&&_0x57c126&&(this[_0x2b94e1(0x156)]['geometry']=_0x57c126);}get[_0x28d22b(0x12f)](){const _0x173b36=_0x28d22b;let _0x1b348a=[];return this[_0x173b36(0x13c)][_0x173b36(0x135)](_0x4a2065=>{const _0x1e83ef=_0x173b36;let _0x41ab3d=_0x4a2065['getValue']();if(_0x41ab3d)_0x1b348a[_0x1e83ef(0x143)](_0x41ab3d);}),_0x1b348a[_0x173b36(0x149)]>0x1?_0x1b348a:_0x1b348a[0x0];}get[_0x28d22b(0x12d)](){const _0x3a950b=_0x28d22b;return this[_0x3a950b(0x12d)];}set['material'](_0x1eae7e){const _0x410760=_0x28d22b;let _0x7dd799=Array['isArray'](_0x1eae7e)?_0x1eae7e:[_0x1eae7e],_0x504ea2=[];_0x7dd799['forEach'](_0x5c8f45=>{const _0x396018=_0x3266;let _0x21ca37=this[_0x396018(0x13f)]['assetManager']['addMaterialAsset'](_0x5c8f45);if(_0x21ca37)_0x504ea2['push'](_0x21ca37);}),this[_0x410760(0x12d)]=_0x504ea2;}set[_0x28d22b(0x12d)](_0x39d4ed){const _0x3344e7=_0x28d22b;this['_materialPtr']&&(this['_materialPtr'][_0x3344e7(0x135)](_0x2680b9=>{const _0x1d6303=_0x3344e7;_0x2680b9[_0x1d6303(0x150)]();}),this[_0x3344e7(0x13c)]=[]);let _0x2ef155=Array['isArray'](_0x39d4ed)?_0x39d4ed:[_0x39d4ed],_0x3cd397=[];_0x2ef155['forEach'](_0x5bf95d=>{const _0x138660=_0x3344e7;let _0x59ae12=_0x5bf95d['getValue']();if(_0x59ae12)_0x3cd397[_0x138660(0x143)](_0x59ae12);_0x5bf95d['addRef']();});if(this[_0x3344e7(0x156)]){if(_0x3cd397[_0x3344e7(0x149)]>0x0)this[_0x3344e7(0x156)][_0x3344e7(0x12f)]=Array['isArray'](_0x39d4ed)?_0x3cd397[0x0]:_0x3cd397;}this['_materialPtr']=_0x2ef155;}constructor(_0x228e44,_0x26e019,_0x3c405e,_0x2d3d62){const _0x386078=_0x28d22b;let _0x5f1829=[],_0x136b43=Array[_0x386078(0x13d)](_0x3c405e)?_0x3c405e:[_0x3c405e];_0x136b43[_0x386078(0x135)](_0x7167b4=>{const _0x51efab=_0x386078;let _0x5a40e0=_0x228e44[_0x51efab(0x144)]['addMaterialAsset'](_0x7167b4);if(_0x5a40e0)_0x5f1829['push'](_0x5a40e0);}),super(_0x228e44,_0x2d3d62),this['_geometryPtr']=_0x228e44[_0x386078(0x144)]['addGeometryAsset'](_0x26e019),this[_0x386078(0x13c)]=_0x5f1829,_0x5f1829[_0x386078(0x135)](_0xda96c0=>{_0xda96c0['addRef']();}),this[_0x386078(0x156)][_0x386078(0x12f)]=_0x3c405e,this['threeObject']['geometry']=_0x26e019;}[_0x28d22b(0x134)](){return new webgpu.Mesh();}set[_0x28d22b(0x12e)](_0x60f8d6){const _0x31dabd=_0x28d22b;if(this[_0x31dabd(0x156)])this[_0x31dabd(0x156)][_0x31dabd(0x12e)]=_0x60f8d6;}get[_0x28d22b(0x12e)](){const _0x578bf0=_0x28d22b;return this['threeObject']?this[_0x578bf0(0x156)][_0x578bf0(0x12e)]:![];}set[_0x28d22b(0x145)](_0x1f1074){const _0x7da347=_0x28d22b;if(!this[_0x7da347(0x156)])return;this['threeObject']['receiveShadow']=_0x1f1074;}get['receiveShadow'](){const _0x3e60d6=_0x28d22b;return this[_0x3e60d6(0x156)]?this['threeObject']['receiveShadow']:![];}[_0x28d22b(0x14c)](){const _0x59ae99=_0x28d22b;let _0x2f17de=new webgpu.Vector3();return this[_0x59ae99(0x14a)]()['getCenter'](_0x2f17de),_0x2f17de;}[_0x28d22b(0x14e)](){const _0x8011d9=_0x28d22b;let _0xbd8680=new webgpu.Vector3(),_0x4c88e1=this[_0x8011d9(0x14a)]();return _0x4c88e1['getCenter'](_0xbd8680),_0xbd8680['y']=_0x4c88e1[_0x8011d9(0x153)]['y'],_0xbd8680;}[_0x28d22b(0x146)](){const _0x5a225f=_0x28d22b;let _0x35fb91=new webgpu.Vector3(),_0x3268ec=this[_0x5a225f(0x14a)]();return _0x3268ec[_0x5a225f(0x140)](_0x35fb91),_0x35fb91['y']=_0x3268ec[_0x5a225f(0x133)]['y'],_0x35fb91;}['destroyObject'](){const _0x3e2de3=_0x28d22b;var _0x23acd7;this[_0x3e2de3(0x156)]&&this['threeObject']['removeFromParent']();(_0x23acd7=this[_0x3e2de3(0x14b)])===null||_0x23acd7===void 0?void 0:_0x23acd7[_0x3e2de3(0x150)]();let _0x271787=Array[_0x3e2de3(0x13d)](this['_materialPtr'])?this['_materialPtr']:[this[_0x3e2de3(0x13c)]];_0x271787[_0x3e2de3(0x135)](_0x5c5b1b=>{const _0x39c8f1=_0x3e2de3;_0x5c5b1b[_0x39c8f1(0x150)]();}),super['destroyObject']();}}
912
33
 
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
- }
34
+ var _0x32d69a=_0x1976;(function(_0x57c087,_0x2da4f1){var _0x1b459d=_0x1976,_0x595b18=_0x57c087();while(!![]){try{var _0x2069cb=-parseInt(_0x1b459d(0x18b))/0x1*(parseInt(_0x1b459d(0x18c))/0x2)+parseInt(_0x1b459d(0x18f))/0x3*(parseInt(_0x1b459d(0x190))/0x4)+-parseInt(_0x1b459d(0x191))/0x5+-parseInt(_0x1b459d(0x195))/0x6*(parseInt(_0x1b459d(0x196))/0x7)+parseInt(_0x1b459d(0x198))/0x8+parseInt(_0x1b459d(0x18e))/0x9+-parseInt(_0x1b459d(0x194))/0xa;if(_0x2069cb===_0x2da4f1)break;else _0x595b18['push'](_0x595b18['shift']());}catch(_0x3b3d38){_0x595b18['push'](_0x595b18['shift']());}}}(_0x44f9,0xbb137));function _0x1976(_0x41f6eb,_0x611ddf){_0x41f6eb=_0x41f6eb-0x189;var _0x44f96b=_0x44f9();var _0x19764b=_0x44f96b[_0x41f6eb];return _0x19764b;}function _0x44f9(){var _0x6fe771=['22555670vfPSmv','90Gdsige','117887nNwapv','referenceCount','12253232mqYzpZ','value','forceRelease','isValid','11GnSNWU','91492bhQHZN','addRef','9921303NLyfOr','3597546gJultT','4zTLCpZ','277760XKxRaE','dispose','getRefCount'];_0x44f9=function(){return _0x6fe771;};return _0x44f9();}class TSmartPointer{constructor(_0x2a7bcb,_0x262db2=0x1){var _0x1bb007=_0x1976;this['referenceCount']=0x1,this[_0x1bb007(0x199)]=null,this[_0x1bb007(0x199)]=_0x2a7bcb,this[_0x1bb007(0x197)]=_0x262db2;}[_0x32d69a(0x193)](){var _0x10b94f=_0x32d69a;return this[_0x10b94f(0x197)];}[_0x32d69a(0x18a)](){var _0x130dd7=_0x32d69a;return this[_0x130dd7(0x199)]!==null;}[_0x32d69a(0x18d)](_0x3c7c84=0x1){var _0x205b46=_0x32d69a;this[_0x205b46(0x199)]!==null&&(this[_0x205b46(0x197)]+=_0x3c7c84);}['release'](){var _0x1426f4=_0x32d69a;this['value']!==null&&this['referenceCount']>0x0&&(this[_0x1426f4(0x197)]--,this[_0x1426f4(0x197)]===0x0&&this[_0x1426f4(0x192)]());}[_0x32d69a(0x189)](){var _0x3c031c=_0x32d69a;this[_0x3c031c(0x199)]!==null&&(this[_0x3c031c(0x192)](),this[_0x3c031c(0x197)]=0x0);}[_0x32d69a(0x192)](){this['value']=null;}['getValue'](){var _0xc7d574=_0x32d69a;return this[_0xc7d574(0x199)];}}
955
35
 
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
- }
36
+ function _0xf6a0(_0x46e38a,_0x24d31e){_0x46e38a=_0x46e38a-0x117;const _0x4463da=_0x4463();let _0xf6a020=_0x4463da[_0x46e38a];return _0xf6a020;}const _0x26bd59=_0xf6a0;(function(_0x145cc6,_0x2fb79d){const _0x56b52c=_0xf6a0,_0x24857f=_0x145cc6();while(!![]){try{const _0x4d99dc=parseInt(_0x56b52c(0x119))/0x1*(-parseInt(_0x56b52c(0x11a))/0x2)+-parseInt(_0x56b52c(0x118))/0x3+parseInt(_0x56b52c(0x123))/0x4*(-parseInt(_0x56b52c(0x11e))/0x5)+-parseInt(_0x56b52c(0x127))/0x6+parseInt(_0x56b52c(0x117))/0x7*(parseInt(_0x56b52c(0x126))/0x8)+-parseInt(_0x56b52c(0x11f))/0x9+parseInt(_0x56b52c(0x124))/0xa;if(_0x4d99dc===_0x2fb79d)break;else _0x24857f['push'](_0x24857f['shift']());}catch(_0x3c2455){_0x24857f['push'](_0x24857f['shift']());}}}(_0x4463,0xdf29c));function _0x4463(){const _0x5118cc=['value','function','7095665Ehijko','13841388kzmwKc','_uuid','dispose','uuid','4SbvQrN','64571720ZdaHwT','userData','1480brGonW','10700478cIDzyX','11081FdnzXT','1496013NgyBfb','11702YVVpFX','102KSYqEn','editorAssetId'];_0x4463=function(){return _0x5118cc;};return _0x4463();}const ASSET_POINTER_KEY='assetPointer';const EDITOR_ASSET_ID_KEY=_0x26bd59(0x11b);class TAssetPointer extends TSmartPointer{get['uuid'](){const _0x60e57c=_0x26bd59;return this[_0x60e57c(0x120)];}constructor(_0x40f5ca,_0x3ed1f1=0x0){const _0x44d3aa=_0x26bd59;super(_0x40f5ca,_0x3ed1f1),this['_uuid']=_0x40f5ca[_0x44d3aa(0x122)],_0x40f5ca[_0x44d3aa(0x125)][ASSET_POINTER_KEY]=this;}[_0x26bd59(0x121)](){const _0x1d69d4=_0x26bd59;this[_0x1d69d4(0x11c)]&&(this[_0x1d69d4(0x11c)][_0x1d69d4(0x125)]&&(delete this[_0x1d69d4(0x11c)][_0x1d69d4(0x125)][ASSET_POINTER_KEY],delete this[_0x1d69d4(0x11c)][_0x1d69d4(0x125)][EDITOR_ASSET_ID_KEY]),typeof this['value'][_0x1d69d4(0x121)]===_0x1d69d4(0x11d)&&this[_0x1d69d4(0x11c)][_0x1d69d4(0x121)]()),super[_0x1d69d4(0x121)]();}}
993
37
 
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
- }
38
+ const _0xd5341a=_0x2a9b;(function(_0x32b90d,_0x4825e8){const _0x2bf577=_0x2a9b,_0x490e3a=_0x32b90d();while(!![]){try{const _0x487032=parseInt(_0x2bf577(0x143))/0x1*(parseInt(_0x2bf577(0x142))/0x2)+-parseInt(_0x2bf577(0x148))/0x3*(parseInt(_0x2bf577(0x149))/0x4)+-parseInt(_0x2bf577(0x146))/0x5+-parseInt(_0x2bf577(0x14d))/0x6+-parseInt(_0x2bf577(0x13f))/0x7+parseInt(_0x2bf577(0x153))/0x8+parseInt(_0x2bf577(0x14b))/0x9;if(_0x487032===_0x4825e8)break;else _0x490e3a['push'](_0x490e3a['shift']());}catch(_0x273e55){_0x490e3a['push'](_0x490e3a['shift']());}}}(_0x4975,0xdacc4));class MaterialAssetPointer extends TAssetPointer{constructor(_0x568de7,_0x10b953,_0x461158=0x0){const _0x350f9e=_0x2a9b;super(_0x568de7,_0x461158),this[_0x350f9e(0x141)]=_0x10b953;}get['texturePointers'](){const _0x1414d0=_0x2a9b;return this[_0x1414d0(0x141)];}[_0xd5341a(0x151)](_0xf51e2e,_0x3d0035){const _0x13c5ae=_0xd5341a,_0x565e45=this[_0x13c5ae(0x14f)](),_0x2f3582=_0x3d0035['getValue']();if(!_0x2f3582)throw new Error(_0x13c5ae(0x14e));if(!_0x565e45)throw new Error(_0x13c5ae(0x150));const _0x5daaff=this[_0x13c5ae(0x141)]['get'](_0xf51e2e);_0x5daaff!==_0x3d0035&&(_0x5daaff&&_0x5daaff['release'](),this[_0x13c5ae(0x141)]['set'](_0xf51e2e,_0x3d0035),_0x565e45[_0xf51e2e]=_0x2f3582,_0x3d0035['addRef'](),_0x565e45['needsUpdate']=!![]);}[_0xd5341a(0x14c)](_0x242a8b){const _0x42e36d=_0xd5341a,_0x5c3935=this[_0x42e36d(0x14f)](),_0x94e0ec=this['textures'][_0x42e36d(0x140)](_0x242a8b);_0x94e0ec&&(_0x94e0ec[_0x42e36d(0x152)](),this[_0x42e36d(0x141)][_0x42e36d(0x145)](_0x242a8b),_0x5c3935&&(_0x5c3935[_0x242a8b]=null,_0x5c3935[_0x42e36d(0x154)]=!![]));}['dispose'](){const _0xd72521=_0xd5341a;for(const _0x394412 of this['textures'][_0xd72521(0x14a)]()){_0x394412[_0xd72521(0x152)]();}this[_0xd72521(0x141)][_0xd72521(0x147)](),super[_0xd72521(0x144)]();}}function _0x2a9b(_0x3bf7da,_0x1f78d4){_0x3bf7da=_0x3bf7da-0x13f;const _0x49751b=_0x4975();let _0x2a9be2=_0x49751b[_0x3bf7da];return _0x2a9be2;}function _0x4975(){const _0x28aea6=['clear','3089187tVPAtb','4WEGJXB','values','27995760JBiVyx','removeTexture','9252096gVkJfz','Texture\x20is\x20null','getValue','Material\x20is\x20null','setTexture','release','2099168QWCtDH','needsUpdate','4137546mTzjpx','get','textures','2993422PSjmha','1YNASWq','dispose','delete','4053640Grszzr'];_0x4975=function(){return _0x28aea6;};return _0x4975();}
1059
39
 
1060
- class TextureAssetPointer extends TAssetPointer {
1061
- constructor(value, referenceCount = 1) {
1062
- super(value, referenceCount);
1063
- }
1064
- }
40
+ (function(_0x43b84d,_0x21c79d){var _0x30b978=_0x580f,_0x2c485b=_0x43b84d();while(!![]){try{var _0x13b7f8=-parseInt(_0x30b978(0xe2))/0x1+-parseInt(_0x30b978(0xe3))/0x2*(parseInt(_0x30b978(0xe6))/0x3)+parseInt(_0x30b978(0xe9))/0x4*(parseInt(_0x30b978(0xe4))/0x5)+parseInt(_0x30b978(0xe7))/0x6*(-parseInt(_0x30b978(0xe5))/0x7)+parseInt(_0x30b978(0xec))/0x8+parseInt(_0x30b978(0xeb))/0x9*(parseInt(_0x30b978(0xea))/0xa)+parseInt(_0x30b978(0xe8))/0xb;if(_0x13b7f8===_0x21c79d)break;else _0x2c485b['push'](_0x2c485b['shift']());}catch(_0x343ea9){_0x2c485b['push'](_0x2c485b['shift']());}}}(_0x9ceb,0x20a56));function _0x580f(_0x12a0f7,_0xdb9cbf){_0x12a0f7=_0x12a0f7-0xe2;var _0x9ceb4b=_0x9ceb();var _0x580f0b=_0x9ceb4b[_0x12a0f7];return _0x580f0b;}class TextureAssetPointer extends TAssetPointer{constructor(_0x4dd648,_0x33feaa=0x1){super(_0x4dd648,_0x33feaa);}}function _0x9ceb(){var _0x52c101=['58884XViXgn','3258iFqGNA','180ErMqZn','492767NwnOuJ','1628UvwCdB','2120Lusszl','10917wnFyQf','1777760aMnTme','104990UqTLSo','414ELGmJj','2355rgqcTX'];_0x9ceb=function(){return _0x52c101;};return _0x9ceb();}
1065
41
 
1066
- class GeometryAssetPointer extends TAssetPointer {
1067
- constructor(value, referenceCount = 1) {
1068
- super(value, referenceCount);
1069
- }
1070
- }
42
+ function _0x298e(){var _0x5f37fa=['21881256psPWDp','1325628AVmIFy','40XYAFxw','54MGoQjD','2459891EnVYpp','13bAmaPd','546160NyDrtB','11ZYawOH','2518070ICjrVF','6nWUKNf','1749036hAUpnc','5XubsHN','9288jRjyTy'];_0x298e=function(){return _0x5f37fa;};return _0x298e();}function _0x2856(_0x61d904,_0x1818f4){_0x61d904=_0x61d904-0x130;var _0x298ecd=_0x298e();var _0x2856e7=_0x298ecd[_0x61d904];return _0x2856e7;}(function(_0x423b54,_0x248350){var _0x48e06f=_0x2856,_0x1c3c7e=_0x423b54();while(!![]){try{var _0x4e791c=parseInt(_0x48e06f(0x132))/0x1*(-parseInt(_0x48e06f(0x135))/0x2)+-parseInt(_0x48e06f(0x134))/0x3+-parseInt(_0x48e06f(0x130))/0x4*(parseInt(_0x48e06f(0x131))/0x5)+parseInt(_0x48e06f(0x13c))/0x6*(-parseInt(_0x48e06f(0x137))/0x7)+-parseInt(_0x48e06f(0x139))/0x8*(parseInt(_0x48e06f(0x136))/0x9)+-parseInt(_0x48e06f(0x13b))/0xa*(-parseInt(_0x48e06f(0x13a))/0xb)+-parseInt(_0x48e06f(0x133))/0xc*(-parseInt(_0x48e06f(0x138))/0xd);if(_0x4e791c===_0x248350)break;else _0x1c3c7e['push'](_0x1c3c7e['shift']());}catch(_0xe94630){_0x1c3c7e['push'](_0x1c3c7e['shift']());}}}(_0x298e,0x3cde5));class GeometryAssetPointer extends TAssetPointer{constructor(_0xfb07aa,_0x659341=0x1){super(_0xfb07aa,_0x659341);}}
1071
43
 
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
- }
44
+ const _0x3bb783=_0x5dc3;(function(_0x36ced,_0x9d0f41){const _0x43a9a1=_0x5dc3,_0x55f36d=_0x36ced();while(!![]){try{const _0x51aae8=parseInt(_0x43a9a1(0x8c))/0x1*(-parseInt(_0x43a9a1(0x8f))/0x2)+parseInt(_0x43a9a1(0x93))/0x3+parseInt(_0x43a9a1(0x8d))/0x4*(-parseInt(_0x43a9a1(0xaf))/0x5)+-parseInt(_0x43a9a1(0x9a))/0x6*(parseInt(_0x43a9a1(0xbd))/0x7)+parseInt(_0x43a9a1(0xbc))/0x8+parseInt(_0x43a9a1(0xa7))/0x9*(parseInt(_0x43a9a1(0xb7))/0xa)+-parseInt(_0x43a9a1(0xa4))/0xb*(-parseInt(_0x43a9a1(0xab))/0xc);if(_0x51aae8===_0x9d0f41)break;else _0x55f36d['push'](_0x55f36d['shift']());}catch(_0x384d7c){_0x55f36d['push'](_0x55f36d['shift']());}}}(_0x1e12,0xb5f1a));function _0x5dc3(_0x2bf0a4,_0x70300d){_0x2bf0a4=_0x2bf0a4-0x6e;const _0x1e12dc=_0x1e12();let _0x5dc337=_0x1e12dc[_0x2bf0a4];return _0x5dc337;}function _0x1e12(){const _0x12b0fd=['gltfLoader','traverse','/SceneResource/draco/','postMessage','load','clear','isArray','get','assetPointer','forceRelease','24sOwecV','656WVusSt','position','82462VAFqXf','addMaterialAsset','LoadingManager','release','843906DgPTpG','object','materials','dracoLoader','bind','_dracoPatched','onStart','345126EIaQYh','geometry','parse','scale','setDRACOLoader','setDecoderPath','setRotation','set','loadGltfFromPathAsync','addTextureAsset','77yZFlJU','Group','uuid','10912347LxQQFY','onLoad','userData','entries','2488152HCPurZ','materialAssets','geometries','isMesh','25055HwKqJt','forEach','checkMeshResource','addAsset','clone','manager','convertThreeObjectToLYObject','loadGltfFromBuffer','10FlFctV','setupDracoLoader','onError','app','textureAssets','1492744mgidAv','70gdckin','Object3D','clearAssets','children','loadGltfFromPath','values','prototype','geometryAssets','init','loadingManager','collectResourcesAndReferences','dispose','addRef','addChildComponent','type','addGeometryAsset','decoderConfig','call','Worker','setPosition','textures','releaseAsset','hasOwnProperty','material'];_0x1e12=function(){return _0x12b0fd;};return _0x1e12();}class AssetManager{constructor(_0x8edfc2){const _0x4b7b67=_0x5dc3;this[_0x4b7b67(0x71)]=new Map(),this[_0x4b7b67(0xbb)]=new Map(),this[_0x4b7b67(0xac)]=new Map(),this[_0x4b7b67(0x96)]=null,this[_0x4b7b67(0x73)]=new webgpu.LoadingManager(),this[_0x4b7b67(0x82)]=new Addons_js.GLTFLoader(this[_0x4b7b67(0x73)]),this[_0x4b7b67(0xba)]=_0x8edfc2;}get[_0x3bb783(0x91)](){const _0x2a7016=_0x3bb783;return this[_0x2a7016(0x73)];}async[_0x3bb783(0x72)](){return;}[_0x3bb783(0xb8)](_0x322ed3){const _0x5ec5b4=_0x3bb783;if(!this[_0x5ec5b4(0x96)]){this[_0x5ec5b4(0x96)]=new Addons_js.DRACOLoader();if(this[_0x5ec5b4(0x96)][_0x5ec5b4(0xb4)]){const _0x55446b=this[_0x5ec5b4(0x96)][_0x5ec5b4(0xb4)];_0x55446b[_0x5ec5b4(0x99)]=undefined,_0x55446b[_0x5ec5b4(0xa8)]=undefined,_0x55446b['onProgress']=undefined,_0x55446b[_0x5ec5b4(0xb9)]=undefined;}this[_0x5ec5b4(0x96)][_0x5ec5b4(0x9f)](_0x322ed3);const _0x1177c1=window[_0x5ec5b4(0x7c)];if(_0x1177c1&&!_0x1177c1[_0x5ec5b4(0x98)]){_0x1177c1[_0x5ec5b4(0x98)]=!![],window[_0x5ec5b4(0x7c)]=function(_0x30860b,_0x2a4fe6){const _0x234fd9=_0x5ec5b4,_0x3346ea=new _0x1177c1(_0x30860b,_0x2a4fe6),_0x417621=_0x3346ea[_0x234fd9(0x85)][_0x234fd9(0x97)](_0x3346ea);return _0x3346ea[_0x234fd9(0x85)]=function(_0x1751b0,_0x489fc3){const _0x206220=_0x234fd9;if(_0x1751b0&&_0x1751b0[_0x206220(0x7a)]&&typeof _0x1751b0['decoderConfig']===_0x206220(0x94)){const _0x48db8e=_0x1751b0['decoderConfig'],_0x79de0={};for(const _0x6af121 in _0x48db8e){Object[_0x206220(0x70)][_0x206220(0x80)][_0x206220(0x7b)](_0x48db8e,_0x6af121)&&(_0x79de0[_0x6af121]=_0x48db8e[_0x6af121]);}_0x1751b0=Object['assign'](Object['assign']({},_0x1751b0),{'decoderConfig':_0x79de0});}return _0x417621(_0x1751b0,_0x489fc3);},_0x3346ea;};for(const _0x2f7f48 in _0x1177c1){Object[_0x5ec5b4(0x70)][_0x5ec5b4(0x80)][_0x5ec5b4(0x7b)](_0x1177c1,_0x2f7f48)&&(window[_0x5ec5b4(0x7c)][_0x2f7f48]=_0x1177c1[_0x2f7f48]);}}this[_0x5ec5b4(0x96)]['preload'](),this[_0x5ec5b4(0x82)][_0x5ec5b4(0x9e)](this['dracoLoader']);}}[_0x3bb783(0xb5)](_0xd72a61,_0x78cd2b){const _0x1126f5=_0x3bb783,_0x1c9890=_0x78cd2b[_0x1126f5(0x8e)]['clone'](),_0x566900=_0x78cd2b['rotation'][_0x1126f5(0xb3)](),_0xd1ab69=_0x78cd2b[_0x1126f5(0x9d)][_0x1126f5(0xb3)]();let _0x552cf3=null;const _0x598d51=_0x78cd2b['children'];_0x78cd2b[_0x1126f5(0xc0)]=[];if(_0x78cd2b[_0x1126f5(0x78)]===_0x1126f5(0xa5)||_0x78cd2b[_0x1126f5(0x78)]===_0x1126f5(0xbe))_0x552cf3=new SceneComponent(this['app'],_0x78cd2b[_0x1126f5(0xa6)]);else {if(_0x78cd2b[_0x1126f5(0xae)]){const _0x1dc5fc=_0x78cd2b;_0x552cf3=new MeshComponent(this['app'],_0x1dc5fc[_0x1126f5(0x9b)],_0x1dc5fc['material']),_0x78cd2b['layers'][_0x1126f5(0xa1)](0x0);}else _0x552cf3=new SceneComponent(this[_0x1126f5(0xba)],_0x78cd2b[_0x1126f5(0xa6)]);}if(_0x552cf3===null)return _0x78cd2b[_0x1126f5(0xc0)]=_0x598d51,null;_0xd72a61[_0x1126f5(0x77)](_0x552cf3),_0x552cf3[_0x1126f5(0x7d)](_0x1c9890),_0x552cf3[_0x1126f5(0xa0)](_0x566900),_0x552cf3['setScale'](_0xd1ab69);for(const _0x42d7cc of _0x598d51){this[_0x1126f5(0xb5)](_0x552cf3,_0x42d7cc);}return _0x552cf3;}[_0x3bb783(0x74)](_0x444d28){const _0x567a84=_0x3bb783,_0x55d64b=(_0x348424,_0x4321d5)=>{const _0x4e533c=_0x5dc3;var _0x32a237;const _0x2dbec7=(_0x32a237=_0x348424[_0x4e533c(0x89)](_0x4321d5))!==null&&_0x32a237!==void 0?_0x32a237:0x0;_0x348424[_0x4e533c(0xa1)](_0x4321d5,_0x2dbec7+0x1);},_0x3a3af2={'geometries':new Map(),'materials':new Map(),'textures':new Map()};_0x444d28[_0x567a84(0x83)](_0x2363ad=>{const _0x495a18=_0x567a84,_0x5ec63f=_0x2363ad;_0x5ec63f[_0x495a18(0x9b)]instanceof webgpu.BufferGeometry&&_0x55d64b(_0x3a3af2[_0x495a18(0xad)],_0x5ec63f[_0x495a18(0x9b)]);if(_0x5ec63f[_0x495a18(0x81)]){const _0x41bfc4=Array['isArray'](_0x5ec63f[_0x495a18(0x81)])?_0x5ec63f[_0x495a18(0x81)]:[_0x5ec63f[_0x495a18(0x81)]];_0x41bfc4[_0x495a18(0xb0)](_0x45d691=>{const _0x320530=_0x495a18;_0x45d691&&(_0x55d64b(_0x3a3af2[_0x320530(0x95)],_0x45d691),Object[_0x320530(0x6f)](_0x45d691)[_0x320530(0xb0)](_0x42619a=>{const _0x4a2c7e=_0x320530;_0x42619a instanceof webgpu.Texture&&_0x55d64b(_0x3a3af2[_0x4a2c7e(0x7e)],_0x42619a);}));});}}),_0x3a3af2[_0x567a84(0xad)][_0x567a84(0xb0)]((_0xc8c5ca,_0x24e81d)=>this[_0x567a84(0xb2)](_0x24e81d,_0xc8c5ca)),_0x3a3af2[_0x567a84(0x95)][_0x567a84(0xb0)]((_0x7f359a,_0x6f03bd)=>this[_0x567a84(0xb2)](_0x6f03bd,_0x7f359a)),_0x3a3af2[_0x567a84(0x7e)][_0x567a84(0xb0)]((_0x5030c5,_0x566dfa)=>this[_0x567a84(0xb2)](_0x566dfa,_0x5030c5));}[_0x3bb783(0xb1)](_0x59d774){const _0x16d885=_0x3bb783;_0x59d774['geometry']&&!_0x59d774[_0x16d885(0x9b)]['userData']['assetPointer']&&this['addAsset'](_0x59d774['geometry']);if(_0x59d774['material']){const _0x2a87a2=Array[_0x16d885(0x88)](_0x59d774[_0x16d885(0x81)])?_0x59d774[_0x16d885(0x81)]:[_0x59d774['material']];_0x2a87a2['forEach'](_0x36e922=>{const _0x159ce1=_0x16d885;if(!_0x36e922)return;!_0x36e922[_0x159ce1(0xa9)][_0x159ce1(0x8a)]&&this[_0x159ce1(0xb2)](_0x36e922),Object[_0x159ce1(0x6f)](_0x36e922)['forEach'](_0x514ad1=>{const _0x36b0d3=_0x159ce1;_0x514ad1 instanceof webgpu.Texture&&!_0x514ad1[_0x36b0d3(0xa9)][_0x36b0d3(0x8a)]&&this[_0x36b0d3(0xb2)](_0x514ad1);});});}}async[_0x3bb783(0xa2)](_0x549ff2){const _0x5a2da1=_0x3bb783;return this[_0x5a2da1(0xb8)]('/SceneResource/draco/'),await this[_0x5a2da1(0x82)]['loadAsync'](_0x549ff2);}[_0x3bb783(0x6e)](_0x11694d,_0x50517d){const _0x3aac47=_0x3bb783;this['setupDracoLoader'](_0x3aac47(0x84)),this['gltfLoader'][_0x3aac47(0x86)](_0x11694d,_0x50517d);}[_0x3bb783(0xb6)](_0x1f4367,_0x5de15a,_0x4b3e9b){const _0x755918=_0x3bb783;this[_0x755918(0xb8)](_0x755918(0x84)),this[_0x755918(0x82)][_0x755918(0x9c)](_0x1f4367,_0x5de15a,_0x4b3e9b);}['loadFile'](_0x2e07bf='',_0x158f81){const _0x1efde2=new webgpu.FileLoader();_0x1efde2['load'](_0x2e07bf,_0x158f81);}[_0x3bb783(0xb2)](_0x1a7a24,_0x3e4859=0x0){const _0x1ad310=_0x3bb783;if(_0x1a7a24 instanceof webgpu.BufferGeometry)return this[_0x1ad310(0x79)](_0x1a7a24,_0x3e4859);if(_0x1a7a24 instanceof webgpu.Material)return this['addMaterialAsset'](_0x1a7a24,_0x3e4859);if(_0x1a7a24 instanceof webgpu.Texture)return this[_0x1ad310(0xa3)](_0x1a7a24,_0x3e4859);return undefined;}[_0x3bb783(0x90)](_0x5d8f5f,_0xf5b11d=0x0){const _0x4cb767=_0x3bb783;let _0x2ea06d=_0x5d8f5f[_0x4cb767(0xa9)]['assetPointer'];if(!_0x2ea06d){const _0x33ad51=new Map();Object[_0x4cb767(0xaa)](_0x5d8f5f)[_0x4cb767(0xb0)](([_0x1cfb28,_0x514797])=>{const _0x5a6b93=_0x4cb767;if(_0x514797 instanceof webgpu.Texture){const _0x2df6d6=this[_0x5a6b93(0xa3)](_0x514797,0x1);_0x33ad51['set'](_0x1cfb28,_0x2df6d6);}}),_0x2ea06d=new MaterialAssetPointer(_0x5d8f5f,_0x33ad51,_0xf5b11d),this[_0x4cb767(0xac)][_0x4cb767(0xa1)](_0x5d8f5f['uuid'],_0x2ea06d);}else _0x2ea06d[_0x4cb767(0x76)](_0xf5b11d);return _0x2ea06d;}[_0x3bb783(0xa3)](_0x1925e0,_0x4a9182=0x0){const _0x5694a0=_0x3bb783;let _0x52c5cb=_0x1925e0[_0x5694a0(0xa9)][_0x5694a0(0x8a)];return !_0x52c5cb?(_0x52c5cb=new TextureAssetPointer(_0x1925e0,_0x4a9182),this[_0x5694a0(0xbb)][_0x5694a0(0xa1)](_0x1925e0[_0x5694a0(0xa6)],_0x52c5cb)):_0x52c5cb[_0x5694a0(0x76)](_0x4a9182),_0x52c5cb;}[_0x3bb783(0x79)](_0x112aac,_0x1086ff=0x0){const _0x590820=_0x3bb783;let _0x2848a4=_0x112aac['userData'][_0x590820(0x8a)];return !_0x2848a4?(_0x2848a4=new GeometryAssetPointer(_0x112aac,_0x1086ff),this[_0x590820(0x71)]['set'](_0x112aac[_0x590820(0xa6)],_0x2848a4)):_0x2848a4[_0x590820(0x76)](_0x1086ff),_0x2848a4;}[_0x3bb783(0x7f)](_0x19eb71){const _0x45cf29=_0x3bb783,_0x2f849a=_0x19eb71[_0x45cf29(0xa9)]['assetPointer'];_0x2f849a?_0x2f849a[_0x45cf29(0x92)]():_0x19eb71[_0x45cf29(0x75)]();}[_0x3bb783(0xbf)](){const _0x2f41b3=_0x3bb783;this[_0x2f41b3(0x71)][_0x2f41b3(0xb0)](_0x53d242=>_0x53d242['forceRelease']()),this[_0x2f41b3(0x71)][_0x2f41b3(0x87)](),this[_0x2f41b3(0xac)][_0x2f41b3(0xb0)](_0x5862e3=>_0x5862e3['forceRelease']()),this[_0x2f41b3(0xac)][_0x2f41b3(0x87)](),this[_0x2f41b3(0xbb)][_0x2f41b3(0xb0)](_0x2b3401=>_0x2b3401[_0x2f41b3(0x8b)]()),this['textureAssets'][_0x2f41b3(0x87)]();}}
1307
45
 
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 = {}));
46
+ (function(_0x19c114,_0x36b9db){var _0x4e7263=_0x243a,_0x1b282d=_0x19c114();while(!![]){try{var _0x3bba16=parseInt(_0x4e7263(0x1de))/0x1*(parseInt(_0x4e7263(0x1df))/0x2)+parseInt(_0x4e7263(0x1cc))/0x3*(parseInt(_0x4e7263(0x1da))/0x4)+-parseInt(_0x4e7263(0x1c0))/0x5*(parseInt(_0x4e7263(0x1c6))/0x6)+-parseInt(_0x4e7263(0x1d4))/0x7*(parseInt(_0x4e7263(0x1c2))/0x8)+parseInt(_0x4e7263(0x1bf))/0x9*(-parseInt(_0x4e7263(0x1c8))/0xa)+-parseInt(_0x4e7263(0x1dd))/0xb*(parseInt(_0x4e7263(0x1d3))/0xc)+parseInt(_0x4e7263(0x1c3))/0xd;if(_0x3bba16===_0x36b9db)break;else _0x1b282d['push'](_0x1b282d['shift']());}catch(_0x309608){_0x1b282d['push'](_0x1b282d['shift']());}}}(_0xb8df,0x2f933));exports.AssetCategory = void 0;(function(_0x6c3b64){var _0x2f0f18=_0x243a;_0x6c3b64[_0x2f0f18(0x1ca)]='geometry',_0x6c3b64[_0x2f0f18(0x1c1)]=_0x2f0f18(0x1e0),_0x6c3b64[_0x2f0f18(0x1be)]=_0x2f0f18(0x1d9),_0x6c3b64[_0x2f0f18(0x1c9)]='actor',_0x6c3b64[_0x2f0f18(0x1cd)]='actorManager',_0x6c3b64[_0x2f0f18(0x1c4)]=_0x2f0f18(0x1d1),_0x6c3b64[_0x2f0f18(0x1cf)]=_0x2f0f18(0x1d7),_0x6c3b64[_0x2f0f18(0x1db)]=_0x2f0f18(0x1d8),_0x6c3b64['Undefined']=_0x2f0f18(0x1c7);}(exports.AssetCategory||(exports.AssetCategory={})));function _0x243a(_0x1d0899,_0xdccdc0){_0x1d0899=_0x1d0899-0x1be;var _0xb8df19=_0xb8df();var _0x243a0d=_0xb8df19[_0x1d0899];return _0x243a0d;}exports.AssetLoadState = void 0;(function(_0x241395){var _0xed3aa6=_0x243a;_0x241395['Unloaded']='unloaded',_0x241395[_0xed3aa6(0x1d0)]='loading',_0x241395['Loaded']=_0xed3aa6(0x1cb),_0x241395[_0xed3aa6(0x1ce)]=_0xed3aa6(0x1d2);}(exports.AssetLoadState||(exports.AssetLoadState={})));exports.ReferenceType = void 0;function _0xb8df(){var _0x4fca3e=['undefined','690GTBjPT','Actor','Geometry','loaded','4461DugWWS','ActorManager','Error','HTML','Loading','level','error','7476eDaoJY','21MsvqUq','actor','external','html','code','texture','344hSzlxB','Code','geometry','3971QibKWy','298wkKjSu','2078YmOAdm','material','Texture','34272keKYqS','179735EhRbtp','Material','611304RiWQfV','6632652zTvais','Level','External','6jVUiwE'];_0xb8df=function(){return _0x4fca3e;};return _0xb8df();}(function(_0x2e6f75){var _0x20aa5d=_0x243a;_0x2e6f75['Actor']=_0x20aa5d(0x1d5),_0x2e6f75['Component']='component',_0x2e6f75[_0x20aa5d(0x1c1)]='material',_0x2e6f75[_0x20aa5d(0x1c4)]=_0x20aa5d(0x1d1),_0x2e6f75['AssetPointer']='assetPointer',_0x2e6f75[_0x20aa5d(0x1c5)]=_0x20aa5d(0x1d6);}(exports.ReferenceType||(exports.ReferenceType={})));exports.AssetType = void 0;(function(_0x58d1c0){var _0x466652=_0x243a;_0x58d1c0[_0x58d1c0[_0x466652(0x1dc)]=0x1]=_0x466652(0x1dc),_0x58d1c0[_0x58d1c0[_0x466652(0x1e0)]=0x2]='material',_0x58d1c0[_0x58d1c0[_0x466652(0x1d9)]=0x3]='texture',_0x58d1c0[_0x58d1c0[_0x466652(0x1c7)]=-1]=_0x466652(0x1c7);}(exports.AssetType||(exports.AssetType={})));
1355
47
 
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 = {}));
48
+ (function(_0x553d0d,_0x5d9667){const _0xe0dadd=_0x4be3,_0x416fb7=_0x553d0d();while(!![]){try{const _0x2077b7=-parseInt(_0xe0dadd(0x116))/0x1*(parseInt(_0xe0dadd(0x113))/0x2)+parseInt(_0xe0dadd(0x11c))/0x3+parseInt(_0xe0dadd(0x11b))/0x4+-parseInt(_0xe0dadd(0x117))/0x5+-parseInt(_0xe0dadd(0x11f))/0x6+-parseInt(_0xe0dadd(0x11a))/0x7+parseInt(_0xe0dadd(0x111))/0x8;if(_0x2077b7===_0x5d9667)break;else _0x416fb7['push'](_0x416fb7['shift']());}catch(_0x46cdc0){_0x416fb7['push'](_0x416fb7['shift']());}}}(_0x343b,0x77c29));function _0x4be3(_0x4c1b43,_0x150604){_0x4c1b43=_0x4c1b43-0x111;const _0x343bf2=_0x343b();let _0x4be3bd=_0x343bf2[_0x4c1b43];return _0x4be3bd;}const DefaultPostProcessParam={'steps':[]};function _0x343b(){const _0x303202=['2330006cxlRZm','1390068LvOlRF','2751969sqLosd','Outline','ScreenSpaceReflection','3316812xHiYxn','13036392UlfUSX','Antialiasing','142aRqnHt','LensFlare','GroundTruthAmbientOcclusion','11579xfWryu','3480415qIfQUA','DepthOfField','Bloom'];_0x343b=function(){return _0x303202;};return _0x343b();}exports.PostProcessStepType = void 0;(function(_0x354942){const _0x5c8e10=_0x4be3;_0x354942[_0x354942[_0x5c8e10(0x119)]=0x0]=_0x5c8e10(0x119),_0x354942[_0x354942[_0x5c8e10(0x118)]=0x1]=_0x5c8e10(0x118),_0x354942[_0x354942[_0x5c8e10(0x11e)]=0x2]=_0x5c8e10(0x11e),_0x354942[_0x354942[_0x5c8e10(0x115)]=0x3]=_0x5c8e10(0x115),_0x354942[_0x354942[_0x5c8e10(0x11d)]=0x4]='Outline',_0x354942[_0x354942[_0x5c8e10(0x112)]=0x5]=_0x5c8e10(0x112),_0x354942[_0x354942[_0x5c8e10(0x114)]=0x6]='LensFlare';}(exports.PostProcessStepType||(exports.PostProcessStepType={})));
1369
49
 
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
- }
50
+ var _0x4aa040=_0x3f3a;function _0x3f3a(_0x5bbae9,_0x10ef3d){_0x5bbae9=_0x5bbae9-0x185;var _0x5c9ea1=_0x5c9e();var _0x3f3af4=_0x5c9ea1[_0x5bbae9];return _0x3f3af4;}(function(_0x16e4cb,_0x424e19){var _0x2690e3=_0x3f3a,_0x8e3757=_0x16e4cb();while(!![]){try{var _0x37b1dd=parseInt(_0x2690e3(0x193))/0x1+-parseInt(_0x2690e3(0x187))/0x2+parseInt(_0x2690e3(0x192))/0x3+parseInt(_0x2690e3(0x18a))/0x4*(parseInt(_0x2690e3(0x18d))/0x5)+parseInt(_0x2690e3(0x1a9))/0x6*(-parseInt(_0x2690e3(0x191))/0x7)+-parseInt(_0x2690e3(0x190))/0x8*(-parseInt(_0x2690e3(0x1a3))/0x9)+parseInt(_0x2690e3(0x199))/0xa*(-parseInt(_0x2690e3(0x1a4))/0xb);if(_0x37b1dd===_0x424e19)break;else _0x8e3757['push'](_0x8e3757['shift']());}catch(_0x3c7a2c){_0x8e3757['push'](_0x8e3757['shift']());}}}(_0x5c9e,0x190c1));class World{get['scene'](){var _0x1a98e8=_0x3f3a,_0x3490ce;let _0x198fc1=(_0x3490ce=this[_0x1a98e8(0x1a8)])===null||_0x3490ce===void 0?void 0:_0x3490ce[_0x1a98e8(0x185)];if(!_0x198fc1)throw new Error(_0x1a98e8(0x19c));return _0x198fc1;}get['viewport'](){var _0x19442f=_0x3f3a;return this['app'][_0x19442f(0x19d)];}get['controller'](){var _0x225ae9=_0x3f3a;return this[_0x225ae9(0x188)]['controller'];}get['rootActor'](){var _0x343723=_0x3f3a;if(!this[_0x343723(0x1a8)])throw new Error(_0x343723(0x1ab));return this[_0x343723(0x1a8)];}constructor(_0x423e7e,_0x3c541c){var _0x5b2168=_0x3f3a;this['_rootActor']=null,this[_0x5b2168(0x1a2)]=new Set(),this['tickableActors']=new Set(),this[_0x5b2168(0x188)]=_0x423e7e,this[_0x5b2168(0x1aa)]=_0x3c541c;}[_0x4aa040(0x1a6)](){var _0x1a814a=_0x4aa040;this['_rootActor']=new this[(_0x1a814a(0x1aa))][(_0x1a814a(0x1a1))](this[_0x1a814a(0x188)]);}[_0x4aa040(0x18f)](_0x549015){var _0x3893a6=_0x4aa040;this[_0x3893a6(0x19e)][_0x3893a6(0x194)](_0x549015);}[_0x4aa040(0x196)](_0x5e1405){var _0x5702c0=_0x4aa040;this[_0x5702c0(0x19e)][_0x5702c0(0x195)](_0x5e1405);}['tick'](_0x22f691){var _0x59f4b1=_0x4aa040;this[_0x59f4b1(0x19e)][_0x59f4b1(0x19f)](_0x472a7e=>{var _0x21db69=_0x59f4b1;_0x472a7e[_0x21db69(0x19a)](_0x22f691);});}[_0x4aa040(0x197)](){var _0x3a6710=_0x4aa040,_0x1c4acb;this[_0x3a6710(0x19e)][_0x3a6710(0x1a5)](),this[_0x3a6710(0x1a2)][_0x3a6710(0x19f)](_0x4104a9=>{var _0x119f09=_0x3a6710;_0x4104a9[_0x119f09(0x197)]();}),this[_0x3a6710(0x1a2)][_0x3a6710(0x1a5)](),(_0x1c4acb=this[_0x3a6710(0x1a8)])===null||_0x1c4acb===void 0?void 0:_0x1c4acb[_0x3a6710(0x197)](),this[_0x3a6710(0x1a8)]=null;}['addActor'](_0x22dc0e){var _0x305ad0=_0x4aa040,_0x37356f;if(!_0x22dc0e['rootComponent']['threeObject'])throw new Error(_0x305ad0(0x19b));_0x22dc0e[_0x305ad0(0x18b)](),(_0x37356f=this[_0x305ad0(0x1a8)])===null||_0x37356f===void 0?void 0:_0x37356f[_0x305ad0(0x1a7)](_0x22dc0e,exports.AttachmentRules[_0x305ad0(0x18e)]),this['actors'][_0x305ad0(0x194)](_0x22dc0e),_0x22dc0e[_0x305ad0(0x18c)](this),this[_0x305ad0(0x19d)][_0x305ad0(0x186)]();}[_0x4aa040(0x198)](_0xf90ad9){var _0x5214fa=_0x4aa040;_0xf90ad9[_0x5214fa(0x197)](),this[_0x5214fa(0x1a2)][_0x5214fa(0x195)](_0xf90ad9),this[_0x5214fa(0x19d)][_0x5214fa(0x186)]();}['removeActors'](_0x15a30c){var _0x163a45=_0x4aa040;for(const _0x676594 of _0x15a30c){_0x676594[_0x163a45(0x197)](),this[_0x163a45(0x1a2)][_0x163a45(0x195)](_0x676594);}this[_0x163a45(0x19d)]['markRenderStateDirty']();}[_0x4aa040(0x1a0)](_0x2ac94c){var _0x28c74e=_0x4aa040;return this[_0x28c74e(0x189)]['getChildActorById'](_0x2ac94c,!![]);}['getActorsByIds'](_0x5b9451){var _0x5339ec=_0x4aa040;return this[_0x5339ec(0x189)]['getChildActorsByIds'](_0x5b9451,!![]);}}function _0x5c9e(){var _0x3ec7dd=['destroy','removeActor','1713930DdOJzh','tick','actor.threeObject\x20is\x20null','scene\x20is\x20null','viewport','tickableActors','forEach','getActorById','levelActorClass','actors','54pJiSdA','11pBtcyv','clear','init','addChildActor','_rootActor','12YwHLeY','worldParam','rootActor\x20is\x20null','scene','markRenderStateDirty','378686zsaMSO','app','rootActor','20924mUDGcr','removeFromParent','onAddedToWorld','80miJSaf','KeepRelative','addTickableActor','178768hQYuPw','163345fgeKrl','508665cGvfpT','122672zDpCUk','add','delete','removeTickableActor'];_0x5c9e=function(){return _0x3ec7dd;};return _0x5c9e();}
1453
51
 
1454
- const DefaultBloomParam = {
1455
- type: exports.PostProcessStepType.Bloom,
1456
- threshold: 0,
1457
- strength: 1,
1458
- radius: 0,
1459
- };
52
+ const _0x376f65=_0x1f9a;(function(_0x3dceba,_0x4b6441){const _0xc96b29=_0x1f9a,_0x1567e4=_0x3dceba();while(!![]){try{const _0x152e9b=-parseInt(_0xc96b29(0x7c))/0x1+parseInt(_0xc96b29(0x79))/0x2+parseInt(_0xc96b29(0x7e))/0x3*(-parseInt(_0xc96b29(0x7b))/0x4)+parseInt(_0xc96b29(0x77))/0x5*(parseInt(_0xc96b29(0x78))/0x6)+-parseInt(_0xc96b29(0x7d))/0x7*(parseInt(_0xc96b29(0x76))/0x8)+-parseInt(_0xc96b29(0x75))/0x9+-parseInt(_0xc96b29(0x80))/0xa*(-parseInt(_0xc96b29(0x7f))/0xb);if(_0x152e9b===_0x4b6441)break;else _0x1567e4['push'](_0x1567e4['shift']());}catch(_0x235a35){_0x1567e4['push'](_0x1567e4['shift']());}}}(_0x1744,0x75854));function _0x1f9a(_0x3ad935,_0x24a395){_0x3ad935=_0x3ad935-0x75;const _0x1744ed=_0x1744();let _0x1f9a52=_0x1744ed[_0x3ad935];return _0x1f9a52;}const DefaultBloomParam={'type':exports.PostProcessStepType[_0x376f65(0x7a)],'threshold':0x0,'strength':0x1,'radius':0x0};function _0x1744(){const _0xf2a240=['441KbgVmG','11839355dZgbcJ','20sQOuiF','3929211veASuj','16uGZeTm','70GTDDLJ','46902NryDtv','427102llMFVG','Bloom','13996LtoSyP','248849GaoIvd','2780589PhJvYS'];_0x1744=function(){return _0xf2a240;};return _0x1744();}
1460
53
 
1461
- const DefaultDOFParam = {
1462
- type: exports.PostProcessStepType.DepthOfField,
1463
- focus: 500.0,
1464
- aperture: 5,
1465
- maxblur: 0.01
1466
- };
54
+ function _0x7283(){const _0x399bae=['217XEsypi','136376eUSCYl','147048GuygoB','171JasZLB','18359WgbnAx','998500xdTagC','1669036gAXyqx','1571795SfOUSs','3JzbjZL','82TmdAAu','8963042Bkgzff'];_0x7283=function(){return _0x399bae;};return _0x7283();}function _0x4785(_0x598642,_0x35a3a8){_0x598642=_0x598642-0x184;const _0x728348=_0x7283();let _0x47857a=_0x728348[_0x598642];return _0x47857a;}(function(_0x3b5440,_0x4237da){const _0x455969=_0x4785,_0x41e913=_0x3b5440();while(!![]){try{const _0x331a53=parseInt(_0x455969(0x186))/0x1*(parseInt(_0x455969(0x18b))/0x2)+parseInt(_0x455969(0x18a))/0x3*(-parseInt(_0x455969(0x188))/0x4)+parseInt(_0x455969(0x189))/0x5+parseInt(_0x455969(0x184))/0x6*(-parseInt(_0x455969(0x18d))/0x7)+parseInt(_0x455969(0x18e))/0x8*(-parseInt(_0x455969(0x185))/0x9)+parseInt(_0x455969(0x187))/0xa+parseInt(_0x455969(0x18c))/0xb;if(_0x331a53===_0x4237da)break;else _0x41e913['push'](_0x41e913['shift']());}catch(_0x4ea8eb){_0x41e913['push'](_0x41e913['shift']());}}}(_0x7283,0x75652));const DefaultDOFParam={'type':exports.PostProcessStepType['DepthOfField'],'focus':0x1f4,'aperture':0x5,'maxblur':0.01};
1467
55
 
1468
- const DefaultGTAOParam = {
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
- };
56
+ const _0x374694=_0x2e41;(function(_0xcf7d96,_0x3045f1){const _0x2d3e82=_0x2e41,_0x45691b=_0xcf7d96();while(!![]){try{const _0xdc98b1=-parseInt(_0x2d3e82(0x18a))/0x1*(parseInt(_0x2d3e82(0x188))/0x2)+-parseInt(_0x2d3e82(0x18c))/0x3+parseInt(_0x2d3e82(0x187))/0x4*(-parseInt(_0x2d3e82(0x185))/0x5)+-parseInt(_0x2d3e82(0x186))/0x6+-parseInt(_0x2d3e82(0x18d))/0x7+parseInt(_0x2d3e82(0x184))/0x8+parseInt(_0x2d3e82(0x18b))/0x9;if(_0xdc98b1===_0x3045f1)break;else _0x45691b['push'](_0x45691b['shift']());}catch(_0x102bfd){_0x45691b['push'](_0x45691b['shift']());}}}(_0x1735,0xc0a4e));const DefaultGTAOParam={'type':exports.PostProcessStepType[_0x374694(0x189)],'distanceExponent':0x1,'distanceFallOff':0x1,'radius':0.25,'scale':0x1,'thickness':0x1,'samples':0x10,'useTemporalFiltering':![]};function _0x2e41(_0x65f2f4,_0x52aefb){_0x65f2f4=_0x65f2f4-0x184;const _0x17352d=_0x1735();let _0x2e410f=_0x17352d[_0x65f2f4];return _0x2e410f;}function _0x1735(){const _0xc85d30=['5KNezmD','1574988MZHYvf','563236TeAzDV','159656dQwfKf','GroundTruthAmbientOcclusion','7jHIUOC','30808827VEfrAm','2689341ANwNZU','9348066mAdkOi','4478840MmGylM'];_0x1735=function(){return _0xc85d30;};return _0x1735();}
1478
57
 
1479
- const DefaultOutlineParams = {
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
- };
58
+ const _0x1b7e7c=_0x5173;function _0xa32c(){const _0x37ad19=['1685YaYmsh','14158884dZWzLt','1836QrFRze','3pJvoTB','1970437zSuDOg','27296wInWNz','11RIubTz','1359220aLEkNq','Outline','3905190akISSy','2177772CJfXly','19854tEePrD','1XNhvOc'];_0xa32c=function(){return _0x37ad19;};return _0xa32c();}(function(_0x2e9bd0,_0x8aa759){const _0x386642=_0x5173,_0x2c5c87=_0x2e9bd0();while(!![]){try{const _0x1328d0=-parseInt(_0x386642(0x1a2))/0x1*(-parseInt(_0x386642(0x19d))/0x2)+-parseInt(_0x386642(0x199))/0x3*(-parseInt(_0x386642(0x1a0))/0x4)+-parseInt(_0x386642(0x1a3))/0x5*(parseInt(_0x386642(0x1a1))/0x6)+-parseInt(_0x386642(0x19a))/0x7+-parseInt(_0x386642(0x19b))/0x8*(parseInt(_0x386642(0x198))/0x9)+-parseInt(_0x386642(0x19f))/0xa*(-parseInt(_0x386642(0x19c))/0xb)+parseInt(_0x386642(0x1a4))/0xc;if(_0x1328d0===_0x8aa759)break;else _0x2c5c87['push'](_0x2c5c87['shift']());}catch(_0x241564){_0x2c5c87['push'](_0x2c5c87['shift']());}}}(_0xa32c,0xab56f));function _0x5173(_0x49b2a3,_0x329685){_0x49b2a3=_0x49b2a3-0x198;const _0xa32c54=_0xa32c();let _0x5173b4=_0xa32c54[_0x49b2a3];return _0x5173b4;}const DefaultOutlineParams={'type':exports.PostProcessStepType[_0x1b7e7c(0x19e)],'edgeStrength':0x3,'edgeGlow':0x1,'edgeThickness':0x1,'pulsePeriod':0x0,'visibleEdgeColor':0xffffff,'hiddenEdgeColor':0xffffff};
1488
59
 
1489
- const DefaultLensFlareParam = {
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
- };
60
+ const _0x164c70=_0x53d0;(function(_0xb80239,_0x590f0c){const _0x62239=_0x53d0,_0x1c97c5=_0xb80239();while(!![]){try{const _0x4c6578=parseInt(_0x62239(0xd4))/0x1+parseInt(_0x62239(0xd3))/0x2*(-parseInt(_0x62239(0xd7))/0x3)+parseInt(_0x62239(0xda))/0x4+parseInt(_0x62239(0xd5))/0x5*(parseInt(_0x62239(0xd2))/0x6)+-parseInt(_0x62239(0xdb))/0x7*(-parseInt(_0x62239(0xd1))/0x8)+parseInt(_0x62239(0xd6))/0x9*(-parseInt(_0x62239(0xd8))/0xa)+parseInt(_0x62239(0xdc))/0xb*(-parseInt(_0x62239(0xd9))/0xc);if(_0x4c6578===_0x590f0c)break;else _0x1c97c5['push'](_0x1c97c5['shift']());}catch(_0x5a2f41){_0x1c97c5['push'](_0x1c97c5['shift']());}}}(_0x44c0,0x6439f));function _0x44c0(){const _0x218d50=['10QIBOdi','91128hVScdJ','1121728kljGQY','675346tiKRcm','1221YkLdls','LensFlare','64XYOsyK','17022fpnQaD','8ocWWAH','643411ERyoOC','525nYsXww','3038859WyUCnG','301830AmFGpl'];_0x44c0=function(){return _0x218d50;};return _0x44c0();}function _0x53d0(_0x338db7,_0x3c16aa){_0x338db7=_0x338db7-0xd0;const _0x44c0c7=_0x44c0();let _0x53d0f2=_0x44c0c7[_0x338db7];return _0x53d0f2;}const DefaultLensFlareParam={'type':exports.PostProcessStepType[_0x164c70(0xd0)],'threshold':0.5,'ghostSamples':0x4,'ghostSpacing':0.25,'ghostAttenuationFactor':0x19,'ghostTint':[0x1,0x1,0x1],'downSampleRatio':0x4};
1498
61
 
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
- }
62
+ const _0x546c1a=_0x3888;(function(_0x146d91,_0x5e40e7){const _0x2fbe09=_0x3888,_0x31507d=_0x146d91();while(!![]){try{const _0x153c19=parseInt(_0x2fbe09(0x11f))/0x1+-parseInt(_0x2fbe09(0x115))/0x2*(parseInt(_0x2fbe09(0x163))/0x3)+parseInt(_0x2fbe09(0x16f))/0x4+parseInt(_0x2fbe09(0x10e))/0x5*(parseInt(_0x2fbe09(0x17a))/0x6)+parseInt(_0x2fbe09(0x12b))/0x7*(-parseInt(_0x2fbe09(0x168))/0x8)+parseInt(_0x2fbe09(0x139))/0x9*(parseInt(_0x2fbe09(0x147))/0xa)+parseInt(_0x2fbe09(0x160))/0xb;if(_0x153c19===_0x5e40e7)break;else _0x31507d['push'](_0x31507d['shift']());}catch(_0xd92afe){_0x31507d['push'](_0x31507d['shift']());}}}(_0x1c3a,0xbc65d));function _0x3888(_0x4602cf,_0x1c61dc){_0x4602cf=_0x4602cf-0x104;const _0x1c3a67=_0x1c3a();let _0x38880c=_0x1c3a67[_0x4602cf];return _0x38880c;}function _0x1c3a(){const _0x5337b5=['ghostSamples','ghostSpacing','setOutlineObjects','6558079HfmGnL','Bloom','Antialiasing','3063jXYtTf','onDirtyCallback','outlineEdgeStrength','outlinePass','greaterThan','184ztVikg','bokehScaleNode','splice','getStepParam','edgeThicknessNode','updateAllUniforms','camera','156536FLomKD','getLUT3DTexture','maxblur','outlineEdgeThickness','effectUniforms','traaPass','outlineObjects','ghostTint','resolutionScale','velocity','strength','1863678ryCQjV','getViewZNode','markDirty','dofAperture','mul','edgeThickness','pulsePeriod','useTemporalFiltering','GroundTruthAmbientOcclusion','output','push','bloomRadius','assign','gtaoSamples','15KRpOjx','postProcessing','dispose','renderer','outlineVisibleEdgeColor','DepthOfField','outlineEnabled','1882pbMzZW','dofEnabled','LensFlare','gtaoEnabled','set','div','selectedObjects','edgeGlowNode','gtaoRadius','focusDistanceNode','884244ozumqv','bloomPass','type','distanceFallOff','setLUT3DTexture','add','lut3dTexture','buildPipeline','has','bloomStrength','distanceExponent','lensflarePass','239281XaCRIV','postProcessParam','gtaoScale','smaaEnabled','method','aperture','lensflareEnabled','edgeGlow','createEffectUniforms','steps','outlineEdgeGlow','select','scene','indexOf','31851lCDWfV','fxaa','value','hiddenEdgeColor','depth','render','thickness','samples','smaa','includes','bloomEnabled','getTextureNode','gtaoPass','updateCamera','190FsxctB','threshold','fxaaEnabled','onBuildFinalNode','focalLengthNode','outlinePulsePeriod','updateSteps','focus','visibleEdgeColor','Outline','traa','radius','needsUpdate','setMRT','ghostAttenuationFactor','edgeStrength','dofPass','bloomThreshold','outlineHiddenEdgeColor','scale','find','gtaoDistanceExponent'];_0x1c3a=function(){return _0x5337b5;};return _0x1c3a();}class PostProcessManager{constructor(_0x18e81e,_0x55f809,_0x5c9469,_0x497588,_0x27225b){const _0x1bf0dd=_0x3888;this[_0x1bf0dd(0x10f)]=null,this[_0x1bf0dd(0x175)]=[],this[_0x1bf0dd(0x173)]=null,this[_0x1bf0dd(0x166)]=null,this[_0x1bf0dd(0x120)]=null,this['dofPass']=null,this[_0x1bf0dd(0x145)]=null,this['traaPass']=null,this[_0x1bf0dd(0x12a)]=null,this[_0x1bf0dd(0x125)]=null,this[_0x1bf0dd(0x164)]=null,this[_0x1bf0dd(0x111)]=_0x18e81e,this['scene']=_0x55f809,this['camera']=_0x5c9469,this[_0x1bf0dd(0x12c)]=Object[_0x1bf0dd(0x10c)]({},_0x497588),this[_0x1bf0dd(0x164)]=_0x27225b!==null&&_0x27225b!==void 0?_0x27225b:null;}get['processing'](){const _0x3b5abb=_0x3888;return this[_0x3b5abb(0x10f)];}[_0x546c1a(0x146)](_0x1b1a88){const _0x3612a3=_0x546c1a;this[_0x3612a3(0x16e)]=_0x1b1a88,(!this['postProcessing']||!this[_0x3612a3(0x173)])&&(this[_0x3612a3(0x126)](),this[_0x3612a3(0x16d)](),this['markDirty']());}['setup'](){const _0x1254f4=_0x546c1a;(!this[_0x1254f4(0x10f)]||!this[_0x1254f4(0x173)])&&this[_0x1254f4(0x126)](),this['updateAllUniforms'](),this['markDirty']();}[_0x546c1a(0x126)](){const _0x4a2653=_0x546c1a;var _0x4b11f3,_0x1b7a59,_0xf991d5,_0x1183c2,_0x39c081;this['postProcessing']&&this['postProcessing'][_0x4a2653(0x110)]();this[_0x4a2653(0x10f)]=new webgpu.PostProcessing(this['renderer']),this[_0x4a2653(0x173)]=this[_0x4a2653(0x133)]();const _0x44a44e=tsl.pass(this['scene'],this[_0x4a2653(0x16e)]);_0x44a44e[_0x4a2653(0x154)](tsl.mrt({'output':tsl.output,'normal':tsl.normalView,'velocity':tsl.velocity}));const _0x53fe4b=_0x44a44e['getTextureNode'](_0x4a2653(0x109)),_0x40b390=_0x44a44e['getTextureNode']('normal'),_0x362e80=_0x44a44e['getTextureNode'](_0x4a2653(0x13d)),_0x4b36d8=_0x44a44e['getTextureNode'](_0x4a2653(0x178)),_0x739ad9=_0x44a44e[_0x4a2653(0x17b)](),_0x2204c4=this[_0x4a2653(0x173)],_0x2bb98b=(_0x4b11f3=this[_0x4a2653(0x16b)](exports.PostProcessStepType[_0x4a2653(0x161)]))!==null&&_0x4b11f3!==void 0?_0x4b11f3:DefaultBloomParam;this['bloomPass']=BloomNode_js.bloom(_0x53fe4b),this[_0x4a2653(0x120)][_0x4a2653(0x148)][_0x4a2653(0x13b)]=_0x2bb98b[_0x4a2653(0x148)],this[_0x4a2653(0x120)][_0x4a2653(0x179)][_0x4a2653(0x13b)]=_0x2bb98b[_0x4a2653(0x179)],this[_0x4a2653(0x120)]['radius'][_0x4a2653(0x13b)]=_0x2bb98b[_0x4a2653(0x152)];const _0x283204=_0x53fe4b[_0x4a2653(0x124)](this[_0x4a2653(0x120)][_0x4a2653(0x104)](_0x2204c4[_0x4a2653(0x128)])),_0x19cbd7=_0x2204c4[_0x4a2653(0x143)][_0x4a2653(0x167)](0.5)['select'](_0x283204,_0x53fe4b),_0x125535=(_0x1b7a59=this[_0x4a2653(0x16b)](exports.PostProcessStepType[_0x4a2653(0x117)]))!==null&&_0x1b7a59!==void 0?_0x1b7a59:DefaultLensFlareParam;this['lensflarePass']=LensflareNode_js.lensflare(this[_0x4a2653(0x120)][_0x4a2653(0x144)](),{'ghostTint':tsl.vec3(_0x125535[_0x4a2653(0x176)][0x0],_0x125535[_0x4a2653(0x176)][0x1],_0x125535['ghostTint'][0x2]),'threshold':tsl.float(_0x125535[_0x4a2653(0x148)]),'ghostSamples':tsl.float(_0x125535[_0x4a2653(0x15d)]),'ghostSpacing':tsl.float(_0x125535[_0x4a2653(0x15e)]),'ghostAttenuationFactor':tsl.float(_0x125535[_0x4a2653(0x155)]),'downSampleRatio':_0x125535['downSampleRatio']});const _0x2c386c=_0x19cbd7[_0x4a2653(0x124)](this['lensflarePass'][_0x4a2653(0x144)]()),_0x364f0f=_0x2204c4[_0x4a2653(0x131)][_0x4a2653(0x167)](0.5)['select'](_0x2c386c,_0x19cbd7),_0x53b120=(_0xf991d5=this[_0x4a2653(0x16b)](exports.PostProcessStepType[_0x4a2653(0x113)]))!==null&&_0xf991d5!==void 0?_0xf991d5:DefaultDOFParam;this['dofPass']=DepthOfFieldNode_js.dof(_0x364f0f,_0x739ad9,tsl.uniform(_0x53b120['focus']),tsl.uniform(_0x53b120[_0x4a2653(0x130)]),tsl.uniform(_0x53b120[_0x4a2653(0x171)]));const _0x4c9b61=_0x2204c4[_0x4a2653(0x116)]['greaterThan'](0.5)[_0x4a2653(0x136)](this[_0x4a2653(0x157)],_0x364f0f),_0x52b5d3=(_0x1183c2=this['getStepParam'](exports.PostProcessStepType[_0x4a2653(0x108)]))!==null&&_0x1183c2!==void 0?_0x1183c2:DefaultGTAOParam;this[_0x4a2653(0x145)]=GTAONode_js.ao(_0x362e80,_0x40b390,this[_0x4a2653(0x16e)]),this[_0x4a2653(0x145)][_0x4a2653(0x177)]=0.5,this[_0x4a2653(0x145)][_0x4a2653(0x129)][_0x4a2653(0x13b)]=_0x52b5d3[_0x4a2653(0x129)],this[_0x4a2653(0x145)][_0x4a2653(0x122)]['value']=_0x52b5d3[_0x4a2653(0x122)],this[_0x4a2653(0x145)]['radius'][_0x4a2653(0x13b)]=_0x52b5d3[_0x4a2653(0x152)],this[_0x4a2653(0x145)][_0x4a2653(0x15a)]['value']=_0x52b5d3['scale'],this[_0x4a2653(0x145)][_0x4a2653(0x13f)][_0x4a2653(0x13b)]=_0x52b5d3[_0x4a2653(0x13f)],this['gtaoPass'][_0x4a2653(0x140)][_0x4a2653(0x13b)]=_0x52b5d3[_0x4a2653(0x140)],this[_0x4a2653(0x145)][_0x4a2653(0x107)]=_0x52b5d3['useTemporalFiltering'];const _0x13fa95=this[_0x4a2653(0x145)][_0x4a2653(0x144)](),_0x3b96c1=_0x13fa95['r'],_0x186d1b=_0x4c9b61[_0x4a2653(0x104)](_0x3b96c1),_0x23463a=_0x2204c4[_0x4a2653(0x118)][_0x4a2653(0x167)](0.5)[_0x4a2653(0x136)](_0x186d1b,_0x4c9b61),_0x107561=(_0x39c081=this[_0x4a2653(0x16b)](exports.PostProcessStepType[_0x4a2653(0x150)]))!==null&&_0x39c081!==void 0?_0x39c081:DefaultOutlineParams;this[_0x4a2653(0x166)]=OutlineNode_js.outline(this[_0x4a2653(0x137)],this[_0x4a2653(0x16e)],{'selectedObjects':this['outlineObjects'],'edgeGlow':tsl.uniform(_0x107561['edgeGlow']),'edgeThickness':tsl.uniform(_0x107561[_0x4a2653(0x105)])});const {visibleEdge:_0x26217e,hiddenEdge:_0x452271}=this[_0x4a2653(0x166)],_0x1707fc=_0x2204c4[_0x4a2653(0x14c)][_0x4a2653(0x167)](0x0)[_0x4a2653(0x136)](_0x2204c4[_0x4a2653(0x14c)],tsl.uniform(0x1)),_0x2a7c9b=tsl.time[_0x4a2653(0x11a)](_0x1707fc)['mul'](0x2),_0x967f1=tsl.oscSine(_0x2a7c9b)[_0x4a2653(0x104)](0.5)[_0x4a2653(0x124)](0.5),_0x2a9522=_0x26217e['mul'](_0x2204c4[_0x4a2653(0x112)])[_0x4a2653(0x124)](_0x452271[_0x4a2653(0x104)](_0x2204c4['outlineHiddenEdgeColor']))['mul'](_0x2204c4['outlineEdgeStrength']),_0x4cf317=_0x2204c4['outlinePulsePeriod'][_0x4a2653(0x167)](0x0)[_0x4a2653(0x136)](_0x2a9522[_0x4a2653(0x104)](_0x967f1),_0x2a9522),_0x146363=_0x4cf317[_0x4a2653(0x124)](_0x23463a),_0xb941a4=_0x2204c4[_0x4a2653(0x114)][_0x4a2653(0x167)](0.5)[_0x4a2653(0x136)](_0x146363,_0x23463a),_0x299dd1=FXAANode_js.fxaa(_0xb941a4),_0x1b2b58=_0x2204c4[_0x4a2653(0x149)][_0x4a2653(0x167)](0.5)[_0x4a2653(0x136)](_0x299dd1,_0xb941a4),_0x3b89f9=SMAANode_js.smaa(_0x1b2b58),_0x286de9=_0x2204c4[_0x4a2653(0x12e)][_0x4a2653(0x167)](0.5)[_0x4a2653(0x136)](_0x3b89f9,_0x1b2b58),_0x37b398=this[_0x4a2653(0x16b)](exports.PostProcessStepType[_0x4a2653(0x162)]);let _0x31621f=_0x286de9;_0x37b398&&_0x37b398[_0x4a2653(0x12f)]===_0x4a2653(0x151)&&(this[_0x4a2653(0x174)]=TRAANode_js.traa(_0x286de9,_0x362e80,_0x4b36d8,this[_0x4a2653(0x16e)]),_0x31621f=this['traaPass']['getTextureNode']()),_0x31621f=this[_0x4a2653(0x14a)](_0x31621f),this[_0x4a2653(0x10f)]['outputNode']=_0x31621f,this['postProcessing'][_0x4a2653(0x153)]=!![];}['onBuildFinalNode'](_0x4a3904){return _0x4a3904;}['createEffectUniforms'](){const _0x5bf3ce=_0x546c1a;var _0x132dee,_0x590639,_0x21f3ed,_0x3e378e;const _0x4233bb=(_0x132dee=this[_0x5bf3ce(0x16b)](exports.PostProcessStepType['Bloom']))!==null&&_0x132dee!==void 0?_0x132dee:DefaultBloomParam,_0x8b914b=(_0x590639=this[_0x5bf3ce(0x16b)](exports.PostProcessStepType[_0x5bf3ce(0x113)]))!==null&&_0x590639!==void 0?_0x590639:DefaultDOFParam,_0x57462d=(_0x21f3ed=this[_0x5bf3ce(0x16b)](exports.PostProcessStepType['GroundTruthAmbientOcclusion']))!==null&&_0x21f3ed!==void 0?_0x21f3ed:DefaultGTAOParam,_0x14b6b0=(_0x3e378e=this[_0x5bf3ce(0x16b)](exports.PostProcessStepType['Outline']))!==null&&_0x3e378e!==void 0?_0x3e378e:DefaultOutlineParams;return {'bloomEnabled':tsl.uniform(0x0),'bloomStrength':tsl.uniform(_0x4233bb[_0x5bf3ce(0x179)]),'bloomThreshold':tsl.uniform(_0x4233bb[_0x5bf3ce(0x148)]),'bloomRadius':tsl.uniform(_0x4233bb[_0x5bf3ce(0x152)]),'dofEnabled':tsl.uniform(0x0),'dofFocus':tsl.uniform(_0x8b914b[_0x5bf3ce(0x14e)]),'dofAperture':tsl.uniform(_0x8b914b[_0x5bf3ce(0x130)]),'dofMaxBlur':tsl.uniform(_0x8b914b['maxblur']),'gtaoEnabled':tsl.uniform(0x0),'gtaoScale':tsl.uniform(_0x57462d[_0x5bf3ce(0x15a)]),'gtaoDistanceExponent':tsl.uniform(_0x57462d['distanceExponent']),'gtaoDistanceFallOff':tsl.uniform(_0x57462d['distanceFallOff']),'gtaoRadius':tsl.uniform(_0x57462d[_0x5bf3ce(0x152)]),'gtaoThickness':tsl.uniform(_0x57462d['thickness']),'gtaoSamples':tsl.uniform(_0x57462d[_0x5bf3ce(0x140)]),'outlineEnabled':tsl.uniform(0x0),'outlineEdgeStrength':tsl.uniform(_0x14b6b0[_0x5bf3ce(0x156)]),'outlineEdgeGlow':tsl.uniform(_0x14b6b0[_0x5bf3ce(0x132)]),'outlineEdgeThickness':tsl.uniform(_0x14b6b0[_0x5bf3ce(0x105)]),'outlinePulsePeriod':tsl.uniform(_0x14b6b0['pulsePeriod']),'outlineVisibleEdgeColor':tsl.uniform(new webgpu.Color(_0x14b6b0[_0x5bf3ce(0x14f)])),'outlineHiddenEdgeColor':tsl.uniform(new webgpu.Color(_0x14b6b0[_0x5bf3ce(0x13c)])),'fxaaEnabled':tsl.uniform(0x0),'smaaEnabled':tsl.uniform(0x0),'lensflareEnabled':tsl.uniform(0x0)};}[_0x546c1a(0x16b)](_0x5d44b9){const _0x385b9f=_0x546c1a;var _0x484f3c;return (_0x484f3c=this[_0x385b9f(0x12c)][_0x385b9f(0x134)][_0x385b9f(0x15b)](_0x1b76ec=>_0x1b76ec[_0x385b9f(0x121)]===_0x5d44b9))!==null&&_0x484f3c!==void 0?_0x484f3c:null;}['updateAllUniforms'](){const _0x2b3ac1=_0x546c1a;if(!this[_0x2b3ac1(0x173)])return;const _0x5cd45f=this[_0x2b3ac1(0x173)],_0x2b2d20=new Set(this['postProcessParam'][_0x2b3ac1(0x134)]['map'](_0x4a5627=>_0x4a5627['type']));_0x5cd45f[_0x2b3ac1(0x143)][_0x2b3ac1(0x13b)]=_0x2b2d20[_0x2b3ac1(0x127)](exports.PostProcessStepType[_0x2b3ac1(0x161)])?0x1:0x0,_0x5cd45f[_0x2b3ac1(0x116)][_0x2b3ac1(0x13b)]=_0x2b2d20['has'](exports.PostProcessStepType[_0x2b3ac1(0x113)])?0x1:0x0,_0x5cd45f['gtaoEnabled']['value']=_0x2b2d20[_0x2b3ac1(0x127)](exports.PostProcessStepType[_0x2b3ac1(0x108)])?0x1:0x0,_0x5cd45f[_0x2b3ac1(0x114)][_0x2b3ac1(0x13b)]=_0x2b2d20[_0x2b3ac1(0x127)](exports.PostProcessStepType[_0x2b3ac1(0x150)])?0x1:0x0,_0x5cd45f['lensflareEnabled'][_0x2b3ac1(0x13b)]=_0x2b2d20[_0x2b3ac1(0x127)](exports.PostProcessStepType[_0x2b3ac1(0x117)])?0x1:0x0;const _0x2d22fb=this[_0x2b3ac1(0x16b)](exports.PostProcessStepType[_0x2b3ac1(0x162)]);_0x2d22fb?(_0x5cd45f['fxaaEnabled'][_0x2b3ac1(0x13b)]=_0x2d22fb[_0x2b3ac1(0x12f)]===_0x2b3ac1(0x13a)?0x1:0x0,_0x5cd45f[_0x2b3ac1(0x12e)][_0x2b3ac1(0x13b)]=_0x2d22fb[_0x2b3ac1(0x12f)]===_0x2b3ac1(0x141)?0x1:0x0):(_0x5cd45f[_0x2b3ac1(0x149)][_0x2b3ac1(0x13b)]=0x0,_0x5cd45f[_0x2b3ac1(0x12e)]['value']=0x0);const _0x24cee7=this[_0x2b3ac1(0x16b)](exports.PostProcessStepType['Bloom']);_0x24cee7&&(_0x5cd45f[_0x2b3ac1(0x128)][_0x2b3ac1(0x13b)]=_0x24cee7['strength'],_0x5cd45f[_0x2b3ac1(0x158)][_0x2b3ac1(0x13b)]=_0x24cee7[_0x2b3ac1(0x148)],_0x5cd45f[_0x2b3ac1(0x10b)]['value']=_0x24cee7['radius'],this[_0x2b3ac1(0x120)]&&(this[_0x2b3ac1(0x120)][_0x2b3ac1(0x148)][_0x2b3ac1(0x13b)]=_0x24cee7[_0x2b3ac1(0x148)],this[_0x2b3ac1(0x120)]['strength'][_0x2b3ac1(0x13b)]=_0x24cee7['strength'],this['bloomPass'][_0x2b3ac1(0x152)]['value']=_0x24cee7[_0x2b3ac1(0x152)]));const _0x3a93b5=this[_0x2b3ac1(0x16b)](exports.PostProcessStepType[_0x2b3ac1(0x117)]);if(_0x3a93b5&&this[_0x2b3ac1(0x12a)]);const _0x5f518d=this[_0x2b3ac1(0x16b)](exports.PostProcessStepType[_0x2b3ac1(0x113)]);_0x5f518d&&(_0x5cd45f['dofFocus']['value']=_0x5f518d['focus'],_0x5cd45f[_0x2b3ac1(0x17d)][_0x2b3ac1(0x13b)]=_0x5f518d['aperture'],_0x5cd45f['dofMaxBlur'][_0x2b3ac1(0x13b)]=_0x5f518d[_0x2b3ac1(0x171)],this[_0x2b3ac1(0x157)]&&(this[_0x2b3ac1(0x157)][_0x2b3ac1(0x11e)][_0x2b3ac1(0x13b)]=_0x5f518d[_0x2b3ac1(0x14e)],this[_0x2b3ac1(0x157)][_0x2b3ac1(0x14b)][_0x2b3ac1(0x13b)]=_0x5f518d[_0x2b3ac1(0x130)],this[_0x2b3ac1(0x157)][_0x2b3ac1(0x169)]['value']=_0x5f518d['maxblur']));const _0x32f368=this['getStepParam'](exports.PostProcessStepType[_0x2b3ac1(0x108)]);_0x32f368&&(_0x5cd45f[_0x2b3ac1(0x12d)][_0x2b3ac1(0x13b)]=_0x32f368[_0x2b3ac1(0x15a)],_0x5cd45f[_0x2b3ac1(0x15c)]['value']=_0x32f368['distanceExponent'],_0x5cd45f['gtaoDistanceFallOff']['value']=_0x32f368[_0x2b3ac1(0x122)],_0x5cd45f[_0x2b3ac1(0x11d)][_0x2b3ac1(0x13b)]=_0x32f368[_0x2b3ac1(0x152)],_0x5cd45f['gtaoThickness'][_0x2b3ac1(0x13b)]=_0x32f368['thickness'],_0x5cd45f[_0x2b3ac1(0x10d)][_0x2b3ac1(0x13b)]=_0x32f368[_0x2b3ac1(0x140)],this[_0x2b3ac1(0x145)]&&(this['gtaoPass'][_0x2b3ac1(0x129)][_0x2b3ac1(0x13b)]=_0x32f368['distanceExponent'],this[_0x2b3ac1(0x145)][_0x2b3ac1(0x122)][_0x2b3ac1(0x13b)]=_0x32f368[_0x2b3ac1(0x122)],this[_0x2b3ac1(0x145)][_0x2b3ac1(0x152)]['value']=_0x32f368[_0x2b3ac1(0x152)],this[_0x2b3ac1(0x145)]['scale']['value']=_0x32f368['scale'],this['gtaoPass'][_0x2b3ac1(0x13f)][_0x2b3ac1(0x13b)]=_0x32f368[_0x2b3ac1(0x13f)],this[_0x2b3ac1(0x145)][_0x2b3ac1(0x140)][_0x2b3ac1(0x13b)]=_0x32f368[_0x2b3ac1(0x140)],this['gtaoPass']['useTemporalFiltering']=_0x32f368['useTemporalFiltering']));const _0x1adb17=this['getStepParam'](exports.PostProcessStepType[_0x2b3ac1(0x150)]);_0x1adb17&&(_0x5cd45f[_0x2b3ac1(0x165)][_0x2b3ac1(0x13b)]=_0x1adb17['edgeStrength'],_0x5cd45f[_0x2b3ac1(0x135)][_0x2b3ac1(0x13b)]=_0x1adb17[_0x2b3ac1(0x132)],_0x5cd45f[_0x2b3ac1(0x172)][_0x2b3ac1(0x13b)]=_0x1adb17[_0x2b3ac1(0x105)],_0x5cd45f['outlinePulsePeriod']['value']=_0x1adb17[_0x2b3ac1(0x106)],_0x5cd45f[_0x2b3ac1(0x112)][_0x2b3ac1(0x13b)][_0x2b3ac1(0x119)](_0x1adb17['visibleEdgeColor']),_0x5cd45f[_0x2b3ac1(0x159)]['value'][_0x2b3ac1(0x119)](_0x1adb17[_0x2b3ac1(0x13c)]),this[_0x2b3ac1(0x166)]&&(this[_0x2b3ac1(0x166)][_0x2b3ac1(0x11c)][_0x2b3ac1(0x13b)]=_0x1adb17[_0x2b3ac1(0x132)],this[_0x2b3ac1(0x166)][_0x2b3ac1(0x16c)][_0x2b3ac1(0x13b)]=_0x1adb17[_0x2b3ac1(0x105)],this['outlinePass'][_0x2b3ac1(0x11b)]=this['outlineObjects']));}[_0x546c1a(0x14d)](_0x40ff78){const _0x407b4f=_0x546c1a;this[_0x407b4f(0x12c)][_0x407b4f(0x134)]=_0x40ff78,(!this[_0x407b4f(0x173)]||!this[_0x407b4f(0x10f)])&&this[_0x407b4f(0x126)](),this[_0x407b4f(0x16d)](),this[_0x407b4f(0x17c)]();}['addOutlineObject'](_0x1b052f){const _0x45c38d=_0x546c1a;!this['outlineObjects'][_0x45c38d(0x142)](_0x1b052f)&&(this[_0x45c38d(0x175)][_0x45c38d(0x10a)](_0x1b052f),this[_0x45c38d(0x166)]&&(this[_0x45c38d(0x166)][_0x45c38d(0x11b)]=this[_0x45c38d(0x175)])),this['markDirty']();}[_0x546c1a(0x15f)](_0x4f7cc3){const _0x4574de=_0x546c1a;this[_0x4574de(0x175)]['length']=0x0,this[_0x4574de(0x175)][_0x4574de(0x10a)](..._0x4f7cc3),this['outlinePass']&&(this['outlinePass']['selectedObjects']=this[_0x4574de(0x175)]),this['markDirty']();}['removeOutlineObject'](_0x69ec20){const _0x1fef10=_0x546c1a,_0x562919=this[_0x1fef10(0x175)][_0x1fef10(0x138)](_0x69ec20);_0x562919>-1&&(this['outlineObjects'][_0x1fef10(0x16a)](_0x562919,0x1),this[_0x1fef10(0x166)]&&(this['outlinePass'][_0x1fef10(0x11b)]=this[_0x1fef10(0x175)])),this['markDirty']();}[_0x546c1a(0x123)](_0x10dbc7){const _0x58def0=_0x546c1a;this[_0x58def0(0x125)]=_0x10dbc7,this[_0x58def0(0x126)](),this[_0x58def0(0x16d)](),this[_0x58def0(0x17c)]();}[_0x546c1a(0x170)](){const _0x5b9846=_0x546c1a;return this[_0x5b9846(0x125)];}[_0x546c1a(0x13e)](){const _0x1ff7f1=_0x546c1a;if(this['postProcessing'])return this[_0x1ff7f1(0x10f)][_0x1ff7f1(0x13e)](),!![];return ![];}['destroy'](){const _0x1ee76a=_0x546c1a;this['outlineObjects']=[],this['effectUniforms']=null,this['outlinePass']=null,this[_0x1ee76a(0x120)]=null,this['dofPass']=null,this[_0x1ee76a(0x145)]=null,this['traaPass']=null,this[_0x1ee76a(0x12a)]=null,this[_0x1ee76a(0x125)]=null,this[_0x1ee76a(0x10f)]&&(this[_0x1ee76a(0x10f)][_0x1ee76a(0x110)](),this[_0x1ee76a(0x10f)]=null);}['markDirty'](){const _0x2a8068=_0x546c1a;this[_0x2a8068(0x164)]&&this[_0x2a8068(0x164)]();}}
1846
63
 
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
- }
64
+ function _0x25ef(_0x25dd92,_0x1f118e){_0x25dd92=_0x25dd92-0x78;const _0x24da44=_0x24da();let _0x25ef47=_0x24da44[_0x25dd92];return _0x25ef47;}const _0xa61c4a=_0x25ef;(function(_0x274d5b,_0x2f2de5){const _0x59c856=_0x25ef,_0x47f5b4=_0x274d5b();while(!![]){try{const _0x12db82=parseInt(_0x59c856(0xb7))/0x1+-parseInt(_0x59c856(0xba))/0x2*(-parseInt(_0x59c856(0x7b))/0x3)+-parseInt(_0x59c856(0xbe))/0x4*(parseInt(_0x59c856(0x9e))/0x5)+-parseInt(_0x59c856(0xb8))/0x6+-parseInt(_0x59c856(0x81))/0x7*(parseInt(_0x59c856(0x8a))/0x8)+parseInt(_0x59c856(0x78))/0x9*(parseInt(_0x59c856(0xe2))/0xa)+parseInt(_0x59c856(0x7f))/0xb;if(_0x12db82===_0x2f2de5)break;else _0x47f5b4['push'](_0x47f5b4['shift']());}catch(_0x3edfdb){_0x47f5b4['push'](_0x47f5b4['shift']());}}}(_0x24da,0xdd991));function _0x24da(){const _0x35436c=['destroyPostProcess','world','25093673dIblZi','position','3688601PaOtBi','resizeObserver','uiDom','setSize','alpha','clientWidth','domElement','observe','createUILayer','16gFGtns','100%','scene','App\x20is\x20not\x20initialized','render','setAlpha','setup','setStencil','markRenderStateDirty','outputBufferType','createRenderer','camera','setToneMappingExposure','renderAsImage','getContext','devicePixelRatio','none','div','scene-uiLayer','image/jpeg','5mNSWai','shadowMapType','_app','setPixelRatio','addOutlineObject','updateSteps','labelRenderer','shadowMapEnabled','createLabelRenderer','toneMapping','setToneMapping','_canvasContainer','logarithmicDepthBuffer','updateCamera','samples','contentBoxSize','querySelector','getElementById','toDataURL','.scene-uiLayer','top','stencil','renderer','remove','setShadowMapEnabled','1627440nVgidv','10072740MXvcnx','app','2euZyPW','clientHeight','removeOutlineObject','setOutlineObjects','5207104rtZbRZ','className','disconnect','Can\x20not\x20create\x20context','dispose','setAnimationLoop','onAfterPostProcessRender','zIndex','appendChild','removeChild','init','forceWebGL','setDepth','postProcessManager','height','style','absolute','onWindowResize','antialias','isLabelRendererNeeded','drawImage','type','setLogarithmicDepthBufferEnabled','updateRendererSettings','enabled','updatePostProcess','setupPostProcess','_uiDom','left','postProcessParam','width','pointerEvents','onCameraChangedDelegate','isRenderStateDirty','shadowMap','scene-labelRenderer','193460HEWBos','_renderer','0px','destroy','canvas','423FtFZWq','_outerContainer','toneMappingExposure','372516gqdddx','depth'];_0x24da=function(){return _0x35436c;};return _0x24da();}class Viewport{get[_0xa61c4a(0x83)](){const _0x2edc1a=_0xa61c4a;return this[_0x2edc1a(0xd9)];}get[_0xa61c4a(0xe6)](){const _0x4a9b49=_0xa61c4a;return this[_0x4a9b49(0xa9)];}get['outer'](){const _0x348eee=_0xa61c4a;return this[_0x348eee(0x79)];}get[_0xa61c4a(0xb4)](){if(!this['_renderer'])throw Error('Renderer\x20is\x20not\x20initialized');return this['_renderer'];}get[_0xa61c4a(0xb9)](){const _0x365938=_0xa61c4a;if(!this[_0x365938(0xa0)])throw Error(_0x365938(0x8d));return this[_0x365938(0xa0)];}constructor(_0x114a0f,_0x3bb55a,_0x1e76fd,_0x23603c){const _0x3d4aa3=_0xa61c4a;this[_0x3d4aa3(0xd9)]=null,this['_renderer']=null,this['labelRenderer']=null,this[_0x3d4aa3(0xa0)]=null,this['resizeObserver']=null,this[_0x3d4aa3(0x79)]=null,this[_0x3d4aa3(0xa9)]=null,this[_0x3d4aa3(0xdf)]=!![],this[_0x3d4aa3(0xcb)]=null,this['postProcessParam']=Object['assign']({},_0x23603c),this[_0x3d4aa3(0xa0)]=_0x114a0f,_0x3bb55a['elementId']&&(this[_0x3d4aa3(0x79)]=document[_0x3d4aa3(0xaf)](_0x3bb55a['elementId'])),this[_0x3d4aa3(0x94)](_0x1e76fd),_0x3bb55a[_0x3d4aa3(0xd1)]&&this[_0x3d4aa3(0xa6)](),_0x3bb55a['isUILayerNeeded']&&this[_0x3d4aa3(0x89)](),this[_0x3d4aa3(0x79)]&&(this[_0x3d4aa3(0x82)]=new ResizeObserver(_0x50c816=>{const _0x475838=_0x3d4aa3;for(let _0xfb3e56 of _0x50c816){_0xfb3e56[_0x475838(0xad)]&&this['onWindowResize']();}}),this[_0x3d4aa3(0x82)][_0x3d4aa3(0x88)](this['_outerContainer'])),this['app'][_0x3d4aa3(0xde)]['add'](()=>{const _0x516a50=_0x3d4aa3;this[_0x516a50(0xcb)]&&(this[_0x516a50(0xcb)][_0x516a50(0xab)](this[_0x516a50(0xb9)][_0x516a50(0x95)]),this[_0x516a50(0xcb)][_0x516a50(0x90)]());});}[_0xa61c4a(0x94)](_0x247fbb){const _0x244d54=_0xa61c4a;this['_outerContainer']&&!this[_0x244d54(0xa9)]&&(this[_0x244d54(0xa9)]=document['createElement'](_0x244d54(0x9b)),this['_canvasContainer'][_0x244d54(0xcd)]['left']=_0x244d54(0xe4),this[_0x244d54(0xa9)][_0x244d54(0xcd)]['top']='0px',this[_0x244d54(0xa9)][_0x244d54(0xcd)][_0x244d54(0xdc)]=_0x244d54(0x8b),this['_canvasContainer'][_0x244d54(0xcd)][_0x244d54(0xcc)]=_0x244d54(0x8b),this[_0x244d54(0x79)][_0x244d54(0xc6)](this[_0x244d54(0xa9)]));const _0x4a8f69=this[_0x244d54(0xa9)];this[_0x244d54(0xe3)]&&(_0x4a8f69&&_0x4a8f69[_0x244d54(0xc7)](this[_0x244d54(0xe3)][_0x244d54(0x87)]),this[_0x244d54(0xe3)][_0x244d54(0xc2)]());let _0x597bbb=_0x4a8f69?_0x4a8f69['clientWidth']:0x200,_0x1a00c7=_0x4a8f69?_0x4a8f69[_0x244d54(0xbb)]:0x200,_0x342ae7={};_0x342ae7[_0x244d54(0xc9)]=_0x247fbb[_0x244d54(0xc9)],_0x342ae7[_0x244d54(0xd0)]=_0x247fbb['antialias'],_0x342ae7[_0x244d54(0x7c)]=_0x247fbb[_0x244d54(0x7c)],_0x342ae7['stencil']=_0x247fbb[_0x244d54(0xb3)],_0x342ae7['alpha']=_0x247fbb[_0x244d54(0x85)],_0x342ae7['logarithmicDepthBuffer']=_0x247fbb['logarithmicDepthBuffer'],_0x342ae7[_0x244d54(0xac)]=_0x247fbb[_0x244d54(0xac)],_0x342ae7[_0x244d54(0x93)]=_0x247fbb[_0x244d54(0x93)],this['_renderer']=new webgpu.WebGPURenderer(_0x342ae7),this[_0x244d54(0xe3)][_0x244d54(0xa1)](window[_0x244d54(0x99)]),this[_0x244d54(0xe3)][_0x244d54(0x84)](_0x597bbb,_0x1a00c7),this[_0x244d54(0xe3)][_0x244d54(0xe0)][_0x244d54(0xd6)]=_0x247fbb[_0x244d54(0xa5)],this[_0x244d54(0xe3)][_0x244d54(0xe0)][_0x244d54(0xd3)]=_0x247fbb[_0x244d54(0x9f)],this[_0x244d54(0xe3)][_0x244d54(0xa7)]=_0x247fbb[_0x244d54(0xa7)],this['_renderer'][_0x244d54(0x7a)]=_0x247fbb[_0x244d54(0x7a)],this[_0x244d54(0xe3)]['setClearAlpha'](0x0),_0x4a8f69&&_0x4a8f69[_0x244d54(0xc6)](this[_0x244d54(0xe3)][_0x244d54(0x87)]);}['createLabelRenderer'](){const _0x3d9c85=_0xa61c4a,_0x228aaa=this[_0x3d9c85(0x79)];this[_0x3d9c85(0xa4)]&&(_0x228aaa&&_0x228aaa[_0x3d9c85(0xc7)](this['labelRenderer'][_0x3d9c85(0x87)]));let _0x46ad20=_0x228aaa?_0x228aaa[_0x3d9c85(0x86)]:0x200,_0x14f40a=_0x228aaa?_0x228aaa[_0x3d9c85(0xbb)]:0x200;this['labelRenderer']=new Addons_js.CSS2DRenderer(),this[_0x3d9c85(0xa4)][_0x3d9c85(0x84)](_0x46ad20,_0x14f40a),this[_0x3d9c85(0xa4)]['domElement']['style'][_0x3d9c85(0xdd)]=_0x3d9c85(0x9a),this[_0x3d9c85(0xa4)][_0x3d9c85(0x87)]['style'][_0x3d9c85(0x80)]=_0x3d9c85(0xce),this[_0x3d9c85(0xa4)][_0x3d9c85(0x87)][_0x3d9c85(0xcd)][_0x3d9c85(0xb2)]=_0x3d9c85(0xe4),this[_0x3d9c85(0xa4)]['domElement'][_0x3d9c85(0xbf)]=_0x3d9c85(0xe1),_0x228aaa&&_0x228aaa['appendChild'](this[_0x3d9c85(0xa4)][_0x3d9c85(0x87)]);}[_0xa61c4a(0x89)](){const _0x12092f=_0xa61c4a;if(!this[_0x12092f(0x79)])return;let _0x5230cc=this[_0x12092f(0x79)][_0x12092f(0xae)](_0x12092f(0xb1));!_0x5230cc&&(_0x5230cc=document['createElement'](_0x12092f(0x9b)),_0x5230cc[_0x12092f(0xbf)]=_0x12092f(0x9c),_0x5230cc['id']=_0x12092f(0x9c),_0x5230cc['style'][_0x12092f(0x80)]=_0x12092f(0xce),_0x5230cc[_0x12092f(0xcd)][_0x12092f(0xda)]='0',_0x5230cc[_0x12092f(0xcd)][_0x12092f(0xb2)]='0',_0x5230cc[_0x12092f(0xcd)]['width']='100%',_0x5230cc[_0x12092f(0xcd)][_0x12092f(0xcc)]='100%',_0x5230cc[_0x12092f(0xcd)][_0x12092f(0xdd)]=_0x12092f(0x9a),_0x5230cc['style'][_0x12092f(0xc5)]='10',this['_outerContainer'][_0x12092f(0xc6)](_0x5230cc),this[_0x12092f(0xd9)]=_0x5230cc);}[_0xa61c4a(0xc8)](){this['setupPostProcess']();}[_0xa61c4a(0xd8)](){const _0x2b34de=_0xa61c4a;!this['postProcessManager']&&(this[_0x2b34de(0xcb)]=this['createPostProcessManager']()),this[_0x2b34de(0xcb)]['setup']();}['createPostProcessManager'](){const _0x4c6f05=_0xa61c4a;return new PostProcessManager(this[_0x4c6f05(0xb4)],this['app'][_0x4c6f05(0x7e)][_0x4c6f05(0x8c)],this['app']['camera'],this[_0x4c6f05(0xdb)],()=>this[_0x4c6f05(0x92)]());}[_0xa61c4a(0xd7)](_0x1cfa58){const _0x23c463=_0xa61c4a;this[_0x23c463(0xcb)]&&this[_0x23c463(0xcb)][_0x23c463(0xa3)](_0x1cfa58);}[_0xa61c4a(0xd5)](_0x23b619){const _0x461bec=_0xa61c4a;this[_0x461bec(0x94)](_0x23b619),this[_0x461bec(0x92)]();}[_0xa61c4a(0xa2)](_0x2fccad){const _0x5f3dc5=_0xa61c4a;this['postProcessManager']&&this[_0x5f3dc5(0xcb)][_0x5f3dc5(0xa2)](_0x2fccad);}[_0xa61c4a(0xbd)](_0x583b09){const _0x434aed=_0xa61c4a;this[_0x434aed(0xcb)]&&this[_0x434aed(0xcb)][_0x434aed(0xbd)](_0x583b09);}['removeOutlineObject'](_0x320802){const _0x532d8c=_0xa61c4a;this[_0x532d8c(0xcb)]&&this[_0x532d8c(0xcb)][_0x532d8c(0xbc)](_0x320802);}[_0xa61c4a(0x7d)](){const _0x536463=_0xa61c4a;this[_0x536463(0xcb)]&&(this[_0x536463(0xcb)][_0x536463(0xe5)](),this['postProcessManager']=null);}[_0xa61c4a(0xcf)](){const _0x4d73cb=_0xa61c4a;let _0x3b58d2=this[_0x4d73cb(0x79)];if(!_0x3b58d2)return;this['app']['onWindowResize'](_0x3b58d2[_0x4d73cb(0x86)],_0x3b58d2[_0x4d73cb(0xbb)]),this[_0x4d73cb(0xb4)][_0x4d73cb(0x84)](_0x3b58d2['clientWidth'],_0x3b58d2[_0x4d73cb(0xbb)]);if(this[_0x4d73cb(0xa4)])this['labelRenderer'][_0x4d73cb(0x84)](_0x3b58d2[_0x4d73cb(0x86)],_0x3b58d2[_0x4d73cb(0xbb)]);this[_0x4d73cb(0x92)]();}[_0xa61c4a(0x92)](){this['isRenderStateDirty']=!![];}[_0xa61c4a(0x8e)](){const _0x39cb4c=_0xa61c4a;if(!this[_0x39cb4c(0xdf)])return;if(this[_0x39cb4c(0xcb)]&&this[_0x39cb4c(0xcb)]['render']());else this[_0x39cb4c(0xb4)]['render'](this[_0x39cb4c(0xb9)][_0x39cb4c(0x7e)]['scene'],this[_0x39cb4c(0xb9)]['camera']);this[_0x39cb4c(0xc4)](),this[_0x39cb4c(0xa4)]&&this[_0x39cb4c(0xa4)][_0x39cb4c(0x8e)](this[_0x39cb4c(0xb9)][_0x39cb4c(0x7e)][_0x39cb4c(0x8c)],this[_0x39cb4c(0xb9)][_0x39cb4c(0x95)]),this['isRenderStateDirty']=![];}[_0xa61c4a(0xc4)](){}async[_0xa61c4a(0x97)](_0x86edf=0x400,_0x2d6944=0x400){const _0x5a6fc3=_0xa61c4a;try{if(this[_0x5a6fc3(0xcb)]&&this[_0x5a6fc3(0xcb)]['render']()){}else await this[_0x5a6fc3(0xb4)][_0x5a6fc3(0x8e)](this['app'][_0x5a6fc3(0x7e)][_0x5a6fc3(0x8c)],this[_0x5a6fc3(0xb9)][_0x5a6fc3(0x95)]);const _0x5629a3=this[_0x5a6fc3(0xb4)]['domElement']['width'],_0x4d7a99=this[_0x5a6fc3(0xb4)][_0x5a6fc3(0x87)][_0x5a6fc3(0xcc)];let _0x8c30f5=_0x5629a3||_0x86edf,_0x583f42=_0x4d7a99||_0x2d6944;(_0x8c30f5<=0x0||_0x583f42<=0x0)&&(_0x8c30f5=_0x86edf,_0x583f42=_0x2d6944);const _0x2f9a13=document['createElement']('canvas');_0x2f9a13[_0x5a6fc3(0xdc)]=_0x86edf,_0x2f9a13[_0x5a6fc3(0xcc)]=_0x2d6944;const _0x595bd9=_0x2f9a13[_0x5a6fc3(0x98)]('2d');if(!_0x595bd9)throw Error(_0x5a6fc3(0xc1));_0x595bd9[_0x5a6fc3(0xd2)](this[_0x5a6fc3(0xb4)][_0x5a6fc3(0x87)],0x0,0x0,_0x8c30f5,_0x583f42,0x0,0x0,_0x86edf,_0x2d6944);const _0x59220e=_0x2f9a13[_0x5a6fc3(0xb0)](_0x5a6fc3(0x9d));return _0x2f9a13[_0x5a6fc3(0xb5)](),_0x59220e;}catch(_0x46c43c){return '';}}[_0xa61c4a(0x8f)](_0x35e6d3){const _0x39f3c8=_0xa61c4a;if(!this['_renderer'])return;this[_0x39f3c8(0xe3)][_0x39f3c8(0x85)]=_0x35e6d3;}[_0xa61c4a(0xb6)](_0x521da3){const _0x358898=_0xa61c4a;if(!this[_0x358898(0xe3)])return;this[_0x358898(0xe3)][_0x358898(0xe0)][_0x358898(0xd6)]=_0x521da3;}['setShadowMapType'](_0xbdbf32){const _0x9b4951=_0xa61c4a;if(!this['_renderer'])return;this[_0x9b4951(0xe3)][_0x9b4951(0xe0)][_0x9b4951(0xd3)]=_0xbdbf32;}[_0xa61c4a(0xa8)](_0x4230bf){const _0xf8a363=_0xa61c4a;if(!this['_renderer'])return;this['_renderer'][_0xf8a363(0xa7)]=_0x4230bf;}[_0xa61c4a(0x96)](_0x4902ac){const _0x52f0eb=_0xa61c4a;if(!this[_0x52f0eb(0xe3)])return;this[_0x52f0eb(0xe3)][_0x52f0eb(0x7a)]=_0x4902ac;}[_0xa61c4a(0xd4)](_0x4a56c2){const _0x25a0cd=_0xa61c4a;if(!this[_0x25a0cd(0xe3)])return;this['_renderer'][_0x25a0cd(0xaa)]=_0x4a56c2;}[_0xa61c4a(0xca)](_0x4cd1a1){const _0x380fce=_0xa61c4a;if(!this['_renderer'])return;this[_0x380fce(0xe3)]['depth']=_0x4cd1a1;}[_0xa61c4a(0x91)](_0x14ab77){const _0x1eb407=_0xa61c4a;if(!this[_0x1eb407(0xe3)])return;this[_0x1eb407(0xe3)]['stencil']=_0x14ab77;}['destroy'](){const _0x29f231=_0xa61c4a;this[_0x29f231(0x7d)](),this[_0x29f231(0xb4)][_0x29f231(0xc3)](null),this[_0x29f231(0x82)]&&(this[_0x29f231(0x82)][_0x29f231(0xc0)](),this[_0x29f231(0x82)]=null),this[_0x29f231(0xa4)]&&(this[_0x29f231(0xa4)]['domElement'][_0x29f231(0xb5)](),this[_0x29f231(0xa4)]=null),this[_0x29f231(0xe3)]&&(this[_0x29f231(0xb4)][_0x29f231(0x87)][_0x29f231(0xb5)](),this['_renderer'][_0x29f231(0xc2)](),this[_0x29f231(0xe3)]=null),this['_canvasContainer']&&(this[_0x29f231(0xa9)][_0x29f231(0xb5)](),this[_0x29f231(0xa9)]=null),this[_0x29f231(0x79)]=null,this[_0x29f231(0xa0)]=null;}}
2174
65
 
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
- }
66
+ function _0x4fa2(){var _0x309783=['getFocuingData','destroy','4706324RNEfhK','enabled','unpossess','465546fUVLnd','stopFocusing','203607FWRPWk','controller','12850pXsEmF','4744zDPiQA','4GrXJhY','5786JmPTrS','focusTo','65uOyoaV','882426zwwjVD','control','camera','tick','3897TvVUUj','40628844uFxgto','4SykiWk','_control'];_0x4fa2=function(){return _0x309783;};return _0x4fa2();}function _0x31ed(_0x18f936,_0x591ed1){_0x18f936=_0x18f936-0x17e;var _0x4fa260=_0x4fa2();var _0x31eda7=_0x4fa260[_0x18f936];return _0x31eda7;}var _0x102298=_0x31ed;(function(_0x3be97d,_0x39405d){var _0x170f28=_0x31ed,_0x54718e=_0x3be97d();while(!![]){try{var _0x58520f=-parseInt(_0x170f28(0x185))/0x1*(parseInt(_0x170f28(0x189))/0x2)+parseInt(_0x170f28(0x18d))/0x3*(-parseInt(_0x170f28(0x193))/0x4)+-parseInt(_0x170f28(0x18c))/0x5*(parseInt(_0x170f28(0x183))/0x6)+-parseInt(_0x170f28(0x180))/0x7+-parseInt(_0x170f28(0x188))/0x8*(-parseInt(_0x170f28(0x191))/0x9)+parseInt(_0x170f28(0x187))/0xa*(-parseInt(_0x170f28(0x18a))/0xb)+parseInt(_0x170f28(0x192))/0xc;if(_0x58520f===_0x39405d)break;else _0x54718e['push'](_0x54718e['shift']());}catch(_0x9fdce4){_0x54718e['push'](_0x54718e['shift']());}}}(_0x4fa2,0x8ea21));class Pawn{get[_0x102298(0x18f)](){var _0x3b1a57=_0x102298;return this[_0x3b1a57(0x186)][_0x3b1a57(0x18f)];}set[_0x102298(0x181)](_0x3d547c){var _0x252584=_0x102298;this[_0x252584(0x18e)]['enabled']=_0x3d547c;}get['control'](){var _0x13ff3b=_0x102298;if(!this[_0x13ff3b(0x194)])throw new Error('Control\x20not\x20initialized');return this[_0x13ff3b(0x194)];}constructor(_0x22c8df){var _0x41298b=_0x102298;this[_0x41298b(0x194)]=null,this['isTickEnabled']=![],this[_0x41298b(0x186)]=_0x22c8df;}[_0x102298(0x190)](_0x517145){return;}['possess'](){}[_0x102298(0x182)](){}[_0x102298(0x18b)](_0xf55cf1,_0x1529a1,_0x48e6e3,_0x2c7f4c,_0x244cad=null,_0x32ae25=null){}[_0x102298(0x184)](){}[_0x102298(0x17e)](){return null;}[_0x102298(0x17f)](){}}
2210
67
 
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
- }
68
+ function _0x56dc(_0x2e3cb8,_0x5ac4eb){_0x2e3cb8=_0x2e3cb8-0x98;const _0x1573ec=_0x1573();let _0x56dcc9=_0x1573ec[_0x2e3cb8];return _0x56dcc9;}const _0x5d0822=_0x56dc;(function(_0x1051a9,_0x1db096){const _0x355201=_0x56dc,_0x29d0fb=_0x1051a9();while(!![]){try{const _0x147f1e=parseInt(_0x355201(0xa9))/0x1+parseInt(_0x355201(0xac))/0x2+-parseInt(_0x355201(0xc0))/0x3*(parseInt(_0x355201(0xa4))/0x4)+parseInt(_0x355201(0x9c))/0x5*(-parseInt(_0x355201(0xa2))/0x6)+-parseInt(_0x355201(0xaf))/0x7*(parseInt(_0x355201(0xb5))/0x8)+parseInt(_0x355201(0x9d))/0x9*(parseInt(_0x355201(0xbe))/0xa)+-parseInt(_0x355201(0x9f))/0xb*(-parseInt(_0x355201(0xa5))/0xc);if(_0x147f1e===_0x1db096)break;else _0x29d0fb['push'](_0x29d0fb['shift']());}catch(_0x397bb8){_0x29d0fb['push'](_0x29d0fb['shift']());}}}(_0x1573,0xb4dc8));function _0x1573(){const _0x48ddb3=['694920AHEaWN','clone','501KdeufZ','removeEventListener','changeEvent','update','unpossess','addEventListener','control','controller','set','5sgIXmz','36BWHxng','getFocuingData','764280xoxsTG','object','length','7414206oCaMzJ','normalize','19900wZfIrE','204uWhvcL','focusTo','onChange','_control','1274010MDPNGu','distanceTo','viewPort','716444DzWWTB','markRenderStateDirty','position','826eDpqjZ','kill','multiplyScalar','subVectors','anim','target','19256GzYiFz','stopFocusing','isEuler','quaternion','possess','Control\x20not\x20initialized','camera','copy','alpha'];_0x1573=function(){return _0x48ddb3;};return _0x1573();}class Orbital extends Pawn{get[_0x5d0822(0x99)](){const _0xf0e572=_0x5d0822;if(!this[_0xf0e572(0xa8)])throw new Error(_0xf0e572(0xba));return this['_control'];}get[_0x5d0822(0xbb)](){const _0xa5365d=_0x5d0822;return this[_0xa5365d(0x9a)][_0xa5365d(0xbb)];}constructor(_0x35ada3){const _0x11e755=_0x5d0822;super(_0x35ada3),this[_0x11e755(0xb3)]=null,this[_0x11e755(0xc2)]=()=>{const _0x3a627c=_0x11e755;this[_0x3a627c(0xa7)]();},this[_0x11e755(0xa8)]=new Addons_js.OrbitControls(_0x35ada3['camera'],_0x35ada3['viewPort']['canvas']),this[_0x11e755(0x99)][_0x11e755(0xb4)][_0x11e755(0x9b)](0x0,0x0,0x0),_0x35ada3[_0x11e755(0xbb)]['position'][_0x11e755(0x9b)](0x0,0x4,0x4),this[_0x11e755(0x99)][_0x11e755(0xc3)]();}[_0x5d0822(0xb9)](){const _0xad44f=_0x5d0822;super['possess'](),this[_0xad44f(0x99)][_0xad44f(0x98)]('change',this[_0xad44f(0xc2)]);}[_0x5d0822(0xc4)](){const _0x2fcfe2=_0x5d0822;super[_0x2fcfe2(0xc4)](),this[_0x2fcfe2(0x99)][_0x2fcfe2(0xc1)]('change',this['changeEvent']);}['onChange'](){const _0x298ec1=_0x5d0822;this[_0x298ec1(0x9a)][_0x298ec1(0xab)][_0x298ec1(0xad)]();}[_0x5d0822(0xa6)](_0x9a1927,_0x4077ba,_0x3ebcfd,_0x4e71c0,_0x1452f7=null,_0x32e560=null){const _0x44fe02=_0x5d0822;this[_0x44fe02(0xb6)]();let _0x30882d=null;(_0x4077ba===null||_0x4077ba===void 0?void 0:_0x4077ba[_0x44fe02(0xb7)])?_0x30882d=new webgpu.Quaternion()['setFromEuler'](_0x4077ba):_0x30882d=_0x4077ba;!_0x4077ba&&(_0x30882d=this['controller'][_0x44fe02(0xbb)]['quaternion']);_0x30882d[_0x44fe02(0xa3)]();let _0x61e7ee=new webgpu.Vector3(0x0,0x0,0x1);_0x61e7ee['applyQuaternion'](_0x30882d)[_0x44fe02(0xb1)](-1),_0x61e7ee['normalize']();let _0x4a3f9a=this[_0x44fe02(0xbb)][_0x44fe02(0xae)][_0x44fe02(0xbf)](),_0x5aa847=new webgpu.Vector3(_0x9a1927['x']+_0x61e7ee['x']*_0x3ebcfd*-1,_0x9a1927['y']+_0x61e7ee['y']*_0x3ebcfd*-1,_0x9a1927['z']+_0x61e7ee['z']*_0x3ebcfd*-1),_0x121913=new webgpu.Vector3()[_0x44fe02(0xb2)](_0x5aa847,_0x4a3f9a),_0x3779de=_0x121913[_0x44fe02(0xa1)]();_0x121913[_0x44fe02(0xa3)]();let _0x2753a2=this[_0x44fe02(0x99)][_0x44fe02(0xb4)]['clone'](),_0x513ed5=new webgpu.Vector3()['subVectors'](_0x9a1927,_0x2753a2),_0x4ae799=_0x513ed5['length']();_0x513ed5['normalize']();if(_0x3779de+_0x4ae799<0.1)return;const _0x21087c=this;let _0x4913a9={'alpha':0x0};this[_0x44fe02(0xb3)]=gsap.gsap['to'](_0x4913a9,{'duration':_0x4e71c0,'alpha':0x1,'onUpdate':()=>{const _0x5aa4f1=_0x44fe02;let _0x55d67a=_0x4913a9[_0x5aa4f1(0xbd)],_0x2bd857=new webgpu.Vector3(_0x4a3f9a['x']+_0x121913['x']*_0x55d67a*_0x3779de,_0x4a3f9a['y']+_0x121913['y']*_0x55d67a*_0x3779de,_0x4a3f9a['z']+_0x121913['z']*_0x55d67a*_0x3779de),_0x465342=new webgpu.Vector3(_0x2753a2['x']+_0x513ed5['x']*_0x55d67a*_0x4ae799,_0x2753a2['y']+_0x513ed5['y']*_0x55d67a*_0x4ae799,_0x2753a2['z']+_0x513ed5['z']*_0x55d67a*_0x4ae799);_0x21087c[_0x5aa4f1(0x99)][_0x5aa4f1(0xa0)][_0x5aa4f1(0xae)]['copy'](_0x2bd857),_0x21087c['control'][_0x5aa4f1(0xb4)][_0x5aa4f1(0xbc)](_0x465342),_0x21087c['control'][_0x5aa4f1(0xc3)]();_0x1452f7&&_0x1452f7();if(_0x21087c['controller'][_0x5aa4f1(0xab)])_0x21087c['controller'][_0x5aa4f1(0xab)]['markRenderStateDirty']();},'onComplete':function(){const _0x5d6995=_0x44fe02;_0x32e560&&_0x32e560();if(_0x21087c[_0x5d6995(0x9a)][_0x5d6995(0xab)])_0x21087c[_0x5d6995(0x9a)]['viewPort'][_0x5d6995(0xad)]();}});}[_0x5d0822(0x9e)](){const _0x1055e7=_0x5d0822;if(!this[_0x1055e7(0x99)]||!this[_0x1055e7(0xbb)])return null;const _0x2978a7=this[_0x1055e7(0xbb)][_0x1055e7(0xae)][_0x1055e7(0xbf)](),_0x15367d=this[_0x1055e7(0xbb)][_0x1055e7(0xb8)][_0x1055e7(0xbf)](),_0xc4f9a9=this[_0x1055e7(0x99)][_0x1055e7(0xb4)][_0x1055e7(0xbf)](),_0x5925b0=_0x2978a7[_0x1055e7(0xaa)](_0xc4f9a9);return {'position':_0xc4f9a9,'quaternion':_0x15367d,'distance':_0x5925b0};}['stopFocusing'](){const _0x240ff9=_0x5d0822;this[_0x240ff9(0xb3)]&&this[_0x240ff9(0xb3)][_0x240ff9(0xb0)](),this[_0x240ff9(0xb3)]=null;}}
2328
69
 
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
- }
70
+ function _0x4a0a(_0x1da67,_0x19a2f9){_0x1da67=_0x1da67-0x166;const _0x438002=_0x4380();let _0x4a0acc=_0x438002[_0x1da67];return _0x4a0acc;}const _0x34655d=_0x4a0a;(function(_0x139a92,_0x102c4b){const _0x5a6efa=_0x4a0a,_0x54de4c=_0x139a92();while(!![]){try{const _0x35607b=-parseInt(_0x5a6efa(0x193))/0x1*(parseInt(_0x5a6efa(0x168))/0x2)+parseInt(_0x5a6efa(0x18d))/0x3+-parseInt(_0x5a6efa(0x19a))/0x4*(parseInt(_0x5a6efa(0x19c))/0x5)+-parseInt(_0x5a6efa(0x17c))/0x6+parseInt(_0x5a6efa(0x1d6))/0x7*(parseInt(_0x5a6efa(0x1bf))/0x8)+parseInt(_0x5a6efa(0x1b5))/0x9*(parseInt(_0x5a6efa(0x180))/0xa)+parseInt(_0x5a6efa(0x1b2))/0xb;if(_0x35607b===_0x102c4b)break;else _0x54de4c['push'](_0x54de4c['shift']());}catch(_0x548c14){_0x54de4c['push'](_0x54de4c['shift']());}}}(_0x4380,0x7c4ed));function _0x4380(){const _0x275a56=['onActorHoverEnd','enabled','destroy','onPointerEnter','length','top','shiftKey','isHoverEnabled','intersectObjects','_onActorHoverEndDelegate','subVectors','pointerPosition','2353944ApDyde','fireComponentClick','pointerenter','fireComponentHoverBegin','onActorClickDelegate','_onComponentClickDelegate','122522MFhswK','prepareClickHit','_onActorDoubleClickDelegate','isClickEnabled','removeCorePointerListeners','onPointerMove','getHitResultFromScreenPoint','24052FWevop','component','335XNEGHc','assign','onActorHoverEndDelegate','_app','_onClickNothingDelegate','copy','set','pointerleave','onComponentHoverBeginDelegate','add','viewPort','onPointerUp','getAllHitResultFromScreenPoint','onPointerEnterEvent','clientWidth','onActorDoubleClick','hit','_raycastVec2','button','leftClickTimer','pointerup','fireComponentHoverEnd','12842434PyJvSo','size','getBoundingClientRect','9Uxzsuv','fireActorClick','_onComponentHoverEndDelegate','onActorHoverBeginDelegate','canvas','onActorHoverBegin','removeEventListener','tick','_onActorClickDelegate','prepareClickModifiers','16DaKrLU','addEventListener','doubleClickDelay','setFromCamera','scene','fireActorHoverEnd','raycaster','parentActor','onPointerMoveEvent','left','hoveringComponent','children','onPointerDownEvent','fireClickEvents','onClickNothingDelegate','fireActorHoverBegin','_pawn','unpossess','_onComponentHoverBeginDelegate','LYObject','viewport','canvas\x20is\x20null','onPointerLeave','1993803FYlkPH','_pointButtonIsDown','onComponentHoverEndDelegate','_onComponentPointerDownDelegate','object','firePointerDownEvent','addCorePointerListeners','onActorDoubleClickDelegate','hoveringActor','updateCamera','userData','pointerLeftDownPosition','onHorveringBegin','broadcast','onComponentDoubleClickDelegate','_tempVec2','14veMGyy','handleDoubleClick','clientHeight','onPointerDown','getHitResultUnderCursor','pointerdown','_onActorHoverBeginDelegate','_onComponentDoubleClickDelegate','focusTo','prepareClickComponent','handleFirstClick','handled','onClicked','app','pawn','pointermove','clientX','clearClickTimer','clearHovering','delete','5079858suDIUf','camera','onPointerUpEvent','world','945330NHSHrh'];_0x4380=function(){return _0x275a56;};return _0x4380();}class Controller{get[_0x34655d(0x17d)](){const _0x28077c=_0x34655d;return this[_0x28077c(0x19f)][_0x28077c(0x17d)];}get[_0x34655d(0x17f)](){const _0x538ee8=_0x34655d;return this[_0x538ee8(0x19f)][_0x538ee8(0x17f)];}get['viewPort'](){const _0x191eeb=_0x34655d;return this['_app'][_0x191eeb(0x1d3)];}get[_0x34655d(0x175)](){return this['_app'];}get[_0x34655d(0x176)](){const _0x114c41=_0x34655d;if(!this[_0x114c41(0x1cf)])throw Error('pawn\x20is\x20null');return this[_0x114c41(0x1cf)];}get['onComponentClickDelegate'](){const _0x24cc41=_0x34655d;return this[_0x24cc41(0x192)];}get[_0x34655d(0x166)](){const _0x288809=_0x34655d;return this[_0x288809(0x16f)];}get[_0x34655d(0x1a4)](){const _0x590ec6=_0x34655d;return this[_0x590ec6(0x1d1)];}get[_0x34655d(0x1d8)](){return this['_onComponentHoverEndDelegate'];}get['onComponentPointerDownDelegate'](){const _0x588c9b=_0x34655d;return this[_0x588c9b(0x1d9)];}get[_0x34655d(0x191)](){const _0x9f2a21=_0x34655d;return this[_0x9f2a21(0x1bd)];}get[_0x34655d(0x1dd)](){const _0x555de6=_0x34655d;return this[_0x555de6(0x195)];}get[_0x34655d(0x1b8)](){const _0x190553=_0x34655d;return this[_0x190553(0x16e)];}get[_0x34655d(0x19e)](){return this['_onActorHoverEndDelegate'];}get[_0x34655d(0x1cd)](){const _0x1b5b80=_0x34655d;return this[_0x1b5b80(0x1a0)];}constructor(_0x5b51ed){const _0x1a39d3=_0x34655d;this[_0x1a39d3(0x1cf)]=null,this[_0x1a39d3(0x1c9)]=null,this[_0x1a39d3(0x1de)]=null,this[_0x1a39d3(0x171)]=null,this[_0x1a39d3(0x194)]=null,this[_0x1a39d3(0x1be)]={'ctrlKey':![],'shiftKey':![],'altKey':![]},this[_0x1a39d3(0x1d7)]=new Set(),this[_0x1a39d3(0x192)]=new Delegate(),this[_0x1a39d3(0x16f)]=new Delegate(),this[_0x1a39d3(0x1d1)]=new Delegate(),this[_0x1a39d3(0x1b7)]=new Delegate(),this[_0x1a39d3(0x1d9)]=new Delegate(),this[_0x1a39d3(0x1bd)]=new Delegate(),this[_0x1a39d3(0x195)]=new Delegate(),this[_0x1a39d3(0x16e)]=new Delegate(),this[_0x1a39d3(0x18a)]=new Delegate(),this[_0x1a39d3(0x1a0)]=new Delegate(),this[_0x1a39d3(0x18c)]=new webgpu.Vector2(),this[_0x1a39d3(0x1e1)]=new webgpu.Vector2(),this[_0x1a39d3(0x167)]=new webgpu.Vector2(),this[_0x1a39d3(0x1ad)]=new webgpu.Vector2(),this[_0x1a39d3(0x1c1)]=0xfa,this['leftClickTimer']=null,this[_0x1a39d3(0x198)]=_0x2ca059=>this[_0x1a39d3(0x1c7)](_0x2ca059),this[_0x1a39d3(0x184)]=_0x3c4dd3=>this[_0x1a39d3(0x1a9)](_0x3c4dd3),this['onPointerLeave']=_0x59883c=>this['onPointerLeaveEvent'](_0x59883c),this[_0x1a39d3(0x1a7)]=_0x7edd7a=>this[_0x1a39d3(0x17e)](_0x7edd7a),this[_0x1a39d3(0x16b)]=_0x2dd68e=>this[_0x1a39d3(0x1cb)](_0x2dd68e),this[_0x1a39d3(0x19f)]=_0x5b51ed,this[_0x1a39d3(0x1cf)]=new Orbital(this),this[_0x1a39d3(0x176)]['possess'](),this['raycaster']=new webgpu.Raycaster();}['init'](){const _0x559885=_0x34655d,_0x106f9=this[_0x559885(0x1a6)][_0x559885(0x1b9)];_0x106f9&&(_0x106f9['addEventListener']('pointerenter',this[_0x559885(0x184)]),_0x106f9['addEventListener'](_0x559885(0x1a3),this[_0x559885(0x1d5)]),this[_0x559885(0x1dc)]());}[_0x34655d(0x1df)](){const _0x32e178=_0x34655d;var _0x83a384,_0x1ef458;const _0x36a677=this[_0x32e178(0x176)][_0x32e178(0x182)];(_0x83a384=this[_0x32e178(0x1cf)])===null||_0x83a384===void 0?void 0:_0x83a384[_0x32e178(0x1d0)](),(_0x1ef458=this[_0x32e178(0x1cf)])===null||_0x1ef458===void 0?void 0:_0x1ef458['destroy'](),this[_0x32e178(0x1cf)]=new Orbital(this),this[_0x32e178(0x176)]['possess'](),this[_0x32e178(0x176)][_0x32e178(0x182)]=_0x36a677;}[_0x34655d(0x1bc)](_0x40add5){const _0x29e83f=_0x34655d;this[_0x29e83f(0x176)][_0x29e83f(0x1bc)](_0x40add5);}[_0x34655d(0x183)](){const _0x5da745=_0x34655d;this[_0x5da745(0x179)](),this['clearHovering']();const _0x28f2cc=this['viewPort'][_0x5da745(0x1b9)];_0x28f2cc&&(_0x28f2cc[_0x5da745(0x1bb)](_0x5da745(0x18f),this[_0x5da745(0x184)]),_0x28f2cc[_0x5da745(0x1bb)]('pointerleave',this[_0x5da745(0x1d5)]),this['removeCorePointerListeners']()),this['pawn']['unpossess'](),this[_0x5da745(0x176)]['destroy'](),this[_0x5da745(0x1cf)]=null;}['onPointerMoveEvent'](_0x35fb46){const _0x46ac66=_0x34655d;var _0x50602d,_0x3503c3;const _0x25c184=this[_0x46ac66(0x1a6)][_0x46ac66(0x1b9)];if(!_0x25c184)throw Error(_0x46ac66(0x1d4));const _0x234e57=_0x25c184[_0x46ac66(0x1b4)]();this['pointerPosition'][_0x46ac66(0x1a2)]((_0x35fb46[_0x46ac66(0x178)]-_0x234e57[_0x46ac66(0x1c8)])/_0x25c184[_0x46ac66(0x1aa)]*0x2-0x1,0x1-(_0x35fb46['clientY']-_0x234e57[_0x46ac66(0x186)])/_0x25c184[_0x46ac66(0x16a)]*0x2);if(this[_0x46ac66(0x1d7)][_0x46ac66(0x1b3)]>0x0)return;const _0x472bb2=this['getHitResultUnderCursor'](),_0x46a870=(_0x50602d=_0x472bb2===null||_0x472bb2===void 0?void 0:_0x472bb2['component'])!==null&&_0x50602d!==void 0?_0x50602d:null,_0x59f085=(_0x3503c3=_0x46a870===null||_0x46a870===void 0?void 0:_0x46a870['parentActor'])!==null&&_0x3503c3!==void 0?_0x3503c3:null;_0x46a870!==this['hoveringComponent']&&(this[_0x46ac66(0x1c9)]&&this[_0x46ac66(0x1b1)](this[_0x46ac66(0x1c9)]),_0x46a870&&_0x46a870['isHoverEnabled']&&_0x472bb2&&this['fireComponentHoverBegin'](_0x46a870,_0x472bb2[_0x46ac66(0x1ac)])),_0x59f085!==this['hoveringActor']&&(this[_0x46ac66(0x1de)]&&this[_0x46ac66(0x1c9)]&&this[_0x46ac66(0x1c4)](this['hoveringActor'],this[_0x46ac66(0x1c9)]),_0x59f085&&_0x46a870&&_0x59f085[_0x46ac66(0x188)]&&_0x472bb2&&this[_0x46ac66(0x1ce)](_0x59f085,_0x46a870,_0x472bb2[_0x46ac66(0x1ac)])),this['hoveringComponent']=_0x46a870,this[_0x46ac66(0x1de)]=_0x59f085;}[_0x34655d(0x17a)](){const _0x58a7f8=_0x34655d;this[_0x58a7f8(0x1c9)]&&this['fireComponentHoverEnd'](this[_0x58a7f8(0x1c9)]),this[_0x58a7f8(0x1de)]&&this[_0x58a7f8(0x1c9)]&&this['fireActorHoverEnd'](this[_0x58a7f8(0x1de)],this['hoveringComponent']),this['hoveringComponent']=null,this['hoveringActor']=null;}[_0x34655d(0x17e)](_0x2cc98c){const _0x20201d=_0x34655d;this[_0x20201d(0x1d7)][_0x20201d(0x17b)](_0x2cc98c[_0x20201d(0x1ae)]);if(_0x2cc98c[_0x20201d(0x1ae)]!==0x0)return;const _0x845df5=this[_0x20201d(0x167)][_0x20201d(0x18b)](this[_0x20201d(0x1e1)],this[_0x20201d(0x18c)])[_0x20201d(0x185)]();if(_0x845df5>0.005){this[_0x20201d(0x179)]();return;}this['prepareClickModifiers']={'ctrlKey':_0x2cc98c['ctrlKey'],'shiftKey':_0x2cc98c[_0x20201d(0x187)],'altKey':_0x2cc98c['altKey']},!this[_0x20201d(0x1af)]?this['handleFirstClick']():this[_0x20201d(0x169)]();}[_0x34655d(0x172)](){const _0xc1a577=_0x34655d,_0xed0151=this[_0xc1a577(0x16c)](),_0x2c94de=_0xed0151===null||_0xed0151===void 0?void 0:_0xed0151[_0xc1a577(0x19b)];_0x2c94de instanceof SceneComponent&&_0x2c94de['isClickEnabled']&&_0xed0151?(this[_0xc1a577(0x171)]=_0x2c94de,this[_0xc1a577(0x194)]=_0xed0151[_0xc1a577(0x1ac)],this[_0xc1a577(0x1af)]=window['setTimeout'](()=>{const _0x543c33=_0xc1a577;this[_0x543c33(0x1af)]=null,this[_0x543c33(0x171)]&&this[_0x543c33(0x194)]&&(this[_0x543c33(0x1cc)](this[_0x543c33(0x171)],this[_0x543c33(0x194)],![]),this[_0x543c33(0x171)]=null,this[_0x543c33(0x194)]=null);},this[_0xc1a577(0x1c1)])):this['_onClickNothingDelegate'][_0xc1a577(0x1e3)]();}[_0x34655d(0x169)](){const _0x40cc3c=_0x34655d;this[_0x40cc3c(0x179)](),this[_0x40cc3c(0x171)]&&this[_0x40cc3c(0x194)]?this['fireClickEvents'](this[_0x40cc3c(0x171)],this[_0x40cc3c(0x194)],!![]):this[_0x40cc3c(0x1a0)][_0x40cc3c(0x1e3)](),this[_0x40cc3c(0x171)]=null,this[_0x40cc3c(0x194)]=null;}['onPointerDownEvent'](_0x56ce71){const _0x15ccbe=_0x34655d;this['_pointButtonIsDown'][_0x15ccbe(0x1a5)](_0x56ce71['button']);_0x56ce71[_0x15ccbe(0x1ae)]===0x0&&this[_0x15ccbe(0x1e1)][_0x15ccbe(0x1a1)](this[_0x15ccbe(0x18c)]);const _0x28153c=this[_0x15ccbe(0x16c)](),_0x50b7ce=_0x28153c===null||_0x28153c===void 0?void 0:_0x28153c[_0x15ccbe(0x19b)];_0x50b7ce instanceof SceneComponent&&_0x28153c&&this[_0x15ccbe(0x1db)](_0x50b7ce,_0x28153c['hit'],_0x56ce71[_0x15ccbe(0x1ae)]);}[_0x34655d(0x1a9)](_0x34d5c8){const _0x371ce6=_0x34655d;this[_0x371ce6(0x1dc)]();}['onPointerLeaveEvent'](_0x281367){this['removeCorePointerListeners']();}[_0x34655d(0x190)](_0x328480,_0x533848){const _0x5cd3bf=_0x34655d,_0x7fdc11={'component':_0x328480,'hit':_0x533848,'handled':![]};this[_0x5cd3bf(0x1d1)]['broadcast'](_0x7fdc11),!_0x7fdc11['handled']&&_0x328480[_0x5cd3bf(0x1e2)]();}['fireComponentHoverEnd'](_0x45c52b){const _0x253d65=_0x34655d,_0x97a05c={'component':_0x45c52b,'hit':null,'handled':![]};this[_0x253d65(0x1b7)][_0x253d65(0x1e3)](_0x97a05c),!_0x97a05c[_0x253d65(0x173)]&&_0x45c52b['onHorveringEnd']();}['fireComponentClick'](_0x25d864,_0x3688fc,_0x30a28a){const _0x2d1e27=_0x34655d,_0x4c28de=Object[_0x2d1e27(0x19d)]({'component':_0x25d864,'hit':_0x3688fc,'handled':![]},this[_0x2d1e27(0x1be)]);_0x30a28a?(this[_0x2d1e27(0x16f)]['broadcast'](_0x4c28de),!_0x4c28de[_0x2d1e27(0x173)]&&_0x25d864['onDoubleClicked']()):(this[_0x2d1e27(0x192)][_0x2d1e27(0x1e3)](_0x4c28de),!_0x4c28de['handled']&&_0x25d864[_0x2d1e27(0x174)]());}[_0x34655d(0x1db)](_0xe0f64b,_0x1472bf,_0x13da8f){const _0x4fb03d=_0x34655d,_0x5f50ab={'component':_0xe0f64b,'hit':_0x1472bf,'button':_0x13da8f,'handled':![]};this[_0x4fb03d(0x1d9)]['broadcast'](_0x5f50ab);}[_0x34655d(0x1ce)](_0x43ddc3,_0x2e85c9,_0x55f4ee){const _0x490561=_0x34655d,_0x36bb6f={'actor':_0x43ddc3,'component':_0x2e85c9,'hit':_0x55f4ee,'handled':![]};this[_0x490561(0x16e)][_0x490561(0x1e3)](_0x36bb6f),!_0x36bb6f[_0x490561(0x173)]&&_0x43ddc3[_0x490561(0x1ba)](_0x2e85c9);}['fireActorHoverEnd'](_0x17d636,_0x2b43e4){const _0x1f6a6d=_0x34655d,_0xbaab9d={'actor':_0x17d636,'component':_0x2b43e4,'hit':null,'handled':![]};this[_0x1f6a6d(0x18a)][_0x1f6a6d(0x1e3)](_0xbaab9d),!_0xbaab9d[_0x1f6a6d(0x173)]&&_0x17d636[_0x1f6a6d(0x181)](_0x2b43e4);}[_0x34655d(0x1b6)](_0x185eab,_0x10939a,_0x56994f,_0x2ece24){const _0x194032=_0x34655d,_0x59e508=Object[_0x194032(0x19d)]({'actor':_0x185eab,'component':_0x10939a,'hit':_0x56994f,'handled':![]},this[_0x194032(0x1be)]);_0x2ece24?(this[_0x194032(0x195)][_0x194032(0x1e3)](_0x59e508),!_0x59e508[_0x194032(0x173)]&&_0x185eab[_0x194032(0x1ab)](_0x10939a)):(this['_onActorClickDelegate']['broadcast'](_0x59e508),!_0x59e508[_0x194032(0x173)]&&_0x185eab['onActorClick'](_0x10939a));}[_0x34655d(0x1cc)](_0x31e7bf,_0x297f0c,_0x4cc08d){const _0x1ecf74=_0x34655d;this[_0x1ecf74(0x18e)](_0x31e7bf,_0x297f0c,_0x4cc08d);const _0x455016=_0x31e7bf[_0x1ecf74(0x1c6)];_0x455016&&_0x455016[_0x1ecf74(0x196)]&&this[_0x1ecf74(0x1b6)](_0x455016,_0x31e7bf,_0x297f0c,_0x4cc08d);}[_0x34655d(0x179)](){const _0x479dc8=_0x34655d;this[_0x479dc8(0x1af)]&&(window['clearTimeout'](this[_0x479dc8(0x1af)]),this[_0x479dc8(0x1af)]=null);}[_0x34655d(0x1dc)](){const _0x51e785=_0x34655d,_0x3a2155=this[_0x51e785(0x1a6)]['canvas'];if(!_0x3a2155)return;_0x3a2155[_0x51e785(0x1c0)](_0x51e785(0x177),this[_0x51e785(0x198)]),_0x3a2155[_0x51e785(0x1c0)](_0x51e785(0x1b0),this['onPointerUp']),_0x3a2155[_0x51e785(0x1c0)](_0x51e785(0x16d),this[_0x51e785(0x16b)]);}[_0x34655d(0x197)](){const _0x1dac75=_0x34655d,_0x1dc501=this[_0x1dac75(0x1a6)]['canvas'];if(!_0x1dc501)return;_0x1dc501[_0x1dac75(0x1bb)](_0x1dac75(0x177),this[_0x1dac75(0x198)]),_0x1dc501[_0x1dac75(0x1bb)](_0x1dac75(0x1b0),this[_0x1dac75(0x1a7)]),_0x1dc501[_0x1dac75(0x1bb)](_0x1dac75(0x16d),this['onPointerDown']);}[_0x34655d(0x16c)](){const _0x4cd787=_0x34655d;return this[_0x4cd787(0x199)](this[_0x4cd787(0x18c)]['x'],this[_0x4cd787(0x18c)]['y']);}[_0x34655d(0x199)](_0x33e370,_0x2ac110){const _0x3c0629=_0x34655d;this['_raycastVec2'][_0x3c0629(0x1a2)](_0x33e370,_0x2ac110),this[_0x3c0629(0x1c5)]['setFromCamera'](this['_raycastVec2'],this[_0x3c0629(0x17d)]);const _0x297ba8=this[_0x3c0629(0x1a8)](_0x33e370,_0x2ac110);for(const _0x203b71 of _0x297ba8){const _0x2413ac=_0x203b71[_0x3c0629(0x19b)][_0x3c0629(0x188)]||_0x203b71[_0x3c0629(0x19b)][_0x3c0629(0x196)],_0x164559=_0x203b71[_0x3c0629(0x19b)][_0x3c0629(0x1c6)],_0x1fde7a=_0x164559&&(_0x164559[_0x3c0629(0x188)]||_0x164559[_0x3c0629(0x196)]);if(!_0x2413ac&&!_0x1fde7a)continue;return _0x203b71;}return null;}[_0x34655d(0x1a8)](_0x2dc49e,_0x1b72a1){const _0x124ef7=_0x34655d;this[_0x124ef7(0x1ad)][_0x124ef7(0x1a2)](_0x2dc49e,_0x1b72a1),this[_0x124ef7(0x1c5)][_0x124ef7(0x1c2)](this['_raycastVec2'],this[_0x124ef7(0x17d)]);const _0x110928=this[_0x124ef7(0x1c5)][_0x124ef7(0x189)](this[_0x124ef7(0x17f)][_0x124ef7(0x1c3)][_0x124ef7(0x1ca)],!![]),_0x3f23b7=[];for(const _0x57be94 of _0x110928){if(_0x57be94[_0x124ef7(0x1da)][_0x124ef7(0x1e0)]['rayIgnored'])continue;const _0x503386=_0x57be94[_0x124ef7(0x1da)][_0x124ef7(0x1e0)][_0x124ef7(0x1d2)];if(!_0x503386)continue;_0x3f23b7['push']({'component':_0x503386,'hit':_0x57be94});}return _0x3f23b7;}[_0x34655d(0x170)](_0x1dd93a,_0x3fd797,_0x822773,_0xbcb561,_0x44e808=null,_0x335f2c=null){const _0x213b95=_0x34655d;this['pawn'][_0x213b95(0x170)](_0x1dd93a,_0x3fd797,_0x822773,_0xbcb561,_0x44e808,_0x335f2c);}}
2677
71
 
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
- }
72
+ function _0x3863(){const _0x145671=['6447600uRxyGt','warn','9wNoayM','Perspective','609355BIwSMU','3643108QOxNJI','[CameraFactory]Update\x20Failed.\x20Return\x20old\x20camera\x20instead','left','aspect','145ETardV','334413zKuOGE','near','far','[CameraFactory]Error\x20occurred\x20while\x20creating\x20camera:\x20','right','bottom','type','top','[CameraFactory]Error\x20occurred\x20while\x20updating\x20camera:\x20','fov','20464eSeiih','createCamera','151304ZXPYlV','[CameraFactory]Create\x20default\x20perspective\x20camera\x20instead','Invalid\x20camera\x20type','1532730qPELWq'];_0x3863=function(){return _0x145671;};return _0x3863();}const _0x268527=_0x3adb;function _0x3adb(_0x289569,_0x32a35f){_0x289569=_0x289569-0x191;const _0x38633e=_0x3863();let _0x3adb7e=_0x38633e[_0x289569];return _0x3adb7e;}(function(_0x40aee8,_0xd02d8b){const _0x4f8f15=_0x3adb,_0x5da6cc=_0x40aee8();while(!![]){try{const _0x2064af=-parseInt(_0x4f8f15(0x1a5))/0x1+parseInt(_0x4f8f15(0x19d))/0x2*(parseInt(_0x4f8f15(0x1a3))/0x3)+-parseInt(_0x4f8f15(0x19b))/0x4*(parseInt(_0x4f8f15(0x1aa))/0x5)+-parseInt(_0x4f8f15(0x1a0))/0x6+parseInt(_0x4f8f15(0x1a6))/0x7+parseInt(_0x4f8f15(0x1a1))/0x8+parseInt(_0x4f8f15(0x191))/0x9;if(_0x2064af===_0xd02d8b)break;else _0x5da6cc['push'](_0x5da6cc['shift']());}catch(_0x9c3ff){_0x5da6cc['push'](_0x5da6cc['shift']());}}}(_0x3863,0x8cf35));class CameraFactory{static[_0x268527(0x19c)](_0x5810a8){const _0x120276=_0x268527;try{switch(_0x5810a8[_0x120276(0x197)]){case _0x120276(0x1a4):{let _0x4fb201=_0x5810a8;return new webgpu.PerspectiveCamera(_0x4fb201[_0x120276(0x19a)],_0x4fb201[_0x120276(0x1a9)],_0x4fb201[_0x120276(0x192)],_0x4fb201[_0x120276(0x193)]);}case 'Orthographic':{let _0x59707c=_0x5810a8;return new webgpu.OrthographicCamera(_0x59707c[_0x120276(0x1a8)],_0x59707c[_0x120276(0x195)],_0x59707c[_0x120276(0x198)],_0x59707c[_0x120276(0x196)],_0x59707c[_0x120276(0x192)],_0x59707c['far']);}default:{throw new Error(_0x120276(0x19f));}}}catch(_0x12d29b){return console[_0x120276(0x1a2)](_0x120276(0x194),_0x12d29b),console[_0x120276(0x1a2)](_0x120276(0x19e)),new webgpu.PerspectiveCamera(0x32,0x1,0.1,0x3e8);}}static['updataCamera'](_0x37cf79,_0x567450){const _0x42800a=_0x268527;try{switch(_0x37cf79[_0x42800a(0x197)]){case _0x42800a(0x1a4):{let _0x3b0ca8=_0x37cf79;if(_0x567450 instanceof webgpu.PerspectiveCamera)return _0x567450[_0x42800a(0x192)]=_0x3b0ca8[_0x42800a(0x192)],_0x567450['far']=_0x3b0ca8['far'],_0x567450[_0x42800a(0x19a)]=_0x3b0ca8[_0x42800a(0x19a)],_0x567450['aspect']=_0x3b0ca8[_0x42800a(0x1a9)],_0x567450;return new webgpu.PerspectiveCamera(_0x3b0ca8[_0x42800a(0x19a)],_0x3b0ca8[_0x42800a(0x1a9)],_0x3b0ca8[_0x42800a(0x192)],_0x3b0ca8['far']);}case 'Orthographic':{let _0xcc7f5a=_0x37cf79;if(_0x567450 instanceof webgpu.OrthographicCamera)return _0x567450[_0x42800a(0x192)]=_0xcc7f5a[_0x42800a(0x192)],_0x567450[_0x42800a(0x193)]=_0xcc7f5a[_0x42800a(0x193)],_0x567450['left']=_0xcc7f5a[_0x42800a(0x1a8)],_0x567450['right']=_0xcc7f5a[_0x42800a(0x195)],_0x567450[_0x42800a(0x198)]=_0xcc7f5a['top'],_0x567450[_0x42800a(0x196)]=_0xcc7f5a[_0x42800a(0x196)],_0x567450;return new webgpu.OrthographicCamera(_0xcc7f5a[_0x42800a(0x1a8)],_0xcc7f5a['right'],_0xcc7f5a['top'],_0xcc7f5a[_0x42800a(0x196)],_0xcc7f5a['near'],_0xcc7f5a['far']);}default:{throw new Error(_0x42800a(0x19f));}}}catch(_0x15942f){return console[_0x42800a(0x1a2)](_0x42800a(0x199),_0x15942f),console[_0x42800a(0x1a2)](_0x42800a(0x1a7)),_0x567450;}}}
2746
73
 
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));
74
+ const _0x276de8=_0xad1b;(function(_0x588117,_0x396b7b){const _0x5e2bae=_0xad1b,_0x432150=_0x588117();while(!![]){try{const _0x329cb7=-parseInt(_0x5e2bae(0x8b))/0x1*(parseInt(_0x5e2bae(0x8d))/0x2)+-parseInt(_0x5e2bae(0x89))/0x3*(parseInt(_0x5e2bae(0x92))/0x4)+-parseInt(_0x5e2bae(0x88))/0x5+-parseInt(_0x5e2bae(0x91))/0x6+-parseInt(_0x5e2bae(0x8e))/0x7+-parseInt(_0x5e2bae(0x8f))/0x8+-parseInt(_0x5e2bae(0x93))/0x9*(-parseInt(_0x5e2bae(0x90))/0xa);if(_0x329cb7===_0x396b7b)break;else _0x432150['push'](_0x432150['shift']());}catch(_0x58cb8d){_0x432150['push'](_0x432150['shift']());}}}(_0x3c45,0x5765f));function _0xad1b(_0x48926c,_0x49cbc4){_0x48926c=_0x48926c-0x88;const _0x3c45fa=_0x3c45();let _0xad1b47=_0x3c45fa[_0x48926c];return _0xad1b47;}const DefaultPerspectiveCameraParam={'near':0.1,'far':0x3e8,'type':_0x276de8(0x8c),'fov':0x32,'aspect':0x1};const DefaultOrthographicCameraParam={'type':_0x276de8(0x8a),'near':0.1,'far':0x3e8,'left':-1,'right':0x1,'top':0x1,'bottom':-1};const DefaultCameraParam=JSON['parse'](JSON['stringify'](DefaultPerspectiveCameraParam));function _0x3c45(){const _0x10786b=['1757008GkKCur','40wstJez','653400phLCmz','4DmxxYy','5070429PZRlRl','757650TKINtR','1780593sYIYWC','Orthographic','273KhRnWx','Perspective','2846czgkSx','3034325QNaFEw'];_0x3c45=function(){return _0x10786b;};return _0x3c45();}
2764
75
 
2765
- const DefaultViewportParam = {
2766
- elementId: null,
2767
- isLabelRendererNeeded: false,
2768
- isUILayerNeeded: false,
2769
- };
76
+ (function(_0x135561,_0x4e51d1){const _0x5decfc=_0x1db3,_0x149092=_0x135561();while(!![]){try{const _0x479a2e=parseInt(_0x5decfc(0x159))/0x1+parseInt(_0x5decfc(0x156))/0x2+-parseInt(_0x5decfc(0x158))/0x3+parseInt(_0x5decfc(0x157))/0x4+-parseInt(_0x5decfc(0x155))/0x5*(parseInt(_0x5decfc(0x15b))/0x6)+parseInt(_0x5decfc(0x15a))/0x7*(parseInt(_0x5decfc(0x15c))/0x8)+parseInt(_0x5decfc(0x154))/0x9;if(_0x479a2e===_0x4e51d1)break;else _0x149092['push'](_0x149092['shift']());}catch(_0xabca1c){_0x149092['push'](_0x149092['shift']());}}}(_0x3fc2,0x48eb5));function _0x1db3(_0x36cc3d,_0x27ac3a){_0x36cc3d=_0x36cc3d-0x154;const _0x3fc210=_0x3fc2();let _0x1db32b=_0x3fc210[_0x36cc3d];return _0x1db32b;}const DefaultViewportParam={'elementId':null,'isLabelRendererNeeded':![],'isUILayerNeeded':![]};function _0x3fc2(){const _0x4858a2=['251202AWnWsV','1596WGlheP','2934918VwfRvd','1208SUoiFO','4262301QhHUJM','5nWwJAR','1022478soRQSm','375836xPvPqo','1729761YlHbIP'];_0x3fc2=function(){return _0x4858a2;};return _0x3fc2();}
2770
77
 
2771
- const DefaultRendererParameters = {
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
- };
78
+ function _0x2205(_0x40ba86,_0x5867ab){_0x40ba86=_0x40ba86-0xb3;const _0xf6c02b=_0xf6c0();let _0x220525=_0xf6c02b[_0x40ba86];return _0x220525;}(function(_0x115816,_0x26ef9b){const _0x31a2b1=_0x2205,_0x1b4218=_0x115816();while(!![]){try{const _0x4c5b43=parseInt(_0x31a2b1(0xbe))/0x1*(-parseInt(_0x31a2b1(0xb7))/0x2)+-parseInt(_0x31a2b1(0xba))/0x3+-parseInt(_0x31a2b1(0xbb))/0x4*(-parseInt(_0x31a2b1(0xbd))/0x5)+parseInt(_0x31a2b1(0xb6))/0x6*(-parseInt(_0x31a2b1(0xb4))/0x7)+parseInt(_0x31a2b1(0xb5))/0x8*(-parseInt(_0x31a2b1(0xb3))/0x9)+-parseInt(_0x31a2b1(0xb8))/0xa+parseInt(_0x31a2b1(0xb9))/0xb*(parseInt(_0x31a2b1(0xbc))/0xc);if(_0x4c5b43===_0x26ef9b)break;else _0x1b4218['push'](_0x1b4218['shift']());}catch(_0x44ebfc){_0x1b4218['push'](_0x1b4218['shift']());}}}(_0xf6c0,0xc4e90));function _0xf6c0(){const _0xac3730=['14888KGnSBl','8329480TvQrof','42928193mdjkgr','562953vIYroB','2079020fprwja','12NQoPys','5bJYzGR','141qjKpbj','1304253lIgDCT','112RjCGRI','56xCnpbc','199182MEBhCd'];_0xf6c0=function(){return _0xac3730;};return _0xf6c0();}const DefaultRendererParameters={'logarithmicDepthBuffer':![],'alpha':![],'depth':!![],'stencil':![],'antialias':![],'samples':0x1,'forceWebGL':![],'outputBufferType':0x3f8,'toneMapping':0x0,'toneMappingExposure':0x1,'shadowMapEnabled':!![],'shadowMapType':0x1};
2785
79
 
2786
- const DefaultAppParam = {
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
- };
80
+ (function(_0x35fe3f,_0x3179f1){const _0x3a514a=_0x2f1c,_0x360686=_0x35fe3f();while(!![]){try{const _0x31d950=parseInt(_0x3a514a(0x1da))/0x1*(parseInt(_0x3a514a(0x1df))/0x2)+-parseInt(_0x3a514a(0x1d8))/0x3+-parseInt(_0x3a514a(0x1dc))/0x4*(-parseInt(_0x3a514a(0x1dd))/0x5)+parseInt(_0x3a514a(0x1d9))/0x6+parseInt(_0x3a514a(0x1de))/0x7*(-parseInt(_0x3a514a(0x1d6))/0x8)+-parseInt(_0x3a514a(0x1d7))/0x9*(parseInt(_0x3a514a(0x1db))/0xa)+parseInt(_0x3a514a(0x1d5))/0xb;if(_0x31d950===_0x3179f1)break;else _0x360686['push'](_0x360686['shift']());}catch(_0x17427e){_0x360686['push'](_0x360686['shift']());}}}(_0x407a,0x5c947));function _0x407a(){const _0x36bb8e=['828mdqoVK','1544232tUwCXQ','538962JtZaHw','675827jdNSOd','44280sAZXil','116lqIlwi','97590CAsLLn','483IKgHjY','2NjDjcS','4225474vrLAjG','48056LjXkgZ'];_0x407a=function(){return _0x36bb8e;};return _0x407a();}function _0x2f1c(_0x7836c9,_0x23e7d5){_0x7836c9=_0x7836c9-0x1d5;const _0x407a92=_0x407a();let _0x2f1c77=_0x407a92[_0x7836c9];return _0x2f1c77;}const DefaultAppParam={'renderParam':DefaultRendererParameters,'cameraParam':DefaultCameraParam,'postProcessParam':DefaultPostProcessParam,'viewportParam':DefaultViewportParam,'classes':{'assetManagerClass':AssetManager,'controllerClass':Controller,'worldClass':World,'viewportClass':Viewport}};
2798
81
 
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
- }
82
+ const _0x4135c2=_0x3a93;function _0x3a93(_0x16f8d4,_0x6a052a){_0x16f8d4=_0x16f8d4-0x1c4;const _0x4c95e7=_0x4c95();let _0x3a93c3=_0x4c95e7[_0x16f8d4];return _0x3a93c3;}(function(_0xf66784,_0x4988a6){const _0x1acbb4=_0x3a93,_0x4d28f4=_0xf66784();while(!![]){try{const _0x45b5c1=parseInt(_0x1acbb4(0x216))/0x1*(parseInt(_0x1acbb4(0x1c8))/0x2)+-parseInt(_0x1acbb4(0x1cc))/0x3*(parseInt(_0x1acbb4(0x1cb))/0x4)+-parseInt(_0x1acbb4(0x21f))/0x5+-parseInt(_0x1acbb4(0x220))/0x6*(parseInt(_0x1acbb4(0x1c6))/0x7)+parseInt(_0x1acbb4(0x1fa))/0x8+-parseInt(_0x1acbb4(0x215))/0x9+-parseInt(_0x1acbb4(0x210))/0xa*(-parseInt(_0x1acbb4(0x1d5))/0xb);if(_0x45b5c1===_0x4988a6)break;else _0x4d28f4['push'](_0x4d28f4['shift']());}catch(_0x307949){_0x4d28f4['push'](_0x4d28f4['shift']());}}}(_0x4c95,0x3211b));function _0x4c95(){const _0x389bcd=['markRenderStateDirty','getChildActorsByIds','getCenter','getBoundsCenterPosition','getWorldForwardDirection','forEach','children','onClickDelegate','worldToLocal','onRemovedFromWorld','app','broadcast','_onDoubleClickDelegate','addLocalOffset','_world','threeObject','destroy','onHoverEndDelegate','isVisible','getWorldRightDirection','userData','50mWlEdr','name','getBounds','onAddedToWorld','getWorldPosition','407601CRoLdN','13ZdnBjI','onActorDoubleClick','getWorldUpDirection','isTickEnabled','setVisible','setWorldMatrix','_onHoverBeginDelegate','onDoubleClickDelegate','getChildActorById','1801065SMGNnr','23484aQTOIE','getBoundsBottomCenterPosition','Actor','delete','constructRootComponent','addTickableActor','LYObject','max','KeepRelative','98WmFpmH','push','33740OkkUOn','addChildActor','childActors','794000hZgqwB','3xwvWeN','removeChildActor','has','uuid','tick','sub','size','_name','childrenComponents','1123331vQxROL','_rootComponent','setQuaternion','setRotation','addComponent','isClickEnabled','getWorldMatrix','getQuaternion','_onClickDelegate','setScale','getWorldQuaternion','KeepWorld','rootComponent','localToWorld','removeTickableActor','min','setLayers','rootComponent\x20is\x20invalid','_onHoverEndDelegate','length','getWorldScale','attachComponent','addChildComponent','getPosition','viewport','setPosition','clearComponent','getWorldRotation','onActorClick','error','getRotation','onActorHoverBegin','world','destroyChildren','parentActor','getComponents','isHoverEnabled','1071728JVrsgI'];_0x4c95=function(){return _0x389bcd;};return _0x4c95();}class Actor extends BaseObject{get['world'](){const _0x3e9e47=_0x3a93;return this[_0x3e9e47(0x209)];}get[_0x4135c2(0x211)](){const _0x47cd3f=_0x4135c2;return this[_0x47cd3f(0x1d3)];}set[_0x4135c2(0x211)](_0x59f35b){const _0x51e597=_0x4135c2;this[_0x51e597(0x1d3)]=_0x59f35b;}get['rootComponent'](){const _0x4f1d04=_0x4135c2;if(!this['_rootComponent'])throw Error(_0x4f1d04(0x1e6));return this[_0x4f1d04(0x1d6)];}set['rootComponent'](_0x1d74b3){const _0xdc3a06=_0x4135c2;_0x1d74b3['detachFromParentComponent'](),_0x1d74b3[_0xdc3a06(0x1f7)]=this;if(this[_0xdc3a06(0x1d6)]){let _0x32441f=this[_0xdc3a06(0x1e1)]['childrenComponents'];for(let _0x3225aa=0x0;_0x3225aa<_0x32441f[_0xdc3a06(0x1e8)];++_0x3225aa){_0x1d74b3[_0xdc3a06(0x1eb)](_0x32441f[_0x3225aa]);}this['rootComponent']['destroy']();}this['_rootComponent']=_0x1d74b3;}get[_0x4135c2(0x1d4)](){const _0x3cf914=_0x4135c2;return this[_0x3cf914(0x1e1)][_0x3cf914(0x1d4)];}get[_0x4135c2(0x1ca)](){const _0xb49fab=_0x4135c2;var _0x3eec77;let _0x4e2d93=[];return (_0x3eec77=this[_0xb49fab(0x1e1)][_0xb49fab(0x20a)])===null||_0x3eec77===void 0?void 0:_0x3eec77[_0xb49fab(0x201)][_0xb49fab(0x200)](_0xb9d7d1=>{const _0x54fff7=_0xb49fab;var _0x5aaa05;let _0x36ae3c=(_0x5aaa05=_0xb9d7d1[_0x54fff7(0x20f)]['LYObject'])===null||_0x5aaa05===void 0?void 0:_0x5aaa05['parentActor'];_0x36ae3c!==this&&_0x36ae3c instanceof Actor&&_0x4e2d93[_0x54fff7(0x1c7)](_0x36ae3c);}),_0x4e2d93;}get[_0x4135c2(0x1f7)](){const _0xcbaae8=_0x4135c2;var _0x349c8c,_0x572bd8;let _0x50f863=(_0x572bd8=(_0x349c8c=this[_0xcbaae8(0x1e1)][_0xcbaae8(0x20a)])===null||_0x349c8c===void 0?void 0:_0x349c8c['parent'])===null||_0x572bd8===void 0?void 0:_0x572bd8[_0xcbaae8(0x20f)][_0xcbaae8(0x226)][_0xcbaae8(0x1f7)];return _0x50f863===this?null:_0x50f863;}get[_0x4135c2(0x20d)](){const _0x274f00=_0x4135c2;return this[_0x274f00(0x1e1)]?this[_0x274f00(0x1e1)]['isVisible']:![];}get['isTickEnabled'](){const _0x76b3a1=_0x4135c2;return super[_0x76b3a1(0x219)];}set[_0x4135c2(0x219)](_0x51e6ab){const _0x4467f2=_0x4135c2;super['isTickEnabled']=_0x51e6ab,this[_0x4467f2(0x219)]?this['app'][_0x4467f2(0x1f5)][_0x4467f2(0x225)](this):this[_0x4467f2(0x205)][_0x4467f2(0x1f5)][_0x4467f2(0x1e3)](this);}get['onHoverBeginDelegate'](){return this['_onHoverBeginDelegate'];}get[_0x4135c2(0x20c)](){const _0x5ee257=_0x4135c2;return this[_0x5ee257(0x1e7)];}get[_0x4135c2(0x202)](){const _0x3d26fb=_0x4135c2;return this[_0x3d26fb(0x1dd)];}get[_0x4135c2(0x21d)](){return this['_onDoubleClickDelegate'];}constructor(_0x37f88d,_0x3f15ca){const _0x298d58=_0x4135c2;super(_0x3f15ca),this['_name']=_0x298d58(0x222),this[_0x298d58(0x1d6)]=null,this[_0x298d58(0x209)]=null,this[_0x298d58(0x21c)]=new Delegate(),this['_onHoverEndDelegate']=new Delegate(),this[_0x298d58(0x1dd)]=new Delegate(),this[_0x298d58(0x207)]=new Delegate(),this['app']=_0x37f88d,this['rootComponent']=this[_0x298d58(0x224)](),this[_0x298d58(0x1e1)]['parentActor']=this;}[_0x4135c2(0x224)](){const _0x552a6e=_0x4135c2;return new SceneComponent(this[_0x552a6e(0x205)]);}[_0x4135c2(0x1fe)](_0x5634c7=!![]){const _0x531d6b=_0x4135c2;let _0x56d263=new webgpu.Vector3();return this[_0x531d6b(0x212)]()['getCenter'](_0x56d263),!_0x5634c7?_0x56d263[_0x531d6b(0x1d1)](this[_0x531d6b(0x1ec)]()):_0x56d263;}[_0x4135c2(0x21e)](_0x377bfa,_0x2ef977=!![]){const _0x33cc48=_0x4135c2,_0x53888f=this[_0x33cc48(0x1ca)];for(const _0x435072 of _0x53888f){if(_0x435072[_0x33cc48(0x1cf)]===_0x377bfa)return _0x435072;}if(_0x2ef977)for(const _0x4c8a7b of _0x53888f){const _0x2d8900=_0x4c8a7b[_0x33cc48(0x21e)](_0x377bfa,!![]);if(_0x2d8900)return _0x2d8900;}return null;}[_0x4135c2(0x1fc)](_0x1951d2,_0x2cdde6=!![]){const _0x1087b0=_0x4135c2,_0x36f2bd=[],_0x5a90ae=new Set(_0x1951d2),_0xdc2439=this['childActors'];for(const _0x484024 of _0xdc2439){_0x5a90ae[_0x1087b0(0x1ce)](_0x484024[_0x1087b0(0x1cf)])&&(_0x36f2bd[_0x1087b0(0x1c7)](_0x484024),_0x5a90ae[_0x1087b0(0x223)](_0x484024['uuid']));}if(_0x2cdde6&&_0x5a90ae[_0x1087b0(0x1d2)]>0x0)for(const _0x16a993 of _0xdc2439){const _0x4ad981=_0x16a993['getChildActorsByIds']([..._0x5a90ae],!![]);for(const _0x2e3b64 of _0x4ad981){_0x36f2bd['push'](_0x2e3b64),_0x5a90ae[_0x1087b0(0x223)](_0x2e3b64[_0x1087b0(0x1cf)]);}if(_0x5a90ae[_0x1087b0(0x1d2)]===0x0)break;}return _0x36f2bd;}['getComponentById'](_0x5ea8ef){const _0x322f8b=_0x4135c2;return this[_0x322f8b(0x1e1)]['getComponentById'](_0x5ea8ef);}['getBoundsTopCenterPosition'](_0xf41770=!![]){const _0x1cba68=_0x4135c2;let _0x58f886=new webgpu.Vector3(),_0x1133cd=this['rootComponent'][_0x1cba68(0x212)]();return _0x1133cd[_0x1cba68(0x1fd)](_0x58f886),_0x58f886['y']=_0x1133cd[_0x1cba68(0x1c4)]['y'],!_0xf41770?_0x58f886[_0x1cba68(0x1d1)](this[_0x1cba68(0x1ec)]()):_0x58f886;}[_0x4135c2(0x221)](_0x4e2f2d=!![]){const _0x2d9eac=_0x4135c2;let _0x428d0b=new webgpu.Vector3(),_0x498ab0=this[_0x2d9eac(0x212)]();return _0x498ab0[_0x2d9eac(0x1fd)](_0x428d0b),_0x428d0b['y']=_0x498ab0[_0x2d9eac(0x1e4)]['y'],!_0x4e2f2d?_0x428d0b[_0x2d9eac(0x1d1)](this[_0x2d9eac(0x1ec)]()):_0x428d0b;}['getBounds'](){const _0x37c7c8=_0x4135c2;return this[_0x37c7c8(0x1e1)][_0x37c7c8(0x212)]();}[_0x4135c2(0x20b)](){const _0x439314=_0x4135c2;let _0x1f46f0=this[_0x439314(0x1ca)];_0x1f46f0[_0x439314(0x200)](_0x829f75=>{const _0x136bf5=_0x439314;_0x829f75[_0x136bf5(0x20b)]();}),this['rootComponent']['destroy']();}[_0x4135c2(0x21a)](_0x1c59a4){const _0x7db9fc=_0x4135c2;this[_0x7db9fc(0x1e1)]['setVisible'](_0x1c59a4);}[_0x4135c2(0x1e5)](_0x213932,_0xa2c9a7=!![]){const _0x447544=_0x4135c2;this[_0x447544(0x1e1)][_0x447544(0x1e5)](_0x213932),_0xa2c9a7&&this['childActors'][_0x447544(0x200)](_0x2d1b9f=>{_0x2d1b9f['setLayers'](_0x213932,_0xa2c9a7);});}[_0x4135c2(0x1d0)](_0x3773f8){const _0x25f05d=_0x4135c2;if(!this[_0x25f05d(0x219)])return;super[_0x25f05d(0x1d0)](_0x3773f8),this['rootComponent'][_0x25f05d(0x1d0)](_0x3773f8);}['getPosition'](){const _0x26d492=_0x4135c2;return this[_0x26d492(0x1e1)]['getPosition']();}[_0x4135c2(0x1ee)](..._0x32db6f){const _0x54c934=_0x4135c2;_0x32db6f['length']===0x1?this['rootComponent'][_0x54c934(0x1ee)](_0x32db6f[0x0]):this[_0x54c934(0x1e1)]['setPosition'](_0x32db6f[0x0],_0x32db6f[0x1],_0x32db6f[0x2]);}[_0x4135c2(0x1f3)](){const _0x2b9974=_0x4135c2;return this[_0x2b9974(0x1e1)][_0x2b9974(0x1f3)]();}['setRotation'](..._0x446346){const _0x523a3c=_0x4135c2;_0x446346[_0x523a3c(0x1e8)]===0x1?this['rootComponent'][_0x523a3c(0x1d8)](_0x446346[0x0]):this[_0x523a3c(0x1e1)][_0x523a3c(0x1d8)](_0x446346[0x0],_0x446346[0x1],_0x446346[0x2]);}[_0x4135c2(0x1dc)](){return this['rootComponent']['getQuaternion']();}[_0x4135c2(0x1d7)](..._0x42939b){const _0x2641cd=_0x4135c2;_0x42939b[_0x2641cd(0x1e8)]===0x1?this[_0x2641cd(0x1e1)][_0x2641cd(0x1d7)](_0x42939b[0x0]):this[_0x2641cd(0x1e1)][_0x2641cd(0x1d7)](_0x42939b[0x0],_0x42939b[0x1],_0x42939b[0x2],_0x42939b[0x3]);}['getScale'](){const _0x345afd=_0x4135c2;return this[_0x345afd(0x1e1)]['getScale']();}['setScale'](..._0x2b98bf){const _0x157e63=_0x4135c2;_0x2b98bf['length']===0x1?this[_0x157e63(0x1e1)][_0x157e63(0x1de)](_0x2b98bf[0x0]):this[_0x157e63(0x1e1)][_0x157e63(0x1de)](_0x2b98bf[0x0],_0x2b98bf[0x1],_0x2b98bf[0x2]);}[_0x4135c2(0x1db)](){const _0x8ef81=_0x4135c2;return this[_0x8ef81(0x1e1)][_0x8ef81(0x1db)]();}[_0x4135c2(0x21b)](_0x3e4c23){const _0x6669fe=_0x4135c2;this[_0x6669fe(0x1e1)]['setWorldMatrix'](_0x3e4c23);}[_0x4135c2(0x214)](){const _0x30d205=_0x4135c2;return this[_0x30d205(0x1e1)]['getWorldPosition']();}[_0x4135c2(0x1f0)](){const _0x2e811c=_0x4135c2;return this[_0x2e811c(0x1e1)]['getWorldRotation']();}[_0x4135c2(0x1df)](){const _0x2dca23=_0x4135c2;return this[_0x2dca23(0x1e1)][_0x2dca23(0x1df)]();}[_0x4135c2(0x1e9)](){const _0x43f2ef=_0x4135c2;return this[_0x43f2ef(0x1e1)][_0x43f2ef(0x1e9)]();}['getWorldForwardDirection'](){const _0x165a15=_0x4135c2;return this[_0x165a15(0x1e1)][_0x165a15(0x1ff)]();}[_0x4135c2(0x218)](){const _0x108cac=_0x4135c2;return this[_0x108cac(0x1e1)][_0x108cac(0x218)]();}[_0x4135c2(0x20e)](){const _0x29c599=_0x4135c2;return this[_0x29c599(0x1e1)]['getWorldRightDirection']();}[_0x4135c2(0x208)](_0x4d83b3,_0x37ade0){const _0xa6ed8f=_0x4135c2;let _0x1a9983=this[_0xa6ed8f(0x1ec)]();this[_0xa6ed8f(0x1ee)](_0x1a9983['x']+_0x4d83b3['x']*_0x37ade0,_0x1a9983['y']+_0x4d83b3['y']*_0x37ade0,_0x1a9983['z']+_0x4d83b3['z']*_0x37ade0);}[_0x4135c2(0x203)](_0x549c05){const _0x42ce6b=_0x4135c2;return this[_0x42ce6b(0x1e1)][_0x42ce6b(0x203)](_0x549c05);}[_0x4135c2(0x1e2)](_0x527f80){const _0x40f0d4=_0x4135c2;return this[_0x40f0d4(0x1e1)][_0x40f0d4(0x1e2)](_0x527f80);}[_0x4135c2(0x1f8)](){const _0x14e3f6=_0x4135c2;return this[_0x14e3f6(0x1e1)][_0x14e3f6(0x1d4)];}[_0x4135c2(0x1d9)](_0x33afa1,_0x25d4c9=exports.AttachmentRules[_0x4135c2(0x1c5)]){const _0x15e86d=_0x4135c2;this[_0x15e86d(0x1e1)][_0x15e86d(0x1eb)](_0x33afa1,_0x25d4c9),this['_world']&&_0x33afa1[_0x15e86d(0x213)](this[_0x15e86d(0x209)]);}['removeComponent'](_0x1c46a3){const _0xbe2fb0=_0x4135c2;if(_0x1c46a3===this['_rootComponent'])return;this[_0xbe2fb0(0x1e1)]['removeChildComponent'](_0x1c46a3);}[_0x4135c2(0x1ef)](){const _0x335be5=_0x4135c2;this[_0x335be5(0x1e1)][_0x335be5(0x1f6)]();}[_0x4135c2(0x1c9)](_0x102864,_0x203f77=exports.AttachmentRules[_0x4135c2(0x1e0)]){const _0x170be0=_0x4135c2;if(!_0x102864['rootComponent']){console[_0x170be0(0x1f2)]('Actor\x20::\x20addChildActor\x20:\x20the\x20\x27newActor\x27\x20you\x20want\x20to\x20add\x20has\x20no\x20rootcomponent');return;}if(_0x102864[_0x170be0(0x1f7)]===this)return;_0x203f77===exports.AttachmentRules[_0x170be0(0x1c5)]&&this['rootComponent'][_0x170be0(0x1ea)](_0x102864[_0x170be0(0x1e1)]);if(_0x203f77===exports.AttachmentRules['KeepWorld']){let _0x1a26d3=_0x102864[_0x170be0(0x1db)]();this[_0x170be0(0x1e1)][_0x170be0(0x1ea)](_0x102864[_0x170be0(0x1e1)]),_0x102864['setWorldMatrix'](_0x1a26d3);}this[_0x170be0(0x209)]&&this['_world'][_0x170be0(0x1ed)][_0x170be0(0x1fb)]();}['removeChildActor'](_0x4b64ee){const _0x3bed34=_0x4135c2;let _0x5714f6=_0x4b64ee[_0x3bed34(0x1db)]();this[_0x3bed34(0x1e1)]['detachComponent'](_0x4b64ee[_0x3bed34(0x1e1)]),_0x4b64ee[_0x3bed34(0x21b)](_0x5714f6);}['removeFromParent'](){const _0x4197b9=_0x4135c2;this[_0x4197b9(0x1f7)]&&this[_0x4197b9(0x1f7)][_0x4197b9(0x1cd)](this);}[_0x4135c2(0x213)](_0x41ccc6){const _0x57cd08=_0x4135c2;this[_0x57cd08(0x209)]=_0x41ccc6,this[_0x57cd08(0x1e1)][_0x57cd08(0x213)](this[_0x57cd08(0x209)]),this[_0x57cd08(0x1ca)]['forEach'](_0x3b248c=>{const _0x78ef56=_0x57cd08;_0x3b248c[_0x78ef56(0x213)](_0x41ccc6);});}[_0x4135c2(0x204)](){const _0xd9034=_0x4135c2;this[_0xd9034(0x209)]=null;}get[_0x4135c2(0x1f9)](){const _0x29cd92=_0x4135c2;return this['rootComponent'][_0x29cd92(0x1f9)];}set['isHoverEnabled'](_0x3849f1){const _0x4ef0e5=_0x4135c2;this[_0x4ef0e5(0x1e1)][_0x4ef0e5(0x1f9)]=_0x3849f1;}get[_0x4135c2(0x1da)](){const _0x525d6c=_0x4135c2;return this[_0x525d6c(0x1e1)][_0x525d6c(0x1da)];}set[_0x4135c2(0x1da)](_0x937525){const _0x5c66ba=_0x4135c2;this[_0x5c66ba(0x1e1)][_0x5c66ba(0x1da)]=_0x937525;}[_0x4135c2(0x1f4)](_0x3026d7){const _0x4fda59=_0x4135c2;this[_0x4fda59(0x21c)][_0x4fda59(0x206)](_0x3026d7);}['onActorHoverEnd'](_0x4fad82){const _0x4cc9e8=_0x4135c2;this[_0x4cc9e8(0x1e7)][_0x4cc9e8(0x206)](_0x4fad82);}[_0x4135c2(0x1f1)](_0x3d5317){const _0x51193b=_0x4135c2;this[_0x51193b(0x1dd)][_0x51193b(0x206)](_0x3d5317);}[_0x4135c2(0x217)](_0x3c25a1){const _0x300f7e=_0x4135c2;this[_0x300f7e(0x207)][_0x300f7e(0x206)](_0x3c25a1);}}
3168
83
 
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
- }
84
+ const _0xcaaf35=_0x2363;function _0x594a(){const _0x279736=['4742208rjZjuF','forEach','dispose','keys','material','children','2723376ZixbIW','834552uGZsHX','3009408kvrSYZ','1213964JqZIDQ','isTexture','1744694kTFqQn','disposeMaterialTextures','893394cEeoeD','5UjgiNI','disposeMeshResource'];_0x594a=function(){return _0x279736;};return _0x594a();}(function(_0x19e702,_0x4de94e){const _0x4b5ebd=_0x2363,_0x515059=_0x19e702();while(!![]){try{const _0x2de151=-parseInt(_0x4b5ebd(0x195))/0x1+parseInt(_0x4b5ebd(0x19b))/0x2+parseInt(_0x4b5ebd(0x196))/0x3+-parseInt(_0x4b5ebd(0x197))/0x4*(-parseInt(_0x4b5ebd(0x18c))/0x5)+parseInt(_0x4b5ebd(0x194))/0x6+-parseInt(_0x4b5ebd(0x199))/0x7+-parseInt(_0x4b5ebd(0x18e))/0x8;if(_0x2de151===_0x4de94e)break;else _0x515059['push'](_0x515059['shift']());}catch(_0x363302){_0x515059['push'](_0x515059['shift']());}}}(_0x594a,0x818da));function _0x2363(_0x331fb0,_0x311f02){_0x331fb0=_0x331fb0-0x18c;const _0x594a7b=_0x594a();let _0x236362=_0x594a7b[_0x331fb0];return _0x236362;}class ThreeObjectLibrary{static[_0xcaaf35(0x19a)](_0x175a96){const _0x7e91a9=_0xcaaf35;Object[_0x7e91a9(0x191)](_0x175a96)[_0x7e91a9(0x18f)](_0x5ec062=>{const _0xc1a155=_0x7e91a9,_0x5d92f1=_0x175a96[_0x5ec062];_0x5d92f1&&typeof _0x5d92f1==='object'&&_0xc1a155(0x198)in _0x5d92f1&&_0x5d92f1[_0xc1a155(0x190)]();});}static['disposeMeshMaterial'](_0x56fbb4){const _0x7d90a7=_0xcaaf35;let _0x377d0b=Array['isArray'](_0x56fbb4[_0x7d90a7(0x192)])?_0x56fbb4['material']:[_0x56fbb4['material']];_0x377d0b[_0x7d90a7(0x18f)](_0x18c6da=>{const _0x2a44e5=_0x7d90a7;ThreeObjectLibrary[_0x2a44e5(0x19a)](_0x18c6da),_0x18c6da[_0x2a44e5(0x190)]();});}static['disposeMeshResource'](_0x25f6c8,_0x34dec0=![]){const _0x34b1ce=_0xcaaf35;ThreeObjectLibrary['disposeMeshMaterial'](_0x25f6c8),_0x25f6c8['geometry'][_0x34b1ce(0x190)](),_0x34dec0&&_0x25f6c8[_0x34b1ce(0x193)]['forEach'](_0x1022db=>{const _0x41570a=_0x34b1ce;_0x1022db instanceof webgpu.Mesh&&ThreeObjectLibrary[_0x41570a(0x18d)](_0x1022db,!![]);});}static['disposeObject3DResource'](_0x47fc5b){_0x47fc5b['traverse'](_0x46d59f=>{const _0x560339=_0x2363;_0x46d59f instanceof webgpu.Mesh&&ThreeObjectLibrary[_0x560339(0x18d)](_0x46d59f);});}}
3204
85
 
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
- }
86
+ var _0x35510c=_0x158b;(function(_0x1d23c8,_0x43288a){var _0x17b789=_0x158b,_0x10bad4=_0x1d23c8();while(!![]){try{var _0x423885=parseInt(_0x17b789(0x1a4))/0x1*(-parseInt(_0x17b789(0x1ab))/0x2)+-parseInt(_0x17b789(0x1a7))/0x3+-parseInt(_0x17b789(0x1a6))/0x4+parseInt(_0x17b789(0x1a9))/0x5+-parseInt(_0x17b789(0x1a2))/0x6*(parseInt(_0x17b789(0x1a5))/0x7)+-parseInt(_0x17b789(0x1a0))/0x8+parseInt(_0x17b789(0x1a3))/0x9;if(_0x423885===_0x43288a)break;else _0x10bad4['push'](_0x10bad4['shift']());}catch(_0x5beddb){_0x10bad4['push'](_0x10bad4['shift']());}}}(_0x4004,0xf2690));function _0x158b(_0x57e80f,_0x337c50){_0x57e80f=_0x57e80f-0x1a0;var _0x4004cf=_0x4004();var _0x158b64=_0x4004cf[_0x57e80f];return _0x158b64;}class LevelComponent extends SceneComponent{get[_0x35510c(0x1ac)](){var _0x2b8f41=_0x35510c;if(!this[_0x2b8f41(0x1a8)])throw Error('three\x20object\x20is\x20invalid');return this[_0x2b8f41(0x1a8)];}set[_0x35510c(0x1ac)](_0x26184c){var _0x3d1015=_0x35510c;this[_0x3d1015(0x1a8)]=_0x26184c,this[_0x3d1015(0x1a8)]&&(this[_0x3d1015(0x1a8)][_0x3d1015(0x1aa)]['LYObject']=this);}constructor(_0x3d2f29,_0x2ce19b){super(_0x3d2f29,_0x2ce19b);}[_0x35510c(0x1a1)](){return new three.Scene();}}function _0x4004(){var _0x37b80b=['1263772HNgWPF','4496742QeHtCm','obj','8883735dmOUmo','userData','2SGNIhV','threeObject','11569952ysITVO','createDefaultObject','3289188XTERFL','40823667uxpMkX','414103pmhPOI','21ceRZgt'];_0x4004=function(){return _0x37b80b;};return _0x4004();}
3225
87
 
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
- }
88
+ var _0x47f4b5=_0x3379;(function(_0x32861e,_0x4a275f){var _0x293246=_0x3379,_0x35abd5=_0x32861e();while(!![]){try{var _0x327eed=parseInt(_0x293246(0x16b))/0x1+parseInt(_0x293246(0x15f))/0x2*(parseInt(_0x293246(0x165))/0x3)+parseInt(_0x293246(0x16f))/0x4+-parseInt(_0x293246(0x16c))/0x5+parseInt(_0x293246(0x167))/0x6*(parseInt(_0x293246(0x163))/0x7)+parseInt(_0x293246(0x172))/0x8*(parseInt(_0x293246(0x15d))/0x9)+-parseInt(_0x293246(0x16d))/0xa;if(_0x327eed===_0x4a275f)break;else _0x35abd5['push'](_0x35abd5['shift']());}catch(_0x16369a){_0x35abd5['push'](_0x35abd5['shift']());}}}(_0xc8f0,0xc3a86));function _0x3379(_0x41bc06,_0x3ab392){_0x41bc06=_0x41bc06-0x15c;var _0xc8f05d=_0xc8f0();var _0x33794e=_0xc8f05d[_0x41bc06];return _0x33794e;}function _0xc8f0(){var _0x48efc7=['703293dmqHcw','forEach','18VYWDkL','scene','childActors','scene\x20is\x20null','574364HLMGkP','6384335MjElQd','27373580kcPhpW','app','6334068YbyJmt','uuid','tick','344Yuxdyt','rootComponent','294300yLttOr','destroy','10KjzuXc','threeObject','_scene','clearLevel','185507Phzqgt','isTickEnabled'];_0xc8f0=function(){return _0x48efc7;};return _0xc8f0();}class LevelActor extends Actor{get['scene'](){var _0x45f576=_0x3379;if(!this['_scene'])throw new Error(_0x45f576(0x16a));return this[_0x45f576(0x161)];}constructor(_0x57589d,_0xb1e3d3){var _0x3adc58=_0x3379;super(_0x57589d,_0xb1e3d3),this[_0x3adc58(0x161)]=null,this[_0x3adc58(0x161)]=this[_0x3adc58(0x15c)][_0x3adc58(0x160)],this[_0x3adc58(0x164)]=![];}['constructRootComponent'](){var _0x4732d3=_0x3379;return new LevelComponent(this[_0x4732d3(0x16e)],this[_0x4732d3(0x170)]);}['tick'](_0x4c3a0a){var _0x2daea1=_0x3379;if(!this[_0x2daea1(0x164)])return;super[_0x2daea1(0x171)](_0x4c3a0a);}[_0x47f4b5(0x15e)](){var _0xf4d75a=_0x47f4b5;this[_0xf4d75a(0x162)](),super[_0xf4d75a(0x15e)]();}[_0x47f4b5(0x162)](){var _0x49570d=_0x47f4b5;this[_0x49570d(0x169)][_0x49570d(0x166)](_0x143e69=>{var _0x2abbe2=_0x49570d;_0x143e69[_0x2abbe2(0x15e)]();}),this[_0x49570d(0x168)]['traverse'](_0x37a00d=>{_0x37a00d instanceof webgpu.Mesh&&ThreeObjectLibrary['disposeMeshResource'](_0x37a00d);});}}
3263
89
 
3264
- const DefaultWorldParam = {
3265
- levelActorClass: LevelActor,
3266
- };
90
+ function _0x6687(_0x16ed63,_0x3f236c){_0x16ed63=_0x16ed63-0xae;const _0x2800d6=_0x2800();let _0x668745=_0x2800d6[_0x16ed63];return _0x668745;}(function(_0x5209f1,_0x217f62){const _0x2129eb=_0x6687,_0x1e21be=_0x5209f1();while(!![]){try{const _0x28974d=-parseInt(_0x2129eb(0xb1))/0x1*(parseInt(_0x2129eb(0xb7))/0x2)+parseInt(_0x2129eb(0xb2))/0x3*(parseInt(_0x2129eb(0xba))/0x4)+-parseInt(_0x2129eb(0xb0))/0x5*(parseInt(_0x2129eb(0xae))/0x6)+parseInt(_0x2129eb(0xb5))/0x7+-parseInt(_0x2129eb(0xb9))/0x8*(parseInt(_0x2129eb(0xb8))/0x9)+-parseInt(_0x2129eb(0xb4))/0xa*(parseInt(_0x2129eb(0xaf))/0xb)+parseInt(_0x2129eb(0xb6))/0xc*(parseInt(_0x2129eb(0xb3))/0xd);if(_0x28974d===_0x217f62)break;else _0x1e21be['push'](_0x1e21be['shift']());}catch(_0x42d739){_0x1e21be['push'](_0x1e21be['shift']());}}}(_0x2800,0xdc8a4));function _0x2800(){const _0x4c9612=['42246ukYpXS','11riufCp','1195gbUZuS','41935empfKa','3929199YSuLXg','159835cIlqdG','13343600BFPvNi','9233154QSCvMj','3000MmGNPI','12uCIkcd','3443409nafdZT','32jFYwNQ','4agchGl'];_0x2800=function(){return _0x4c9612;};return _0x2800();}const DefaultWorldParam={'levelActorClass':LevelActor};
3267
91
 
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
- }
92
+ const _0x3e9062=_0x4554;(function(_0x515fa1,_0x5486d2){const _0x3864ff=_0x4554,_0x1daf40=_0x515fa1();while(!![]){try{const _0x474ead=parseInt(_0x3864ff(0x124))/0x1+-parseInt(_0x3864ff(0x155))/0x2+-parseInt(_0x3864ff(0x12b))/0x3+parseInt(_0x3864ff(0x152))/0x4*(-parseInt(_0x3864ff(0x143))/0x5)+parseInt(_0x3864ff(0x129))/0x6*(parseInt(_0x3864ff(0x144))/0x7)+parseInt(_0x3864ff(0x14a))/0x8+parseInt(_0x3864ff(0x14f))/0x9;if(_0x474ead===_0x5486d2)break;else _0x1daf40['push'](_0x1daf40['shift']());}catch(_0x317a67){_0x1daf40['push'](_0x1daf40['shift']());}}}(_0x3d35,0x6b45c));function _0x4554(_0x1c2761,_0x4e07ad){_0x1c2761=_0x1c2761-0x124;const _0x3d35ab=_0x3d35();let _0x455479=_0x3d35ab[_0x1c2761];return _0x455479;}function _0x3d35(){const _0x155fa6=['world','push','classes','destroy','renderer','clearAssets','init','renderParam','_assetManager','markRenderStateDirty','2270BNqCYC','7133qdCqiG','controllerClass','onWindowResize','cameraParam','_appParam','_camera','4397664JcZrDk','viewport','controller','viewportClass','viewportParam','5025456iKQGkW','addTickingFunction','createCamera','6616lXWMwa','_onCameraChangedDelegate','broadcast','1384660fWsRAE','_clock','aspect','528105XQUsln','postConstruct','isRenderEveryFrame','_viewport','_controller','4110hNJIDU','camera','1354734NZWxMK','postProcessParam','setAnimationLoop','worldClass','splice','appParam','updateProjectionMatrix','clear','tick','worldParam','renderAsImage','onCameraChangedDelegate','_world','_tickingFunctions'];_0x3d35=function(){return _0x155fa6;};return _0x3d35();}class ThreeJsApp{get[_0x3e9062(0x12a)](){const _0x9cf8c=_0x3e9062;return this[_0x9cf8c(0x149)];}get['clock'](){return this['_clock'];}get[_0x3e9062(0x139)](){const _0x374fe0=_0x3e9062;return this[_0x374fe0(0x137)];}get['viewport'](){const _0x29b1ec=_0x3e9062;return this[_0x29b1ec(0x127)];}get[_0x3e9062(0x14c)](){return this['_controller'];}get['assetManager'](){const _0x2d6e94=_0x3e9062;return this[_0x2d6e94(0x141)];}get[_0x3e9062(0x130)](){const _0x255b91=_0x3e9062;return this[_0x255b91(0x148)];}get[_0x3e9062(0x136)](){const _0x2266b2=_0x3e9062;return this[_0x2266b2(0x153)];}constructor(_0x47e389=DefaultAppParam){const _0x36036e=_0x3e9062;this[_0x36036e(0x138)]=[],this[_0x36036e(0x148)]={'viewportParam':DefaultViewportParam},this['_onCameraChangedDelegate']=new Delegate(),this[_0x36036e(0x148)][_0x36036e(0x147)]=_0x47e389[_0x36036e(0x147)]?_0x47e389[_0x36036e(0x147)]:DefaultCameraParam,this[_0x36036e(0x148)][_0x36036e(0x140)]=_0x47e389[_0x36036e(0x140)]?_0x47e389[_0x36036e(0x140)]:DefaultRendererParameters,this['_appParam'][_0x36036e(0x12c)]=_0x47e389[_0x36036e(0x12c)]?_0x47e389[_0x36036e(0x12c)]:DefaultPostProcessParam,this[_0x36036e(0x148)][_0x36036e(0x14e)]=_0x47e389['viewportParam']?_0x47e389['viewportParam']:DefaultViewportParam,this[_0x36036e(0x148)][_0x36036e(0x13b)]=_0x47e389[_0x36036e(0x13b)]?_0x47e389[_0x36036e(0x13b)]:{'assetManagerClass':AssetManager,'controllerClass':Controller,'worldClass':World,'viewportClass':Viewport},this[_0x36036e(0x148)][_0x36036e(0x126)]=_0x47e389[_0x36036e(0x126)],this[_0x36036e(0x156)]=new webgpu.Clock(),this[_0x36036e(0x149)]=CameraFactory[_0x36036e(0x151)](this[_0x36036e(0x148)][_0x36036e(0x147)]),this[_0x36036e(0x137)]=new this['_appParam'][(_0x36036e(0x13b))][(_0x36036e(0x12e))](this,this[_0x36036e(0x148)]['worldParam']?this['_appParam'][_0x36036e(0x134)]:DefaultWorldParam),this[_0x36036e(0x127)]=new this['_appParam']['classes'][(_0x36036e(0x14d))](this,this['_appParam'][_0x36036e(0x14e)],this[_0x36036e(0x148)]['renderParam'],this[_0x36036e(0x148)]['postProcessParam']),this[_0x36036e(0x128)]=new this[(_0x36036e(0x148))][(_0x36036e(0x13b))][(_0x36036e(0x145))](this),this[_0x36036e(0x141)]=new this[(_0x36036e(0x148))]['classes']['assetManagerClass'](this),this['viewport'][_0x36036e(0x13d)][_0x36036e(0x12d)](()=>{const _0x3849eb=_0x36036e,_0x5582af=this['_clock']['getDelta']();this[_0x3849eb(0x133)](_0x5582af);}),this[_0x36036e(0x125)]();}[_0x3e9062(0x125)](){const _0x55db43=_0x3e9062;this[_0x55db43(0x14c)][_0x55db43(0x13f)](),this['world']['init'](),this[_0x55db43(0x14b)]['init']();}[_0x3e9062(0x13f)](){}[_0x3e9062(0x133)](_0x1db7c1){const _0x2c5e4b=_0x3e9062;this[_0x2c5e4b(0x128)][_0x2c5e4b(0x133)](_0x1db7c1),this['world']['tick'](_0x1db7c1),this['_tickingFunctions']['forEach'](_0x33d521=>{_0x33d521(_0x1db7c1);}),this[_0x2c5e4b(0x148)][_0x2c5e4b(0x126)]&&this['viewport'][_0x2c5e4b(0x142)](),this[_0x2c5e4b(0x14b)]['render']();}[_0x3e9062(0x150)](_0x24825b){const _0x4a6391=_0x3e9062;this['_tickingFunctions'][_0x4a6391(0x13a)](_0x24825b);}['removeTickingFunction'](_0x52344f){const _0x416341=_0x3e9062,_0x4f5002=this[_0x416341(0x138)]['indexOf'](_0x52344f);_0x4f5002>=0x0&&this[_0x416341(0x138)][_0x416341(0x12f)](_0x4f5002,0x1);}['destroy'](){const _0x20b08b=_0x3e9062;this[_0x20b08b(0x136)][_0x20b08b(0x132)](),this['controller']['destroy'](),this[_0x20b08b(0x139)]['destroy'](),this[_0x20b08b(0x14b)][_0x20b08b(0x13c)](),this['_assetManager'][_0x20b08b(0x13e)]();}['updateCamera'](_0xe06536){const _0x4c713a=_0x3e9062,_0x49d062=this[_0x4c713a(0x12a)];this['_camera']=CameraFactory['updataCamera'](_0xe06536,this['camera']),_0x49d062!==this[_0x4c713a(0x12a)]&&(this['_onCameraChangedDelegate'][_0x4c713a(0x154)](),this[_0x4c713a(0x14c)]['updateCamera']()),this['_camera'][_0x4c713a(0x131)](),this['viewport'][_0x4c713a(0x142)]();}[_0x3e9062(0x146)](_0x49040e,_0x2df0f0){const _0x353cf8=_0x3e9062;this[_0x353cf8(0x12a)]instanceof webgpu.PerspectiveCamera&&(this[_0x353cf8(0x12a)][_0x353cf8(0x157)]=_0x49040e/_0x2df0f0),this[_0x353cf8(0x12a)][_0x353cf8(0x131)]();}async[_0x3e9062(0x135)](_0x27d064=0x400,_0x12ad18=0x400){return await this['viewport']['renderAsImage'](_0x27d064,_0x12ad18);}}
3378
93
 
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
- }
94
+ var _0x190da2=_0x54a8;function _0x54a8(_0x552397,_0x1c7937){_0x552397=_0x552397-0x13c;var _0x540f38=_0x540f();var _0x54a8a8=_0x540f38[_0x552397];return _0x54a8a8;}function _0x540f(){var _0x46b005=['129208YAzMaN','LYObject','387lFKBFa','21wUWxyk','8389145wbYNle','getHex','2mtuBvp','intensity','8016722ioiHfn','6056148oriDij','threeObject','obj','three\x20object\x20is\x20invalid','color','407916xRnWhP','315336dbfQZL','set','10867010lkfGlG'];_0x540f=function(){return _0x46b005;};return _0x540f();}(function(_0x52b0af,_0x5c6544){var _0x113c82=_0x54a8,_0x4d8c70=_0x52b0af();while(!![]){try{var _0x71399b=parseInt(_0x113c82(0x148))/0x1*(parseInt(_0x113c82(0x13f))/0x2)+-parseInt(_0x113c82(0x145))/0x3*(parseInt(_0x113c82(0x13e))/0x4)+parseInt(_0x113c82(0x146))/0x5+-parseInt(_0x113c82(0x14b))/0x6+-parseInt(_0x113c82(0x14a))/0x7+-parseInt(_0x113c82(0x142))/0x8*(-parseInt(_0x113c82(0x144))/0x9)+parseInt(_0x113c82(0x141))/0xa;if(_0x71399b===_0x5c6544)break;else _0x4d8c70['push'](_0x4d8c70['shift']());}catch(_0x385933){_0x4d8c70['push'](_0x4d8c70['shift']());}}}(_0x540f,0xdd2ae));class LightComponent extends SceneComponent{get[_0x190da2(0x14c)](){var _0x4c077b=_0x190da2;if(!this[_0x4c077b(0x14d)])throw Error(_0x4c077b(0x13c));return this[_0x4c077b(0x14d)];}set[_0x190da2(0x14c)](_0x10afef){var _0x1292b6=_0x190da2;this[_0x1292b6(0x14d)]=_0x10afef,this[_0x1292b6(0x14d)]&&(this[_0x1292b6(0x14d)]['userData'][_0x1292b6(0x143)]=this);}get[_0x190da2(0x13d)](){var _0x2f5312=_0x190da2;return this[_0x2f5312(0x14c)][_0x2f5312(0x13d)][_0x2f5312(0x147)]();}set[_0x190da2(0x13d)](_0x237e55){var _0x3578fa=_0x190da2;this[_0x3578fa(0x14c)][_0x3578fa(0x13d)][_0x3578fa(0x140)](_0x237e55);}get['intensity'](){var _0x40327c=_0x190da2;return this[_0x40327c(0x14c)]['intensity'];}set[_0x190da2(0x149)](_0x1c38f9){var _0x39556e=_0x190da2;this[_0x39556e(0x14c)][_0x39556e(0x149)]=_0x1c38f9;}constructor(_0x81bc49,_0x46fb6f){super(_0x81bc49,_0x46fb6f);}}
3411
95
 
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
- }
96
+ var _0x3f353d=_0x34d8;function _0x34d8(_0x1cdca9,_0x3b0fa2){_0x1cdca9=_0x1cdca9-0x18a;var _0xa25f1=_0xa25f();var _0x34d802=_0xa25f1[_0x1cdca9];return _0x34d802;}(function(_0x1fcda2,_0x284b8b){var _0x4ed6d8=_0x34d8,_0x533a3b=_0x1fcda2();while(!![]){try{var _0x18317b=parseInt(_0x4ed6d8(0x1a0))/0x1*(-parseInt(_0x4ed6d8(0x1a1))/0x2)+-parseInt(_0x4ed6d8(0x195))/0x3*(parseInt(_0x4ed6d8(0x193))/0x4)+-parseInt(_0x4ed6d8(0x18a))/0x5*(parseInt(_0x4ed6d8(0x1a2))/0x6)+-parseInt(_0x4ed6d8(0x190))/0x7+parseInt(_0x4ed6d8(0x19e))/0x8*(-parseInt(_0x4ed6d8(0x191))/0x9)+parseInt(_0x4ed6d8(0x198))/0xa+parseInt(_0x4ed6d8(0x18c))/0xb;if(_0x18317b===_0x284b8b)break;else _0x533a3b['push'](_0x533a3b['shift']());}catch(_0x5ebbae){_0x533a3b['push'](_0x533a3b['shift']());}}}(_0xa25f,0x6073a));class DirectionalLightComponent extends LightComponent{get[_0x3f353d(0x19a)](){var _0x2b9670=_0x3f353d;if(!this[_0x2b9670(0x192)])throw Error(_0x2b9670(0x19c));return this[_0x2b9670(0x192)];}set[_0x3f353d(0x19a)](_0x212ce6){var _0x520b43=_0x3f353d;this[_0x520b43(0x192)]=_0x212ce6,this[_0x520b43(0x192)]&&(this['obj']['userData'][_0x520b43(0x194)]=this);}get[_0x3f353d(0x19b)](){var _0x11480f=_0x3f353d;return this[_0x11480f(0x19a)]['castShadow'];}set[_0x3f353d(0x19b)](_0x4d8a5e){var _0x1f28ca=_0x3f353d;this['threeObject'][_0x1f28ca(0x19b)]=_0x4d8a5e;}constructor(_0x460e36,_0x2f5a2a=0xffffff,_0x33fcc0=0xa,_0x2f65bd){var _0x10bd26=_0x3f353d;super(_0x460e36,_0x2f65bd),this[_0x10bd26(0x19a)][_0x10bd26(0x18b)]['set'](_0x2f5a2a),this[_0x10bd26(0x19a)][_0x10bd26(0x199)]=_0x33fcc0;}['createDefaultObject'](){return new webgpu.DirectionalLight(0xffffff,0xa);}[_0x3f353d(0x197)](..._0x2b7634){var _0x1c245e=_0x3f353d;_0x2b7634['length']===0x1?super[_0x1c245e(0x197)](_0x2b7634[0x0]):super[_0x1c245e(0x197)](_0x2b7634[0x0],_0x2b7634[0x1],_0x2b7634[0x2]),this[_0x1c245e(0x19d)]();}[_0x3f353d(0x19d)](){var _0x2564fe=_0x3f353d;if(this['world'])this[_0x2564fe(0x19f)][_0x2564fe(0x18f)][_0x2564fe(0x18e)]();}[_0x3f353d(0x196)](_0x3fe222){var _0x2f2fac=_0x3f353d;if(!this[_0x2f2fac(0x19a)])throw Error(_0x2f2fac(0x19c));super[_0x2f2fac(0x196)](_0x3fe222);}[_0x3f353d(0x18d)](){var _0x1d40b4=_0x3f353d;super[_0x1d40b4(0x18d)]();}}function _0xa25f(){var _0x358869=['1220ZpNfXb','color','20381603WOKjGj','destroy','markRenderStateDirty','viewport','1054844dDxdRA','4284PsoAsn','obj','254984bEftQN','LYObject','21SHrMyX','onAddedToWorld','setPosition','1238310zQnkkh','intensity','threeObject','castShadow','three\x20object\x20is\x20invalid','update','7088NTisAU','world','516YxOGlp','1644LYqsHJ','3414MbJbqO'];_0xa25f=function(){return _0x358869;};return _0xa25f();}
3462
97
 
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
- }
98
+ var _0x229a44=_0x5d9c;function _0x5d9c(_0x55b7f4,_0x11ac97){_0x55b7f4=_0x55b7f4-0x68;var _0x46959b=_0x4695();var _0x5d9ce8=_0x46959b[_0x55b7f4];return _0x5d9ce8;}(function(_0x19452f,_0x5e4b72){var _0x1ee1bd=_0x5d9c,_0xd01f55=_0x19452f();while(!![]){try{var _0x5ce7f3=parseInt(_0x1ee1bd(0x76))/0x1*(-parseInt(_0x1ee1bd(0x73))/0x2)+-parseInt(_0x1ee1bd(0x6c))/0x3+parseInt(_0x1ee1bd(0x72))/0x4*(-parseInt(_0x1ee1bd(0x6f))/0x5)+-parseInt(_0x1ee1bd(0x69))/0x6*(parseInt(_0x1ee1bd(0x6b))/0x7)+parseInt(_0x1ee1bd(0x71))/0x8+parseInt(_0x1ee1bd(0x68))/0x9*(parseInt(_0x1ee1bd(0x6d))/0xa)+parseInt(_0x1ee1bd(0x75))/0xb;if(_0x5ce7f3===_0x5e4b72)break;else _0xd01f55['push'](_0xd01f55['shift']());}catch(_0x2a2a0e){_0xd01f55['push'](_0xd01f55['shift']());}}}(_0x4695,0x3f1de));function _0x4695(){var _0x38db40=['399203ZdSLMF','1103142hNcuHO','41770cFhhbS','intensity','5QnqPWx','lightComponent','462928eZjLlr','1187772wDOwVA','26ImLcHv','color','13322573REwIIp','21179YAlwQh','castShadow','constructRootComponent','954bewlLS','54MVicfW','rootComponent'];_0x4695=function(){return _0x38db40;};return _0x4695();}class DirectionalLightActor extends Actor{constructor(_0x13b390,_0x2cf4d1=0xffffff,_0x43663f=0x1,_0x547cd5){var _0x4e9f72=_0x5d9c;super(_0x13b390,_0x547cd5),this[_0x4e9f72(0x70)]=null,this['lightComponent']=this[_0x4e9f72(0x6a)],this['lightComponent']&&(this[_0x4e9f72(0x70)][_0x4e9f72(0x74)]=_0x2cf4d1,this[_0x4e9f72(0x70)][_0x4e9f72(0x6e)]=_0x43663f,this[_0x4e9f72(0x70)][_0x4e9f72(0x77)]=!![]),this[_0x4e9f72(0x70)][_0x4e9f72(0x77)]=!![];}[_0x229a44(0x78)](){return new DirectionalLightComponent(this['app']);}}
3479
99
 
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
- }
100
+ function _0x2ab4(_0x5c9d38,_0x4acd09){_0x5c9d38=_0x5c9d38-0x10d;var _0x566538=_0x5665();var _0x2ab4ac=_0x566538[_0x5c9d38];return _0x2ab4ac;}var _0x4e6d56=_0x2ab4;function _0x5665(){var _0x74df45=['setPosition','length','2917308BUOpUY','38370fFOuUT','set','788756gVLvBZ','createDefaultObject','color','12909584GbDwOC','threeObject','intensity','three\x20object\x20is\x20invalid','3844650QTLZmH','1039197yxTXfg','obj','onAddedToWorld','destroy','castShadow','markRenderStateDirty','2QkzCrB','world','update','580020oPnKZk','userData'];_0x5665=function(){return _0x74df45;};return _0x5665();}(function(_0x5565c1,_0x3f9726){var _0x55423d=_0x2ab4,_0x66ebda=_0x5565c1();while(!![]){try{var _0x19a1ba=parseInt(_0x55423d(0x10e))/0x1*(-parseInt(_0x55423d(0x11c))/0x2)+-parseInt(_0x55423d(0x116))/0x3+-parseInt(_0x55423d(0x123))/0x4+-parseInt(_0x55423d(0x124))/0x5+parseInt(_0x55423d(0x115))/0x6+parseInt(_0x55423d(0x11f))/0x7+parseInt(_0x55423d(0x111))/0x8;if(_0x19a1ba===_0x3f9726)break;else _0x66ebda['push'](_0x66ebda['shift']());}catch(_0x5e370b){_0x66ebda['push'](_0x66ebda['shift']());}}}(_0x5665,0x71919));class AmbientLightComponent extends LightComponent{get['threeObject'](){var _0x201e32=_0x2ab4;if(!this[_0x201e32(0x117)])throw Error(_0x201e32(0x114));return this['obj'];}set['threeObject'](_0x20afb5){var _0x23b454=_0x2ab4;this[_0x23b454(0x117)]=_0x20afb5,this[_0x23b454(0x117)]&&(this[_0x23b454(0x117)][_0x23b454(0x120)]['LYObject']=this);}get['castShadow'](){var _0x538561=_0x2ab4;return this['threeObject'][_0x538561(0x11a)];}set['castShadow'](_0x10656f){var _0x2f82d4=_0x2ab4;this[_0x2f82d4(0x112)]['castShadow']=_0x10656f;}constructor(_0x50abb8,_0x69455b=0xffffff,_0x31ef33=0xa,_0x574a7b){var _0x2ed4a5=_0x2ab4;super(_0x50abb8,_0x574a7b),this[_0x2ed4a5(0x112)][_0x2ed4a5(0x110)][_0x2ed4a5(0x10d)](_0x69455b),this[_0x2ed4a5(0x112)][_0x2ed4a5(0x113)]=_0x31ef33;}[_0x4e6d56(0x10f)](){return new webgpu.AmbientLight(0xffffff,0xa);}[_0x4e6d56(0x121)](..._0x9cd4b7){var _0x2d7354=_0x4e6d56;_0x9cd4b7[_0x2d7354(0x122)]===0x1?super[_0x2d7354(0x121)](_0x9cd4b7[0x0]):super[_0x2d7354(0x121)](_0x9cd4b7[0x0],_0x9cd4b7[0x1],_0x9cd4b7[0x2]),this[_0x2d7354(0x11e)]();}[_0x4e6d56(0x11e)](){var _0xcfb910=_0x4e6d56;if(this[_0xcfb910(0x11d)])this[_0xcfb910(0x11d)]['viewport'][_0xcfb910(0x11b)]();}['onAddedToWorld'](_0x175fa8){var _0x3a81f8=_0x4e6d56;if(!this[_0x3a81f8(0x112)])throw Error(_0x3a81f8(0x114));super[_0x3a81f8(0x118)](_0x175fa8);}['destroy'](){var _0x1da11a=_0x4e6d56;super[_0x1da11a(0x119)]();}}
3530
101
 
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
- }
102
+ var _0x361ca7=_0x3901;(function(_0x264bf0,_0x49c797){var _0x218705=_0x3901,_0x10f3ec=_0x264bf0();while(!![]){try{var _0x89bf66=parseInt(_0x218705(0x10b))/0x1*(parseInt(_0x218705(0x109))/0x2)+parseInt(_0x218705(0x107))/0x3+-parseInt(_0x218705(0x10a))/0x4+parseInt(_0x218705(0x10d))/0x5+parseInt(_0x218705(0x110))/0x6*(-parseInt(_0x218705(0x10c))/0x7)+parseInt(_0x218705(0x10f))/0x8*(parseInt(_0x218705(0x106))/0x9)+-parseInt(_0x218705(0x103))/0xa;if(_0x89bf66===_0x49c797)break;else _0x10f3ec['push'](_0x10f3ec['shift']());}catch(_0x23a0e0){_0x10f3ec['push'](_0x10f3ec['shift']());}}}(_0x7672,0x56981));function _0x3901(_0x3e85c2,_0x2deaba){_0x3e85c2=_0x3e85c2-0x103;var _0x767267=_0x7672();var _0x390195=_0x767267[_0x3e85c2];return _0x390195;}function _0x7672(){var _0x2549b2=['app','432BTzVrL','6DGizDI','constructRootComponent','4880010rqNcCv','intensity','castShadow','25947EVEWqa','360813ofYOSk','lightComponent','6832gpJVPo','993228QzPPMf','109aqPnlH','520142YPpcSy','2585030BsVmZY'];_0x7672=function(){return _0x2549b2;};return _0x7672();}class AmbientLightActor extends Actor{constructor(_0x16515d,_0x31b13b=0xffffff,_0x4e0cad=0x1,_0x279fb7){var _0x19dfc0=_0x3901;super(_0x16515d,_0x279fb7),this[_0x19dfc0(0x108)]=null,this[_0x19dfc0(0x108)]=this['rootComponent'],this['lightComponent']&&(this[_0x19dfc0(0x108)]['color']=_0x31b13b,this[_0x19dfc0(0x108)][_0x19dfc0(0x104)]=_0x4e0cad,this[_0x19dfc0(0x108)][_0x19dfc0(0x105)]=!![]),this[_0x19dfc0(0x108)][_0x19dfc0(0x105)]=!![];}[_0x361ca7(0x111)](){var _0x58c660=_0x361ca7;return new AmbientLightComponent(this[_0x58c660(0x10e)]);}}
3547
103
 
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
- }
104
+ function _0x41b6(_0x395a83,_0x49ac67){_0x395a83=_0x395a83-0x115;var _0x21a46e=_0x21a4();var _0x41b622=_0x21a46e[_0x395a83];return _0x41b622;}(function(_0x586984,_0x9ec565){var _0x1c369f=_0x41b6,_0x230c08=_0x586984();while(!![]){try{var _0x160fda=parseInt(_0x1c369f(0x11a))/0x1+parseInt(_0x1c369f(0x11b))/0x2*(parseInt(_0x1c369f(0x115))/0x3)+-parseInt(_0x1c369f(0x11c))/0x4*(-parseInt(_0x1c369f(0x118))/0x5)+parseInt(_0x1c369f(0x119))/0x6*(-parseInt(_0x1c369f(0x11e))/0x7)+-parseInt(_0x1c369f(0x117))/0x8+-parseInt(_0x1c369f(0x11d))/0x9+parseInt(_0x1c369f(0x116))/0xa;if(_0x160fda===_0x9ec565)break;else _0x230c08['push'](_0x230c08['shift']());}catch(_0x1aa9c9){_0x230c08['push'](_0x230c08['shift']());}}}(_0x21a4,0x271b9));function _0x21a4(){var _0x15619a=['4WcsrQp','1597437vatpdH','231LuDvSc','3lpQQzd','2409040poGVZH','177688RmWBxQ','94090gNURlJ','14046yLpxaL','78298msgWCN','198244bylibg'];_0x21a4=function(){return _0x15619a;};return _0x21a4();}class BoxComponent extends MeshComponent{constructor(_0x4e1dfc,_0x261a4d=0x1,_0xfb8ee7=0x1,_0x320259=0x1,_0x12fb47=0x1,_0x3d8e8b=0x1,_0x50bf3d=0x1,_0x36f853=new webgpu.MeshStandardMaterial(),_0x254fec){super(_0x4e1dfc,new webgpu.BoxGeometry(_0x261a4d,_0xfb8ee7,_0x320259,_0x12fb47,_0x3d8e8b,_0x50bf3d),_0x36f853,_0x254fec);}}
3553
105
 
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
- }
106
+ function _0x3924(){var _0x341cb6=['13ixPilx','1844873fUYoVz','2fmyNKR','3357270upSEeM','4621379RmBarD','7260076LLgWHW','2538aSyGJW','3333517oDohOR','5DHYjmi','22824DThaeT','50sjvDRp','6117828KzkIla','6qTuizt'];_0x3924=function(){return _0x341cb6;};return _0x3924();}(function(_0x5888f1,_0x32b746){var _0x578870=_0x4662,_0x4fa780=_0x5888f1();while(!![]){try{var _0x4e3924=-parseInt(_0x578870(0x176))/0x1*(parseInt(_0x578870(0x177))/0x2)+parseInt(_0x578870(0x16b))/0x3+parseInt(_0x578870(0x16d))/0x4*(-parseInt(_0x578870(0x170))/0x5)+-parseInt(_0x578870(0x174))/0x6*(-parseInt(_0x578870(0x16c))/0x7)+parseInt(_0x578870(0x171))/0x8*(parseInt(_0x578870(0x16e))/0x9)+parseInt(_0x578870(0x172))/0xa*(parseInt(_0x578870(0x16f))/0xb)+parseInt(_0x578870(0x173))/0xc*(parseInt(_0x578870(0x175))/0xd);if(_0x4e3924===_0x32b746)break;else _0x4fa780['push'](_0x4fa780['shift']());}catch(_0x4ea935){_0x4fa780['push'](_0x4fa780['shift']());}}}(_0x3924,0xe7b03));function _0x4662(_0x57fda0,_0x1ac090){_0x57fda0=_0x57fda0-0x16b;var _0x3924b4=_0x3924();var _0x46626b=_0x3924b4[_0x57fda0];return _0x46626b;}class BoxActor extends Actor{constructor(_0x1e989c,_0x347d65){super(_0x1e989c,_0x347d65);}['constructRootComponent'](){return new BoxComponent(this['app'],0x1,0x1,0x1,0x1,0x1,0x1,new webgpu.MeshBasicMaterial(),this['uuid']);}}
3562
107
 
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
- }
108
+ const _0x3e3d89=_0x1010;(function(_0x474d1e,_0x5b9097){const _0x5303a3=_0x1010,_0xd62003=_0x474d1e();while(!![]){try{const _0x4f0e14=-parseInt(_0x5303a3(0x1eb))/0x1+-parseInt(_0x5303a3(0x204))/0x2*(-parseInt(_0x5303a3(0x203))/0x3)+parseInt(_0x5303a3(0x1f8))/0x4*(parseInt(_0x5303a3(0x1ff))/0x5)+parseInt(_0x5303a3(0x1f0))/0x6*(-parseInt(_0x5303a3(0x1ed))/0x7)+parseInt(_0x5303a3(0x1ea))/0x8+parseInt(_0x5303a3(0x1fc))/0x9*(-parseInt(_0x5303a3(0x209))/0xa)+-parseInt(_0x5303a3(0x1f7))/0xb*(-parseInt(_0x5303a3(0x206))/0xc);if(_0x4f0e14===_0x5b9097)break;else _0xd62003['push'](_0xd62003['shift']());}catch(_0x219dcf){_0xd62003['push'](_0xd62003['shift']());}}}(_0x4080,0xbf8bc));const DefaultSkyParam={'turbidity':0xa,'rayleigh':0x3,'mieCoefficient':0.005,'mieDirectionalG':0.7,'elevation':0x2,'azimuth':0x87};function _0x1010(_0x14fbc7,_0x322d6c){_0x14fbc7=_0x14fbc7-0x1e9;const _0x408099=_0x4080();let _0x101017=_0x408099[_0x14fbc7];return _0x101017;}function _0x4080(){const _0x145bce=['azimuth','451XuqGeP','1627196VykKJH','disposeMeshResource','LYObject','sunPosition','981NZlYuS','world','obj','5YuMHcy','setFromSphericalCoords','copy','mieCoefficient','2805PalNuh','2936cDzQwQ','userData','295656JbfHcx','skyParam','viewport','112910dRroix','three\x20object\x20is\x20invalid','8496656bweHoa','338345fHSnpr','mieDirectionalG','10485881cjmBsp','turbidity','degToRad','6sUjUPb','threeObject','value','elevation','createDefaultObject','rayleigh'];_0x4080=function(){return _0x145bce;};return _0x4080();}class SkyComponent extends SceneComponent{get[_0x3e3d89(0x1f1)](){const _0x2c47c7=_0x3e3d89;if(!this[_0x2c47c7(0x1fe)])throw Error(_0x2c47c7(0x1e9));return this[_0x2c47c7(0x1fe)];}set[_0x3e3d89(0x1f1)](_0x7471cf){const _0x1ea333=_0x3e3d89;this[_0x1ea333(0x1fe)]=_0x7471cf,this[_0x1ea333(0x1fe)]&&(this[_0x1ea333(0x1fe)][_0x1ea333(0x205)][_0x1ea333(0x1fa)]=this);}constructor(_0x4d3e31,_0x1cd942,_0x187f87){const _0x5cd0cb=_0x3e3d89;super(_0x4d3e31,_0x187f87),this[_0x5cd0cb(0x207)]=DefaultSkyParam,this[_0x5cd0cb(0x1fb)]=new webgpu.Vector3(),_0x1cd942&&(this[_0x5cd0cb(0x207)]=_0x1cd942),this['updateSky']();}[_0x3e3d89(0x1f4)](){return new SkyMesh_js.SkyMesh();}['updateSky'](){const _0x57fedd=_0x3e3d89;var _0x54d202,_0xa9cffd;this[_0x57fedd(0x1f1)][_0x57fedd(0x1ee)]['value']=this['skyParam']['turbidity'],this[_0x57fedd(0x1f1)][_0x57fedd(0x1f5)][_0x57fedd(0x1f2)]=this['skyParam'][_0x57fedd(0x1f5)],this[_0x57fedd(0x1f1)][_0x57fedd(0x202)][_0x57fedd(0x1f2)]=this[_0x57fedd(0x207)][_0x57fedd(0x202)],this[_0x57fedd(0x1f1)][_0x57fedd(0x1ec)]['value']=this[_0x57fedd(0x207)][_0x57fedd(0x1ec)];const _0x57e62b=webgpu.MathUtils[_0x57fedd(0x1ef)](0x5a-this[_0x57fedd(0x207)][_0x57fedd(0x1f3)]),_0x3bd482=webgpu.MathUtils[_0x57fedd(0x1ef)](this[_0x57fedd(0x207)][_0x57fedd(0x1f6)]);this[_0x57fedd(0x1fb)][_0x57fedd(0x200)](0x1,_0x57e62b,_0x3bd482),this['threeObject'][_0x57fedd(0x1fb)][_0x57fedd(0x1f2)][_0x57fedd(0x201)](this['sunPosition']),(_0xa9cffd=(_0x54d202=this[_0x57fedd(0x1fd)])===null||_0x54d202===void 0?void 0:_0x54d202[_0x57fedd(0x208)])===null||_0xa9cffd===void 0?void 0:_0xa9cffd['markRenderStateDirty']();}['destroyObject'](){const _0x34c014=_0x3e3d89;this[_0x34c014(0x1fe)]&&ThreeObjectLibrary[_0x34c014(0x1f9)](this['threeObject']);}}
3614
109
 
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
- }
110
+ var _0x12ca9a=_0x1b82;(function(_0x434e4e,_0x3b6564){var _0x5e471a=_0x1b82,_0x49c374=_0x434e4e();while(!![]){try{var _0x5c88f5=parseInt(_0x5e471a(0xec))/0x1+parseInt(_0x5e471a(0xf6))/0x2+-parseInt(_0x5e471a(0xf3))/0x3*(-parseInt(_0x5e471a(0xe9))/0x4)+-parseInt(_0x5e471a(0xef))/0x5*(-parseInt(_0x5e471a(0xf7))/0x6)+-parseInt(_0x5e471a(0xf1))/0x7*(-parseInt(_0x5e471a(0xe7))/0x8)+parseInt(_0x5e471a(0xeb))/0x9+-parseInt(_0x5e471a(0xe8))/0xa;if(_0x5c88f5===_0x3b6564)break;else _0x49c374['push'](_0x49c374['shift']());}catch(_0x4b9193){_0x49c374['push'](_0x49c374['shift']());}}}(_0x3d03,0xecd67));function _0x3d03(){var _0x179cbb=['SkyActor','2145792ebvbgy','3048462eNVdEM','8SVSMoy','59669900mizkSF','92uLvupE','_name','16518960xUgQXw','1041576OpgqXM','constructRootComponent','setScale','10OBxNNc','skyComponent','2753926jXRWhE','rootComponent','205773sPibvG','name'];_0x3d03=function(){return _0x179cbb;};return _0x3d03();}function _0x1b82(_0x44aa7e,_0x1650b0){_0x44aa7e=_0x44aa7e-0xe7;var _0x3d03da=_0x3d03();var _0x1b8242=_0x3d03da[_0x44aa7e];return _0x1b8242;}class SkyActor extends Actor{constructor(_0x3da074,_0x462478){var _0x111617=_0x1b82;super(_0x3da074,_0x462478),this[_0x111617(0xea)]=_0x111617(0xf5),this['skyComponent']=null,this[_0x111617(0xf4)]='SkyActor',this[_0x111617(0xf0)]=this[_0x111617(0xf2)],this[_0x111617(0xf2)][_0x111617(0xf4)]=this[_0x111617(0xf2)][_0x111617(0xf4)]+'(Root)',this[_0x111617(0xee)](0xafc8,0xafc8,0xafc8);}[_0x12ca9a(0xed)](){return new SkyComponent(this['app']);}}
3629
111
 
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
- }
112
+ function _0x4a61(_0xe22ab3,_0x814d38){_0xe22ab3=_0xe22ab3-0x116;var _0x2f964f=_0x2f96();var _0x4a6124=_0x2f964f[_0xe22ab3];return _0x4a6124;}(function(_0x300cc2,_0x47717d){var _0x180b45=_0x4a61,_0x12ea8d=_0x300cc2();while(!![]){try{var _0x731e06=-parseInt(_0x180b45(0x118))/0x1+parseInt(_0x180b45(0x121))/0x2*(-parseInt(_0x180b45(0x120))/0x3)+parseInt(_0x180b45(0x11f))/0x4+parseInt(_0x180b45(0x11a))/0x5*(parseInt(_0x180b45(0x119))/0x6)+parseInt(_0x180b45(0x11d))/0x7*(-parseInt(_0x180b45(0x11c))/0x8)+-parseInt(_0x180b45(0x117))/0x9*(-parseInt(_0x180b45(0x116))/0xa)+-parseInt(_0x180b45(0x11e))/0xb*(-parseInt(_0x180b45(0x11b))/0xc);if(_0x731e06===_0x47717d)break;else _0x12ea8d['push'](_0x12ea8d['shift']());}catch(_0x388aae){_0x12ea8d['push'](_0x12ea8d['shift']());}}}(_0x2f96,0xa2409));function _0x2f96(){var _0x337631=['359363sozvhj','1065954gEiURR','5HnJZDT','41676lnbKQj','3350168wHlSwN','7vRaHJH','1265yApLOa','1780808aeNBpt','3rmuMRL','1571436sGPsQi','10OuVALW','10855629oRvqBz'];_0x2f96=function(){return _0x337631;};return _0x2f96();}class PlaneComponent extends MeshComponent{constructor(_0xe3dab1,_0x4ceb72,_0x46c218,_0x234ebd,_0xbe1395=0x1,_0x353a2c=0x1,_0x1000b8){super(_0xe3dab1,new webgpu.PlaneGeometry(_0x4ceb72,_0x46c218,_0xbe1395,_0x353a2c),_0x234ebd,_0x1000b8);}}
3635
113
 
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
- }
114
+ function _0x139d(_0x42dab6,_0x3bbe7c){_0x42dab6=_0x42dab6-0x1ea;var _0x2519cf=_0x2519();var _0x139da5=_0x2519cf[_0x42dab6];return _0x139da5;}var _0x5f23c0=_0x139d;function _0x2519(){var _0x64d5f8=['177951ZZGAkm','4750385XSACsh','14UyHVyY','2860490PrsNRi','destroy','app','81JYWoHV','3597288wAnffB','constructRootComponent','43557jfarVo','208OWPFcA','2423094nCZliF','369092RigcId'];_0x2519=function(){return _0x64d5f8;};return _0x2519();}(function(_0x45f003,_0x34bf66){var _0x4e5495=_0x139d,_0x255321=_0x45f003();while(!![]){try{var _0x31a3c5=-parseInt(_0x4e5495(0x1eb))/0x1+parseInt(_0x4e5495(0x1ea))/0x2+-parseInt(_0x4e5495(0x1f4))/0x3*(parseInt(_0x4e5495(0x1f5))/0x4)+-parseInt(_0x4e5495(0x1ec))/0x5+parseInt(_0x4e5495(0x1f6))/0x6*(-parseInt(_0x4e5495(0x1ed))/0x7)+parseInt(_0x4e5495(0x1f2))/0x8+-parseInt(_0x4e5495(0x1f1))/0x9*(-parseInt(_0x4e5495(0x1ee))/0xa);if(_0x31a3c5===_0x34bf66)break;else _0x255321['push'](_0x255321['shift']());}catch(_0x38e2c2){_0x255321['push'](_0x255321['shift']());}}}(_0x2519,0x7e72e));class PlaneActor extends Actor{constructor(_0x92cbce,_0x181cf9){super(_0x92cbce,_0x181cf9);}[_0x5f23c0(0x1f3)](){var _0x4c2295=_0x5f23c0;return new PlaneComponent(this[_0x4c2295(0x1f0)],0x1,0x1,new webgpu.MeshBasicMaterial(),0x1,0x1,this['uuid']);}[_0x5f23c0(0x1ef)](){var _0x385040=_0x5f23c0;super[_0x385040(0x1ef)]();}}
3647
115
 
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
- }
116
+ const _0x310dbb=_0x8e60;(function(_0x45fc2d,_0x47239b){const _0x5cf168=_0x8e60,_0x355afd=_0x45fc2d();while(!![]){try{const _0x45be15=-parseInt(_0x5cf168(0x82))/0x1*(-parseInt(_0x5cf168(0xb5))/0x2)+-parseInt(_0x5cf168(0xa8))/0x3*(-parseInt(_0x5cf168(0x8e))/0x4)+-parseInt(_0x5cf168(0x9e))/0x5*(-parseInt(_0x5cf168(0xba))/0x6)+parseInt(_0x5cf168(0xa3))/0x7*(parseInt(_0x5cf168(0x9f))/0x8)+-parseInt(_0x5cf168(0x9b))/0x9+parseInt(_0x5cf168(0xb0))/0xa*(-parseInt(_0x5cf168(0xb1))/0xb)+-parseInt(_0x5cf168(0x91))/0xc;if(_0x45be15===_0x47239b)break;else _0x355afd['push'](_0x355afd['shift']());}catch(_0x375812){_0x355afd['push'](_0x355afd['shift']());}}}(_0xf110,0x54871));function _0x8e60(_0x5d1a48,_0x39ba3){_0x5d1a48=_0x5d1a48-0x78;const _0x8e60ea=_0xf110();let _0x25fed3=_0x8e60ea[_0x5d1a48];return _0x25fed3;}class CustomMeshComponent extends SceneComponent{get['threeObject'](){const _0x4f173e=_0x8e60;if(!this[_0x4f173e(0xa5)])throw new Error('CustomMeshComponent:\x20threeObject\x20is\x20null');return this[_0x4f173e(0xa5)];}set[_0x310dbb(0x9c)](_0x3818fa){const _0x1865b6=_0x310dbb;this['obj']=_0x3818fa,this['obj']&&(this[_0x1865b6(0xa5)][_0x1865b6(0x89)][_0x1865b6(0x92)]=this);}get[_0x310dbb(0x90)](){const _0xb292b8=_0x310dbb;if(!this[_0xb292b8(0xaa)])throw new Error('geometryPtr\x20is\x20null');return this[_0xb292b8(0xaa)][_0xb292b8(0x96)]();}set[_0x310dbb(0x90)](_0x1e45df){const _0x5ab538=_0x310dbb;let _0x380f99=this['app'][_0x5ab538(0x9a)]['addGeometryAsset'](_0x1e45df);this['geometryPtr']=_0x380f99;}get[_0x310dbb(0x79)](){const _0x560f6f=_0x310dbb;if(!this[_0x560f6f(0xaa)])throw new Error(_0x560f6f(0x98));return this[_0x560f6f(0xaa)];}set[_0x310dbb(0x79)](_0x2f47aa){const _0x3aa9e9=_0x310dbb;this['_geometryPtr']&&(this[_0x3aa9e9(0xaa)][_0x3aa9e9(0xc0)](),this['_geometryPtr']=null);this[_0x3aa9e9(0xaa)]=_0x2f47aa;let _0x2a0296=_0x2f47aa[_0x3aa9e9(0x96)]();this[_0x3aa9e9(0x9c)]&&_0x2a0296&&(this[_0x3aa9e9(0x9c)][_0x3aa9e9(0x90)]=_0x2a0296);}get[_0x310dbb(0xb2)](){const _0x9ea031=_0x310dbb;if(!this[_0x9ea031(0x7d)])throw new Error(_0x9ea031(0x83));let _0x56c779=this[_0x9ea031(0x7d)][_0x9ea031(0x96)]();if(!_0x56c779)throw new Error(_0x9ea031(0x78));return _0x56c779;}get['materialPtr'](){const _0x3bde87=_0x310dbb;if(!this['_materialPtr'])throw new Error(_0x3bde87(0x83));return this['_materialPtr'];}set[_0x310dbb(0xb2)](_0xc9a7c){const _0x1d959a=_0x310dbb;let _0x28b07b=this['app'][_0x1d959a(0x9a)][_0x1d959a(0xbc)](_0xc9a7c);this[_0x1d959a(0x85)]=_0x28b07b;}set[_0x310dbb(0x85)](_0x1ea398){const _0x1c33be=_0x310dbb;this[_0x1c33be(0x7d)]&&(this[_0x1c33be(0x7d)]['release'](),this['_materialPtr']=null);this['_materialPtr']=_0x1ea398;let _0xb5fab2=_0x1ea398[_0x1c33be(0x96)]();_0x1ea398['addRef'](),this[_0x1c33be(0x9c)]&&_0xb5fab2&&(this['threeObject'][_0x1c33be(0xb2)]=_0xb5fab2);}constructor(_0x3307b5,_0x404df1,_0x93c346,_0xbf6d5e){const _0xb22662=_0x310dbb;super(_0x3307b5,_0xbf6d5e),this['_meshData']=_0x404df1;let _0x4131e7=_0x3307b5['assetManager'][_0xb22662(0xbc)](_0x93c346);this[_0xb22662(0x7d)]=_0x4131e7,_0x4131e7[_0xb22662(0x86)]();const _0x3ba715=this[_0xb22662(0x9d)](_0x404df1);this[_0xb22662(0xaa)]=_0x3307b5[_0xb22662(0x9a)][_0xb22662(0x93)](_0x3ba715),this['threeObject'][_0xb22662(0xb2)]=_0x93c346,this[_0xb22662(0x9c)][_0xb22662(0x90)]=_0x3ba715,this[_0xb22662(0xb4)]=_0xb22662(0xa6);}['calculatePolygonArea'](_0x2d96e2){const _0x16c630=_0x310dbb;let _0x34a33a=0x0;const _0x2c4d80=_0x2d96e2[_0x16c630(0xb9)]/0x2;for(let _0x32a7e2=0x0;_0x32a7e2<_0x2c4d80;_0x32a7e2++){const _0x35090f=(_0x32a7e2+0x1)%_0x2c4d80,_0x918c78=_0x2d96e2[_0x32a7e2*0x2],_0x5a534c=_0x2d96e2[_0x32a7e2*0x2+0x1],_0x38769f=_0x2d96e2[_0x35090f*0x2],_0x14c96e=_0x2d96e2[_0x35090f*0x2+0x1];_0x34a33a+=_0x918c78*_0x14c96e-_0x38769f*_0x5a534c;}return _0x34a33a/0x2;}[_0x310dbb(0x9d)](_0x2ab202){const _0x1d9e53=_0x310dbb,_0x4eeae3=new webgpu.BufferGeometry();if(!_0x2ab202[_0x1d9e53(0x94)]||_0x2ab202[_0x1d9e53(0x94)][_0x1d9e53(0xb9)]===0x0)return console[_0x1d9e53(0xbe)](_0x1d9e53(0x7f)),_0x4eeae3;const _0x4ecc18=new Float32Array(_0x2ab202[_0x1d9e53(0x94)][_0x1d9e53(0xb9)]*0x3);for(let _0x63eea7=0x0;_0x63eea7<_0x2ab202[_0x1d9e53(0x94)][_0x1d9e53(0xb9)];_0x63eea7++){_0x4ecc18[_0x63eea7*0x3]=_0x2ab202['vertices'][_0x63eea7]['x'],_0x4ecc18[_0x63eea7*0x3+0x1]=_0x2ab202['vertices'][_0x63eea7]['y'],_0x4ecc18[_0x63eea7*0x3+0x2]=_0x2ab202['vertices'][_0x63eea7]['z'];}_0x4eeae3[_0x1d9e53(0x99)](_0x1d9e53(0x97),new webgpu.Float32BufferAttribute(_0x4ecc18,0x3));if(_0x2ab202[_0x1d9e53(0xbb)]&&_0x2ab202[_0x1d9e53(0xbb)][_0x1d9e53(0xb9)]>0x0)_0x4eeae3['setIndex'](_0x2ab202[_0x1d9e53(0xbb)]);else {const _0x190298=[];let _0x3c6773=Infinity,_0x2eacb5=-Infinity,_0x5c0f60=Infinity,_0xd091c3=-Infinity,_0x3d1eaa=Infinity,_0x3bfc9b=-Infinity;for(let _0x4923d6=0x0;_0x4923d6<_0x2ab202[_0x1d9e53(0x94)][_0x1d9e53(0xb9)];_0x4923d6++){const _0x2d37db=_0x2ab202['vertices'][_0x4923d6];_0x5c0f60=Math['min'](_0x5c0f60,_0x2d37db['x']),_0xd091c3=Math[_0x1d9e53(0x7e)](_0xd091c3,_0x2d37db['x']),_0x3c6773=Math[_0x1d9e53(0x8a)](_0x3c6773,_0x2d37db['y']),_0x2eacb5=Math[_0x1d9e53(0x7e)](_0x2eacb5,_0x2d37db['y']),_0x3d1eaa=Math[_0x1d9e53(0x8a)](_0x3d1eaa,_0x2d37db['z']),_0x3bfc9b=Math[_0x1d9e53(0x7e)](_0x3bfc9b,_0x2d37db['z']);}const _0x27581e=_0xd091c3-_0x5c0f60,_0x3657a8=_0x2eacb5-_0x3c6773,_0x2bad27=_0x3bfc9b-_0x3d1eaa;let _0x372c34='XY';if(_0x3657a8<=_0x27581e&&_0x3657a8<=_0x2bad27){_0x372c34='XZ';for(let _0x23ea94=0x0;_0x23ea94<_0x2ab202[_0x1d9e53(0x94)][_0x1d9e53(0xb9)];_0x23ea94++){_0x190298[_0x1d9e53(0xae)](_0x2ab202[_0x1d9e53(0x94)][_0x23ea94]['x']),_0x190298[_0x1d9e53(0xae)](_0x2ab202[_0x1d9e53(0x94)][_0x23ea94]['z']);}}else {if(_0x27581e<=_0x3657a8&&_0x27581e<=_0x2bad27){_0x372c34='YZ';for(let _0x31695f=0x0;_0x31695f<_0x2ab202['vertices']['length'];_0x31695f++){_0x190298[_0x1d9e53(0xae)](_0x2ab202['vertices'][_0x31695f]['y']),_0x190298[_0x1d9e53(0xae)](_0x2ab202[_0x1d9e53(0x94)][_0x31695f]['z']);}}else {_0x372c34='XY';for(let _0x3e1a28=0x0;_0x3e1a28<_0x2ab202[_0x1d9e53(0x94)][_0x1d9e53(0xb9)];_0x3e1a28++){_0x190298[_0x1d9e53(0xae)](_0x2ab202['vertices'][_0x3e1a28]['x']),_0x190298[_0x1d9e53(0xae)](_0x2ab202[_0x1d9e53(0x94)][_0x3e1a28]['y']);}}}const _0x421e3d=this['calculatePolygonArea'](_0x190298),_0x338942=_0x421e3d<0x0;if(_0x338942){console['warn'](_0x1d9e53(0xa4)),_0x190298['reverse']();const _0x2690eb=[];for(let _0x52b79e=_0x190298[_0x1d9e53(0xb9)]-0x2;_0x52b79e>=0x0;_0x52b79e-=0x2){_0x2690eb[_0x1d9e53(0xae)](_0x190298[_0x52b79e],_0x190298[_0x52b79e+0x1]);}_0x190298[_0x1d9e53(0xb9)]=0x0,_0x190298[_0x1d9e53(0xae)](..._0x2690eb);}try{const _0x43873c=_0x430ee4(_0x190298,undefined,0x2);if(_0x43873c&&_0x43873c[_0x1d9e53(0xb9)]>0x0){if(_0x338942)for(let _0x128e0f=0x0;_0x128e0f<_0x43873c['length'];_0x128e0f+=0x3){const _0x3a072d=_0x43873c[_0x128e0f];_0x43873c[_0x128e0f]=_0x43873c[_0x128e0f+0x2],_0x43873c[_0x128e0f+0x2]=_0x3a072d;}_0x4eeae3[_0x1d9e53(0x88)](_0x43873c),console['log'](_0x1d9e53(0xa1),{'planeType':_0x372c34,'vertexCount':_0x2ab202[_0x1d9e53(0x94)]['length'],'triangleCount':_0x43873c[_0x1d9e53(0xb9)]/0x3,'area':Math[_0x1d9e53(0x87)](_0x421e3d),'wasClockwise':_0x338942,'indices':Array[_0x1d9e53(0x7a)](_0x43873c)});}else console[_0x1d9e53(0xa7)](_0x1d9e53(0xb8));}catch(_0x220277){console[_0x1d9e53(0xbe)](_0x1d9e53(0xab),_0x220277);}}if(_0x2ab202[_0x1d9e53(0x7b)]&&_0x2ab202['normals'][_0x1d9e53(0xb9)]===_0x2ab202['vertices']['length']){const _0x26bee0=new Float32Array(_0x2ab202[_0x1d9e53(0x7b)]['length']*0x3);for(let _0x36317d=0x0;_0x36317d<_0x2ab202[_0x1d9e53(0x7b)][_0x1d9e53(0xb9)];_0x36317d++){_0x26bee0[_0x36317d*0x3]=_0x2ab202['normals'][_0x36317d]['x'],_0x26bee0[_0x36317d*0x3+0x1]=_0x2ab202[_0x1d9e53(0x7b)][_0x36317d]['y'],_0x26bee0[_0x36317d*0x3+0x2]=_0x2ab202[_0x1d9e53(0x7b)][_0x36317d]['z'];}_0x4eeae3[_0x1d9e53(0x99)]('normal',new webgpu.Float32BufferAttribute(_0x26bee0,0x3));}else _0x4eeae3[_0x1d9e53(0x95)]();if(_0x2ab202[_0x1d9e53(0x84)]&&_0x2ab202[_0x1d9e53(0x84)][_0x1d9e53(0xb9)]>0x0){const _0x49c4f0=new Float32Array(_0x2ab202[_0x1d9e53(0x84)][_0x1d9e53(0xb9)]*0x2);for(let _0x76eea5=0x0;_0x76eea5<_0x2ab202[_0x1d9e53(0x84)][_0x1d9e53(0xb9)];_0x76eea5++){_0x49c4f0[_0x76eea5*0x2]=_0x2ab202[_0x1d9e53(0x84)][_0x76eea5]['x'],_0x49c4f0[_0x76eea5*0x2+0x1]=_0x2ab202[_0x1d9e53(0x84)][_0x76eea5]['y'];}_0x4eeae3[_0x1d9e53(0x99)]('uv',new webgpu.Float32BufferAttribute(_0x49c4f0,0x2));}if(_0x2ab202[_0x1d9e53(0x81)]&&_0x2ab202[_0x1d9e53(0x81)][_0x1d9e53(0xb9)]===_0x2ab202[_0x1d9e53(0x94)]['length']){const _0x50897b=new Float32Array(_0x2ab202[_0x1d9e53(0x81)]['length']*0x3);for(let _0x2c9040=0x0;_0x2c9040<_0x2ab202[_0x1d9e53(0x81)]['length'];_0x2c9040++){_0x50897b[_0x2c9040*0x3]=_0x2ab202['colors'][_0x2c9040]['r'],_0x50897b[_0x2c9040*0x3+0x1]=_0x2ab202['colors'][_0x2c9040]['g'],_0x50897b[_0x2c9040*0x3+0x2]=_0x2ab202[_0x1d9e53(0x81)][_0x2c9040]['b'];}_0x4eeae3[_0x1d9e53(0x99)]('color',new webgpu.Float32BufferAttribute(_0x50897b,0x3));}return _0x4eeae3;}set[_0x310dbb(0xac)](_0x3edd02){const _0x52a1d1=_0x310dbb;var _0xd8de41,_0x362230,_0x1a082c;this[_0x52a1d1(0xaa)]&&this[_0x52a1d1(0xaa)][_0x52a1d1(0xc0)]();const _0x1868e5=this[_0x52a1d1(0x9d)](_0x3edd02);this[_0x52a1d1(0xaa)]=this[_0x52a1d1(0xa2)]['assetManager'][_0x52a1d1(0x93)](_0x1868e5),this['threeObject']['geometry']=_0x1868e5,this[_0x52a1d1(0xa0)]={'vertices':_0x3edd02[_0x52a1d1(0x94)][_0x52a1d1(0xad)](_0x1b5410=>_0x1b5410[_0x52a1d1(0xb7)]()),'indices':_0x3edd02[_0x52a1d1(0xbb)]?[..._0x3edd02[_0x52a1d1(0xbb)]]:undefined,'normals':(_0xd8de41=_0x3edd02[_0x52a1d1(0x7b)])===null||_0xd8de41===void 0?void 0:_0xd8de41[_0x52a1d1(0xad)](_0x466067=>_0x466067[_0x52a1d1(0xb7)]()),'uvs':(_0x362230=_0x3edd02[_0x52a1d1(0x84)])===null||_0x362230===void 0?void 0:_0x362230[_0x52a1d1(0xad)](_0x233cc7=>_0x233cc7[_0x52a1d1(0xb7)]()),'colors':(_0x1a082c=_0x3edd02[_0x52a1d1(0x81)])===null||_0x1a082c===void 0?void 0:_0x1a082c['map'](_0x2f9d31=>_0x2f9d31[_0x52a1d1(0xb7)]())},this[_0x52a1d1(0x7c)]&&this[_0x52a1d1(0x7c)][_0x52a1d1(0xbf)][_0x52a1d1(0x8c)]();}get[_0x310dbb(0xac)](){const _0x3742e1=_0x310dbb;return this[_0x3742e1(0xa0)];}[_0x310dbb(0x8f)](){return new webgpu.Mesh();}set['castShadow'](_0x3aeb79){const _0x5c6030=_0x310dbb;if(this[_0x5c6030(0x9c)])this[_0x5c6030(0x9c)][_0x5c6030(0xb3)]=_0x3aeb79;}get['castShadow'](){const _0x590ee7=_0x310dbb;return this[_0x590ee7(0x9c)]?this[_0x590ee7(0x9c)][_0x590ee7(0xb3)]:![];}set[_0x310dbb(0xb6)](_0x5e3ed7){const _0x100a02=_0x310dbb;if(!this[_0x100a02(0x9c)])return;this[_0x100a02(0x9c)][_0x100a02(0xb6)]=_0x5e3ed7;}get[_0x310dbb(0xb6)](){const _0x51af68=_0x310dbb;return this[_0x51af68(0x9c)]?this['threeObject']['receiveShadow']:![];}['getBoundsCenterPosition'](){const _0x1c4520=_0x310dbb;let _0xd9cd3=new webgpu.Vector3();return this[_0x1c4520(0xa9)]()[_0x1c4520(0xbd)](_0xd9cd3),_0xd9cd3;}[_0x310dbb(0x8b)](){const _0x5abd02=_0x310dbb;let _0x31c94f=new webgpu.Vector3(),_0x22666f=this[_0x5abd02(0xa9)]();return _0x22666f[_0x5abd02(0xbd)](_0x31c94f),_0x31c94f['y']=_0x22666f[_0x5abd02(0x7e)]['y'],_0x31c94f;}[_0x310dbb(0xaf)](){const _0x5185de=_0x310dbb;let _0x21395f=new webgpu.Vector3(),_0x584955=this[_0x5185de(0xa9)]();return _0x584955[_0x5185de(0xbd)](_0x21395f),_0x21395f['y']=_0x584955[_0x5185de(0x8a)]['y'],_0x21395f;}[_0x310dbb(0x80)](){const _0x3ca505=_0x310dbb;var _0xf50807,_0x1eb9a9;this[_0x3ca505(0x9c)]&&this[_0x3ca505(0x9c)][_0x3ca505(0x8d)](),(_0xf50807=this[_0x3ca505(0xaa)])===null||_0xf50807===void 0?void 0:_0xf50807[_0x3ca505(0xc0)](),(_0x1eb9a9=this[_0x3ca505(0x7d)])===null||_0x1eb9a9===void 0?void 0:_0x1eb9a9[_0x3ca505(0xc0)](),super[_0x3ca505(0x80)]();}}function _0xf110(){const _0x3d3345=['max','CustomMeshComponent:\x20Invalid\x20vertices\x20data','destroyObject','colors','460261CWJIYr','materialPtr\x20is\x20null','uvs','materialPtr','addRef','abs','setIndex','userData','min','getBoundsTopCenterPosition','markRenderStateDirty','removeFromParent','52aipLTY','createDefaultObject','geometry','5468988ZWkQEp','LYObject','addGeometryAsset','vertices','computeVertexNormals','getValue','position','geometryPtr\x20is\x20null','setAttribute','assetManager','516789hLMRCm','threeObject','constructGeometry','5NwLRwi','928216BqJHsk','_meshData','[CustomMeshComponent]\x20Earcut\x20triangulation\x20success:','app','14OoGXOs','CustomMeshComponent:\x20Vertices\x20are\x20in\x20clockwise\x20order,\x20reversing...','obj','CustomMeshComponent','warn','93969QSDmNj','getBounds','_geometryPtr','CustomMeshComponent:\x20Earcut\x20triangulation\x20failed:','meshData','map','push','getBoundsBottomCenterPosition','10SjIfqo','7066004lvxPqX','material','castShadow','name','2gYZyoe','receiveShadow','clone','CustomMeshComponent:\x20Earcut\x20triangulation\x20returned\x20empty\x20result','length','2413470NgswUZ','indices','addMaterialAsset','getCenter','error','viewport','release','material\x20is\x20null','geometryPtr','from','normals','world','_materialPtr'];_0xf110=function(){return _0x3d3345;};return _0xf110();}
3653
117
 
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';
118
+ (function(_0x28a6ee,_0x42b0b3){var _0x5bed02=_0x83d0,_0x418dd7=_0x28a6ee();while(!![]){try{var _0x4f3c5c=-parseInt(_0x5bed02(0xd2))/0x1+-parseInt(_0x5bed02(0xd8))/0x2*(-parseInt(_0x5bed02(0xd4))/0x3)+parseInt(_0x5bed02(0xd9))/0x4*(-parseInt(_0x5bed02(0xd6))/0x5)+parseInt(_0x5bed02(0xdb))/0x6+parseInt(_0x5bed02(0xd3))/0x7*(-parseInt(_0x5bed02(0xd5))/0x8)+parseInt(_0x5bed02(0xda))/0x9+-parseInt(_0x5bed02(0xdc))/0xa*(parseInt(_0x5bed02(0xd7))/0xb);if(_0x4f3c5c===_0x42b0b3)break;else _0x418dd7['push'](_0x418dd7['shift']());}catch(_0x568fd0){_0x418dd7['push'](_0x418dd7['shift']());}}}(_0x4a5b,0xe914e));function _0x83d0(_0x120b70,_0x12162c){_0x120b70=_0x120b70-0xd2;var _0x4a5bbb=_0x4a5b();var _0x83d09c=_0x4a5bbb[_0x120b70];return _0x83d09c;}class SphereComponent extends MeshComponent{constructor(_0x40a1ec,_0xa2757a,_0x475f30=new webgpu.MeshBasicMaterial(),_0x1e553d=0x20,_0x5bf34f=0x10,_0x12eaee){super(_0x40a1ec,new webgpu.SphereGeometry(_0xa2757a,_0x1e553d,_0x5bf34f),_0x475f30,_0x12eaee);}}function _0x4a5b(){var _0x548e8c=['220881lTJGaU','26616OijIOj','20JjgeaN','467192atXWin','34cbimKB','58288dADnxy','16345305jPRTmA','8422956EKmxoz','670VMBwca','330221XPfHKx','595mqthnp'];_0x4a5b=function(){return _0x548e8c;};return _0x4a5b();}
3695
119
 
3696
- const DefaultSSRParam = {
3697
- type: exports.PostProcessStepType.ScreenSpaceReflection,
3698
- maxDistance: 0.5,
3699
- opacity: 1,
3700
- thickness: 0.015,
3701
- };
120
+ var _0x2dbc96=_0x40d1;function _0x40d1(_0x48eab4,_0x390576){_0x48eab4=_0x48eab4-0x11f;var _0x138af1=_0x138a();var _0x40d143=_0x138af1[_0x48eab4];return _0x40d143;}function _0x138a(){var _0x5440e7=['966ZDhEsS','isHoverEnabled','3156030ZOaLCk','4118082cxlVaN','copy','parentNode','obj','5781112COuROy','isClickEnabled','destroy','620RHyggT','userData','setVisible','element','innerHTML','threeObject','9gzFswU','remove','412640fEKTau','4920895CLsmkB','LYObject','491283vtuYrF','center'];_0x138a=function(){return _0x5440e7;};return _0x138a();}(function(_0x1b1a19,_0xf91561){var _0x2ff9f7=_0x40d1,_0x584f95=_0x1b1a19();while(!![]){try{var _0x12076d=parseInt(_0x2ff9f7(0x120))/0x1+-parseInt(_0x2ff9f7(0x134))/0x2+parseInt(_0x2ff9f7(0x122))/0x3*(parseInt(_0x2ff9f7(0x12c))/0x4)+-parseInt(_0x2ff9f7(0x124))/0x5+parseInt(_0x2ff9f7(0x125))/0x6+-parseInt(_0x2ff9f7(0x135))/0x7+-parseInt(_0x2ff9f7(0x129))/0x8*(-parseInt(_0x2ff9f7(0x132))/0x9);if(_0x12076d===_0xf91561)break;else _0x584f95['push'](_0x584f95['shift']());}catch(_0x37b58d){_0x584f95['push'](_0x584f95['shift']());}}}(_0x138a,0x64044));class LabelComponent extends SceneComponent{get[_0x2dbc96(0x131)](){return this['obj'];}set[_0x2dbc96(0x131)](_0x1fd669){var _0x3ee4a9=_0x2dbc96;this[_0x3ee4a9(0x128)]=_0x1fd669,this[_0x3ee4a9(0x128)]&&(this['obj'][_0x3ee4a9(0x12d)][_0x3ee4a9(0x11f)]=this);}constructor(_0x56b573,_0x485893,_0x529e96=new webgpu.Vector2(0.5,0x1),_0x2f712d){var _0x5f52d2=_0x2dbc96;super(_0x56b573,_0x2f712d),this[_0x5f52d2(0x128)]=new CSS2DRenderer_js.CSS2DObject(_0x485893),this[_0x5f52d2(0x128)][_0x5f52d2(0x121)][_0x5f52d2(0x126)](_0x529e96);}set[_0x2dbc96(0x123)](_0x5daf08){return;}set[_0x2dbc96(0x12a)](_0x4d9716){return;}['setVisible'](_0x50c800){var _0xad9ba7=_0x2dbc96;super[_0xad9ba7(0x12e)](_0x50c800);}[_0x2dbc96(0x12b)](){var _0x10003f=_0x2dbc96;this[_0x10003f(0x131)][_0x10003f(0x12f)]&&this[_0x10003f(0x131)][_0x10003f(0x12f)][_0x10003f(0x127)]&&(this[_0x10003f(0x131)][_0x10003f(0x12f)][_0x10003f(0x130)]='',this[_0x10003f(0x131)]['element'][_0x10003f(0x133)]()),super[_0x10003f(0x12b)]();}}
3702
121
 
3703
- const DefaultAAParams = {
3704
- type: exports.PostProcessStepType.Antialiasing,
3705
- method: "fxaa"
3706
- };
122
+ function _0x34f9(){const _0x17ac0a=['990CqSWHj','3EmxTIF','67119lGOdvq','1958716uyqdnx','145144SmWAGL','207vrupta','7BhdsHW','108202eDlZUL','5911301zXukXT','693935jvFTTa','ScreenSpaceReflection','3227DRSsUB','10spiYnK','1332lhdAGx'];_0x34f9=function(){return _0x17ac0a;};return _0x34f9();}const _0x269b0c=_0x2b89;function _0x2b89(_0x969b62,_0x1ff007){_0x969b62=_0x969b62-0x136;const _0x34f916=_0x34f9();let _0x2b896c=_0x34f916[_0x969b62];return _0x2b896c;}(function(_0x5a4f00,_0x115b83){const _0x9175fc=_0x2b89,_0x1aea70=_0x5a4f00();while(!![]){try{const _0x128374=-parseInt(_0x9175fc(0x137))/0x1*(-parseInt(_0x9175fc(0x138))/0x2)+parseInt(_0x9175fc(0x140))/0x3*(-parseInt(_0x9175fc(0x142))/0x4)+parseInt(_0x9175fc(0x13a))/0x5+-parseInt(_0x9175fc(0x13f))/0x6*(parseInt(_0x9175fc(0x13c))/0x7)+parseInt(_0x9175fc(0x143))/0x8*(parseInt(_0x9175fc(0x136))/0x9)+-parseInt(_0x9175fc(0x13d))/0xa*(-parseInt(_0x9175fc(0x139))/0xb)+parseInt(_0x9175fc(0x13e))/0xc*(-parseInt(_0x9175fc(0x141))/0xd);if(_0x128374===_0x115b83)break;else _0x1aea70['push'](_0x1aea70['shift']());}catch(_0xefcdac){_0x1aea70['push'](_0x1aea70['shift']());}}}(_0x34f9,0x51619));const DefaultSSRParam={'type':exports.PostProcessStepType[_0x269b0c(0x13b)],'maxDistance':0.5,'opacity':0x1,'thickness':0.015};
3707
123
 
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
- }
124
+ const _0x3beaab=_0xfcc8;(function(_0x4e8943,_0x5595dd){const _0x5152fd=_0xfcc8,_0x1aed2e=_0x4e8943();while(!![]){try{const _0x3799c2=parseInt(_0x5152fd(0x6e))/0x1+parseInt(_0x5152fd(0x75))/0x2*(parseInt(_0x5152fd(0x78))/0x3)+-parseInt(_0x5152fd(0x71))/0x4*(-parseInt(_0x5152fd(0x6f))/0x5)+parseInt(_0x5152fd(0x73))/0x6+-parseInt(_0x5152fd(0x70))/0x7+-parseInt(_0x5152fd(0x76))/0x8+-parseInt(_0x5152fd(0x74))/0x9*(parseInt(_0x5152fd(0x72))/0xa);if(_0x3799c2===_0x5595dd)break;else _0x1aed2e['push'](_0x1aed2e['shift']());}catch(_0x12268c){_0x1aed2e['push'](_0x1aed2e['shift']());}}}(_0x2793,0x3632d));function _0x2793(){const _0x4e3729=['840110HcUDZL','680736CKRKlH','36nwlkrm','270974XONEAj','3344848CZbgKa','Antialiasing','3GCKanM','372498wzozCo','2085735zyzTtV','437087sQXtui','4AkoigJ'];_0x2793=function(){return _0x4e3729;};return _0x2793();}function _0xfcc8(_0x11ff7f,_0x5940cd){_0x11ff7f=_0x11ff7f-0x6e;const _0x27932a=_0x2793();let _0xfcc81a=_0x27932a[_0x11ff7f];return _0xfcc81a;}const DefaultAAParams={'type':exports.PostProcessStepType[_0x3beaab(0x77)],'method':'fxaa'};
3730
125
 
3731
- class TransformGizmo extends Pawn {
3732
- get control() {
3733
- if (!this._control) {
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
- }
126
+ const _0x31c40c=_0x5bc1;(function(_0xd21611,_0x400d16){const _0x4211d5=_0x5bc1,_0x15b586=_0xd21611();while(!![]){try{const _0x432aca=-parseInt(_0x4211d5(0x100))/0x1+parseInt(_0x4211d5(0xfd))/0x2+parseInt(_0x4211d5(0xf1))/0x3*(-parseInt(_0x4211d5(0xf2))/0x4)+parseInt(_0x4211d5(0xf7))/0x5*(-parseInt(_0x4211d5(0xfe))/0x6)+-parseInt(_0x4211d5(0xf4))/0x7*(parseInt(_0x4211d5(0xf8))/0x8)+parseInt(_0x4211d5(0xf9))/0x9+parseInt(_0x4211d5(0xff))/0xa;if(_0x432aca===_0x400d16)break;else _0x15b586['push'](_0x15b586['shift']());}catch(_0x3a2167){_0x15b586['push'](_0x15b586['shift']());}}}(_0x2b4b,0xba81b));class FirstPerson extends Pawn{constructor(_0x43e562){const _0x2a6a78=_0x5bc1;super(_0x43e562),this[_0x2a6a78(0xfa)]=new PointerLockControls_js.PointerLockControls(_0x43e562[_0x2a6a78(0xf6)],_0x43e562[_0x2a6a78(0xfb)][_0x2a6a78(0xf3)]);}[_0x31c40c(0x102)](){const _0x3d29b9=_0x31c40c;var _0x11af18;if(!this[_0x3d29b9(0xfa)]||!((_0x11af18=this[_0x3d29b9(0x103)])===null||_0x11af18===void 0?void 0:_0x11af18[_0x3d29b9(0xf6)]))return null;const _0x5a881e=this[_0x3d29b9(0x103)][_0x3d29b9(0xf6)][_0x3d29b9(0x101)][_0x3d29b9(0xf5)](),_0x2510f5=this[_0x3d29b9(0x103)][_0x3d29b9(0xf6)][_0x3d29b9(0xfc)]['clone'](),_0x403874=0x0;return {'position':_0x5a881e,'quaternion':_0x2510f5,'distance':_0x403874};}}function _0x5bc1(_0x4eb097,_0x4cb884){_0x4eb097=_0x4eb097-0xf1;const _0x2b4b13=_0x2b4b();let _0x5bc173=_0x2b4b13[_0x4eb097];return _0x5bc173;}function _0x2b4b(){const _0x2ff050=['getFocuingData','controller','93bPAmRX','38804dulhLk','canvas','3420473YEjdan','clone','camera','5520495NlEXGe','16muCgFb','4324365KMRnan','_control','viewPort','quaternion','907344bwSZmV','6itHsWc','35838220YLALgn','1371940aBXRSv','position'];_0x2b4b=function(){return _0x2ff050;};return _0x2b4b();}
127
+
128
+ const _0x18f39c=_0x56a7;(function(_0x176ec0,_0x516956){const _0x3c3fb6=_0x56a7,_0xaff221=_0x176ec0();while(!![]){try{const _0x1f3407=parseInt(_0x3c3fb6(0x153))/0x1*(parseInt(_0x3c3fb6(0x180))/0x2)+parseInt(_0x3c3fb6(0x16c))/0x3*(parseInt(_0x3c3fb6(0x188))/0x4)+parseInt(_0x3c3fb6(0x16b))/0x5*(parseInt(_0x3c3fb6(0x178))/0x6)+parseInt(_0x3c3fb6(0x170))/0x7+parseInt(_0x3c3fb6(0x155))/0x8+parseInt(_0x3c3fb6(0x15a))/0x9*(-parseInt(_0x3c3fb6(0x18c))/0xa)+parseInt(_0x3c3fb6(0x1a4))/0xb*(-parseInt(_0x3c3fb6(0x193))/0xc);if(_0x1f3407===_0x516956)break;else _0xaff221['push'](_0xaff221['shift']());}catch(_0x51ee88){_0xaff221['push'](_0xaff221['shift']());}}}(_0x9bb4,0xb7a9b));function _0x9bb4(){const _0x585742=['targetMatrixMap','70281yBcZhX','removeEventListener','getMatrixInWorld','traverse','viewPort','dragging-changed','includes','primaryTarget','getRotationnSnap','Control\x20not\x20initialized','_control','dispose','getMode','setTarget','add','multiplyMatrices','onDraggingChangedEvent','3745GlcwYc','147zrblNb','showZ','multiply','showX','9487499ZOrQqh','forEach','onObjectChanged','onDraggingFunction','isTickEnabled','TransformHelperObject','setScaleSnap','onChangeEvent','11514dVOEyu','onUpdateFunction','quaternion','onDraggingChanged','enabled','setAxis','control','position','4626EZhnLM','targets','destroy','getTranslationSnap','userData','scale','setSpace','setMode','77048uOuRUm','enable','onChange','showY','1630XOnaZJ','helperObject','invert','scene','updateMatrixWorld','markRenderStateDirty','decompose','48233544MOpeJh','refresh','attach','objectChange','clear','rayIgnored','helperScene','get','setRotationSnap','gizmoScene','remove','translationSnap','unpossess','camera','setTranslationSnap','onTransforming','possess','11mmDsPP','name','addEventListener','getTargetScene','getHelper','511kFQqHP','setSize','9009144EXwLoN','onObjectChangeEvent','getScaleSnap','set'];_0x9bb4=function(){return _0x585742;};return _0x9bb4();}function _0x56a7(_0x4d6d74,_0x36083f){_0x4d6d74=_0x4d6d74-0x153;const _0x9bb4be=_0x9bb4();let _0x56a765=_0x9bb4be[_0x4d6d74];return _0x56a765;}class TransformGizmo extends Pawn{get[_0x18f39c(0x17e)](){const _0x4b8e13=_0x18f39c;if(!this[_0x4b8e13(0x164)])throw new Error(_0x4b8e13(0x163));return this['_control'];}constructor(_0x2d867b,_0x4cf4c5){const _0x331fe6=_0x18f39c;var _0x2628a3;super(_0x2d867b),this[_0x331fe6(0x164)]=null,this[_0x331fe6(0x18d)]=new webgpu.Object3D(),this['targets']=[],this[_0x331fe6(0x161)]=null,this[_0x331fe6(0x159)]=new Map(),this[_0x331fe6(0x19c)]=null,this['onDraggingChangedEvent']=_0x336e0b=>{const _0x3c5902=_0x331fe6;this[_0x3c5902(0x17b)](_0x336e0b);},this[_0x331fe6(0x156)]=()=>{const _0x2c8bcc=_0x331fe6;this[_0x2c8bcc(0x172)]();},this['onChangeEvent']=()=>{const _0x5ecbff=_0x331fe6;this[_0x5ecbff(0x18a)]();},this['onUpdateFunction']=null,this[_0x331fe6(0x173)]=null;let _0x1f9998=_0x2d867b[_0x331fe6(0x15e)]['canvas'];if(!_0x1f9998)throw new Error('TransformGizmo:Canvas\x20not\x20found');this[_0x331fe6(0x164)]=new TransformControls_js.TransformControls(_0x2d867b[_0x331fe6(0x1a0)],_0x1f9998),this['control'][_0x331fe6(0x1a8)]()[_0x331fe6(0x15d)](_0x4ba84c=>{const _0x424a9c=_0x331fe6;_0x4ba84c[_0x424a9c(0x184)][_0x424a9c(0x198)]=!![];}),this[_0x331fe6(0x18d)][_0x331fe6(0x1a5)]=_0x331fe6(0x175),this[_0x331fe6(0x19c)]=(_0x2628a3=_0x4cf4c5===null||_0x4cf4c5===void 0?void 0:_0x4cf4c5[_0x331fe6(0x199)])!==null&&_0x2628a3!==void 0?_0x2628a3:null;}[_0x18f39c(0x1a7)](){const _0x1ef84c=_0x18f39c;var _0x625e8e;return (_0x625e8e=this[_0x1ef84c(0x19c)])!==null&&_0x625e8e!==void 0?_0x625e8e:this['controller']['world'][_0x1ef84c(0x18f)];}[_0x18f39c(0x1a3)](){const _0x12b739=_0x18f39c,_0x127fe1=this[_0x12b739(0x1a7)]();_0x127fe1[_0x12b739(0x168)](this['helperObject']),_0x127fe1[_0x12b739(0x168)](this['control']['getHelper']()),this['control'][_0x12b739(0x195)](this[_0x12b739(0x18d)]),this[_0x12b739(0x17e)][_0x12b739(0x1a6)]('change',this[_0x12b739(0x177)]),this[_0x12b739(0x17e)][_0x12b739(0x1a6)](_0x12b739(0x15f),this[_0x12b739(0x16a)]),this[_0x12b739(0x17e)]['addEventListener'](_0x12b739(0x196),this[_0x12b739(0x156)]);}['unpossess'](){const _0x55975e=_0x18f39c;this['control'][_0x55975e(0x15b)]('change',this[_0x55975e(0x177)]),this[_0x55975e(0x17e)]['removeEventListener']('dragging-changed',this['onDraggingChangedEvent']),this[_0x55975e(0x17e)][_0x55975e(0x15b)](_0x55975e(0x196),this[_0x55975e(0x156)]),this[_0x55975e(0x17e)]['detach']();const _0x3a6561=this[_0x55975e(0x1a7)]();_0x3a6561[_0x55975e(0x19d)](this[_0x55975e(0x18d)]),_0x3a6561['remove'](this[_0x55975e(0x17e)][_0x55975e(0x1a8)]());}[_0x18f39c(0x194)](){const _0x1e18a1=_0x18f39c;if(!this[_0x1e18a1(0x161)])return;this['control']['detach']();const _0x4d9f90=this[_0x1e18a1(0x1a7)]();_0x4d9f90['remove'](this[_0x1e18a1(0x18d)]),this[_0x1e18a1(0x159)][_0x1e18a1(0x197)]();let _0x38d2fe=this[_0x1e18a1(0x161)][_0x1e18a1(0x15c)]();_0x38d2fe['decompose'](this[_0x1e18a1(0x18d)]['position'],this[_0x1e18a1(0x18d)][_0x1e18a1(0x17a)],this[_0x1e18a1(0x18d)][_0x1e18a1(0x185)]),_0x4d9f90[_0x1e18a1(0x168)](this[_0x1e18a1(0x17e)][_0x1e18a1(0x1a8)]()),_0x4d9f90[_0x1e18a1(0x168)](this['helperObject']),this['control'][_0x1e18a1(0x195)](this[_0x1e18a1(0x18d)]),this['targets'][_0x1e18a1(0x171)](_0x763f1e=>{const _0x467b79=_0x1e18a1,_0x2e2717=_0x763f1e[_0x467b79(0x15c)](),_0x5a46ac=_0x38d2fe['clone']()['invert']()['multiply'](_0x2e2717);this[_0x467b79(0x159)][_0x467b79(0x158)](_0x763f1e,_0x5a46ac);});}['onChange'](){const _0x3a4ecf=_0x18f39c;this['controller']['viewPort'][_0x3a4ecf(0x191)]();}['onDraggingChanged'](_0x47716a){const _0x374412=_0x18f39c;if(this[_0x374412(0x161)]){let _0x34ea54=this[_0x374412(0x161)]['getMatrixInWorld']();_0x34ea54['decompose'](this['helperObject'][_0x374412(0x17f)],this[_0x374412(0x18d)][_0x374412(0x17a)],this[_0x374412(0x18d)]['scale']);}this[_0x374412(0x173)]&&this['onDraggingFunction'](_0x47716a['value']);}[_0x18f39c(0x172)](){const _0x16fff1=_0x18f39c;if(this['primaryTarget']){this[_0x16fff1(0x18d)][_0x16fff1(0x190)](!![]);const _0x778619=this['helperObject']['matrixWorld']['clone']();this[_0x16fff1(0x161)][_0x16fff1(0x1a2)](_0x778619),this[_0x16fff1(0x181)][_0x16fff1(0x171)](_0x125104=>{const _0x44df4a=_0x16fff1,_0x136e34=this['targetMatrixMap'][_0x44df4a(0x19a)](_0x125104);if(_0x136e34){const _0x13fd88=new webgpu.Matrix4()[_0x44df4a(0x169)](_0x778619,_0x136e34);_0x125104[_0x44df4a(0x1a2)](_0x13fd88);}});}this[_0x16fff1(0x179)]&&this[_0x16fff1(0x179)]();}set[_0x18f39c(0x189)](_0x2b0010){const _0x1147da=_0x18f39c;this[_0x1147da(0x17e)][_0x1147da(0x17c)]=_0x2b0010;}[_0x18f39c(0x167)](_0x1ae7a5,_0x8d9cb9,_0xd38b87=null,_0x3ea8d1=null){const _0x56b70f=_0x18f39c;this[_0x56b70f(0x159)]['clear']();let _0x15fba1=_0x1ae7a5[_0x56b70f(0x15c)]();_0x15fba1[_0x56b70f(0x192)](this[_0x56b70f(0x18d)][_0x56b70f(0x17f)],this[_0x56b70f(0x18d)][_0x56b70f(0x17a)],this['helperObject']['scale']);const _0x47e5fb=this['getTargetScene']();_0x47e5fb[_0x56b70f(0x168)](this[_0x56b70f(0x17e)][_0x56b70f(0x1a8)]()),this[_0x56b70f(0x161)]=_0x1ae7a5,this['targets']=_0x8d9cb9,this[_0x56b70f(0x181)]['forEach'](_0x24ac4b=>{const _0x31e4f1=_0x56b70f,_0x128047=_0x24ac4b[_0x31e4f1(0x15c)](),_0x238e56=_0x15fba1['clone']()[_0x31e4f1(0x18e)]()[_0x31e4f1(0x16e)](_0x128047);this[_0x31e4f1(0x159)][_0x31e4f1(0x158)](_0x24ac4b,_0x238e56);}),_0xd38b87&&(this[_0x56b70f(0x179)]=_0xd38b87),_0x3ea8d1&&(this[_0x56b70f(0x173)]=_0x3ea8d1),this[_0x56b70f(0x174)]=!![];}[_0x18f39c(0x166)](){const _0x880881=_0x18f39c;return this[_0x880881(0x17e)]['getMode']();}[_0x18f39c(0x187)](_0x3fbddd){const _0x2d6d4d=_0x18f39c;this[_0x2d6d4d(0x17e)][_0x2d6d4d(0x187)](_0x3fbddd);}[_0x18f39c(0x186)](_0x57fdbb){const _0x1152b1=_0x18f39c;this['control'][_0x1152b1(0x186)](_0x57fdbb);}[_0x18f39c(0x17d)](_0x24a26d){const _0x1cdcf4=_0x18f39c;this[_0x1cdcf4(0x17e)][_0x1cdcf4(0x16f)]=_0x24a26d?_0x24a26d===null||_0x24a26d===void 0?void 0:_0x24a26d['includes']('X'):![],this[_0x1cdcf4(0x17e)][_0x1cdcf4(0x18b)]=_0x24a26d?_0x24a26d===null||_0x24a26d===void 0?void 0:_0x24a26d[_0x1cdcf4(0x160)]('Y'):![],this['control'][_0x1cdcf4(0x16d)]=_0x24a26d?_0x24a26d===null||_0x24a26d===void 0?void 0:_0x24a26d[_0x1cdcf4(0x160)]('Z'):![];}[_0x18f39c(0x154)](_0xe98821){const _0x3e1865=_0x18f39c;this['control'][_0x3e1865(0x154)](_0xe98821);}[_0x18f39c(0x183)](){const _0x11f8ca=_0x18f39c;return this[_0x11f8ca(0x17e)][_0x11f8ca(0x19e)];}[_0x18f39c(0x1a1)](_0x3e6ba1){const _0x1b75ce=_0x18f39c;this[_0x1b75ce(0x17e)]['setTranslationSnap'](_0x3e6ba1);}[_0x18f39c(0x162)](){const _0x5a9af0=_0x18f39c;return this[_0x5a9af0(0x17e)]['rotationSnap'];}[_0x18f39c(0x19b)](_0x1bb876){const _0x1007c2=_0x18f39c;this[_0x1007c2(0x17e)][_0x1007c2(0x19b)](_0x1bb876);}[_0x18f39c(0x157)](){const _0x14d90b=_0x18f39c;return this[_0x14d90b(0x17e)]['scaleSnap'];}[_0x18f39c(0x176)](_0x4d9c9e){const _0x125d79=_0x18f39c;this['control'][_0x125d79(0x176)](_0x4d9c9e);}[_0x18f39c(0x182)](){const _0x5e1039=_0x18f39c;var _0x141461;this[_0x5e1039(0x174)]=![],this[_0x5e1039(0x19f)](),this[_0x5e1039(0x159)]['clear'](),this[_0x5e1039(0x181)]=[],this[_0x5e1039(0x161)]=null,this[_0x5e1039(0x179)]=null,this['onDraggingFunction']=null,(_0x141461=this[_0x5e1039(0x164)])===null||_0x141461===void 0?void 0:_0x141461[_0x5e1039(0x165)](),this['_control']=null,super[_0x5e1039(0x182)]();}}
129
+
130
+ function _0x1232(){var _0x362ab3=['360345FmkwFi','5ijSLSB','8TyAXBX','1034824MYGIgx','2tbhjAf','4441662HdJbcL','6331910kqYNsx','8732395jGsAUd','696642xAgfcW','746730PzqrKq'];_0x1232=function(){return _0x362ab3;};return _0x1232();}(function(_0x5a5136,_0x55a7f6){var _0x2755a0=_0x477f,_0x5a6a88=_0x5a5136();while(!![]){try{var _0x47f780=-parseInt(_0x2755a0(0x7e))/0x1+-parseInt(_0x2755a0(0x83))/0x2*(-parseInt(_0x2755a0(0x7f))/0x3)+parseInt(_0x2755a0(0x82))/0x4+parseInt(_0x2755a0(0x80))/0x5*(-parseInt(_0x2755a0(0x7d))/0x6)+parseInt(_0x2755a0(0x7c))/0x7*(parseInt(_0x2755a0(0x81))/0x8)+parseInt(_0x2755a0(0x84))/0x9+-parseInt(_0x2755a0(0x7b))/0xa;if(_0x47f780===_0x55a7f6)break;else _0x5a6a88['push'](_0x5a6a88['shift']());}catch(_0x536144){_0x5a6a88['push'](_0x5a6a88['shift']());}}}(_0x1232,0x984b4));function _0x477f(_0x279b85,_0x2b1309){_0x279b85=_0x279b85-0x7b;var _0x12326c=_0x1232();var _0x477f7b=_0x12326c[_0x279b85];return _0x477f7b;}
3910
131
 
3911
132
  exports.ASSET_POINTER_KEY = ASSET_POINTER_KEY;
3912
133
  exports.Actor = Actor;
@@ -3916,6 +137,7 @@ exports.AssetManager = AssetManager;
3916
137
  exports.BoxActor = BoxActor;
3917
138
  exports.BoxComponent = BoxComponent;
3918
139
  exports.Controller = Controller;
140
+ exports.CustomMeshComponent = CustomMeshComponent;
3919
141
  exports.DefaultAAParams = DefaultAAParams;
3920
142
  exports.DefaultAppParam = DefaultAppParam;
3921
143
  exports.DefaultBloomParam = DefaultBloomParam;