@galacean/engine-core 0.9.0-beta.82 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -11,56 +11,48 @@ import { Quaternion, Vector3, Matrix3x3, Matrix, MathUtil as MathUtil$1, Vector2
11
11
  Platform[Platform[/** Unknown platform. */ "Unknown"] = 4] = "Unknown";
12
12
  })(Platform || (Platform = {}));
13
13
 
14
- function _assertThisInitialized(self) {
15
- if (self === void 0) {
16
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
17
- }
14
+ function _assert_this_initialized(self) {
15
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
18
16
 
19
- return self;
17
+ return self;
20
18
  }
21
19
 
22
20
  function _defineProperties(target, props) {
23
- for (var i = 0; i < props.length; i++) {
24
- var descriptor = props[i];
25
- descriptor.enumerable = descriptor.enumerable || false;
26
- descriptor.configurable = true;
27
- if ("value" in descriptor) descriptor.writable = true;
28
- Object.defineProperty(target, descriptor.key, descriptor);
29
- }
21
+ for (var i = 0; i < props.length; i++) {
22
+ var descriptor = props[i];
23
+ descriptor.enumerable = descriptor.enumerable || false;
24
+ descriptor.configurable = true;
25
+
26
+ if ("value" in descriptor) descriptor.writable = true;
27
+
28
+ Object.defineProperty(target, descriptor.key, descriptor);
29
+ }
30
30
  }
31
+ function _create_class(Constructor, protoProps, staticProps) {
32
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
33
+ if (staticProps) _defineProperties(Constructor, staticProps);
31
34
 
32
- function _createClass(Constructor, protoProps, staticProps) {
33
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
34
- if (staticProps) _defineProperties(Constructor, staticProps);
35
- return Constructor;
35
+ return Constructor;
36
36
  }
37
37
 
38
- function setPrototypeOf(o, p) {
39
- setPrototypeOf = Object.setPrototypeOf || function setPrototypeOf(o, p) {
40
- o.__proto__ = p;
41
- return o;
42
- };
38
+ function _set_prototype_of(o, p) {
39
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
40
+ o.__proto__ = p;
43
41
 
44
- return setPrototypeOf(o, p);
45
- }
42
+ return o;
43
+ };
46
44
 
47
- function _setPrototypeOf(o, p) {
48
- return setPrototypeOf(o, p);
45
+ return _set_prototype_of(o, p);
49
46
  }
50
47
 
51
48
  function _inherits(subClass, superClass) {
52
- if (typeof superClass !== "function" && superClass !== null) {
53
- throw new TypeError("Super expression must either be null or a function");
54
- }
55
-
56
- subClass.prototype = Object.create(superClass && superClass.prototype, {
57
- constructor: {
58
- value: subClass,
59
- writable: true,
60
- configurable: true
49
+ if (typeof superClass !== "function" && superClass !== null) {
50
+ throw new TypeError("Super expression must either be null or a function");
61
51
  }
62
- });
63
- if (superClass) _setPrototypeOf(subClass, superClass);
52
+
53
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
54
+
55
+ if (superClass) _set_prototype_of(subClass, superClass);
64
56
  }
65
57
 
66
58
  /**
@@ -108,9 +100,15 @@ function _inherits(subClass, superClass) {
108
100
  };
109
101
  return MathUtil;
110
102
  }();
111
- /** The value for which all absolute numbers smaller than are considered equal to zero. */ MathUtil.zeroTolerance = 1e-6;
112
- /** The conversion factor that radian to degree. */ MathUtil.radToDegreeFactor = 180 / Math.PI;
113
- /** The conversion factor that degree to radian. */ MathUtil.degreeToRadFactor = Math.PI / 180;
103
+ (function() {
104
+ /** The value for which all absolute numbers smaller than are considered equal to zero. */ MathUtil.zeroTolerance = 1e-6;
105
+ })();
106
+ (function() {
107
+ /** The conversion factor that radian to degree. */ MathUtil.radToDegreeFactor = 180 / Math.PI;
108
+ })();
109
+ (function() {
110
+ /** The conversion factor that degree to radian. */ MathUtil.degreeToRadFactor = Math.PI / 180;
111
+ })();
114
112
 
115
113
  /**
116
114
  * Describes a color in the from of RGBA (in order: R, G, B, A).
@@ -320,7 +318,7 @@ function _inherits(subClass, superClass) {
320
318
  out._onValueChanged && out._onValueChanged();
321
319
  return out;
322
320
  };
323
- _createClass(Color, [
321
+ _create_class(Color, [
324
322
  {
325
323
  key: "r",
326
324
  get: /**
@@ -396,11 +394,9 @@ function __decorate(decorators, target, key, desc) {
396
394
  }
397
395
 
398
396
  function _instanceof(left, right) {
399
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
400
- return !!right[Symbol.hasInstance](left);
401
- } else {
402
- return left instanceof right;
403
- }
397
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
398
+ return !!right[Symbol.hasInstance](left);
399
+ } else return left instanceof right;
404
400
  }
405
401
 
406
402
  /**
@@ -581,16 +577,22 @@ function _instanceof(left, right) {
581
577
  };
582
578
  return CloneManager;
583
579
  }();
584
- /** @internal */ CloneManager._subCloneModeMap = new Map();
585
- /** @internal */ CloneManager._cloneModeMap = new Map();
586
- CloneManager._objectType = Object.getPrototypeOf(Object);
580
+ (function() {
581
+ /** @internal */ CloneManager._subCloneModeMap = new Map();
582
+ })();
583
+ (function() {
584
+ /** @internal */ CloneManager._cloneModeMap = new Map();
585
+ })();
586
+ (function() {
587
+ CloneManager._objectType = Object.getPrototypeOf(Object);
588
+ })();
587
589
 
588
590
  /**
589
591
  * EngineObject.
590
592
  */ var EngineObject = /*#__PURE__*/ function() {
591
593
  function EngineObject(engine) {
592
- this._destroyed = false;
593
594
  /** Engine unique id. */ this.instanceId = ++EngineObject._instanceIdCounter;
595
+ this._destroyed = false;
594
596
  this._engine = engine;
595
597
  }
596
598
  var _proto = EngineObject.prototype;
@@ -602,7 +604,7 @@ CloneManager._objectType = Object.getPrototypeOf(Object);
602
604
  (_this__engine_resourceManager = this._engine.resourceManager) == null ? void 0 : _this__engine_resourceManager._deleteAsset(this);
603
605
  this._destroyed = true;
604
606
  };
605
- _createClass(EngineObject, [
607
+ _create_class(EngineObject, [
606
608
  {
607
609
  key: "engine",
608
610
  get: /**
@@ -622,7 +624,9 @@ CloneManager._objectType = Object.getPrototypeOf(Object);
622
624
  ]);
623
625
  return EngineObject;
624
626
  }();
625
- EngineObject._instanceIdCounter = 0;
627
+ (function() {
628
+ EngineObject._instanceIdCounter = 0;
629
+ })();
626
630
  __decorate([
627
631
  ignoreClone
628
632
  ], EngineObject.prototype, "instanceId", void 0);
@@ -639,7 +643,7 @@ __decorate([
639
643
  _this = EngineObject.call(this, engine) || this;
640
644
  /** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */ _this.isGCIgnored = false;
641
645
  _this._refCount = 0;
642
- engine.resourceManager._addRefObject(_this.instanceId, _assertThisInitialized(_this));
646
+ engine.resourceManager._addRefObject(_this.instanceId, _assert_this_initialized(_this));
643
647
  return _this;
644
648
  }
645
649
  var _proto = RefObject.prototype;
@@ -681,7 +685,7 @@ __decorate([
681
685
  */ _proto._addToResourceManager = function _addToResourceManager(path) {
682
686
  this._engine.resourceManager._addAsset(path, this);
683
687
  };
684
- _createClass(RefObject, [
688
+ _create_class(RefObject, [
685
689
  {
686
690
  key: "refCount",
687
691
  get: /**
@@ -807,7 +811,7 @@ __decorate([
807
811
  _proto.stopPropagation = function stopPropagation() {
808
812
  this._propagationStopped = true;
809
813
  };
810
- _createClass(Event, [
814
+ _create_class(Event, [
811
815
  {
812
816
  key: "propagationStopped",
813
817
  get: function get() {
@@ -1083,7 +1087,7 @@ var Time = /*#__PURE__*/ function() {
1083
1087
  this._lastTickTime = now;
1084
1088
  this._frameCount++;
1085
1089
  };
1086
- _createClass(Time, [
1090
+ _create_class(Time, [
1087
1091
  {
1088
1092
  key: "frameCount",
1089
1093
  get: /*
@@ -1321,7 +1325,7 @@ var GLCapabilityType;
1321
1325
  _proto._getMipmapCount = function _getMipmapCount() {
1322
1326
  return this._mipmap ? Math.floor(Math.log2(Math.max(this._width, this._height))) + 1 : 1;
1323
1327
  };
1324
- _createClass(Texture, [
1328
+ _create_class(Texture, [
1325
1329
  {
1326
1330
  key: "format",
1327
1331
  get: /**
@@ -1471,7 +1475,7 @@ var GLCapabilityType;
1471
1475
  }
1472
1476
  _this._depthTexture = depth;
1473
1477
  }
1474
- _this._platformRenderTarget = engine._hardwareRenderer.createPlatformRenderTarget(_assertThisInitialized(_this));
1478
+ _this._platformRenderTarget = engine._hardwareRenderer.createPlatformRenderTarget(_assert_this_initialized(_this));
1475
1479
  return _this;
1476
1480
  }
1477
1481
  var _proto = RenderTarget.prototype;
@@ -1513,7 +1517,7 @@ var GLCapabilityType;
1513
1517
  */ _proto._blitRenderTarget = function _blitRenderTarget() {
1514
1518
  this._platformRenderTarget.blitRenderTarget();
1515
1519
  };
1516
- _createClass(RenderTarget, [
1520
+ _create_class(RenderTarget, [
1517
1521
  {
1518
1522
  key: "autoGenerateMipmaps",
1519
1523
  get: /**
@@ -1585,7 +1589,7 @@ var GLCapabilityType;
1585
1589
  _this._format = format;
1586
1590
  _this._mipmapCount = _this._getMipmapCount();
1587
1591
  _this._isDepthTexture = format == TextureFormat.Depth || format == TextureFormat.DepthStencil || format == TextureFormat.Depth16 || format == TextureFormat.Depth24 || format == TextureFormat.Depth32 || format == TextureFormat.Depth24Stencil8 || format == TextureFormat.Depth32Stencil8;
1588
- _this._platformTexture = engine._hardwareRenderer.createPlatformTexture2D(_assertThisInitialized(_this));
1592
+ _this._platformTexture = engine._hardwareRenderer.createPlatformTexture2D(_assert_this_initialized(_this));
1589
1593
  _this.filterMode = TextureFilterMode.Bilinear;
1590
1594
  _this.wrapModeU = _this.wrapModeV = TextureWrapMode.Repeat;
1591
1595
  return _this;
@@ -1652,7 +1656,7 @@ var GLCapabilityType;
1652
1656
  _this._length = length;
1653
1657
  _this._format = format;
1654
1658
  _this._mipmapCount = _this._getMipmapCount();
1655
- _this._platformTexture = engine._hardwareRenderer.createPlatformTexture2DArray(_assertThisInitialized(_this));
1659
+ _this._platformTexture = engine._hardwareRenderer.createPlatformTexture2DArray(_assert_this_initialized(_this));
1656
1660
  _this.filterMode = TextureFilterMode.Bilinear;
1657
1661
  _this.wrapModeU = _this.wrapModeV = TextureWrapMode.Repeat;
1658
1662
  return _this;
@@ -1704,7 +1708,7 @@ var GLCapabilityType;
1704
1708
  this._platformTexture.getPixelBuffer(elementIndex, xOrMipLevelOrOut, yOrMipLevel, width, height, mipLevelOrOut, out);
1705
1709
  }
1706
1710
  };
1707
- _createClass(Texture2DArray, [
1711
+ _create_class(Texture2DArray, [
1708
1712
  {
1709
1713
  key: "length",
1710
1714
  get: /**
@@ -1731,7 +1735,7 @@ var GLCapabilityType;
1731
1735
  _this._height = size;
1732
1736
  _this._format = format;
1733
1737
  _this._mipmapCount = _this._getMipmapCount();
1734
- _this._platformTexture = engine._hardwareRenderer.createPlatformTextureCube(_assertThisInitialized(_this));
1738
+ _this._platformTexture = engine._hardwareRenderer.createPlatformTextureCube(_assert_this_initialized(_this));
1735
1739
  _this.filterMode = TextureFilterMode.Bilinear;
1736
1740
  _this.wrapModeU = _this.wrapModeV = TextureWrapMode.Clamp;
1737
1741
  return _this;
@@ -1858,7 +1862,7 @@ var GLCapabilityType;
1858
1862
  _proto.getCharInfo = function getCharInfo(char) {
1859
1863
  return this._charInfoMap[char.charCodeAt(0)];
1860
1864
  };
1861
- _createClass(FontAtlas, [
1865
+ _create_class(FontAtlas, [
1862
1866
  {
1863
1867
  key: "texture",
1864
1868
  get: function get() {
@@ -2006,7 +2010,7 @@ var GLCapabilityType;
2006
2010
  }
2007
2011
  return null;
2008
2012
  };
2009
- _createClass(Font, [
2013
+ _create_class(Font, [
2010
2014
  {
2011
2015
  key: "name",
2012
2016
  get: /**
@@ -2018,9 +2022,10 @@ var GLCapabilityType;
2018
2022
  ]);
2019
2023
  return Font;
2020
2024
  }(RefObject);
2021
- Font._fontMap = {};
2025
+ (function() {
2026
+ Font._fontMap = {};
2027
+ })();
2022
2028
 
2023
- var _Symbol_toStringTag = Symbol.toStringTag;
2024
2029
  var AssetPromise = /*#__PURE__*/ function() {
2025
2030
  function AssetPromise(executor) {
2026
2031
  var _this = this;
@@ -2139,9 +2144,9 @@ var AssetPromise = /*#__PURE__*/ function() {
2139
2144
  }
2140
2145
  });
2141
2146
  };
2142
- _createClass(AssetPromise, [
2147
+ _create_class(AssetPromise, [
2143
2148
  {
2144
- key: _Symbol_toStringTag,
2149
+ key: Symbol.toStringTag,
2145
2150
  get: /** compatible with Promise */ function get() {
2146
2151
  return "AssetPromise";
2147
2152
  }
@@ -2454,8 +2459,12 @@ var /** @internal */ PromiseState;
2454
2459
  };
2455
2460
  return ResourceManager;
2456
2461
  }();
2457
- /** Loader collection. */ ResourceManager._loaders = {};
2458
- ResourceManager._extTypeMapping = {};
2462
+ (function() {
2463
+ /** Loader collection. */ ResourceManager._loaders = {};
2464
+ })();
2465
+ (function() {
2466
+ ResourceManager._extTypeMapping = {};
2467
+ })();
2459
2468
  /**
2460
2469
  * Declare ResourceLoader's decorator.
2461
2470
  * @param assetType - Type of asset
@@ -2813,10 +2822,14 @@ var ComponentCloner = /*#__PURE__*/ function() {
2813
2822
  };
2814
2823
  return ComponentsDependencies;
2815
2824
  }();
2816
- /**
2825
+ (function() {
2826
+ /**
2817
2827
  * @internal
2818
2828
  */ ComponentsDependencies._dependenciesMap = new Map();
2819
- ComponentsDependencies._invDependenciesMap = new Map();
2829
+ })();
2830
+ (function() {
2831
+ ComponentsDependencies._invDependenciesMap = new Map();
2832
+ })();
2820
2833
  /**
2821
2834
  * Dependent components, automatically added if they do not exist.
2822
2835
  * @param components - Dependent components
@@ -2982,7 +2995,7 @@ ComponentsDependencies._invDependenciesMap = new Map();
2982
2995
  }
2983
2996
  }
2984
2997
  };
2985
- _createClass(Component, [
2998
+ _create_class(Component, [
2986
2999
  {
2987
3000
  key: "enabled",
2988
3001
  get: /**
@@ -3116,7 +3129,6 @@ __decorate([
3116
3129
  function Transform(entity) {
3117
3130
  var _this;
3118
3131
  _this = Component.call(this, entity) || this;
3119
- _this._dirtyFlag = 0xbc;
3120
3132
  _this._position = new Vector3();
3121
3133
  _this._rotation = new Vector3();
3122
3134
  _this._rotationQuaternion = new Quaternion();
@@ -3129,14 +3141,15 @@ __decorate([
3129
3141
  _this._worldMatrix = new Matrix();
3130
3142
  _this._isParentDirty = true;
3131
3143
  _this._parentTransformCache = null;
3144
+ _this._dirtyFlag = 0xbc;
3132
3145
  /** @internal */ _this._updateFlagManager = new UpdateFlagManager();
3133
- _this._onPositionChanged = _this._onPositionChanged.bind(_assertThisInitialized(_this));
3134
- _this._onWorldPositionChanged = _this._onWorldPositionChanged.bind(_assertThisInitialized(_this));
3135
- _this._onRotationChanged = _this._onRotationChanged.bind(_assertThisInitialized(_this));
3136
- _this._onWorldRotationChanged = _this._onWorldRotationChanged.bind(_assertThisInitialized(_this));
3137
- _this._onRotationQuaternionChanged = _this._onRotationQuaternionChanged.bind(_assertThisInitialized(_this));
3138
- _this._onWorldRotationQuaternionChanged = _this._onWorldRotationQuaternionChanged.bind(_assertThisInitialized(_this));
3139
- _this._onScaleChanged = _this._onScaleChanged.bind(_assertThisInitialized(_this));
3146
+ _this._onPositionChanged = _this._onPositionChanged.bind(_assert_this_initialized(_this));
3147
+ _this._onWorldPositionChanged = _this._onWorldPositionChanged.bind(_assert_this_initialized(_this));
3148
+ _this._onRotationChanged = _this._onRotationChanged.bind(_assert_this_initialized(_this));
3149
+ _this._onWorldRotationChanged = _this._onWorldRotationChanged.bind(_assert_this_initialized(_this));
3150
+ _this._onRotationQuaternionChanged = _this._onRotationQuaternionChanged.bind(_assert_this_initialized(_this));
3151
+ _this._onWorldRotationQuaternionChanged = _this._onWorldRotationQuaternionChanged.bind(_assert_this_initialized(_this));
3152
+ _this._onScaleChanged = _this._onScaleChanged.bind(_assert_this_initialized(_this));
3140
3153
  //@ts-ignore
3141
3154
  _this._position._onValueChanged = _this._onPositionChanged;
3142
3155
  //@ts-ignore
@@ -3528,7 +3541,7 @@ __decorate([
3528
3541
  this._setDirtyFlagTrue(0x40);
3529
3542
  this._updateWorldScaleFlag();
3530
3543
  };
3531
- _createClass(Transform, [
3544
+ _create_class(Transform, [
3532
3545
  {
3533
3546
  key: "position",
3534
3547
  get: /**
@@ -3774,15 +3787,33 @@ __decorate([
3774
3787
  ]);
3775
3788
  return Transform;
3776
3789
  }(Component);
3777
- Transform._tempQuat0 = new Quaternion();
3778
- Transform._tempVec30 = new Vector3();
3779
- Transform._tempVec31 = new Vector3();
3780
- Transform._tempVec32 = new Vector3();
3781
- Transform._tempMat30 = new Matrix3x3();
3782
- Transform._tempMat31 = new Matrix3x3();
3783
- Transform._tempMat32 = new Matrix3x3();
3784
- Transform._tempMat41 = new Matrix();
3785
- Transform._tempMat42 = new Matrix();
3790
+ (function() {
3791
+ Transform._tempQuat0 = new Quaternion();
3792
+ })();
3793
+ (function() {
3794
+ Transform._tempVec30 = new Vector3();
3795
+ })();
3796
+ (function() {
3797
+ Transform._tempVec31 = new Vector3();
3798
+ })();
3799
+ (function() {
3800
+ Transform._tempVec32 = new Vector3();
3801
+ })();
3802
+ (function() {
3803
+ Transform._tempMat30 = new Matrix3x3();
3804
+ })();
3805
+ (function() {
3806
+ Transform._tempMat31 = new Matrix3x3();
3807
+ })();
3808
+ (function() {
3809
+ Transform._tempMat32 = new Matrix3x3();
3810
+ })();
3811
+ (function() {
3812
+ Transform._tempMat41 = new Matrix();
3813
+ })();
3814
+ (function() {
3815
+ Transform._tempMat42 = new Matrix();
3816
+ })();
3786
3817
  __decorate([
3787
3818
  deepClone
3788
3819
  ], Transform.prototype, "_position", void 0);
@@ -4282,7 +4313,7 @@ var TransformModifyFlags;
4282
4313
  this._traverseSetOwnerScene(children[i], scene);
4283
4314
  }
4284
4315
  };
4285
- _createClass(Entity, [
4316
+ _create_class(Entity, [
4286
4317
  {
4287
4318
  key: "isActive",
4288
4319
  get: /**
@@ -4500,7 +4531,7 @@ var TransformModifyFlags;
4500
4531
  }
4501
4532
  }
4502
4533
  };
4503
- _createClass(SystemInfo, null, [
4534
+ _create_class(SystemInfo, null, [
4504
4535
  {
4505
4536
  key: "devicePixelRatio",
4506
4537
  get: /**
@@ -4512,8 +4543,12 @@ var TransformModifyFlags;
4512
4543
  ]);
4513
4544
  return SystemInfo;
4514
4545
  }();
4515
- /** The platform is running on. */ SystemInfo.platform = Platform.Unknown;
4516
- /** The operating system is running on. */ SystemInfo.operatingSystem = "";
4546
+ (function() {
4547
+ /** The platform is running on. */ SystemInfo.platform = Platform.Unknown;
4548
+ })();
4549
+ (function() {
4550
+ /** The operating system is running on. */ SystemInfo.operatingSystem = "";
4551
+ })();
4517
4552
  SystemInfo._initialize();
4518
4553
 
4519
4554
  /**
@@ -5130,7 +5165,7 @@ SystemInfo._initialize();
5130
5165
  _proto._setGravity = function _setGravity() {
5131
5166
  this._nativePhysicsManager.setGravity(this._gravity);
5132
5167
  };
5133
- _createClass(PhysicsManager, [
5168
+ _create_class(PhysicsManager, [
5134
5169
  {
5135
5170
  key: "gravity",
5136
5171
  get: /**
@@ -5188,7 +5223,7 @@ SystemInfo._initialize();
5188
5223
  */ _proto._destroy = function _destroy() {
5189
5224
  this._nativeMaterial.destroy();
5190
5225
  };
5191
- _createClass(PhysicsMaterial, [
5226
+ _create_class(PhysicsMaterial, [
5192
5227
  {
5193
5228
  key: "bounciness",
5194
5229
  get: /**
@@ -5268,8 +5303,8 @@ var Collider = /*#__PURE__*/ function(Component) {
5268
5303
  function Collider(entity) {
5269
5304
  var _this;
5270
5305
  _this = Component.call(this, entity) || this;
5271
- _this._shapes = [];
5272
5306
  /** @internal */ _this._index = -1;
5307
+ _this._shapes = [];
5273
5308
  _this._updateFlag = _this.entity.transform.registerWorldChangeFlag();
5274
5309
  return _this;
5275
5310
  }
@@ -5348,7 +5383,7 @@ var Collider = /*#__PURE__*/ function(Component) {
5348
5383
  this.clearShapes();
5349
5384
  this._nativeCollider.destroy();
5350
5385
  };
5351
- _createClass(Collider, [
5386
+ _create_class(Collider, [
5352
5387
  {
5353
5388
  key: "shapes",
5354
5389
  get: /**
@@ -5388,7 +5423,7 @@ Collider = __decorate([
5388
5423
  _this._upDirection = new Vector3(0, 1, 0);
5389
5424
  _this._slopeLimit = 0.707;
5390
5425
  _this._nativeCollider = PhysicsManager._nativePhysics.createCharacterController();
5391
- _this._setUpDirection = _this._setUpDirection.bind(_assertThisInitialized(_this));
5426
+ _this._setUpDirection = _this._setUpDirection.bind(_assert_this_initialized(_this));
5392
5427
  //@ts-ignore
5393
5428
  _this._upDirection._onValueChanged = _this._setUpDirection;
5394
5429
  return _this;
@@ -5461,7 +5496,7 @@ Collider = __decorate([
5461
5496
  _proto._setUpDirection = function _setUpDirection() {
5462
5497
  this._nativeCollider.setUpDirection(this._upDirection);
5463
5498
  };
5464
- _createClass(CharacterController, [
5499
+ _create_class(CharacterController, [
5465
5500
  {
5466
5501
  key: "stepOffset",
5467
5502
  get: /**
@@ -5556,7 +5591,7 @@ Collider = __decorate([
5556
5591
  _proto._setRotation = function _setRotation() {
5557
5592
  this._nativeShape.setRotation(this._rotation);
5558
5593
  };
5559
- _createClass(ColliderShape, [
5594
+ _create_class(ColliderShape, [
5560
5595
  {
5561
5596
  key: "collider",
5562
5597
  get: /**
@@ -5644,7 +5679,9 @@ Collider = __decorate([
5644
5679
  ]);
5645
5680
  return ColliderShape;
5646
5681
  }();
5647
- ColliderShape._idGenerator = 0;
5682
+ (function() {
5683
+ ColliderShape._idGenerator = 0;
5684
+ })();
5648
5685
 
5649
5686
  /**
5650
5687
  * Physical collider shape for box.
@@ -5655,7 +5692,7 @@ ColliderShape._idGenerator = 0;
5655
5692
  _this = ColliderShape.call(this) || this;
5656
5693
  _this._size = new Vector3(1, 1, 1);
5657
5694
  _this._nativeShape = PhysicsManager._nativePhysics.createBoxColliderShape(_this._id, _this._size, _this._material._nativeMaterial);
5658
- _this._setSize = _this._setSize.bind(_assertThisInitialized(_this));
5695
+ _this._setSize = _this._setSize.bind(_assert_this_initialized(_this));
5659
5696
  //@ts-ignore
5660
5697
  _this._size._onValueChanged = _this._setSize;
5661
5698
  return _this;
@@ -5664,7 +5701,7 @@ ColliderShape._idGenerator = 0;
5664
5701
  _proto._setSize = function _setSize() {
5665
5702
  this._nativeShape.setSize(this._size);
5666
5703
  };
5667
- _createClass(BoxColliderShape, [
5704
+ _create_class(BoxColliderShape, [
5668
5705
  {
5669
5706
  key: "size",
5670
5707
  get: /**
@@ -5693,7 +5730,7 @@ ColliderShape._idGenerator = 0;
5693
5730
  _this._nativeShape = PhysicsManager._nativePhysics.createSphereColliderShape(_this._id, _this._radius, _this._material._nativeMaterial);
5694
5731
  return _this;
5695
5732
  }
5696
- _createClass(SphereColliderShape, [
5733
+ _create_class(SphereColliderShape, [
5697
5734
  {
5698
5735
  key: "radius",
5699
5736
  get: /**
@@ -5747,7 +5784,7 @@ ColliderShape._idGenerator = 0;
5747
5784
  _this._nativeShape = PhysicsManager._nativePhysics.createCapsuleColliderShape(_this._id, _this._radius, _this._height, _this._material._nativeMaterial);
5748
5785
  return _this;
5749
5786
  }
5750
- _createClass(CapsuleColliderShape, [
5787
+ _create_class(CapsuleColliderShape, [
5751
5788
  {
5752
5789
  key: "radius",
5753
5790
  get: /**
@@ -5806,7 +5843,7 @@ var Joint = /*#__PURE__*/ function(Component) {
5806
5843
  _this._connectedCollider.localPosition = new Vector3();
5807
5844
  return _this;
5808
5845
  }
5809
- _createClass(Joint, [
5846
+ _create_class(Joint, [
5810
5847
  {
5811
5848
  key: "connectedCollider",
5812
5849
  get: /**
@@ -5986,7 +6023,7 @@ Joint = __decorate([
5986
6023
  collider.collider = this.entity.getComponent(Collider);
5987
6024
  this._nativeJoint = PhysicsManager._nativePhysics.createHingeJoint(collider.collider._nativeCollider);
5988
6025
  };
5989
- _createClass(HingeJoint, [
6026
+ _create_class(HingeJoint, [
5990
6027
  {
5991
6028
  key: "axis",
5992
6029
  get: /**
@@ -6138,7 +6175,7 @@ Joint = __decorate([
6138
6175
  collider.collider = this.entity.getComponent(Collider);
6139
6176
  this._nativeJoint = PhysicsManager._nativePhysics.createSpringJoint(collider.collider._nativeCollider);
6140
6177
  };
6141
- _createClass(SpringJoint, [
6178
+ _create_class(SpringJoint, [
6142
6179
  {
6143
6180
  key: "swingOffset",
6144
6181
  get: /**
@@ -6294,10 +6331,10 @@ Joint = __decorate([
6294
6331
  _this._sleepThreshold = 5e-3;
6295
6332
  var transform = _this.entity.transform;
6296
6333
  _this._nativeCollider = PhysicsManager._nativePhysics.createDynamicCollider(transform.worldPosition, transform.worldRotationQuaternion);
6297
- _this._setLinearVelocity = _this._setLinearVelocity.bind(_assertThisInitialized(_this));
6298
- _this._setAngularVelocity = _this._setAngularVelocity.bind(_assertThisInitialized(_this));
6299
- _this._setCenterOfMass = _this._setCenterOfMass.bind(_assertThisInitialized(_this));
6300
- _this._setInertiaTensor = _this._setInertiaTensor.bind(_assertThisInitialized(_this));
6334
+ _this._setLinearVelocity = _this._setLinearVelocity.bind(_assert_this_initialized(_this));
6335
+ _this._setAngularVelocity = _this._setAngularVelocity.bind(_assert_this_initialized(_this));
6336
+ _this._setCenterOfMass = _this._setCenterOfMass.bind(_assert_this_initialized(_this));
6337
+ _this._setInertiaTensor = _this._setInertiaTensor.bind(_assert_this_initialized(_this));
6301
6338
  //@ts-ignore
6302
6339
  _this._linearVelocity._onValueChanged = _this._setLinearVelocity;
6303
6340
  //@ts-ignore
@@ -6355,7 +6392,7 @@ Joint = __decorate([
6355
6392
  _proto._setInertiaTensor = function _setInertiaTensor() {
6356
6393
  this._nativeCollider.setInertiaTensor(this._inertiaTensor);
6357
6394
  };
6358
- _createClass(DynamicCollider, [
6395
+ _create_class(DynamicCollider, [
6359
6396
  {
6360
6397
  key: "linearDamping",
6361
6398
  get: /**
@@ -6899,9 +6936,15 @@ var DynamicColliderConstraints;
6899
6936
  };
6900
6937
  return PointerManager;
6901
6938
  }();
6902
- PointerManager._tempRay = new Ray();
6903
- PointerManager._tempPoint = new Vector2();
6904
- PointerManager._tempHitResult = new HitResult();
6939
+ (function() {
6940
+ PointerManager._tempRay = new Ray();
6941
+ })();
6942
+ (function() {
6943
+ PointerManager._tempPoint = new Vector2();
6944
+ })();
6945
+ (function() {
6946
+ PointerManager._tempHitResult = new HitResult();
6947
+ })();
6905
6948
 
6906
6949
  /**
6907
6950
  * Wheel Manager.
@@ -7107,7 +7150,7 @@ PointerManager._tempHitResult = new HitResult();
7107
7150
  this._pointerManager._onFocus();
7108
7151
  this._keyboardManager._onFocus();
7109
7152
  };
7110
- _createClass(InputManager, [
7153
+ _create_class(InputManager, [
7111
7154
  {
7112
7155
  key: "pointers",
7113
7156
  get: /**
@@ -7294,8 +7337,12 @@ PointerManager._tempHitResult = new HitResult();
7294
7337
  }
7295
7338
  this._nameId = nameID;
7296
7339
  };
7297
- /** @internal */ ShaderMacro._macroNameIdMap = Object.create(null);
7298
- ShaderMacro._macroNameCounter = 0;
7340
+ (function() {
7341
+ /** @internal */ ShaderMacro._macroNameIdMap = Object.create(null);
7342
+ })();
7343
+ (function() {
7344
+ ShaderMacro._macroNameCounter = 0;
7345
+ })();
7299
7346
 
7300
7347
  /**
7301
7348
  * Shader macro collection.
@@ -7447,26 +7494,17 @@ ShaderMacro._macroNameCounter = 0;
7447
7494
  return ShaderMacroCollection;
7448
7495
  }();
7449
7496
 
7450
- function extends_() {
7451
- extends_ = Object.assign || function (target) {
7452
- for (var i = 1; i < arguments.length; i++) {
7453
- var source = arguments[i];
7454
-
7455
- for (var key in source) {
7456
- if (Object.prototype.hasOwnProperty.call(source, key)) {
7457
- target[key] = source[key];
7497
+ function _extends() {
7498
+ _extends = Object.assign || function assign(target) {
7499
+ for (var i = 1; i < arguments.length; i++) {
7500
+ var source = arguments[i];
7501
+ for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
7458
7502
  }
7459
- }
7460
- }
7461
-
7462
- return target;
7463
- };
7464
7503
 
7465
- return extends_.apply(this, arguments);
7466
- }
7504
+ return target;
7505
+ };
7467
7506
 
7468
- function _extends() {
7469
- return extends_.apply(this, arguments);
7507
+ return _extends.apply(this, arguments);
7470
7508
  }
7471
7509
 
7472
7510
  var camera_declare = "#define GLSLIFY 1\nuniform vec3 u_cameraPos;"; // eslint-disable-line
@@ -8308,7 +8346,7 @@ var ShaderFactory = /*#__PURE__*/ function() {
8308
8346
  return prefix + line;
8309
8347
  }).join("\n");
8310
8348
  };
8311
- _createClass(ShaderProgram, [
8349
+ _create_class(ShaderProgram, [
8312
8350
  {
8313
8351
  key: "isValid",
8314
8352
  get: /**
@@ -8320,7 +8358,9 @@ var ShaderFactory = /*#__PURE__*/ function() {
8320
8358
  ]);
8321
8359
  return ShaderProgram;
8322
8360
  }();
8323
- ShaderProgram._counter = 0;
8361
+ (function() {
8362
+ ShaderProgram._counter = 0;
8363
+ })();
8324
8364
 
8325
8365
  /**
8326
8366
  * Shader pass containing vertex and fragment source.
@@ -8365,7 +8405,9 @@ ShaderProgram._counter = 0;
8365
8405
  };
8366
8406
  return ShaderPass;
8367
8407
  }();
8368
- ShaderPass._shaderPassCounter = 0;
8408
+ (function() {
8409
+ ShaderPass._shaderPassCounter = 0;
8410
+ })();
8369
8411
 
8370
8412
  /**
8371
8413
  * Shader property.
@@ -8374,7 +8416,7 @@ ShaderPass._shaderPassCounter = 0;
8374
8416
  this.name = name;
8375
8417
  this._uniqueId = ShaderProperty._propertyNameCounter++;
8376
8418
  }
8377
- _createClass(ShaderProperty, [
8419
+ _create_class(ShaderProperty, [
8378
8420
  {
8379
8421
  key: "type",
8380
8422
  get: /**
@@ -8386,7 +8428,9 @@ ShaderPass._shaderPassCounter = 0;
8386
8428
  ]);
8387
8429
  return ShaderProperty;
8388
8430
  }();
8389
- ShaderProperty._propertyNameCounter = 0;
8431
+ (function() {
8432
+ ShaderProperty._propertyNameCounter = 0;
8433
+ })();
8390
8434
 
8391
8435
  /**
8392
8436
  * Shader for rendering.
@@ -8499,7 +8543,7 @@ ShaderProperty._propertyNameCounter = 0;
8499
8543
  }
8500
8544
  }
8501
8545
  };
8502
- _createClass(Shader, [
8546
+ _create_class(Shader, [
8503
8547
  {
8504
8548
  key: "passes",
8505
8549
  get: /**
@@ -8511,18 +8555,34 @@ ShaderProperty._propertyNameCounter = 0;
8511
8555
  ]);
8512
8556
  return Shader;
8513
8557
  }();
8514
- /** @internal */ Shader._compileMacros = new ShaderMacroCollection();
8515
- /** @internal */ Shader._shaderExtension = [
8516
- "GL_EXT_shader_texture_lod",
8517
- "GL_OES_standard_derivatives",
8518
- "GL_EXT_draw_buffers"
8519
- ];
8520
- /** @internal */ Shader._propertyIdMap = Object.create(null);
8521
- Shader._shaderMap = Object.create(null);
8522
- Shader._propertyNameMap = Object.create(null);
8523
- Shader._macroMaskMap = [];
8524
- Shader._macroCounter = 0;
8525
- Shader._macroMap = Object.create(null);
8558
+ (function() {
8559
+ /** @internal */ Shader._compileMacros = new ShaderMacroCollection();
8560
+ })();
8561
+ (function() {
8562
+ /** @internal */ Shader._shaderExtension = [
8563
+ "GL_EXT_shader_texture_lod",
8564
+ "GL_OES_standard_derivatives",
8565
+ "GL_EXT_draw_buffers"
8566
+ ];
8567
+ })();
8568
+ (function() {
8569
+ /** @internal */ Shader._propertyIdMap = Object.create(null);
8570
+ })();
8571
+ (function() {
8572
+ Shader._shaderMap = Object.create(null);
8573
+ })();
8574
+ (function() {
8575
+ Shader._propertyNameMap = Object.create(null);
8576
+ })();
8577
+ (function() {
8578
+ Shader._macroMaskMap = [];
8579
+ })();
8580
+ (function() {
8581
+ Shader._macroCounter = 0;
8582
+ })();
8583
+ (function() {
8584
+ Shader._macroMap = Object.create(null);
8585
+ })();
8526
8586
 
8527
8587
  /**
8528
8588
  * Shader data collection,Correspondence includes shader properties data and macros data.
@@ -8780,9 +8840,9 @@ Shader._macroMap = Object.create(null);
8780
8840
  /** Shadow mapping normal-based bias. */ _this.shadowNormalBias = 1;
8781
8841
  /** Near plane value to use for shadow frustums. */ _this.shadowNearPlane = 0.1;
8782
8842
  /** Shadow intensity, the larger the value, the clearer and darker the shadow. */ _this.shadowStrength = 1.0;
8843
+ /** @internal */ _this._lightIndex = -1;
8783
8844
  _this._color = new Color$1(1, 1, 1, 1);
8784
8845
  _this._lightColor = new Color$1();
8785
- /** @internal */ _this._lightIndex = -1;
8786
8846
  return _this;
8787
8847
  }
8788
8848
  var _proto = Light.prototype;
@@ -8793,7 +8853,7 @@ Shader._macroMap = Object.create(null);
8793
8853
  this._lightColor.a = this.color.a * this.intensity;
8794
8854
  return this._lightColor;
8795
8855
  };
8796
- _createClass(Light, [
8856
+ _create_class(Light, [
8797
8857
  {
8798
8858
  key: "color",
8799
8859
  get: /**
@@ -8830,9 +8890,11 @@ Shader._macroMap = Object.create(null);
8830
8890
  ]);
8831
8891
  return Light;
8832
8892
  }(Component);
8833
- /**
8893
+ (function() {
8894
+ /**
8834
8895
  * Each type of light source is at most 10, beyond which it will not take effect.
8835
8896
  * */ Light._maxLight = 10;
8897
+ })();
8836
8898
  __decorate([
8837
8899
  ignoreClone
8838
8900
  ], Light.prototype, "_lightIndex", void 0);
@@ -8890,7 +8952,7 @@ __decorate([
8890
8952
  shaderData.setFloatArray(DirectLight._colorProperty, data.color);
8891
8953
  shaderData.setFloatArray(DirectLight._directionProperty, data.direction);
8892
8954
  };
8893
- _createClass(DirectLight, [
8955
+ _create_class(DirectLight, [
8894
8956
  {
8895
8957
  key: "direction",
8896
8958
  get: /**
@@ -8921,14 +8983,22 @@ __decorate([
8921
8983
  ]);
8922
8984
  return DirectLight;
8923
8985
  }(Light);
8924
- DirectLight._cullingMaskProperty = Shader.getPropertyByName("u_directLightCullingMask");
8925
- DirectLight._colorProperty = Shader.getPropertyByName("u_directLightColor");
8926
- DirectLight._directionProperty = Shader.getPropertyByName("u_directLightDirection");
8927
- DirectLight._combinedData = {
8928
- cullingMask: new Int32Array(Light._maxLight * 2),
8929
- color: new Float32Array(Light._maxLight * 3),
8930
- direction: new Float32Array(Light._maxLight * 3)
8931
- };
8986
+ (function() {
8987
+ DirectLight._cullingMaskProperty = Shader.getPropertyByName("u_directLightCullingMask");
8988
+ })();
8989
+ (function() {
8990
+ DirectLight._colorProperty = Shader.getPropertyByName("u_directLightColor");
8991
+ })();
8992
+ (function() {
8993
+ DirectLight._directionProperty = Shader.getPropertyByName("u_directLightDirection");
8994
+ })();
8995
+ (function() {
8996
+ DirectLight._combinedData = {
8997
+ cullingMask: new Int32Array(Light._maxLight * 2),
8998
+ color: new Float32Array(Light._maxLight * 3),
8999
+ direction: new Float32Array(Light._maxLight * 3)
9000
+ };
9001
+ })();
8932
9002
 
8933
9003
  /**
8934
9004
  * Point light.
@@ -8985,7 +9055,7 @@ DirectLight._combinedData = {
8985
9055
  shaderData.setFloatArray(PointLight._positionProperty, data.position);
8986
9056
  shaderData.setFloatArray(PointLight._distanceProperty, data.distance);
8987
9057
  };
8988
- _createClass(PointLight, [
9058
+ _create_class(PointLight, [
8989
9059
  {
8990
9060
  key: "position",
8991
9061
  get: /**
@@ -9006,16 +9076,26 @@ DirectLight._combinedData = {
9006
9076
  ]);
9007
9077
  return PointLight;
9008
9078
  }(Light);
9009
- PointLight._cullingMaskProperty = Shader.getPropertyByName("u_pointLightCullingMask");
9010
- PointLight._colorProperty = Shader.getPropertyByName("u_pointLightColor");
9011
- PointLight._positionProperty = Shader.getPropertyByName("u_pointLightPosition");
9012
- PointLight._distanceProperty = Shader.getPropertyByName("u_pointLightDistance");
9013
- PointLight._combinedData = {
9014
- cullingMask: new Int32Array(Light._maxLight * 2),
9015
- color: new Float32Array(Light._maxLight * 3),
9016
- position: new Float32Array(Light._maxLight * 3),
9017
- distance: new Float32Array(Light._maxLight)
9018
- };
9079
+ (function() {
9080
+ PointLight._cullingMaskProperty = Shader.getPropertyByName("u_pointLightCullingMask");
9081
+ })();
9082
+ (function() {
9083
+ PointLight._colorProperty = Shader.getPropertyByName("u_pointLightColor");
9084
+ })();
9085
+ (function() {
9086
+ PointLight._positionProperty = Shader.getPropertyByName("u_pointLightPosition");
9087
+ })();
9088
+ (function() {
9089
+ PointLight._distanceProperty = Shader.getPropertyByName("u_pointLightDistance");
9090
+ })();
9091
+ (function() {
9092
+ PointLight._combinedData = {
9093
+ cullingMask: new Int32Array(Light._maxLight * 2),
9094
+ color: new Float32Array(Light._maxLight * 3),
9095
+ position: new Float32Array(Light._maxLight * 3),
9096
+ distance: new Float32Array(Light._maxLight)
9097
+ };
9098
+ })();
9019
9099
 
9020
9100
  /**
9021
9101
  * Spot light.
@@ -9089,7 +9169,7 @@ PointLight._combinedData = {
9089
9169
  shaderData.setFloatArray(SpotLight._angleCosProperty, data.angleCos);
9090
9170
  shaderData.setFloatArray(SpotLight._penumbraCosProperty, data.penumbraCos);
9091
9171
  };
9092
- _createClass(SpotLight, [
9172
+ _create_class(SpotLight, [
9093
9173
  {
9094
9174
  key: "position",
9095
9175
  get: /**
@@ -9131,22 +9211,38 @@ PointLight._combinedData = {
9131
9211
  ]);
9132
9212
  return SpotLight;
9133
9213
  }(Light);
9134
- SpotLight._cullingMaskProperty = Shader.getPropertyByName("u_spotLightCullingMask");
9135
- SpotLight._colorProperty = Shader.getPropertyByName("u_spotLightColor");
9136
- SpotLight._positionProperty = Shader.getPropertyByName("u_spotLightPosition");
9137
- SpotLight._directionProperty = Shader.getPropertyByName("u_spotLightDirection");
9138
- SpotLight._distanceProperty = Shader.getPropertyByName("u_spotLightDistance");
9139
- SpotLight._angleCosProperty = Shader.getPropertyByName("u_spotLightAngleCos");
9140
- SpotLight._penumbraCosProperty = Shader.getPropertyByName("u_spotLightPenumbraCos");
9141
- SpotLight._combinedData = {
9142
- cullingMask: new Int32Array(Light._maxLight * 2),
9143
- color: new Float32Array(Light._maxLight * 3),
9144
- position: new Float32Array(Light._maxLight * 3),
9145
- direction: new Float32Array(Light._maxLight * 3),
9146
- distance: new Float32Array(Light._maxLight),
9147
- angleCos: new Float32Array(Light._maxLight),
9148
- penumbraCos: new Float32Array(Light._maxLight)
9149
- };
9214
+ (function() {
9215
+ SpotLight._cullingMaskProperty = Shader.getPropertyByName("u_spotLightCullingMask");
9216
+ })();
9217
+ (function() {
9218
+ SpotLight._colorProperty = Shader.getPropertyByName("u_spotLightColor");
9219
+ })();
9220
+ (function() {
9221
+ SpotLight._positionProperty = Shader.getPropertyByName("u_spotLightPosition");
9222
+ })();
9223
+ (function() {
9224
+ SpotLight._directionProperty = Shader.getPropertyByName("u_spotLightDirection");
9225
+ })();
9226
+ (function() {
9227
+ SpotLight._distanceProperty = Shader.getPropertyByName("u_spotLightDistance");
9228
+ })();
9229
+ (function() {
9230
+ SpotLight._angleCosProperty = Shader.getPropertyByName("u_spotLightAngleCos");
9231
+ })();
9232
+ (function() {
9233
+ SpotLight._penumbraCosProperty = Shader.getPropertyByName("u_spotLightPenumbraCos");
9234
+ })();
9235
+ (function() {
9236
+ SpotLight._combinedData = {
9237
+ cullingMask: new Int32Array(Light._maxLight * 2),
9238
+ color: new Float32Array(Light._maxLight * 3),
9239
+ position: new Float32Array(Light._maxLight * 3),
9240
+ direction: new Float32Array(Light._maxLight * 3),
9241
+ distance: new Float32Array(Light._maxLight),
9242
+ angleCos: new Float32Array(Light._maxLight),
9243
+ penumbraCos: new Float32Array(Light._maxLight)
9244
+ };
9245
+ })();
9150
9246
 
9151
9247
  /**
9152
9248
  * Light manager.
@@ -9707,7 +9803,7 @@ SpotLight._combinedData = {
9707
9803
  /**
9708
9804
  * @override
9709
9805
  */ _proto._onDestroy = function _onDestroy() {};
9710
- _createClass(Material, [
9806
+ _create_class(Material, [
9711
9807
  {
9712
9808
  key: "shader",
9713
9809
  get: /**
@@ -9816,9 +9912,15 @@ var RenderElement = function RenderElement() {
9816
9912
  };
9817
9913
  return RenderContext;
9818
9914
  }();
9819
- /** @internal */ RenderContext._vpMatrixProperty = Shader.getPropertyByName("u_VPMat");
9820
- RenderContext._viewMatrixProperty = Shader.getPropertyByName("u_viewMat");
9821
- RenderContext._projectionMatrixProperty = Shader.getPropertyByName("u_projMat");
9915
+ (function() {
9916
+ /** @internal */ RenderContext._vpMatrixProperty = Shader.getPropertyByName("u_VPMat");
9917
+ })();
9918
+ (function() {
9919
+ RenderContext._viewMatrixProperty = Shader.getPropertyByName("u_viewMat");
9920
+ })();
9921
+ (function() {
9922
+ RenderContext._projectionMatrixProperty = Shader.getPropertyByName("u_projMat");
9923
+ })();
9822
9924
 
9823
9925
  var SpriteElement = /*#__PURE__*/ function(RenderElement) {
9824
9926
  _inherits(SpriteElement, RenderElement);
@@ -9873,7 +9975,6 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
9873
9975
  function Renderer1(entity) {
9874
9976
  var _this;
9875
9977
  _this = Component.call(this, entity) || this;
9876
- /** Whether cast shadow. */ _this.castShadows = true;
9877
9978
  /** ShaderData related to renderer. */ _this.shaderData = new ShaderData(ShaderDataGroup.Renderer);
9878
9979
  /** @internal */ _this._onUpdateIndex = -1;
9879
9980
  /** @internal */ _this._rendererIndex = -1;
@@ -9890,11 +9991,12 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
9890
9991
  _this._priority = 0;
9891
9992
  _this._receiveShadows = true;
9892
9993
  _this._rendererLayer = new Vector4();
9994
+ /** Whether cast shadow. */ _this.castShadows = true;
9893
9995
  var prototype = Renderer.prototype;
9894
9996
  var shaderData = _this.shaderData;
9895
9997
  _this._overrideUpdate = _this.update !== prototype.update;
9896
9998
  shaderData._addRefCount(1);
9897
- _this._onTransformChanged = _this._onTransformChanged.bind(_assertThisInitialized(_this));
9999
+ _this._onTransformChanged = _this._onTransformChanged.bind(_assert_this_initialized(_this));
9898
10000
  _this._registerEntityTransformListener();
9899
10001
  shaderData.enableMacro(Renderer._receiveShadowMacro);
9900
10002
  shaderData.setVector4(Renderer._rendererLayerProperty, _this._rendererLayer);
@@ -10079,7 +10181,7 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10079
10181
  _proto._onTransformChanged = function _onTransformChanged(type) {
10080
10182
  this._dirtyUpdateFlag |= 0x1;
10081
10183
  };
10082
- _createClass(Renderer1, [
10184
+ _create_class(Renderer1, [
10083
10185
  {
10084
10186
  key: "isCulled",
10085
10187
  get: /**
@@ -10145,7 +10247,25 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10145
10247
  }
10146
10248
  ]);
10147
10249
  return Renderer1;
10148
- }(Component), _Renderer._tempVector0 = new Vector3(), _Renderer._receiveShadowMacro = Shader.getMacroByName("OASIS_RECEIVE_SHADOWS"), _Renderer._localMatrixProperty = Shader.getPropertyByName("u_localMat"), _Renderer._worldMatrixProperty = Shader.getPropertyByName("u_modelMat"), _Renderer._mvMatrixProperty = Shader.getPropertyByName("u_MVMat"), _Renderer._mvpMatrixProperty = Shader.getPropertyByName("u_MVPMat"), _Renderer._mvInvMatrixProperty = Shader.getPropertyByName("u_MVInvMat"), _Renderer._normalMatrixProperty = Shader.getPropertyByName("u_normalMat"), _Renderer._rendererLayerProperty = Shader.getPropertyByName("oasis_RendererLayer"), _Renderer);
10250
+ }(Component), function() {
10251
+ _Renderer._tempVector0 = new Vector3();
10252
+ }(), function() {
10253
+ _Renderer._receiveShadowMacro = Shader.getMacroByName("OASIS_RECEIVE_SHADOWS");
10254
+ }(), function() {
10255
+ _Renderer._localMatrixProperty = Shader.getPropertyByName("u_localMat");
10256
+ }(), function() {
10257
+ _Renderer._worldMatrixProperty = Shader.getPropertyByName("u_modelMat");
10258
+ }(), function() {
10259
+ _Renderer._mvMatrixProperty = Shader.getPropertyByName("u_MVMat");
10260
+ }(), function() {
10261
+ _Renderer._mvpMatrixProperty = Shader.getPropertyByName("u_MVPMat");
10262
+ }(), function() {
10263
+ _Renderer._mvInvMatrixProperty = Shader.getPropertyByName("u_MVInvMat");
10264
+ }(), function() {
10265
+ _Renderer._normalMatrixProperty = Shader.getPropertyByName("u_normalMat");
10266
+ }(), function() {
10267
+ _Renderer._rendererLayerProperty = Shader.getPropertyByName("oasis_RendererLayer");
10268
+ }(), _Renderer);
10149
10269
  __decorate([
10150
10270
  deepClone
10151
10271
  ], Renderer.prototype, "shaderData", void 0);
@@ -10275,14 +10395,18 @@ var SimpleSpriteAssembler = (_SimpleSpriteAssembler = /*#__PURE__*/ function() {
10275
10395
  renderUVs[3].set(right, top);
10276
10396
  };
10277
10397
  return SimpleSpriteAssembler1;
10278
- }(), _SimpleSpriteAssembler._rectangleTriangles = [
10279
- 0,
10280
- 1,
10281
- 2,
10282
- 2,
10283
- 1,
10284
- 3
10285
- ], _SimpleSpriteAssembler._worldMatrix = new Matrix(), _SimpleSpriteAssembler);
10398
+ }(), function() {
10399
+ _SimpleSpriteAssembler._rectangleTriangles = [
10400
+ 0,
10401
+ 1,
10402
+ 2,
10403
+ 2,
10404
+ 1,
10405
+ 3
10406
+ ];
10407
+ }(), function() {
10408
+ _SimpleSpriteAssembler._worldMatrix = new Matrix();
10409
+ }(), _SimpleSpriteAssembler);
10286
10410
  SimpleSpriteAssembler = __decorate([
10287
10411
  StaticInterfaceImplement()
10288
10412
  ], SimpleSpriteAssembler);
@@ -10367,10 +10491,10 @@ SimpleSpriteAssembler = __decorate([
10367
10491
  _this._flipY = false;
10368
10492
  _this._alphaCutoff = 0.5;
10369
10493
  _this._renderData = new RenderData2D(4, [], []);
10370
- SimpleSpriteAssembler.resetData(_assertThisInitialized(_this));
10494
+ SimpleSpriteAssembler.resetData(_assert_this_initialized(_this));
10371
10495
  _this.setMaterial(_this._engine._spriteMaskDefaultMaterial);
10372
10496
  _this.shaderData.setFloat(SpriteMask._alphaCutoffProperty, _this._alphaCutoff);
10373
- _this._onSpriteChange = _this._onSpriteChange.bind(_assertThisInitialized(_this));
10497
+ _this._onSpriteChange = _this._onSpriteChange.bind(_assert_this_initialized(_this));
10374
10498
  return _this;
10375
10499
  }
10376
10500
  var _proto = SpriteMask.prototype;
@@ -10438,7 +10562,7 @@ SimpleSpriteAssembler = __decorate([
10438
10562
  break;
10439
10563
  }
10440
10564
  };
10441
- _createClass(SpriteMask, [
10565
+ _create_class(SpriteMask, [
10442
10566
  {
10443
10567
  key: "width",
10444
10568
  get: /**
@@ -10540,8 +10664,12 @@ SimpleSpriteAssembler = __decorate([
10540
10664
  ]);
10541
10665
  return SpriteMask;
10542
10666
  }(Renderer);
10543
- /** @internal */ SpriteMask._textureProperty = Shader.getPropertyByName("u_maskTexture");
10544
- /** @internal */ SpriteMask._alphaCutoffProperty = Shader.getPropertyByName("u_maskAlphaCutoff");
10667
+ (function() {
10668
+ /** @internal */ SpriteMask._textureProperty = Shader.getPropertyByName("u_maskTexture");
10669
+ })();
10670
+ (function() {
10671
+ /** @internal */ SpriteMask._alphaCutoffProperty = Shader.getPropertyByName("u_maskAlphaCutoff");
10672
+ })();
10545
10673
  __decorate([
10546
10674
  assignmentClone
10547
10675
  ], SpriteMask.prototype, "influenceLayers", void 0);
@@ -10747,7 +10875,7 @@ var BufferUtil = /*#__PURE__*/ function() {
10747
10875
  this._glElementInfo = BufferUtil._getElementInfo(this.format);
10748
10876
  this._instanceStepRate = Math.floor(instanceStepRate);
10749
10877
  }
10750
- _createClass(VertexElement, [
10878
+ _create_class(VertexElement, [
10751
10879
  {
10752
10880
  key: "semantic",
10753
10881
  get: /**
@@ -10907,7 +11035,7 @@ var BufferUtil = /*#__PURE__*/ function() {
10907
11035
  gl.bufferData(this._glBindTarget, dataLength, this._glBufferUsage);
10908
11036
  this._byteLength = dataLength;
10909
11037
  };
10910
- _createClass(Buffer, [
11038
+ _create_class(Buffer, [
10911
11039
  {
10912
11040
  key: "type",
10913
11041
  get: /**
@@ -10956,7 +11084,7 @@ var BufferUtil = /*#__PURE__*/ function() {
10956
11084
  this._buffer = buffer;
10957
11085
  this._format = format;
10958
11086
  }
10959
- _createClass(IndexBufferBinding, [
11087
+ _create_class(IndexBufferBinding, [
10960
11088
  {
10961
11089
  key: "buffer",
10962
11090
  get: /**
@@ -11005,8 +11133,8 @@ var BufferUtil = /*#__PURE__*/ function() {
11005
11133
  _this._bounds = new BoundingBox();
11006
11134
  _this._subMeshes = [];
11007
11135
  _this.name = name;
11008
- _this._platformPrimitive = _this._engine._hardwareRenderer.createPlatformPrimitive(_assertThisInitialized(_this));
11009
- _this._onBoundsChanged = _this._onBoundsChanged.bind(_assertThisInitialized(_this));
11136
+ _this._platformPrimitive = _this._engine._hardwareRenderer.createPlatformPrimitive(_assert_this_initialized(_this));
11137
+ _this._onBoundsChanged = _this._onBoundsChanged.bind(_assert_this_initialized(_this));
11010
11138
  var bounds = _this._bounds;
11011
11139
  // @ts-ignore
11012
11140
  bounds.min._onValueChanged = _this._onBoundsChanged;
@@ -11123,7 +11251,7 @@ var BufferUtil = /*#__PURE__*/ function() {
11123
11251
  _proto._onBoundsChanged = function _onBoundsChanged() {
11124
11252
  this._updateFlagManager.dispatch(0x1);
11125
11253
  };
11126
- _createClass(Mesh, [
11254
+ _create_class(Mesh, [
11127
11255
  {
11128
11256
  key: "bounds",
11129
11257
  get: /**
@@ -11169,7 +11297,7 @@ var MeshModifyFlags;
11169
11297
  this._buffer = buffer;
11170
11298
  this._stride = stride;
11171
11299
  }
11172
- _createClass(VertexBufferBinding, [
11300
+ _create_class(VertexBufferBinding, [
11173
11301
  {
11174
11302
  key: "buffer",
11175
11303
  get: /**
@@ -11615,13 +11743,27 @@ var MeshModifyFlags;
11615
11743
  };
11616
11744
  return BlendShapeManager;
11617
11745
  }();
11618
- BlendShapeManager._blendShapeMacro = Shader.getMacroByName("OASIS_BLENDSHAPE");
11619
- BlendShapeManager._blendShapeTextureMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_TEXTURE");
11620
- BlendShapeManager._blendShapeNormalMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_NORMAL");
11621
- BlendShapeManager._blendShapeTangentMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_TANGENT");
11622
- BlendShapeManager._blendShapeWeightsProperty = Shader.getPropertyByName("u_blendShapeWeights");
11623
- BlendShapeManager._blendShapeTextureProperty = Shader.getPropertyByName("u_blendShapeTexture");
11624
- BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_blendShapeTextureInfo");
11746
+ (function() {
11747
+ BlendShapeManager._blendShapeMacro = Shader.getMacroByName("OASIS_BLENDSHAPE");
11748
+ })();
11749
+ (function() {
11750
+ BlendShapeManager._blendShapeTextureMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_TEXTURE");
11751
+ })();
11752
+ (function() {
11753
+ BlendShapeManager._blendShapeNormalMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_NORMAL");
11754
+ })();
11755
+ (function() {
11756
+ BlendShapeManager._blendShapeTangentMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_TANGENT");
11757
+ })();
11758
+ (function() {
11759
+ BlendShapeManager._blendShapeWeightsProperty = Shader.getPropertyByName("u_blendShapeWeights");
11760
+ })();
11761
+ (function() {
11762
+ BlendShapeManager._blendShapeTextureProperty = Shader.getPropertyByName("u_blendShapeTexture");
11763
+ })();
11764
+ (function() {
11765
+ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_blendShapeTextureInfo");
11766
+ })();
11625
11767
 
11626
11768
  /**
11627
11769
  * Vertex attribute types of a vertex in a ModelMesh.
@@ -11678,7 +11820,7 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
11678
11820
  _this._customVertexElements = [];
11679
11821
  _this._vertexCountChanged = false;
11680
11822
  _this.name = name;
11681
- _this._blendShapeManager = new BlendShapeManager(engine, _assertThisInitialized(_this));
11823
+ _this._blendShapeManager = new BlendShapeManager(engine, _assert_this_initialized(_this));
11682
11824
  return _this;
11683
11825
  }
11684
11826
  var _proto = ModelMesh.prototype;
@@ -12628,7 +12770,7 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
12628
12770
  this._uv7 = null;
12629
12771
  this._blendShapeManager._releaseMemoryCache();
12630
12772
  };
12631
- _createClass(ModelMesh, [
12773
+ _create_class(ModelMesh, [
12632
12774
  {
12633
12775
  key: "accessible",
12634
12776
  get: /**
@@ -12696,11 +12838,21 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
12696
12838
  ]);
12697
12839
  return ModelMesh;
12698
12840
  }(Mesh);
12699
- ModelMesh._tempVec0 = new Vector3();
12700
- ModelMesh._tempVec1 = new Vector3();
12701
- ModelMesh._tempVec2 = new Vector3();
12702
- ModelMesh._tempVec3 = new Vector3();
12703
- ModelMesh._tempVec4 = new Vector3();
12841
+ (function() {
12842
+ ModelMesh._tempVec0 = new Vector3();
12843
+ })();
12844
+ (function() {
12845
+ ModelMesh._tempVec1 = new Vector3();
12846
+ })();
12847
+ (function() {
12848
+ ModelMesh._tempVec2 = new Vector3();
12849
+ })();
12850
+ (function() {
12851
+ ModelMesh._tempVec3 = new Vector3();
12852
+ })();
12853
+ (function() {
12854
+ ModelMesh._tempVec4 = new Vector3();
12855
+ })();
12704
12856
  var VertexChangedFlags;
12705
12857
  (function(VertexChangedFlags) {
12706
12858
  VertexChangedFlags[VertexChangedFlags["Position"] = 0x1] = "Position";
@@ -12743,7 +12895,7 @@ var VertexChangedFlags;
12743
12895
  function MeshRenderer(entity) {
12744
12896
  var _this;
12745
12897
  _this = Renderer.call(this, entity) || this;
12746
- _this._onMeshChanged = _this._onMeshChanged.bind(_assertThisInitialized(_this));
12898
+ _this._onMeshChanged = _this._onMeshChanged.bind(_assert_this_initialized(_this));
12747
12899
  return _this;
12748
12900
  }
12749
12901
  var _proto = MeshRenderer.prototype;
@@ -12846,7 +12998,7 @@ var VertexChangedFlags;
12846
12998
  type & MeshModifyFlags.Bounds && (this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume);
12847
12999
  type & MeshModifyFlags.VertexElements && (this._dirtyUpdateFlag |= 0x2);
12848
13000
  };
12849
- _createClass(MeshRenderer, [
13001
+ _create_class(MeshRenderer, [
12850
13002
  {
12851
13003
  key: "mesh",
12852
13004
  get: /**
@@ -12863,11 +13015,21 @@ var VertexChangedFlags;
12863
13015
  ]);
12864
13016
  return MeshRenderer;
12865
13017
  }(Renderer);
12866
- MeshRenderer._uvMacro = Shader.getMacroByName("O3_HAS_UV");
12867
- MeshRenderer._uv1Macro = Shader.getMacroByName("O3_HAS_UV1");
12868
- MeshRenderer._normalMacro = Shader.getMacroByName("O3_HAS_NORMAL");
12869
- MeshRenderer._tangentMacro = Shader.getMacroByName("O3_HAS_TANGENT");
12870
- MeshRenderer._vertexColorMacro = Shader.getMacroByName("O3_HAS_VERTEXCOLOR");
13018
+ (function() {
13019
+ MeshRenderer._uvMacro = Shader.getMacroByName("O3_HAS_UV");
13020
+ })();
13021
+ (function() {
13022
+ MeshRenderer._uv1Macro = Shader.getMacroByName("O3_HAS_UV1");
13023
+ })();
13024
+ (function() {
13025
+ MeshRenderer._normalMacro = Shader.getMacroByName("O3_HAS_NORMAL");
13026
+ })();
13027
+ (function() {
13028
+ MeshRenderer._tangentMacro = Shader.getMacroByName("O3_HAS_TANGENT");
13029
+ })();
13030
+ (function() {
13031
+ MeshRenderer._vertexColorMacro = Shader.getMacroByName("O3_HAS_VERTEXCOLOR");
13032
+ })();
12871
13033
  __decorate([
12872
13034
  ignoreClone
12873
13035
  ], MeshRenderer.prototype, "_mesh", void 0);
@@ -12970,7 +13132,7 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
12970
13132
  // For renderer is "ANGLE (AMD, AMD Radeon(TM) Graphics Direct3011 vs_5_0 ps_5_0, D3011)", compile shader si very slow because of max uniform is 4096.
12971
13133
  maxVertexUniformVectors = Math.min(maxVertexUniformVectors, 256);
12972
13134
  _this._maxVertexUniformVectors = maxVertexUniformVectors;
12973
- _this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(_assertThisInitialized(_this));
13135
+ _this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(_assert_this_initialized(_this));
12974
13136
  var localBounds = _this._localBounds;
12975
13137
  // @ts-ignore
12976
13138
  localBounds.min._onValueChanged = _this._onLocalBoundsChanged;
@@ -13168,7 +13330,7 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13168
13330
  _proto._onLocalBoundsChanged = function _onLocalBoundsChanged() {
13169
13331
  this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
13170
13332
  };
13171
- _createClass(SkinnedMeshRenderer, [
13333
+ _create_class(SkinnedMeshRenderer, [
13172
13334
  {
13173
13335
  key: "blendShapeWeights",
13174
13336
  get: /**
@@ -13233,10 +13395,18 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13233
13395
  ]);
13234
13396
  return SkinnedMeshRenderer;
13235
13397
  }(MeshRenderer);
13236
- SkinnedMeshRenderer._tempMatrix = new Matrix();
13237
- SkinnedMeshRenderer._jointCountProperty = Shader.getPropertyByName("u_jointCount");
13238
- SkinnedMeshRenderer._jointSamplerProperty = Shader.getPropertyByName("u_jointSampler");
13239
- SkinnedMeshRenderer._jointMatrixProperty = Shader.getPropertyByName("u_jointMatrix");
13398
+ (function() {
13399
+ SkinnedMeshRenderer._tempMatrix = new Matrix();
13400
+ })();
13401
+ (function() {
13402
+ SkinnedMeshRenderer._jointCountProperty = Shader.getPropertyByName("u_jointCount");
13403
+ })();
13404
+ (function() {
13405
+ SkinnedMeshRenderer._jointSamplerProperty = Shader.getPropertyByName("u_jointSampler");
13406
+ })();
13407
+ (function() {
13408
+ SkinnedMeshRenderer._jointMatrixProperty = Shader.getPropertyByName("u_jointMatrix");
13409
+ })();
13240
13410
  __decorate([
13241
13411
  ignoreClone
13242
13412
  ], SkinnedMeshRenderer.prototype, "_hasInitSkin", void 0);
@@ -14002,7 +14172,7 @@ __decorate([
14002
14172
  }
14003
14173
  this._setIndexBufferBinding(binding);
14004
14174
  };
14005
- _createClass(BufferMesh, [
14175
+ _create_class(BufferMesh, [
14006
14176
  {
14007
14177
  key: "instanceCount",
14008
14178
  get: /**
@@ -14116,7 +14286,7 @@ __decorate([
14116
14286
  this._layoutChangeManager.dispatch(0, this);
14117
14287
  }
14118
14288
  };
14119
- _createClass(BlendShape, [
14289
+ _create_class(BlendShape, [
14120
14290
  {
14121
14291
  key: "frames",
14122
14292
  get: /**
@@ -14274,8 +14444,12 @@ var Basic2DBatcher = /*#__PURE__*/ function() {
14274
14444
  };
14275
14445
  return Basic2DBatcher;
14276
14446
  }();
14277
- /** The maximum number of vertex. */ Basic2DBatcher.MAX_VERTEX_COUNT = 4096;
14278
- Basic2DBatcher._canUploadSameBuffer = true;
14447
+ (function() {
14448
+ /** The maximum number of vertex. */ Basic2DBatcher.MAX_VERTEX_COUNT = 4096;
14449
+ })();
14450
+ (function() {
14451
+ Basic2DBatcher._canUploadSameBuffer = true;
14452
+ })();
14279
14453
 
14280
14454
  var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher) {
14281
14455
  _inherits(SpriteMaskBatcher, Basic2DBatcher);
@@ -14490,9 +14664,15 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
14490
14664
  };
14491
14665
  return Sky;
14492
14666
  }();
14493
- Sky._epsilon = 1e-6;
14494
- Sky._viewProjMatrix = new Matrix();
14495
- Sky._projectionMatrix = new Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky._epsilon - 1, -1, 0, 0, 0, 0);
14667
+ (function() {
14668
+ Sky._epsilon = 1e-6;
14669
+ })();
14670
+ (function() {
14671
+ Sky._viewProjMatrix = new Matrix();
14672
+ })();
14673
+ (function() {
14674
+ Sky._projectionMatrix = new Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky._epsilon - 1, -1, 0, 0, 0, 0);
14675
+ })();
14496
14676
 
14497
14677
  /**
14498
14678
  * Background of scene.
@@ -14574,7 +14754,7 @@ Sky._projectionMatrix = new Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky._epsilon -
14574
14754
  mesh.addSubMesh(0, indices.length);
14575
14755
  return mesh;
14576
14756
  };
14577
- _createClass(Background, [
14757
+ _create_class(Background, [
14578
14758
  {
14579
14759
  key: "texture",
14580
14760
  get: /**
@@ -14742,7 +14922,7 @@ Sky._projectionMatrix = new Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky._epsilon -
14742
14922
  out[25] = src[25] * 0.429042;
14743
14923
  out[26] = src[26] * 0.429042;
14744
14924
  };
14745
- _createClass(AmbientLight, [
14925
+ _create_class(AmbientLight, [
14746
14926
  {
14747
14927
  key: "specularTextureDecodeRGBM",
14748
14928
  get: /**
@@ -14853,15 +15033,33 @@ Sky._projectionMatrix = new Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky._epsilon -
14853
15033
  ]);
14854
15034
  return AmbientLight;
14855
15035
  }();
14856
- AmbientLight._shMacro = Shader.getMacroByName("O3_USE_SH");
14857
- AmbientLight._specularMacro = Shader.getMacroByName("O3_USE_SPECULAR_ENV");
14858
- AmbientLight._decodeRGBMMacro = Shader.getMacroByName("O3_DECODE_ENV_RGBM");
14859
- AmbientLight._diffuseColorProperty = Shader.getPropertyByName("u_envMapLight.diffuse");
14860
- AmbientLight._diffuseSHProperty = Shader.getPropertyByName("u_env_sh");
14861
- AmbientLight._diffuseIntensityProperty = Shader.getPropertyByName("u_envMapLight.diffuseIntensity");
14862
- AmbientLight._specularTextureProperty = Shader.getPropertyByName("u_env_specularSampler");
14863
- AmbientLight._specularIntensityProperty = Shader.getPropertyByName("u_envMapLight.specularIntensity");
14864
- AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapLevel");
15036
+ (function() {
15037
+ AmbientLight._shMacro = Shader.getMacroByName("O3_USE_SH");
15038
+ })();
15039
+ (function() {
15040
+ AmbientLight._specularMacro = Shader.getMacroByName("O3_USE_SPECULAR_ENV");
15041
+ })();
15042
+ (function() {
15043
+ AmbientLight._decodeRGBMMacro = Shader.getMacroByName("O3_DECODE_ENV_RGBM");
15044
+ })();
15045
+ (function() {
15046
+ AmbientLight._diffuseColorProperty = Shader.getPropertyByName("u_envMapLight.diffuse");
15047
+ })();
15048
+ (function() {
15049
+ AmbientLight._diffuseSHProperty = Shader.getPropertyByName("u_env_sh");
15050
+ })();
15051
+ (function() {
15052
+ AmbientLight._diffuseIntensityProperty = Shader.getPropertyByName("u_envMapLight.diffuseIntensity");
15053
+ })();
15054
+ (function() {
15055
+ AmbientLight._specularTextureProperty = Shader.getPropertyByName("u_env_specularSampler");
15056
+ })();
15057
+ (function() {
15058
+ AmbientLight._specularIntensityProperty = Shader.getPropertyByName("u_envMapLight.specularIntensity");
15059
+ })();
15060
+ (function() {
15061
+ AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapLevel");
15062
+ })();
14865
15063
 
14866
15064
  /**
14867
15065
  * Scene.
@@ -14892,7 +15090,7 @@ AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapL
14892
15090
  var shaderData = _this.shaderData;
14893
15091
  shaderData._addRefCount(1);
14894
15092
  _this.ambientLight = new AmbientLight();
14895
- engine.sceneManager._allScenes.push(_assertThisInitialized(_this));
15093
+ engine.sceneManager._allScenes.push(_assert_this_initialized(_this));
14896
15094
  shaderData.enableMacro("OASIS_FOG_MODE", _this._fogMode.toString());
14897
15095
  shaderData.enableMacro("CASCADED_COUNT", _this.shadowCascades.toString());
14898
15096
  shaderData.setColor(Scene._fogColorProperty, _this._fogColor);
@@ -15099,7 +15297,7 @@ AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapL
15099
15297
  this._fogParams.z = density / Math.LN2;
15100
15298
  this._fogParams.w = density / Math.sqrt(Math.LN2);
15101
15299
  };
15102
- _createClass(Scene, [
15300
+ _create_class(Scene, [
15103
15301
  {
15104
15302
  key: "shadowCascades",
15105
15303
  get: /**
@@ -15227,8 +15425,12 @@ AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapL
15227
15425
  ]);
15228
15426
  return Scene;
15229
15427
  }(EngineObject);
15230
- Scene._fogColorProperty = Shader.getPropertyByName("oasis_FogColor");
15231
- Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
15428
+ (function() {
15429
+ Scene._fogColorProperty = Shader.getPropertyByName("oasis_FogColor");
15430
+ })();
15431
+ (function() {
15432
+ Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
15433
+ })();
15232
15434
 
15233
15435
  /**
15234
15436
  * Scene manager.
@@ -15276,7 +15478,7 @@ Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
15276
15478
  }
15277
15479
  allScenes.length = 0;
15278
15480
  };
15279
- _createClass(SceneManager, [
15481
+ _create_class(SceneManager, [
15280
15482
  {
15281
15483
  key: "activeScene",
15282
15484
  get: /**
@@ -15447,8 +15649,8 @@ ShaderPool.init();
15447
15649
  /** @internal */ _this._canSpriteBatch = true;
15448
15650
  /** @internal @todo: temporary solution */ _this._macroCollection = new ShaderMacroCollection();
15449
15651
  _this._settings = {};
15450
- _this._resourceManager = new ResourceManager(_assertThisInitialized(_this));
15451
- _this._sceneManager = new SceneManager(_assertThisInitialized(_this));
15652
+ _this._resourceManager = new ResourceManager(_assert_this_initialized(_this));
15653
+ _this._sceneManager = new SceneManager(_assert_this_initialized(_this));
15452
15654
  _this._vSyncCount = 1;
15453
15655
  _this._targetFrameRate = 60;
15454
15656
  _this._time = new Time();
@@ -15472,25 +15674,25 @@ ShaderPool.init();
15472
15674
  };
15473
15675
  _this._hardwareRenderer = hardwareRenderer;
15474
15676
  _this._hardwareRenderer.init(canvas);
15475
- _this.physicsManager = new PhysicsManager(_assertThisInitialized(_this));
15677
+ _this.physicsManager = new PhysicsManager(_assert_this_initialized(_this));
15476
15678
  _this._canvas = canvas;
15477
- _this._sceneManager.activeScene = new Scene(_assertThisInitialized(_this), "DefaultScene");
15478
- _this._spriteMaskManager = new SpriteMaskManager(_assertThisInitialized(_this));
15679
+ _this._sceneManager.activeScene = new Scene(_assert_this_initialized(_this), "DefaultScene");
15680
+ _this._spriteMaskManager = new SpriteMaskManager(_assert_this_initialized(_this));
15479
15681
  _this._spriteDefaultMaterial = _this._createSpriteMaterial();
15480
15682
  _this._spriteMaskDefaultMaterial = _this._createSpriteMaskMaterial();
15481
- _this._textDefaultFont = Font.createFromOS(_assertThisInitialized(_this), "Arial");
15683
+ _this._textDefaultFont = Font.createFromOS(_assert_this_initialized(_this), "Arial");
15482
15684
  _this._textDefaultFont.isGCIgnored = false;
15483
- _this.inputManager = new InputManager(_assertThisInitialized(_this));
15685
+ _this.inputManager = new InputManager(_assert_this_initialized(_this));
15484
15686
  var magentaPixel = new Uint8Array([
15485
15687
  255,
15486
15688
  0,
15487
15689
  255,
15488
15690
  255
15489
15691
  ]);
15490
- var magentaTexture2D = new Texture2D(_assertThisInitialized(_this), 1, 1, TextureFormat.R8G8B8A8, false);
15692
+ var magentaTexture2D = new Texture2D(_assert_this_initialized(_this), 1, 1, TextureFormat.R8G8B8A8, false);
15491
15693
  magentaTexture2D.setPixelBuffer(magentaPixel);
15492
15694
  magentaTexture2D.isGCIgnored = true;
15493
- var magentaTextureCube = new TextureCube(_assertThisInitialized(_this), 1, TextureFormat.R8G8B8A8, false);
15695
+ var magentaTextureCube = new TextureCube(_assert_this_initialized(_this), 1, TextureFormat.R8G8B8A8, false);
15494
15696
  magentaTextureCube.setPixelBuffer(TextureCubeFace.PositiveX, magentaPixel);
15495
15697
  magentaTextureCube.setPixelBuffer(TextureCubeFace.NegativeX, magentaPixel);
15496
15698
  magentaTextureCube.setPixelBuffer(TextureCubeFace.PositiveY, magentaPixel);
@@ -15501,22 +15703,22 @@ ShaderPool.init();
15501
15703
  if (!hardwareRenderer.canIUse(GLCapabilityType.depthTexture)) {
15502
15704
  _this._macroCollection.enable(Engine._noDepthTextureMacro);
15503
15705
  } else {
15504
- var depthTexture2D = new Texture2D(_assertThisInitialized(_this), 1, 1, TextureFormat.Depth16, false);
15706
+ var depthTexture2D = new Texture2D(_assert_this_initialized(_this), 1, 1, TextureFormat.Depth16, false);
15505
15707
  depthTexture2D.isGCIgnored = true;
15506
15708
  _this._depthTexture2D = depthTexture2D;
15507
15709
  }
15508
15710
  _this._magentaTexture2D = magentaTexture2D;
15509
15711
  _this._magentaTextureCube = magentaTextureCube;
15510
15712
  if (hardwareRenderer.isWebGL2) {
15511
- var magentaTexture2DArray = new Texture2DArray(_assertThisInitialized(_this), 1, 1, 1, TextureFormat.R8G8B8A8, false);
15713
+ var magentaTexture2DArray = new Texture2DArray(_assert_this_initialized(_this), 1, 1, 1, TextureFormat.R8G8B8A8, false);
15512
15714
  magentaTexture2DArray.setPixelBuffer(0, magentaPixel);
15513
15715
  magentaTexture2DArray.isGCIgnored = true;
15514
15716
  _this._magentaTexture2DArray = magentaTexture2DArray;
15515
15717
  }
15516
- var magentaMaterial = new Material(_assertThisInitialized(_this), Shader.find("unlit"));
15718
+ var magentaMaterial = new Material(_assert_this_initialized(_this), Shader.find("unlit"));
15517
15719
  magentaMaterial.shaderData.setColor("u_baseColor", new Color(1.0, 0.0, 1.01, 1.0));
15518
15720
  _this._magentaMaterial = magentaMaterial;
15519
- var backgroundTextureMaterial = new Material(_assertThisInitialized(_this), Shader.find("background-texture"));
15721
+ var backgroundTextureMaterial = new Material(_assert_this_initialized(_this), Shader.find("background-texture"));
15520
15722
  backgroundTextureMaterial.isGCIgnored = true;
15521
15723
  backgroundTextureMaterial.renderState.depthState.compareFunction = CompareFunction.LessEqual;
15522
15724
  _this._backgroundTextureMaterial = backgroundTextureMaterial;
@@ -15687,7 +15889,7 @@ ShaderPool.init();
15687
15889
  material.isGCIgnored = true;
15688
15890
  return material;
15689
15891
  };
15690
- _createClass(Engine, [
15892
+ _create_class(Engine, [
15691
15893
  {
15692
15894
  key: "settings",
15693
15895
  get: /**
@@ -15775,9 +15977,15 @@ ShaderPool.init();
15775
15977
  ]);
15776
15978
  return Engine;
15777
15979
  }(EventDispatcher);
15778
- /** @internal */ Engine._gammaMacro = Shader.getMacroByName("OASIS_COLORSPACE_GAMMA");
15779
- /** @internal */ Engine._noDepthTextureMacro = Shader.getMacroByName("OASIS_NO_DEPTH_TEXTURE");
15780
- /** @internal Conversion of space units to pixel units for 2D. */ Engine._pixelsPerUnit = 100;
15980
+ (function() {
15981
+ /** @internal */ Engine._gammaMacro = Shader.getMacroByName("OASIS_COLORSPACE_GAMMA");
15982
+ })();
15983
+ (function() {
15984
+ /** @internal */ Engine._noDepthTextureMacro = Shader.getMacroByName("OASIS_NO_DEPTH_TEXTURE");
15985
+ })();
15986
+ (function() {
15987
+ /** @internal Conversion of space units to pixel units for 2D. */ Engine._pixelsPerUnit = 100;
15988
+ })();
15781
15989
 
15782
15990
  /**
15783
15991
  * Script class, used for logic writing.
@@ -16092,7 +16300,9 @@ __decorate([
16092
16300
  };
16093
16301
  return SpriteBatcher;
16094
16302
  }(Basic2DBatcher);
16095
- SpriteBatcher._textureProperty = Shader.getPropertyByName("u_spriteTexture");
16303
+ (function() {
16304
+ SpriteBatcher._textureProperty = Shader.getPropertyByName("u_spriteTexture");
16305
+ })();
16096
16306
 
16097
16307
  /**
16098
16308
  * Render queue.
@@ -16590,227 +16800,247 @@ var /**
16590
16800
  };
16591
16801
  return ShadowUtils;
16592
16802
  }();
16593
- ShadowUtils._tempMatrix0 = new Matrix();
16594
- // prettier-ignore
16595
- /** @internal */ ShadowUtils._shadowMapCoordMatrix = new Matrix(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);
16596
- ShadowUtils._frustumCorners = [
16597
- new Vector3(),
16598
- new Vector3(),
16599
- new Vector3(),
16600
- new Vector3(),
16601
- new Vector3(),
16602
- new Vector3(),
16603
- new Vector3(),
16604
- new Vector3()
16605
- ];
16606
- ShadowUtils._adjustNearPlane = new Plane(new Vector3());
16607
- ShadowUtils._adjustFarPlane = new Plane(new Vector3());
16608
- ShadowUtils._backPlaneFaces = new Array(5);
16609
- ShadowUtils._edgePlanePoint2 = new Vector3();
16610
- /** near, far, left, right, bottom, top */ ShadowUtils._frustumPlaneNeighbors = [
16611
- [
16612
- FrustumFace.Left,
16613
- FrustumFace.Right,
16614
- FrustumFace.Top,
16615
- FrustumFace.Bottom
16616
- ],
16617
- [
16618
- FrustumFace.Left,
16619
- FrustumFace.Right,
16620
- FrustumFace.Top,
16621
- FrustumFace.Bottom
16622
- ],
16623
- [
16624
- FrustumFace.Near,
16625
- FrustumFace.Far,
16626
- FrustumFace.Top,
16627
- FrustumFace.Bottom
16628
- ],
16629
- [
16630
- FrustumFace.Near,
16631
- FrustumFace.Far,
16632
- FrustumFace.Top,
16633
- FrustumFace.Bottom
16634
- ],
16635
- [
16636
- FrustumFace.Near,
16637
- FrustumFace.Far,
16638
- FrustumFace.Left,
16639
- FrustumFace.Right
16640
- ],
16641
- [
16642
- FrustumFace.Near,
16643
- FrustumFace.Far,
16644
- FrustumFace.Left,
16645
- FrustumFace.Right
16646
- ]
16647
- ];
16648
- /** near, far, left, right, bottom, top */ ShadowUtils._frustumTwoPlaneCorners = [
16649
- [
16650
- // near, far, left, right, bottom, top
16651
- [
16652
- 8,
16653
- 8
16654
- ],
16655
- [
16656
- 8,
16657
- 8
16658
- ],
16659
- [
16660
- 4,
16661
- 5
16662
- ],
16663
- [
16664
- 6,
16665
- 7
16666
- ],
16667
- [
16668
- 7,
16669
- 4
16670
- ],
16671
- [
16672
- 5,
16673
- 6
16674
- ]
16675
- ],
16676
- [
16677
- // near, far, left, right, bottom, top
16678
- [
16679
- 8,
16680
- 8
16681
- ],
16682
- [
16683
- 8,
16684
- 8
16685
- ],
16686
- [
16687
- 1,
16688
- 0
16689
- ],
16690
- [
16691
- 3,
16692
- 2
16693
- ],
16694
- [
16695
- 0,
16696
- 3
16697
- ],
16698
- [
16699
- 2,
16700
- 1
16701
- ]
16702
- ],
16703
- [
16704
- // near, far, left, right, bottom, top
16705
- [
16706
- 5,
16707
- 4
16708
- ],
16709
- [
16710
- 0,
16711
- 1
16712
- ],
16713
- [
16714
- 8,
16715
- 8
16716
- ],
16717
- [
16718
- 8,
16719
- 8
16720
- ],
16721
- [
16722
- 4,
16723
- 0
16724
- ],
16725
- [
16726
- 1,
16727
- 5
16728
- ]
16729
- ],
16730
- [
16731
- // near, far, left, right, bottom, top
16732
- [
16733
- 7,
16734
- 6
16735
- ],
16736
- [
16737
- 2,
16738
- 3
16739
- ],
16740
- [
16741
- 8,
16742
- 8
16743
- ],
16744
- [
16745
- 8,
16746
- 8
16747
- ],
16748
- [
16749
- 3,
16750
- 7
16751
- ],
16752
- [
16753
- 6,
16754
- 2
16755
- ]
16756
- ],
16757
- [
16758
- // near, far, left, right, bottom, top
16803
+ (function() {
16804
+ ShadowUtils._tempMatrix0 = new Matrix();
16805
+ })();
16806
+ (function() {
16807
+ // prettier-ignore
16808
+ /** @internal */ ShadowUtils._shadowMapCoordMatrix = new Matrix(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);
16809
+ })();
16810
+ (function() {
16811
+ ShadowUtils._frustumCorners = [
16812
+ new Vector3(),
16813
+ new Vector3(),
16814
+ new Vector3(),
16815
+ new Vector3(),
16816
+ new Vector3(),
16817
+ new Vector3(),
16818
+ new Vector3(),
16819
+ new Vector3()
16820
+ ];
16821
+ })();
16822
+ (function() {
16823
+ ShadowUtils._adjustNearPlane = new Plane(new Vector3());
16824
+ })();
16825
+ (function() {
16826
+ ShadowUtils._adjustFarPlane = new Plane(new Vector3());
16827
+ })();
16828
+ (function() {
16829
+ ShadowUtils._backPlaneFaces = new Array(5);
16830
+ })();
16831
+ (function() {
16832
+ ShadowUtils._edgePlanePoint2 = new Vector3();
16833
+ })();
16834
+ (function() {
16835
+ /** near, far, left, right, bottom, top */ ShadowUtils._frustumPlaneNeighbors = [
16759
16836
  [
16760
- 4,
16761
- 7
16837
+ FrustumFace.Left,
16838
+ FrustumFace.Right,
16839
+ FrustumFace.Top,
16840
+ FrustumFace.Bottom
16762
16841
  ],
16763
16842
  [
16764
- 3,
16765
- 0
16843
+ FrustumFace.Left,
16844
+ FrustumFace.Right,
16845
+ FrustumFace.Top,
16846
+ FrustumFace.Bottom
16766
16847
  ],
16767
16848
  [
16768
- 0,
16769
- 4
16849
+ FrustumFace.Near,
16850
+ FrustumFace.Far,
16851
+ FrustumFace.Top,
16852
+ FrustumFace.Bottom
16770
16853
  ],
16771
16854
  [
16772
- 7,
16773
- 3
16855
+ FrustumFace.Near,
16856
+ FrustumFace.Far,
16857
+ FrustumFace.Top,
16858
+ FrustumFace.Bottom
16774
16859
  ],
16775
16860
  [
16776
- 8,
16777
- 8
16861
+ FrustumFace.Near,
16862
+ FrustumFace.Far,
16863
+ FrustumFace.Left,
16864
+ FrustumFace.Right
16778
16865
  ],
16779
16866
  [
16780
- 8,
16781
- 8
16867
+ FrustumFace.Near,
16868
+ FrustumFace.Far,
16869
+ FrustumFace.Left,
16870
+ FrustumFace.Right
16782
16871
  ]
16783
- ],
16784
- [
16785
- // near, far, left, right, bottom, top
16872
+ ];
16873
+ })();
16874
+ (function() {
16875
+ /** near, far, left, right, bottom, top */ ShadowUtils._frustumTwoPlaneCorners = [
16786
16876
  [
16787
- 6,
16788
- 5
16877
+ // near, far, left, right, bottom, top
16878
+ [
16879
+ 8,
16880
+ 8
16881
+ ],
16882
+ [
16883
+ 8,
16884
+ 8
16885
+ ],
16886
+ [
16887
+ 4,
16888
+ 5
16889
+ ],
16890
+ [
16891
+ 6,
16892
+ 7
16893
+ ],
16894
+ [
16895
+ 7,
16896
+ 4
16897
+ ],
16898
+ [
16899
+ 5,
16900
+ 6
16901
+ ]
16789
16902
  ],
16790
16903
  [
16791
- 1,
16792
- 2
16904
+ // near, far, left, right, bottom, top
16905
+ [
16906
+ 8,
16907
+ 8
16908
+ ],
16909
+ [
16910
+ 8,
16911
+ 8
16912
+ ],
16913
+ [
16914
+ 1,
16915
+ 0
16916
+ ],
16917
+ [
16918
+ 3,
16919
+ 2
16920
+ ],
16921
+ [
16922
+ 0,
16923
+ 3
16924
+ ],
16925
+ [
16926
+ 2,
16927
+ 1
16928
+ ]
16793
16929
  ],
16794
16930
  [
16795
- 5,
16796
- 1
16931
+ // near, far, left, right, bottom, top
16932
+ [
16933
+ 5,
16934
+ 4
16935
+ ],
16936
+ [
16937
+ 0,
16938
+ 1
16939
+ ],
16940
+ [
16941
+ 8,
16942
+ 8
16943
+ ],
16944
+ [
16945
+ 8,
16946
+ 8
16947
+ ],
16948
+ [
16949
+ 4,
16950
+ 0
16951
+ ],
16952
+ [
16953
+ 1,
16954
+ 5
16955
+ ]
16797
16956
  ],
16798
16957
  [
16799
- 2,
16800
- 6
16958
+ // near, far, left, right, bottom, top
16959
+ [
16960
+ 7,
16961
+ 6
16962
+ ],
16963
+ [
16964
+ 2,
16965
+ 3
16966
+ ],
16967
+ [
16968
+ 8,
16969
+ 8
16970
+ ],
16971
+ [
16972
+ 8,
16973
+ 8
16974
+ ],
16975
+ [
16976
+ 3,
16977
+ 7
16978
+ ],
16979
+ [
16980
+ 6,
16981
+ 2
16982
+ ]
16801
16983
  ],
16802
16984
  [
16803
- 8,
16804
- 8
16985
+ // near, far, left, right, bottom, top
16986
+ [
16987
+ 4,
16988
+ 7
16989
+ ],
16990
+ [
16991
+ 3,
16992
+ 0
16993
+ ],
16994
+ [
16995
+ 0,
16996
+ 4
16997
+ ],
16998
+ [
16999
+ 7,
17000
+ 3
17001
+ ],
17002
+ [
17003
+ 8,
17004
+ 8
17005
+ ],
17006
+ [
17007
+ 8,
17008
+ 8
17009
+ ]
16805
17010
  ],
16806
17011
  [
16807
- 8,
16808
- 8
17012
+ // near, far, left, right, bottom, top
17013
+ [
17014
+ 6,
17015
+ 5
17016
+ ],
17017
+ [
17018
+ 1,
17019
+ 2
17020
+ ],
17021
+ [
17022
+ 5,
17023
+ 1
17024
+ ],
17025
+ [
17026
+ 2,
17027
+ 6
17028
+ ],
17029
+ [
17030
+ 8,
17031
+ 8
17032
+ ],
17033
+ [
17034
+ 8,
17035
+ 8
17036
+ ]
16809
17037
  ]
16810
- ]
16811
- ];
16812
- //now max shadow sample tent is 5x5, atlas borderSize at least 3=ceil(2.5),and +1 pixel is for global border for no cascade mode.
16813
- ShadowUtils.atlasBorderSize = 4.0;
17038
+ ];
17039
+ })();
17040
+ (function() {
17041
+ //now max shadow sample tent is 5x5, atlas borderSize at least 3=ceil(2.5),and +1 pixel is for global border for no cascade mode.
17042
+ ShadowUtils.atlasBorderSize = 4.0;
17043
+ })();
16814
17044
 
16815
17045
  /**
16816
17046
  * Cascade shadow caster.
@@ -17047,18 +17277,42 @@ ShadowUtils.atlasBorderSize = 4.0;
17047
17277
  };
17048
17278
  return CascadedShadowCasterPass;
17049
17279
  }();
17050
- CascadedShadowCasterPass._lightShadowBiasProperty = Shader.getPropertyByName("u_shadowBias");
17051
- CascadedShadowCasterPass._lightDirectionProperty = Shader.getPropertyByName("u_lightDirection");
17052
- CascadedShadowCasterPass._shadowMatricesProperty = Shader.getPropertyByName("u_shadowMatrices");
17053
- CascadedShadowCasterPass._shadowMapSize = Shader.getPropertyByName("u_shadowMapSize");
17054
- CascadedShadowCasterPass._shadowInfosProperty = Shader.getPropertyByName("u_shadowInfo");
17055
- CascadedShadowCasterPass._shadowMapsProperty = Shader.getPropertyByName("u_shadowMap");
17056
- CascadedShadowCasterPass._shadowSplitSpheresProperty = Shader.getPropertyByName("u_shadowSplitSpheres");
17057
- CascadedShadowCasterPass._maxCascades = 4;
17058
- CascadedShadowCasterPass._cascadesSplitDistance = new Array(CascadedShadowCasterPass._maxCascades + 1);
17059
- CascadedShadowCasterPass._clearColor = new Color$1(1, 1, 1, 1);
17060
- CascadedShadowCasterPass._tempVector = new Vector3();
17061
- CascadedShadowCasterPass._tempMatrix0 = new Matrix();
17280
+ (function() {
17281
+ CascadedShadowCasterPass._lightShadowBiasProperty = Shader.getPropertyByName("u_shadowBias");
17282
+ })();
17283
+ (function() {
17284
+ CascadedShadowCasterPass._lightDirectionProperty = Shader.getPropertyByName("u_lightDirection");
17285
+ })();
17286
+ (function() {
17287
+ CascadedShadowCasterPass._shadowMatricesProperty = Shader.getPropertyByName("u_shadowMatrices");
17288
+ })();
17289
+ (function() {
17290
+ CascadedShadowCasterPass._shadowMapSize = Shader.getPropertyByName("u_shadowMapSize");
17291
+ })();
17292
+ (function() {
17293
+ CascadedShadowCasterPass._shadowInfosProperty = Shader.getPropertyByName("u_shadowInfo");
17294
+ })();
17295
+ (function() {
17296
+ CascadedShadowCasterPass._shadowMapsProperty = Shader.getPropertyByName("u_shadowMap");
17297
+ })();
17298
+ (function() {
17299
+ CascadedShadowCasterPass._shadowSplitSpheresProperty = Shader.getPropertyByName("u_shadowSplitSpheres");
17300
+ })();
17301
+ (function() {
17302
+ CascadedShadowCasterPass._maxCascades = 4;
17303
+ })();
17304
+ (function() {
17305
+ CascadedShadowCasterPass._cascadesSplitDistance = new Array(CascadedShadowCasterPass._maxCascades + 1);
17306
+ })();
17307
+ (function() {
17308
+ CascadedShadowCasterPass._clearColor = new Color$1(1, 1, 1, 1);
17309
+ })();
17310
+ (function() {
17311
+ CascadedShadowCasterPass._tempVector = new Vector3();
17312
+ })();
17313
+ (function() {
17314
+ CascadedShadowCasterPass._tempMatrix0 = new Matrix();
17315
+ })();
17062
17316
 
17063
17317
  var passNum = 0;
17064
17318
  /**
@@ -17291,7 +17545,7 @@ var passNum = 0;
17291
17545
  renderer._prepareRender(context);
17292
17546
  }
17293
17547
  };
17294
- _createClass(BasicRenderPipeline, [
17548
+ _create_class(BasicRenderPipeline, [
17295
17549
  {
17296
17550
  key: "defaultRenderPass",
17297
17551
  get: /**
@@ -17303,15 +17557,25 @@ var passNum = 0;
17303
17557
  ]);
17304
17558
  return BasicRenderPipeline;
17305
17559
  }();
17306
- BasicRenderPipeline._tempVector0 = new Vector3();
17307
- BasicRenderPipeline._tempVector1 = new Vector3();
17560
+ (function() {
17561
+ BasicRenderPipeline._tempVector0 = new Vector3();
17562
+ })();
17563
+ (function() {
17564
+ BasicRenderPipeline._tempVector1 = new Vector3();
17565
+ })();
17308
17566
 
17309
17567
  var _Camera;
17310
17568
  var MathTemp = function MathTemp() {
17311
17569
  };
17312
- MathTemp.tempVec4 = new Vector4();
17313
- MathTemp.tempVec3 = new Vector3();
17314
- MathTemp.tempVec2 = new Vector2();
17570
+ (function() {
17571
+ MathTemp.tempVec4 = new Vector4();
17572
+ })();
17573
+ (function() {
17574
+ MathTemp.tempVec3 = new Vector3();
17575
+ })();
17576
+ (function() {
17577
+ MathTemp.tempVec2 = new Vector2();
17578
+ })();
17315
17579
  var Camera = (_Camera = /*#__PURE__*/ function(Component) {
17316
17580
  _inherits(Camera1, Component);
17317
17581
  function Camera1(entity) {
@@ -17329,6 +17593,8 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component) {
17329
17593
  * @remarks Support bit manipulation, corresponding to `Layer`.
17330
17594
  */ _this.cullingMask = Layer.Everything;
17331
17595
  /** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
17596
+ /** @internal */ _this._frustum = new BoundingFrustum();
17597
+ /** @internal */ _this._virtualCamera = new VirtualCamera();
17332
17598
  _this._isProjMatSetting = false;
17333
17599
  _this._nearClipPlane = 0.1;
17334
17600
  _this._farClipPlane = 100;
@@ -17339,8 +17605,6 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component) {
17339
17605
  _this._isFrustumProjectDirty = true;
17340
17606
  _this._customAspectRatio = undefined;
17341
17607
  _this._renderTarget = null;
17342
- /** @internal */ _this._frustum = new BoundingFrustum();
17343
- /** @internal */ _this._virtualCamera = new VirtualCamera();
17344
17608
  _this._viewport = new Vector4(0, 0, 1, 1);
17345
17609
  _this._inverseProjectionMatrix = new Matrix();
17346
17610
  _this._lastAspectSize = new Vector2(0, 0);
@@ -17350,7 +17614,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component) {
17350
17614
  _this._isViewMatrixDirty = transform.registerWorldChangeFlag();
17351
17615
  _this._isInvViewProjDirty = transform.registerWorldChangeFlag();
17352
17616
  _this._frustumViewChangeFlag = transform.registerWorldChangeFlag();
17353
- _this._renderPipeline = new BasicRenderPipeline(_assertThisInitialized(_this));
17617
+ _this._renderPipeline = new BasicRenderPipeline(_assert_this_initialized(_this));
17354
17618
  _this.shaderData._addRefCount(1);
17355
17619
  return _this;
17356
17620
  }
@@ -17567,7 +17831,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component) {
17567
17831
  }
17568
17832
  return this._inverseProjectionMatrix;
17569
17833
  };
17570
- _createClass(Camera1, [
17834
+ _create_class(Camera1, [
17571
17835
  {
17572
17836
  key: "nearClipPlane",
17573
17837
  get: /**
@@ -17731,7 +17995,11 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component) {
17731
17995
  }
17732
17996
  ]);
17733
17997
  return Camera1;
17734
- }(Component), /** @internal */ _Camera._inverseViewMatrixProperty = Shader.getPropertyByName("u_viewInvMat"), /** @internal */ _Camera._cameraPositionProperty = Shader.getPropertyByName("u_cameraPos"), _Camera);
17998
+ }(Component), function() {
17999
+ /** @internal */ _Camera._inverseViewMatrixProperty = Shader.getPropertyByName("u_viewInvMat");
18000
+ }(), function() {
18001
+ /** @internal */ _Camera._cameraPositionProperty = Shader.getPropertyByName("u_cameraPos");
18002
+ }(), _Camera);
17735
18003
  __decorate([
17736
18004
  deepClone
17737
18005
  ], Camera.prototype, "_frustum", void 0);
@@ -17942,7 +18210,9 @@ var MultiExecutor = /*#__PURE__*/ function() {
17942
18210
  };
17943
18211
  return Loader;
17944
18212
  }();
17945
- Loader._engineObjects = {};
18213
+ (function() {
18214
+ Loader._engineObjects = {};
18215
+ })();
17946
18216
 
17947
18217
  /**
17948
18218
  * Asset Type.
@@ -18095,7 +18365,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
18095
18365
  target._isTransparent = this._isTransparent;
18096
18366
  target._blendMode = this._blendMode;
18097
18367
  };
18098
- _createClass(BaseMaterial, [
18368
+ _create_class(BaseMaterial, [
18099
18369
  {
18100
18370
  key: "shader",
18101
18371
  get: /**
@@ -18195,19 +18465,45 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
18195
18465
  ]);
18196
18466
  return BaseMaterial;
18197
18467
  }(Material);
18198
- BaseMaterial._baseColorProp = Shader.getPropertyByName("u_baseColor");
18199
- BaseMaterial._baseTextureProp = Shader.getPropertyByName("u_baseTexture");
18200
- BaseMaterial._baseTextureMacro = Shader.getMacroByName("BASETEXTURE");
18201
- BaseMaterial._tilingOffsetProp = Shader.getPropertyByName("u_tilingOffset");
18202
- BaseMaterial._normalTextureProp = Shader.getPropertyByName("u_normalTexture");
18203
- BaseMaterial._normalIntensityProp = Shader.getPropertyByName("u_normalIntensity");
18204
- BaseMaterial._normalTextureMacro = Shader.getMacroByName("NORMALTEXTURE");
18205
- BaseMaterial._emissiveColorProp = Shader.getPropertyByName("u_emissiveColor");
18206
- BaseMaterial._emissiveTextureProp = Shader.getPropertyByName("u_emissiveTexture");
18207
- BaseMaterial._emissiveTextureMacro = Shader.getMacroByName("EMISSIVETEXTURE");
18208
- BaseMaterial._transparentMacro = Shader.getMacroByName("OASIS_TRANSPARENT");
18209
- BaseMaterial._alphaCutoffProp = Shader.getPropertyByName("u_alphaCutoff");
18210
- BaseMaterial._alphaCutoffMacro = Shader.getMacroByName("ALPHA_CUTOFF");
18468
+ (function() {
18469
+ BaseMaterial._baseColorProp = Shader.getPropertyByName("u_baseColor");
18470
+ })();
18471
+ (function() {
18472
+ BaseMaterial._baseTextureProp = Shader.getPropertyByName("u_baseTexture");
18473
+ })();
18474
+ (function() {
18475
+ BaseMaterial._baseTextureMacro = Shader.getMacroByName("BASETEXTURE");
18476
+ })();
18477
+ (function() {
18478
+ BaseMaterial._tilingOffsetProp = Shader.getPropertyByName("u_tilingOffset");
18479
+ })();
18480
+ (function() {
18481
+ BaseMaterial._normalTextureProp = Shader.getPropertyByName("u_normalTexture");
18482
+ })();
18483
+ (function() {
18484
+ BaseMaterial._normalIntensityProp = Shader.getPropertyByName("u_normalIntensity");
18485
+ })();
18486
+ (function() {
18487
+ BaseMaterial._normalTextureMacro = Shader.getMacroByName("NORMALTEXTURE");
18488
+ })();
18489
+ (function() {
18490
+ BaseMaterial._emissiveColorProp = Shader.getPropertyByName("u_emissiveColor");
18491
+ })();
18492
+ (function() {
18493
+ BaseMaterial._emissiveTextureProp = Shader.getPropertyByName("u_emissiveTexture");
18494
+ })();
18495
+ (function() {
18496
+ BaseMaterial._emissiveTextureMacro = Shader.getMacroByName("EMISSIVETEXTURE");
18497
+ })();
18498
+ (function() {
18499
+ BaseMaterial._transparentMacro = Shader.getMacroByName("OASIS_TRANSPARENT");
18500
+ })();
18501
+ (function() {
18502
+ BaseMaterial._alphaCutoffProp = Shader.getPropertyByName("u_alphaCutoff");
18503
+ })();
18504
+ (function() {
18505
+ BaseMaterial._alphaCutoffMacro = Shader.getMacroByName("ALPHA_CUTOFF");
18506
+ })();
18211
18507
 
18212
18508
  /**
18213
18509
  * Blinn-phong Material.
@@ -18235,7 +18531,7 @@ BaseMaterial._alphaCutoffMacro = Shader.getMacroByName("ALPHA_CUTOFF");
18235
18531
  this.cloneTo(dest);
18236
18532
  return dest;
18237
18533
  };
18238
- _createClass(BlinnPhongMaterial, [
18534
+ _create_class(BlinnPhongMaterial, [
18239
18535
  {
18240
18536
  key: "baseColor",
18241
18537
  get: /**
@@ -18381,9 +18677,15 @@ BaseMaterial._alphaCutoffMacro = Shader.getMacroByName("ALPHA_CUTOFF");
18381
18677
  ]);
18382
18678
  return BlinnPhongMaterial;
18383
18679
  }(BaseMaterial);
18384
- BlinnPhongMaterial._specularColorProp = Shader.getPropertyByName("u_specularColor");
18385
- BlinnPhongMaterial._shininessProp = Shader.getPropertyByName("u_shininess");
18386
- BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTexture");
18680
+ (function() {
18681
+ BlinnPhongMaterial._specularColorProp = Shader.getPropertyByName("u_specularColor");
18682
+ })();
18683
+ (function() {
18684
+ BlinnPhongMaterial._shininessProp = Shader.getPropertyByName("u_shininess");
18685
+ })();
18686
+ (function() {
18687
+ BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTexture");
18688
+ })();
18387
18689
 
18388
18690
  /**
18389
18691
  * Texture UV coordinate.
@@ -18419,7 +18721,7 @@ BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTe
18419
18721
  shaderData.setFloat(PBRBaseMaterial._clearCoatRoughnessProp, 0);
18420
18722
  return _this;
18421
18723
  }
18422
- _createClass(PBRBaseMaterial, [
18724
+ _create_class(PBRBaseMaterial, [
18423
18725
  {
18424
18726
  key: "baseColor",
18425
18727
  get: /**
@@ -18643,14 +18945,30 @@ BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTe
18643
18945
  ]);
18644
18946
  return PBRBaseMaterial;
18645
18947
  }(BaseMaterial);
18646
- PBRBaseMaterial._occlusionTextureIntensityProp = Shader.getPropertyByName("u_occlusionIntensity");
18647
- PBRBaseMaterial._occlusionTextureCoordProp = Shader.getPropertyByName("u_occlusionTextureCoord");
18648
- PBRBaseMaterial._occlusionTextureProp = Shader.getPropertyByName("u_occlusionTexture");
18649
- PBRBaseMaterial._clearCoatProp = Shader.getPropertyByName("u_clearCoat");
18650
- PBRBaseMaterial._clearCoatTextureProp = Shader.getPropertyByName("u_clearCoatTexture");
18651
- PBRBaseMaterial._clearCoatRoughnessProp = Shader.getPropertyByName("u_clearCoatRoughness");
18652
- PBRBaseMaterial._clearCoatRoughnessTextureProp = Shader.getPropertyByName("u_clearCoatRoughnessTexture");
18653
- PBRBaseMaterial._clearCoatNormalTextureProp = Shader.getPropertyByName("u_clearCoatNormalTexture");
18948
+ (function() {
18949
+ PBRBaseMaterial._occlusionTextureIntensityProp = Shader.getPropertyByName("u_occlusionIntensity");
18950
+ })();
18951
+ (function() {
18952
+ PBRBaseMaterial._occlusionTextureCoordProp = Shader.getPropertyByName("u_occlusionTextureCoord");
18953
+ })();
18954
+ (function() {
18955
+ PBRBaseMaterial._occlusionTextureProp = Shader.getPropertyByName("u_occlusionTexture");
18956
+ })();
18957
+ (function() {
18958
+ PBRBaseMaterial._clearCoatProp = Shader.getPropertyByName("u_clearCoat");
18959
+ })();
18960
+ (function() {
18961
+ PBRBaseMaterial._clearCoatTextureProp = Shader.getPropertyByName("u_clearCoatTexture");
18962
+ })();
18963
+ (function() {
18964
+ PBRBaseMaterial._clearCoatRoughnessProp = Shader.getPropertyByName("u_clearCoatRoughness");
18965
+ })();
18966
+ (function() {
18967
+ PBRBaseMaterial._clearCoatRoughnessTextureProp = Shader.getPropertyByName("u_clearCoatRoughnessTexture");
18968
+ })();
18969
+ (function() {
18970
+ PBRBaseMaterial._clearCoatNormalTextureProp = Shader.getPropertyByName("u_clearCoatNormalTexture");
18971
+ })();
18654
18972
 
18655
18973
  /**
18656
18974
  * PBR (Metallic-Roughness Workflow) Material.
@@ -18671,7 +18989,7 @@ PBRBaseMaterial._clearCoatNormalTextureProp = Shader.getPropertyByName("u_clearC
18671
18989
  this.cloneTo(dest);
18672
18990
  return dest;
18673
18991
  };
18674
- _createClass(PBRMaterial, [
18992
+ _create_class(PBRMaterial, [
18675
18993
  {
18676
18994
  key: "metallic",
18677
18995
  get: /**
@@ -18714,9 +19032,15 @@ PBRBaseMaterial._clearCoatNormalTextureProp = Shader.getPropertyByName("u_clearC
18714
19032
  ]);
18715
19033
  return PBRMaterial;
18716
19034
  }(PBRBaseMaterial);
18717
- PBRMaterial._metallicProp = Shader.getPropertyByName("u_metal");
18718
- PBRMaterial._roughnessProp = Shader.getPropertyByName("u_roughness");
18719
- PBRMaterial._roughnessMetallicTextureProp = Shader.getPropertyByName("u_roughnessMetallicTexture");
19035
+ (function() {
19036
+ PBRMaterial._metallicProp = Shader.getPropertyByName("u_metal");
19037
+ })();
19038
+ (function() {
19039
+ PBRMaterial._roughnessProp = Shader.getPropertyByName("u_roughness");
19040
+ })();
19041
+ (function() {
19042
+ PBRMaterial._roughnessMetallicTextureProp = Shader.getPropertyByName("u_roughnessMetallicTexture");
19043
+ })();
18720
19044
 
18721
19045
  /**
18722
19046
  * PBR (Specular-Glossiness Workflow) Material.
@@ -18737,7 +19061,7 @@ PBRMaterial._roughnessMetallicTextureProp = Shader.getPropertyByName("u_roughnes
18737
19061
  this.cloneTo(dest);
18738
19062
  return dest;
18739
19063
  };
18740
- _createClass(PBRSpecularMaterial, [
19064
+ _create_class(PBRSpecularMaterial, [
18741
19065
  {
18742
19066
  key: "specularColor",
18743
19067
  get: /**
@@ -18783,10 +19107,18 @@ PBRMaterial._roughnessMetallicTextureProp = Shader.getPropertyByName("u_roughnes
18783
19107
  ]);
18784
19108
  return PBRSpecularMaterial;
18785
19109
  }(PBRBaseMaterial);
18786
- PBRSpecularMaterial._specularColorProp = Shader.getPropertyByName("u_PBRSpecularColor");
18787
- PBRSpecularMaterial._glossinessProp = Shader.getPropertyByName("u_glossiness");
18788
- PBRSpecularMaterial._specularGlossinessTextureProp = Shader.getPropertyByName("u_specularGlossinessTexture");
18789
- PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPECULARGLOSSINESSTEXTURE");
19110
+ (function() {
19111
+ PBRSpecularMaterial._specularColorProp = Shader.getPropertyByName("u_PBRSpecularColor");
19112
+ })();
19113
+ (function() {
19114
+ PBRSpecularMaterial._glossinessProp = Shader.getPropertyByName("u_glossiness");
19115
+ })();
19116
+ (function() {
19117
+ PBRSpecularMaterial._specularGlossinessTextureProp = Shader.getPropertyByName("u_specularGlossinessTexture");
19118
+ })();
19119
+ (function() {
19120
+ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPECULARGLOSSINESSTEXTURE");
19121
+ })();
18790
19122
 
18791
19123
  /**
18792
19124
  * Unlit Material.
@@ -18810,7 +19142,7 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
18810
19142
  this.cloneTo(dest);
18811
19143
  return dest;
18812
19144
  };
18813
- _createClass(UnlitMaterial, [
19145
+ _create_class(UnlitMaterial, [
18814
19146
  {
18815
19147
  key: "baseColor",
18816
19148
  get: /**
@@ -18944,7 +19276,7 @@ var TextVerticalAlignment;
18944
19276
  this._sprites = null;
18945
19277
  this._spriteNamesToIndex = null;
18946
19278
  };
18947
- _createClass(SpriteAtlas, [
19279
+ _create_class(SpriteAtlas, [
18948
19280
  {
18949
19281
  key: "sprites",
18950
19282
  get: /**
@@ -19115,7 +19447,7 @@ var TextVerticalAlignment;
19115
19447
  }
19116
19448
  this._updateFlagManager.dispatch(type);
19117
19449
  };
19118
- _createClass(Sprite, [
19450
+ _create_class(Sprite, [
19119
19451
  {
19120
19452
  key: "texture",
19121
19453
  get: /**
@@ -19404,7 +19736,9 @@ var SlicedSpriteAssembler = (_SlicedSpriteAssembler = /*#__PURE__*/ function() {
19404
19736
  };
19405
19737
  SlicedSpriteAssembler1.updateUVs = function updateUVs(renderer) {};
19406
19738
  return SlicedSpriteAssembler1;
19407
- }(), _SlicedSpriteAssembler._worldMatrix = new Matrix(), _SlicedSpriteAssembler);
19739
+ }(), function() {
19740
+ _SlicedSpriteAssembler._worldMatrix = new Matrix();
19741
+ }(), _SlicedSpriteAssembler);
19408
19742
  SlicedSpriteAssembler = __decorate([
19409
19743
  StaticInterfaceImplement()
19410
19744
  ], SlicedSpriteAssembler);
@@ -19427,7 +19761,7 @@ SlicedSpriteAssembler = __decorate([
19427
19761
  _this._renderData = new RenderData2D(4, [], [], null, _this._color);
19428
19762
  _this.drawMode = SpriteDrawMode.Simple;
19429
19763
  _this.setMaterial(_this._engine._spriteDefaultMaterial);
19430
- _this._onSpriteChange = _this._onSpriteChange.bind(_assertThisInitialized(_this));
19764
+ _this._onSpriteChange = _this._onSpriteChange.bind(_assert_this_initialized(_this));
19431
19765
  return _this;
19432
19766
  }
19433
19767
  var _proto = SpriteRenderer.prototype;
@@ -19532,7 +19866,7 @@ SlicedSpriteAssembler = __decorate([
19532
19866
  break;
19533
19867
  }
19534
19868
  };
19535
- _createClass(SpriteRenderer, [
19869
+ _create_class(SpriteRenderer, [
19536
19870
  {
19537
19871
  key: "drawMode",
19538
19872
  get: /**
@@ -19681,7 +20015,9 @@ SlicedSpriteAssembler = __decorate([
19681
20015
  ]);
19682
20016
  return SpriteRenderer;
19683
20017
  }(Renderer);
19684
- /** @internal */ SpriteRenderer._textureProperty = Shader.getPropertyByName("u_spriteTexture");
20018
+ (function() {
20019
+ /** @internal */ SpriteRenderer._textureProperty = Shader.getPropertyByName("u_spriteTexture");
20020
+ })();
19685
20021
  __decorate([
19686
20022
  ignoreClone
19687
20023
  ], SpriteRenderer.prototype, "_renderData", void 0);
@@ -19738,14 +20074,16 @@ var /**
19738
20074
  ];
19739
20075
  this.renderData = new RenderData2D(4, positions, null, CharRenderData.triangles, null);
19740
20076
  };
19741
- CharRenderData.triangles = [
19742
- 0,
19743
- 2,
19744
- 1,
19745
- 2,
19746
- 0,
19747
- 3
19748
- ];
20077
+ (function() {
20078
+ CharRenderData.triangles = [
20079
+ 0,
20080
+ 2,
20081
+ 1,
20082
+ 2,
20083
+ 0,
20084
+ 3
20085
+ ];
20086
+ })();
19749
20087
 
19750
20088
  /**
19751
20089
  * @internal
@@ -20069,23 +20407,37 @@ CharRenderData.triangles = [
20069
20407
  };
20070
20408
  return TextUtils;
20071
20409
  }();
20072
- /** @internal */ TextUtils._genericFontFamilies = [
20073
- "serif",
20074
- "sans-serif",
20075
- "monospace",
20076
- "cursive",
20077
- "fantasy",
20078
- "system-ui",
20079
- "math",
20080
- "emoji",
20081
- "fangsong"
20082
- ];
20083
- /** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
20084
- TextUtils._measureBaseline = "M";
20085
- TextUtils._heightMultiplier = 2;
20086
- TextUtils._baselineMultiplier = 1.4;
20087
- TextUtils._fontSizeInfoCache = {};
20088
- TextUtils._textContext = null;
20410
+ (function() {
20411
+ /** @internal */ TextUtils._genericFontFamilies = [
20412
+ "serif",
20413
+ "sans-serif",
20414
+ "monospace",
20415
+ "cursive",
20416
+ "fantasy",
20417
+ "system-ui",
20418
+ "math",
20419
+ "emoji",
20420
+ "fangsong"
20421
+ ];
20422
+ })();
20423
+ (function() {
20424
+ /** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
20425
+ })();
20426
+ (function() {
20427
+ TextUtils._measureBaseline = "M";
20428
+ })();
20429
+ (function() {
20430
+ TextUtils._heightMultiplier = 2;
20431
+ })();
20432
+ (function() {
20433
+ TextUtils._baselineMultiplier = 1.4;
20434
+ })();
20435
+ (function() {
20436
+ TextUtils._fontSizeInfoCache = {};
20437
+ })();
20438
+ (function() {
20439
+ TextUtils._textContext = null;
20440
+ })();
20089
20441
 
20090
20442
  /**
20091
20443
  * Renders a text for 2D graphics.
@@ -20112,7 +20464,7 @@ TextUtils._textContext = null;
20112
20464
  _this._overflowMode = OverflowMode.Overflow;
20113
20465
  _this._maskInteraction = SpriteMaskInteraction.None;
20114
20466
  _this._maskLayer = SpriteMaskLayer.Layer0;
20115
- var engine = _assertThisInitialized(_this).engine;
20467
+ var engine = _assert_this_initialized(_this).engine;
20116
20468
  _this._font = engine._textDefaultFont;
20117
20469
  _this._font._addRefCount(1);
20118
20470
  _this.setMaterial(engine._spriteDefaultMaterial);
@@ -20351,7 +20703,7 @@ TextUtils._textContext = null;
20351
20703
  Renderer.prototype._onTransformChanged.call(this, bit);
20352
20704
  this._setDirtyFlagTrue(0x4 | 0x8);
20353
20705
  };
20354
- _createClass(TextRenderer, [
20706
+ _create_class(TextRenderer, [
20355
20707
  {
20356
20708
  key: "color",
20357
20709
  get: /**
@@ -20564,9 +20916,15 @@ TextUtils._textContext = null;
20564
20916
  ]);
20565
20917
  return TextRenderer;
20566
20918
  }(Renderer);
20567
- TextRenderer._charRenderDataPool = new CharRenderDataPool(CharRenderData, 50);
20568
- TextRenderer._tempVec30 = new Vector3();
20569
- TextRenderer._tempVec31 = new Vector3();
20919
+ (function() {
20920
+ TextRenderer._charRenderDataPool = new CharRenderDataPool(CharRenderData, 50);
20921
+ })();
20922
+ (function() {
20923
+ TextRenderer._tempVec30 = new Vector3();
20924
+ })();
20925
+ (function() {
20926
+ TextRenderer._tempVec31 = new Vector3();
20927
+ })();
20570
20928
  __decorate([
20571
20929
  assignmentClone
20572
20930
  ], TextRenderer.prototype, "_subFont", void 0);
@@ -20783,7 +21141,9 @@ var DirtyFlag;
20783
21141
  };
20784
21142
  return AnimationCurveOwner;
20785
21143
  }();
20786
- AnimationCurveOwner._assemblerMap = new Map();
21144
+ (function() {
21145
+ AnimationCurveOwner._assemblerMap = new Map();
21146
+ })();
20787
21147
 
20788
21148
  /**
20789
21149
  * @internal
@@ -20957,7 +21317,7 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
20957
21317
  }
20958
21318
  }
20959
21319
  };
20960
- _createClass(AnimationClip, [
21320
+ _create_class(AnimationClip, [
20961
21321
  {
20962
21322
  key: "events",
20963
21323
  get: /**
@@ -21105,7 +21465,7 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
21105
21465
  var result = this._evaluate(time, evaluateData);
21106
21466
  return this._type._subtractValue(result, this.keys[0].value, evaluateData.value);
21107
21467
  };
21108
- _createClass(AnimationCurve, [
21468
+ _create_class(AnimationCurve, [
21109
21469
  {
21110
21470
  key: "interpolation",
21111
21471
  get: /**
@@ -21215,7 +21575,11 @@ var AnimationArrayCurve = (_AnimationArrayCurve = /*#__PURE__*/ function(Animati
21215
21575
  return out;
21216
21576
  };
21217
21577
  return AnimationArrayCurve;
21218
- }(AnimationCurve), /** @internal */ _AnimationArrayCurve._isReferenceType = true, /** @internal */ _AnimationArrayCurve._isInterpolationType = true, _AnimationArrayCurve);
21578
+ }(AnimationCurve), function() {
21579
+ /** @internal */ _AnimationArrayCurve._isReferenceType = true;
21580
+ }(), function() {
21581
+ /** @internal */ _AnimationArrayCurve._isInterpolationType = true;
21582
+ }(), _AnimationArrayCurve);
21219
21583
  AnimationArrayCurve = __decorate([
21220
21584
  StaticInterfaceImplement()
21221
21585
  ], AnimationArrayCurve);
@@ -21268,7 +21632,11 @@ var AnimationBoolCurve = (_AnimationBoolCurve = /*#__PURE__*/ function(Animation
21268
21632
  return frame.value;
21269
21633
  };
21270
21634
  return AnimationBoolCurve;
21271
- }(AnimationCurve), /** @internal */ _AnimationBoolCurve._isReferenceType = false, /** @internal */ _AnimationBoolCurve._isInterpolationType = false, _AnimationBoolCurve);
21635
+ }(AnimationCurve), function() {
21636
+ /** @internal */ _AnimationBoolCurve._isReferenceType = false;
21637
+ }(), function() {
21638
+ /** @internal */ _AnimationBoolCurve._isInterpolationType = false;
21639
+ }(), _AnimationBoolCurve);
21272
21640
  AnimationBoolCurve = __decorate([
21273
21641
  StaticInterfaceImplement()
21274
21642
  ], AnimationBoolCurve);
@@ -21361,7 +21729,11 @@ var AnimationColorCurve = (_AnimationColorCurve = /*#__PURE__*/ function(Animati
21361
21729
  return out;
21362
21730
  };
21363
21731
  return AnimationColorCurve;
21364
- }(AnimationCurve), /** @internal */ _AnimationColorCurve._isReferenceType = true, /** @internal */ _AnimationColorCurve._isInterpolationType = true, _AnimationColorCurve);
21732
+ }(AnimationCurve), function() {
21733
+ /** @internal */ _AnimationColorCurve._isReferenceType = true;
21734
+ }(), function() {
21735
+ /** @internal */ _AnimationColorCurve._isInterpolationType = true;
21736
+ }(), _AnimationColorCurve);
21365
21737
  AnimationColorCurve = __decorate([
21366
21738
  StaticInterfaceImplement()
21367
21739
  ], AnimationColorCurve);
@@ -21457,7 +21829,11 @@ var AnimationFloatArrayCurve = (_AnimationFloatArrayCurve = /*#__PURE__*/ functi
21457
21829
  return out;
21458
21830
  };
21459
21831
  return AnimationFloatArrayCurve;
21460
- }(AnimationCurve), /** @internal */ _AnimationFloatArrayCurve._isReferenceType = true, /** @internal */ _AnimationFloatArrayCurve._isInterpolationType = true, _AnimationFloatArrayCurve);
21832
+ }(AnimationCurve), function() {
21833
+ /** @internal */ _AnimationFloatArrayCurve._isReferenceType = true;
21834
+ }(), function() {
21835
+ /** @internal */ _AnimationFloatArrayCurve._isInterpolationType = true;
21836
+ }(), _AnimationFloatArrayCurve);
21461
21837
  AnimationFloatArrayCurve = __decorate([
21462
21838
  StaticInterfaceImplement()
21463
21839
  ], AnimationFloatArrayCurve);
@@ -21522,7 +21898,11 @@ var AnimationFloatCurve = (_AnimationFloatCurve = /*#__PURE__*/ function(Animati
21522
21898
  }
21523
21899
  };
21524
21900
  return AnimationFloatCurve;
21525
- }(AnimationCurve), /** @internal */ _AnimationFloatCurve._isReferenceType = false, /** @internal */ _AnimationFloatCurve._isInterpolationType = true, _AnimationFloatCurve);
21901
+ }(AnimationCurve), function() {
21902
+ /** @internal */ _AnimationFloatCurve._isReferenceType = false;
21903
+ }(), function() {
21904
+ /** @internal */ _AnimationFloatCurve._isInterpolationType = true;
21905
+ }(), _AnimationFloatCurve);
21526
21906
  AnimationFloatCurve = __decorate([
21527
21907
  StaticInterfaceImplement()
21528
21908
  ], AnimationFloatCurve);
@@ -21620,7 +22000,13 @@ var AnimationQuaternionCurve = (_AnimationQuaternionCurve = /*#__PURE__*/ functi
21620
22000
  return out;
21621
22001
  };
21622
22002
  return AnimationQuaternionCurve1;
21623
- }(AnimationCurve), /** @internal */ _AnimationQuaternionCurve._isInterpolationType = true, /** @internal */ _AnimationQuaternionCurve._isReferenceType = true, /** @internal */ _AnimationQuaternionCurve._tempConjugateQuat = new Quaternion(), _AnimationQuaternionCurve);
22003
+ }(AnimationCurve), function() {
22004
+ /** @internal */ _AnimationQuaternionCurve._isInterpolationType = true;
22005
+ }(), function() {
22006
+ /** @internal */ _AnimationQuaternionCurve._isReferenceType = true;
22007
+ }(), function() {
22008
+ /** @internal */ _AnimationQuaternionCurve._tempConjugateQuat = new Quaternion();
22009
+ }(), _AnimationQuaternionCurve);
21624
22010
  AnimationQuaternionCurve = __decorate([
21625
22011
  StaticInterfaceImplement()
21626
22012
  ], AnimationQuaternionCurve);
@@ -21701,7 +22087,11 @@ var AnimationVector2Curve = (_AnimationVector2Curve = /*#__PURE__*/ function(Ani
21701
22087
  return out;
21702
22088
  };
21703
22089
  return AnimationVector2Curve;
21704
- }(AnimationCurve), /** @internal */ _AnimationVector2Curve._isReferenceType = true, /** @internal */ _AnimationVector2Curve._isInterpolationType = true, _AnimationVector2Curve);
22090
+ }(AnimationCurve), function() {
22091
+ /** @internal */ _AnimationVector2Curve._isReferenceType = true;
22092
+ }(), function() {
22093
+ /** @internal */ _AnimationVector2Curve._isInterpolationType = true;
22094
+ }(), _AnimationVector2Curve);
21705
22095
  AnimationVector2Curve = __decorate([
21706
22096
  StaticInterfaceImplement()
21707
22097
  ], AnimationVector2Curve);
@@ -21794,7 +22184,11 @@ var AnimationVector3Curve = (_AnimationVector3Curve = /*#__PURE__*/ function(Ani
21794
22184
  return out;
21795
22185
  };
21796
22186
  return AnimationVector3Curve;
21797
- }(AnimationCurve), /** @internal */ _AnimationVector3Curve._isReferenceType = true, /** @internal */ _AnimationVector3Curve._isInterpolationType = true, _AnimationVector3Curve);
22187
+ }(AnimationCurve), function() {
22188
+ /** @internal */ _AnimationVector3Curve._isReferenceType = true;
22189
+ }(), function() {
22190
+ /** @internal */ _AnimationVector3Curve._isInterpolationType = true;
22191
+ }(), _AnimationVector3Curve);
21798
22192
  AnimationVector3Curve = __decorate([
21799
22193
  StaticInterfaceImplement()
21800
22194
  ], AnimationVector3Curve);
@@ -21887,7 +22281,11 @@ var AnimationVector4Curve = (_AnimationVector4Curve = /*#__PURE__*/ function(Ani
21887
22281
  return out;
21888
22282
  };
21889
22283
  return AnimationVector4Curve;
21890
- }(AnimationCurve), /** @internal */ _AnimationVector4Curve._isReferenceType = true, /** @internal */ _AnimationVector4Curve._isInterpolationType = true, _AnimationVector4Curve);
22284
+ }(AnimationCurve), function() {
22285
+ /** @internal */ _AnimationVector4Curve._isReferenceType = true;
22286
+ }(), function() {
22287
+ /** @internal */ _AnimationVector4Curve._isInterpolationType = true;
22288
+ }(), _AnimationVector4Curve);
21891
22289
  AnimationVector4Curve = __decorate([
21892
22290
  StaticInterfaceImplement()
21893
22291
  ], AnimationVector4Curve);
@@ -22603,7 +23001,7 @@ var AnimatorLayerBlendingMode;
22603
23001
  }
22604
23002
  }
22605
23003
  };
22606
- _createClass(Animator, [
23004
+ _create_class(Animator, [
22607
23005
  {
22608
23006
  key: "animatorController",
22609
23007
  get: /**
@@ -22694,7 +23092,7 @@ __decorate([
22694
23092
  */ _proto._registerChangeFlag = function _registerChangeFlag() {
22695
23093
  return this._updateFlagManager.createFlag(BoolUpdateFlag);
22696
23094
  };
22697
- _createClass(AnimatorController, [
23095
+ _create_class(AnimatorController, [
22698
23096
  {
22699
23097
  key: "layers",
22700
23098
  get: /**
@@ -22828,7 +23226,7 @@ __decorate([
22828
23226
  index2 !== -1 && this._onStateExitScripts.splice(index2, 1);
22829
23227
  }
22830
23228
  };
22831
- _createClass(AnimatorState, [
23229
+ _create_class(AnimatorState, [
22832
23230
  {
22833
23231
  key: "transitions",
22834
23232
  get: /**
@@ -22960,7 +23358,7 @@ var AnimatorConditionMode;
22960
23358
  _this.shaderData.setVector4("u_cubeDecodeParam", _this._decodeParam);
22961
23359
  return _this;
22962
23360
  }
22963
- _createClass(SkyBoxMaterial, [
23361
+ _create_class(SkyBoxMaterial, [
22964
23362
  {
22965
23363
  key: "textureDecodeRGBM",
22966
23364
  get: /**
@@ -23059,7 +23457,7 @@ var ParticleRendererBlendMode;
23059
23457
  _this._isFadeOut = false;
23060
23458
  _this._playOnEnable = true;
23061
23459
  _this._blendMode = 0;
23062
- _this._onColorChanged = _this._onColorChanged.bind(_assertThisInitialized(_this));
23460
+ _this._onColorChanged = _this._onColorChanged.bind(_assert_this_initialized(_this));
23063
23461
  //@ts-ignore
23064
23462
  _this._color._onValueChanged = _this._onColorChanged;
23065
23463
  _this.setMaterial(_this._createMaterial());
@@ -23336,7 +23734,7 @@ var ParticleRendererBlendMode;
23336
23734
  ParticleRenderer._getRandom = function _getRandom() {
23337
23735
  return Math.random() - 0.5;
23338
23736
  };
23339
- _createClass(ParticleRenderer, [
23737
+ _create_class(ParticleRenderer, [
23340
23738
  {
23341
23739
  key: "texture",
23342
23740
  get: /**
@@ -23767,7 +24165,9 @@ var ParticleRendererBlendMode;
23767
24165
  ]);
23768
24166
  return ParticleRenderer;
23769
24167
  }(MeshRenderer);
23770
- /** The max number of indices that Uint16Array can support. */ ParticleRenderer._uint16VertexLimit = 65535;
24168
+ (function() {
24169
+ /** The max number of indices that Uint16Array can support. */ ParticleRenderer._uint16VertexLimit = 65535;
24170
+ })();
23771
24171
  __decorate([
23772
24172
  ignoreClone
23773
24173
  ], ParticleRenderer.prototype, "_onColorChanged", null);
@@ -24037,7 +24437,7 @@ var _tempVector3 = new Vector3();
24037
24437
  this._camera.renderTarget = this._oriCameraRenderTarget;
24038
24438
  this._camera.cullingMask = this._oriCameraCullingMask;
24039
24439
  };
24040
- _createClass(Probe, [
24440
+ _create_class(Probe, [
24041
24441
  {
24042
24442
  key: "_texture",
24043
24443
  get: function get() {