@galacean/engine-core 0.9.21 → 0.9.22
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/main.js +1491 -824
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +1491 -824
- package/dist/module.js +1105 -603
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/RenderPipeline/RenderData.d.ts +1 -8
- package/types/RenderPipeline/enums/PipelineStage.d.ts +0 -2
- package/types/asset/GraphicsResource.d.ts +0 -4
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
- package/types/shader/ShaderPart.d.ts +0 -5
- package/types/shader/SubShader.d.ts +1 -0
package/dist/main.js
CHANGED
|
@@ -2,23 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _assert_this_initialized = require('@swc/helpers/src/_assert_this_initialized.mjs');
|
|
6
|
-
var _create_class = require('@swc/helpers/src/_create_class.mjs');
|
|
7
|
-
var _inherits = require('@swc/helpers/src/_inherits.mjs');
|
|
8
|
-
var _ts_decorate = require('@swc/helpers/src/_ts_decorate.mjs');
|
|
9
|
-
var _instanceof = require('@swc/helpers/src/_instanceof.mjs');
|
|
10
5
|
var engineMath = require('@galacean/engine-math');
|
|
11
|
-
var _extends = require('@swc/helpers/src/_extends.mjs');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var _assert_this_initialized__default = /*#__PURE__*/_interopDefaultLegacy(_assert_this_initialized);
|
|
16
|
-
var _create_class__default = /*#__PURE__*/_interopDefaultLegacy(_create_class);
|
|
17
|
-
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
18
|
-
var _ts_decorate__default = /*#__PURE__*/_interopDefaultLegacy(_ts_decorate);
|
|
19
|
-
var _instanceof__default = /*#__PURE__*/_interopDefaultLegacy(_instanceof);
|
|
20
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
21
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The platform (including operating system and hardware) is running on.
|
|
9
|
+
*/ exports.Platform = void 0;
|
|
22
10
|
(function(Platform) {
|
|
23
11
|
Platform[Platform[/** Android platform. */ "Android"] = 0] = "Android";
|
|
24
12
|
Platform[Platform[/** IPhone platform. */ "IPhone"] = 1] = "IPhone";
|
|
@@ -27,6 +15,50 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
27
15
|
Platform[Platform[/** Unknown platform. */ "Unknown"] = 4] = "Unknown";
|
|
28
16
|
})(exports.Platform || (exports.Platform = {}));
|
|
29
17
|
|
|
18
|
+
function _assert_this_initialized(self) {
|
|
19
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
20
|
+
|
|
21
|
+
return self;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _defineProperties(target, props) {
|
|
25
|
+
for (var i = 0; i < props.length; i++) {
|
|
26
|
+
var descriptor = props[i];
|
|
27
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
28
|
+
descriptor.configurable = true;
|
|
29
|
+
|
|
30
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
31
|
+
|
|
32
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
36
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
37
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
38
|
+
|
|
39
|
+
return Constructor;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _set_prototype_of(o, p) {
|
|
43
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
44
|
+
o.__proto__ = p;
|
|
45
|
+
|
|
46
|
+
return o;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return _set_prototype_of(o, p);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function _inherits(subClass, superClass) {
|
|
53
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
54
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
58
|
+
|
|
59
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
60
|
+
}
|
|
61
|
+
|
|
30
62
|
/**
|
|
31
63
|
* Common utility methods for math operations.
|
|
32
64
|
*/ var MathUtil = /*#__PURE__*/ function() {
|
|
@@ -72,9 +104,15 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
72
104
|
};
|
|
73
105
|
return MathUtil;
|
|
74
106
|
}();
|
|
75
|
-
|
|
76
|
-
/** The
|
|
77
|
-
|
|
107
|
+
(function() {
|
|
108
|
+
/** The value for which all absolute numbers smaller than are considered equal to zero. */ MathUtil.zeroTolerance = 1e-6;
|
|
109
|
+
})();
|
|
110
|
+
(function() {
|
|
111
|
+
/** The conversion factor that radian to degree. */ MathUtil.radToDegreeFactor = 180 / Math.PI;
|
|
112
|
+
})();
|
|
113
|
+
(function() {
|
|
114
|
+
/** The conversion factor that degree to radian. */ MathUtil.degreeToRadFactor = Math.PI / 180;
|
|
115
|
+
})();
|
|
78
116
|
|
|
79
117
|
/**
|
|
80
118
|
* Describes a color in the from of RGBA (in order: R, G, B, A).
|
|
@@ -284,7 +322,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
284
322
|
out._onValueChanged && out._onValueChanged();
|
|
285
323
|
return out;
|
|
286
324
|
};
|
|
287
|
-
|
|
325
|
+
_create_class(Color, [
|
|
288
326
|
{
|
|
289
327
|
key: "r",
|
|
290
328
|
get: /**
|
|
@@ -337,6 +375,34 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
337
375
|
return Color;
|
|
338
376
|
}();
|
|
339
377
|
|
|
378
|
+
/******************************************************************************
|
|
379
|
+
Copyright (c) Microsoft Corporation.
|
|
380
|
+
|
|
381
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
382
|
+
purpose with or without fee is hereby granted.
|
|
383
|
+
|
|
384
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
385
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
386
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
387
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
388
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
389
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
390
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
391
|
+
***************************************************************************** */
|
|
392
|
+
|
|
393
|
+
function __decorate(decorators, target, key, desc) {
|
|
394
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
395
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
396
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
397
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function _instanceof(left, right) {
|
|
401
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
402
|
+
return !!right[Symbol.hasInstance](left);
|
|
403
|
+
} else return left instanceof right;
|
|
404
|
+
}
|
|
405
|
+
|
|
340
406
|
/**
|
|
341
407
|
* Clone mode.
|
|
342
408
|
*/ var CloneMode;
|
|
@@ -459,7 +525,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
459
525
|
};
|
|
460
526
|
CloneManager._deepCloneObjectItem = function _deepCloneObjectItem(source, target, k) {
|
|
461
527
|
var sourceItem = source[k];
|
|
462
|
-
if (
|
|
528
|
+
if (_instanceof(sourceItem, Object)) {
|
|
463
529
|
var itemType = sourceItem.constructor;
|
|
464
530
|
switch(itemType){
|
|
465
531
|
case Uint8Array:
|
|
@@ -515,16 +581,22 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
515
581
|
};
|
|
516
582
|
return CloneManager;
|
|
517
583
|
}();
|
|
518
|
-
|
|
519
|
-
/** @internal */ CloneManager.
|
|
520
|
-
|
|
584
|
+
(function() {
|
|
585
|
+
/** @internal */ CloneManager._subCloneModeMap = new Map();
|
|
586
|
+
})();
|
|
587
|
+
(function() {
|
|
588
|
+
/** @internal */ CloneManager._cloneModeMap = new Map();
|
|
589
|
+
})();
|
|
590
|
+
(function() {
|
|
591
|
+
CloneManager._objectType = Object.getPrototypeOf(Object);
|
|
592
|
+
})();
|
|
521
593
|
|
|
522
594
|
/**
|
|
523
595
|
* EngineObject.
|
|
524
596
|
*/ var EngineObject = /*#__PURE__*/ function() {
|
|
525
597
|
function EngineObject(engine) {
|
|
526
|
-
this._destroyed = false;
|
|
527
598
|
/** Engine unique id. */ this.instanceId = ++EngineObject._instanceIdCounter;
|
|
599
|
+
this._destroyed = false;
|
|
528
600
|
this._engine = engine;
|
|
529
601
|
}
|
|
530
602
|
var _proto = EngineObject.prototype;
|
|
@@ -536,7 +608,7 @@ CloneManager._objectType = Object.getPrototypeOf(Object);
|
|
|
536
608
|
(_this__engine_resourceManager = this._engine.resourceManager) == null ? void 0 : _this__engine_resourceManager._deleteAsset(this);
|
|
537
609
|
this._destroyed = true;
|
|
538
610
|
};
|
|
539
|
-
|
|
611
|
+
_create_class(EngineObject, [
|
|
540
612
|
{
|
|
541
613
|
key: "engine",
|
|
542
614
|
get: /**
|
|
@@ -556,24 +628,26 @@ CloneManager._objectType = Object.getPrototypeOf(Object);
|
|
|
556
628
|
]);
|
|
557
629
|
return EngineObject;
|
|
558
630
|
}();
|
|
559
|
-
|
|
560
|
-
|
|
631
|
+
(function() {
|
|
632
|
+
EngineObject._instanceIdCounter = 0;
|
|
633
|
+
})();
|
|
634
|
+
__decorate([
|
|
561
635
|
ignoreClone
|
|
562
636
|
], EngineObject.prototype, "instanceId", void 0);
|
|
563
|
-
|
|
637
|
+
__decorate([
|
|
564
638
|
ignoreClone
|
|
565
639
|
], EngineObject.prototype, "_engine", void 0);
|
|
566
640
|
|
|
567
641
|
/**
|
|
568
642
|
* The base class of assets, with reference counting capability.
|
|
569
643
|
*/ var RefObject = /*#__PURE__*/ function(EngineObject) {
|
|
570
|
-
|
|
644
|
+
_inherits(RefObject, EngineObject);
|
|
571
645
|
function RefObject(engine) {
|
|
572
646
|
var _this;
|
|
573
647
|
_this = EngineObject.call(this, engine) || this;
|
|
574
648
|
/** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */ _this.isGCIgnored = false;
|
|
575
649
|
_this._refCount = 0;
|
|
576
|
-
engine.resourceManager._addRefObject(_this.instanceId,
|
|
650
|
+
engine.resourceManager._addRefObject(_this.instanceId, _assert_this_initialized(_this));
|
|
577
651
|
return _this;
|
|
578
652
|
}
|
|
579
653
|
var _proto = RefObject.prototype;
|
|
@@ -615,7 +689,7 @@ _ts_decorate__default['default']([
|
|
|
615
689
|
*/ _proto._addToResourceManager = function _addToResourceManager(path) {
|
|
616
690
|
this._engine.resourceManager._addAsset(path, this);
|
|
617
691
|
};
|
|
618
|
-
|
|
692
|
+
_create_class(RefObject, [
|
|
619
693
|
{
|
|
620
694
|
key: "refCount",
|
|
621
695
|
get: /**
|
|
@@ -628,6 +702,9 @@ _ts_decorate__default['default']([
|
|
|
628
702
|
return RefObject;
|
|
629
703
|
}(EngineObject);
|
|
630
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Render buffer depth format enumeration.
|
|
707
|
+
*/ exports.RenderBufferDepthFormat = void 0;
|
|
631
708
|
(function(RenderBufferDepthFormat) {
|
|
632
709
|
RenderBufferDepthFormat[RenderBufferDepthFormat[/** Render to depth buffer,engine will automatically select the supported precision. */ "Depth"] = 0] = "Depth";
|
|
633
710
|
RenderBufferDepthFormat[RenderBufferDepthFormat[/** Render to depth stencil buffer, engine will automatically select the supported precision. */ "DepthStencil"] = 1] = "DepthStencil";
|
|
@@ -639,6 +716,9 @@ _ts_decorate__default['default']([
|
|
|
639
716
|
RenderBufferDepthFormat[RenderBufferDepthFormat[/** Force 32-bit depth + 8-bit stencil buffer. */ "Depth32Stencil8"] = 7] = "Depth32Stencil8";
|
|
640
717
|
})(exports.RenderBufferDepthFormat || (exports.RenderBufferDepthFormat = {}));
|
|
641
718
|
|
|
719
|
+
/**
|
|
720
|
+
* Define the face of the cube texture.
|
|
721
|
+
*/ exports.TextureCubeFace = void 0;
|
|
642
722
|
(function(TextureCubeFace) {
|
|
643
723
|
TextureCubeFace[TextureCubeFace[/** Positive X face for a cube-mapped texture. */ "PositiveX"] = 0] = "PositiveX";
|
|
644
724
|
TextureCubeFace[TextureCubeFace[/** Negative X face for a cube-mapped texture. */ "NegativeX"] = 1] = "NegativeX";
|
|
@@ -648,6 +728,9 @@ _ts_decorate__default['default']([
|
|
|
648
728
|
TextureCubeFace[TextureCubeFace[/** Negative Z face for a cube-mapped texture. */ "NegativeZ"] = 5] = "NegativeZ";
|
|
649
729
|
})(exports.TextureCubeFace || (exports.TextureCubeFace = {}));
|
|
650
730
|
|
|
731
|
+
/**
|
|
732
|
+
* Define the compare mode of depth texture.
|
|
733
|
+
*/ exports.TextureDepthCompareFunction = void 0;
|
|
651
734
|
(function(TextureDepthCompareFunction) {
|
|
652
735
|
TextureDepthCompareFunction[TextureDepthCompareFunction[/** never pass. */ "Never"] = 0] = "Never";
|
|
653
736
|
TextureDepthCompareFunction[TextureDepthCompareFunction[/** pass if the compare value is less than the sample value. */ "Less"] = 1] = "Less";
|
|
@@ -659,12 +742,18 @@ _ts_decorate__default['default']([
|
|
|
659
742
|
TextureDepthCompareFunction[TextureDepthCompareFunction[/** always pass. */ "Always"] = 7] = "Always";
|
|
660
743
|
})(exports.TextureDepthCompareFunction || (exports.TextureDepthCompareFunction = {}));
|
|
661
744
|
|
|
745
|
+
/**
|
|
746
|
+
* The filter mode of the texture.
|
|
747
|
+
*/ exports.TextureFilterMode = void 0;
|
|
662
748
|
(function(TextureFilterMode) {
|
|
663
749
|
TextureFilterMode[TextureFilterMode[/** Point filtering. */ "Point"] = 0] = "Point";
|
|
664
750
|
TextureFilterMode[TextureFilterMode[/** Bilinear filtering. */ "Bilinear"] = 1] = "Bilinear";
|
|
665
751
|
TextureFilterMode[TextureFilterMode[/** Trilinear filtering. */ "Trilinear"] = 2] = "Trilinear";
|
|
666
752
|
})(exports.TextureFilterMode || (exports.TextureFilterMode = {}));
|
|
667
753
|
|
|
754
|
+
/**
|
|
755
|
+
* Texture format enumeration.
|
|
756
|
+
*/ exports.TextureFormat = void 0;
|
|
668
757
|
(function(TextureFormat) {
|
|
669
758
|
TextureFormat[TextureFormat[/** RGB format,8 bits per channel. */ "R8G8B8"] = 0] = "R8G8B8";
|
|
670
759
|
TextureFormat[TextureFormat[/** RGBA format,8 bits per channel. */ "R8G8B8A8"] = 1] = "R8G8B8A8";
|
|
@@ -700,6 +789,9 @@ _ts_decorate__default['default']([
|
|
|
700
789
|
TextureFormat[TextureFormat[/** 32-bit depth + 8-bit stencil format. */ "Depth32Stencil8"] = 31] = "Depth32Stencil8";
|
|
701
790
|
})(exports.TextureFormat || (exports.TextureFormat = {}));
|
|
702
791
|
|
|
792
|
+
/**
|
|
793
|
+
* Wrapping mode of the texture.
|
|
794
|
+
*/ exports.TextureWrapMode = void 0;
|
|
703
795
|
(function(TextureWrapMode) {
|
|
704
796
|
TextureWrapMode[TextureWrapMode[/** Clamping mode. use the color of edge pixels beyond the texture boundary. */ "Clamp"] = 0] = "Clamp";
|
|
705
797
|
TextureWrapMode[TextureWrapMode[/** Repeating mode. tiling will be repeated if it exceeds the texture boundary. */ "Repeat"] = 1] = "Repeat";
|
|
@@ -723,7 +815,7 @@ _ts_decorate__default['default']([
|
|
|
723
815
|
_proto.stopPropagation = function stopPropagation() {
|
|
724
816
|
this._propagationStopped = true;
|
|
725
817
|
};
|
|
726
|
-
|
|
818
|
+
_create_class(Event, [
|
|
727
819
|
{
|
|
728
820
|
key: "propagationStopped",
|
|
729
821
|
get: function get() {
|
|
@@ -999,7 +1091,7 @@ var Time = /*#__PURE__*/ function() {
|
|
|
999
1091
|
this._lastTickTime = now;
|
|
1000
1092
|
this._frameCount++;
|
|
1001
1093
|
};
|
|
1002
|
-
|
|
1094
|
+
_create_class(Time, [
|
|
1003
1095
|
{
|
|
1004
1096
|
key: "frameCount",
|
|
1005
1097
|
get: /*
|
|
@@ -1122,6 +1214,9 @@ function ObjectValues(obj) {
|
|
|
1122
1214
|
});
|
|
1123
1215
|
}
|
|
1124
1216
|
|
|
1217
|
+
/**
|
|
1218
|
+
* Data type enumeration
|
|
1219
|
+
*/ exports.DataType = void 0;
|
|
1125
1220
|
(function(DataType) {
|
|
1126
1221
|
DataType[DataType[/** Float */ "FLOAT"] = 5126] = "FLOAT";
|
|
1127
1222
|
DataType[DataType[/** Floating-point two-dimensional vector */ "FLOAT_VEC2"] = 35664] = "FLOAT_VEC2";
|
|
@@ -1160,6 +1255,7 @@ function ObjectValues(obj) {
|
|
|
1160
1255
|
DataType[DataType[/** Unsigned int */ "UNSIGNED_INT"] = 5125 // gl.UNSIGNED_INT
|
|
1161
1256
|
] = "UNSIGNED_INT";
|
|
1162
1257
|
})(exports.DataType || (exports.DataType = {}));
|
|
1258
|
+
exports.GLCapabilityType = void 0;
|
|
1163
1259
|
(function(GLCapabilityType) {
|
|
1164
1260
|
GLCapabilityType["shaderVertexID"] = "shaderVertexID";
|
|
1165
1261
|
GLCapabilityType["standardDerivatives"] = "OES_standard_derivatives";
|
|
@@ -1194,7 +1290,7 @@ function ObjectValues(obj) {
|
|
|
1194
1290
|
/**
|
|
1195
1291
|
* The base class of texture, contains some common functions of texture-related classes.
|
|
1196
1292
|
*/ var Texture = /*#__PURE__*/ function(RefObject) {
|
|
1197
|
-
|
|
1293
|
+
_inherits(Texture, RefObject);
|
|
1198
1294
|
function Texture() {
|
|
1199
1295
|
var _this;
|
|
1200
1296
|
_this = RefObject.apply(this, arguments) || this;
|
|
@@ -1233,7 +1329,7 @@ function ObjectValues(obj) {
|
|
|
1233
1329
|
_proto._getMipmapCount = function _getMipmapCount() {
|
|
1234
1330
|
return this._mipmap ? Math.floor(Math.log2(Math.max(this._width, this._height))) + 1 : 1;
|
|
1235
1331
|
};
|
|
1236
|
-
|
|
1332
|
+
_create_class(Texture, [
|
|
1237
1333
|
{
|
|
1238
1334
|
key: "format",
|
|
1239
1335
|
get: /**
|
|
@@ -1353,7 +1449,7 @@ function ObjectValues(obj) {
|
|
|
1353
1449
|
/**
|
|
1354
1450
|
* The render target used for off-screen rendering.
|
|
1355
1451
|
*/ var RenderTarget = /*#__PURE__*/ function(EngineObject) {
|
|
1356
|
-
|
|
1452
|
+
_inherits(RenderTarget, EngineObject);
|
|
1357
1453
|
function RenderTarget(engine, width, height, renderTexture, depth, antiAliasing) {
|
|
1358
1454
|
if (depth === void 0) depth = exports.RenderBufferDepthFormat.Depth;
|
|
1359
1455
|
if (antiAliasing === void 0) antiAliasing = 1;
|
|
@@ -1365,7 +1461,7 @@ function ObjectValues(obj) {
|
|
|
1365
1461
|
_this._antiAliasing = antiAliasing;
|
|
1366
1462
|
_this._depth = depth;
|
|
1367
1463
|
if (renderTexture) {
|
|
1368
|
-
var colorTextures =
|
|
1464
|
+
var colorTextures = _instanceof(renderTexture, Array) ? renderTexture.slice() : [
|
|
1369
1465
|
renderTexture
|
|
1370
1466
|
];
|
|
1371
1467
|
for(var i = 0, n = colorTextures.length; i < n; i++){
|
|
@@ -1379,14 +1475,14 @@ function ObjectValues(obj) {
|
|
|
1379
1475
|
} else {
|
|
1380
1476
|
_this._colorTextures = [];
|
|
1381
1477
|
}
|
|
1382
|
-
if (
|
|
1478
|
+
if (_instanceof(depth, Texture)) {
|
|
1383
1479
|
if (!depth._isDepthTexture) {
|
|
1384
1480
|
throw "Depth texture must use depth format.";
|
|
1385
1481
|
}
|
|
1386
1482
|
_this._depthTexture = depth;
|
|
1387
1483
|
_this._depthTexture._addRefCount(1);
|
|
1388
1484
|
}
|
|
1389
|
-
_this._platformRenderTarget = engine._hardwareRenderer.createPlatformRenderTarget(
|
|
1485
|
+
_this._platformRenderTarget = engine._hardwareRenderer.createPlatformRenderTarget(_assert_this_initialized(_this));
|
|
1390
1486
|
return _this;
|
|
1391
1487
|
}
|
|
1392
1488
|
var _proto = RenderTarget.prototype;
|
|
@@ -1434,7 +1530,7 @@ function ObjectValues(obj) {
|
|
|
1434
1530
|
*/ _proto._blitRenderTarget = function _blitRenderTarget() {
|
|
1435
1531
|
this._platformRenderTarget.blitRenderTarget();
|
|
1436
1532
|
};
|
|
1437
|
-
|
|
1533
|
+
_create_class(RenderTarget, [
|
|
1438
1534
|
{
|
|
1439
1535
|
key: "autoGenerateMipmaps",
|
|
1440
1536
|
get: /**
|
|
@@ -1494,7 +1590,7 @@ function ObjectValues(obj) {
|
|
|
1494
1590
|
/**
|
|
1495
1591
|
* Two-dimensional texture.
|
|
1496
1592
|
*/ var Texture2D = /*#__PURE__*/ function(Texture) {
|
|
1497
|
-
|
|
1593
|
+
_inherits(Texture2D, Texture);
|
|
1498
1594
|
function Texture2D(engine, width, height, format, mipmap) {
|
|
1499
1595
|
if (format === void 0) format = exports.TextureFormat.R8G8B8A8;
|
|
1500
1596
|
if (mipmap === void 0) mipmap = true;
|
|
@@ -1506,7 +1602,7 @@ function ObjectValues(obj) {
|
|
|
1506
1602
|
_this._format = format;
|
|
1507
1603
|
_this._mipmapCount = _this._getMipmapCount();
|
|
1508
1604
|
_this._isDepthTexture = format == exports.TextureFormat.Depth || format == exports.TextureFormat.DepthStencil || format == exports.TextureFormat.Depth16 || format == exports.TextureFormat.Depth24 || format == exports.TextureFormat.Depth32 || format == exports.TextureFormat.Depth24Stencil8 || format == exports.TextureFormat.Depth32Stencil8;
|
|
1509
|
-
_this._platformTexture = engine._hardwareRenderer.createPlatformTexture2D(
|
|
1605
|
+
_this._platformTexture = engine._hardwareRenderer.createPlatformTexture2D(_assert_this_initialized(_this));
|
|
1510
1606
|
_this.filterMode = exports.TextureFilterMode.Bilinear;
|
|
1511
1607
|
_this.wrapModeU = _this.wrapModeV = exports.TextureWrapMode.Repeat;
|
|
1512
1608
|
return _this;
|
|
@@ -1561,7 +1657,7 @@ function ObjectValues(obj) {
|
|
|
1561
1657
|
/**
|
|
1562
1658
|
* Two-dimensional texture array.
|
|
1563
1659
|
*/ var Texture2DArray = /*#__PURE__*/ function(Texture) {
|
|
1564
|
-
|
|
1660
|
+
_inherits(Texture2DArray, Texture);
|
|
1565
1661
|
function Texture2DArray(engine, width, height, length, format, mipmap) {
|
|
1566
1662
|
if (format === void 0) format = exports.TextureFormat.R8G8B8A8;
|
|
1567
1663
|
if (mipmap === void 0) mipmap = true;
|
|
@@ -1573,7 +1669,7 @@ function ObjectValues(obj) {
|
|
|
1573
1669
|
_this._length = length;
|
|
1574
1670
|
_this._format = format;
|
|
1575
1671
|
_this._mipmapCount = _this._getMipmapCount();
|
|
1576
|
-
_this._platformTexture = engine._hardwareRenderer.createPlatformTexture2DArray(
|
|
1672
|
+
_this._platformTexture = engine._hardwareRenderer.createPlatformTexture2DArray(_assert_this_initialized(_this));
|
|
1577
1673
|
_this.filterMode = exports.TextureFilterMode.Bilinear;
|
|
1578
1674
|
_this.wrapModeU = _this.wrapModeV = exports.TextureWrapMode.Repeat;
|
|
1579
1675
|
return _this;
|
|
@@ -1625,7 +1721,7 @@ function ObjectValues(obj) {
|
|
|
1625
1721
|
this._platformTexture.getPixelBuffer(elementIndex, xOrMipLevelOrOut, yOrMipLevel, width, height, mipLevelOrOut, out);
|
|
1626
1722
|
}
|
|
1627
1723
|
};
|
|
1628
|
-
|
|
1724
|
+
_create_class(Texture2DArray, [
|
|
1629
1725
|
{
|
|
1630
1726
|
key: "length",
|
|
1631
1727
|
get: /**
|
|
@@ -1641,7 +1737,7 @@ function ObjectValues(obj) {
|
|
|
1641
1737
|
/**
|
|
1642
1738
|
* Cube texture.
|
|
1643
1739
|
*/ var TextureCube = /*#__PURE__*/ function(Texture) {
|
|
1644
|
-
|
|
1740
|
+
_inherits(TextureCube, Texture);
|
|
1645
1741
|
function TextureCube(engine, size, format, mipmap) {
|
|
1646
1742
|
if (format === void 0) format = exports.TextureFormat.R8G8B8A8;
|
|
1647
1743
|
if (mipmap === void 0) mipmap = true;
|
|
@@ -1652,7 +1748,7 @@ function ObjectValues(obj) {
|
|
|
1652
1748
|
_this._height = size;
|
|
1653
1749
|
_this._format = format;
|
|
1654
1750
|
_this._mipmapCount = _this._getMipmapCount();
|
|
1655
|
-
_this._platformTexture = engine._hardwareRenderer.createPlatformTextureCube(
|
|
1751
|
+
_this._platformTexture = engine._hardwareRenderer.createPlatformTextureCube(_assert_this_initialized(_this));
|
|
1656
1752
|
_this.filterMode = exports.TextureFilterMode.Bilinear;
|
|
1657
1753
|
_this.wrapModeU = _this.wrapModeV = exports.TextureWrapMode.Clamp;
|
|
1658
1754
|
return _this;
|
|
@@ -1710,7 +1806,7 @@ function ObjectValues(obj) {
|
|
|
1710
1806
|
* @internal
|
|
1711
1807
|
* Font Atlas.
|
|
1712
1808
|
*/ var FontAtlas = /*#__PURE__*/ function(RefObject) {
|
|
1713
|
-
|
|
1809
|
+
_inherits(FontAtlas, RefObject);
|
|
1714
1810
|
function FontAtlas(engine) {
|
|
1715
1811
|
var _this;
|
|
1716
1812
|
_this = RefObject.call(this, engine) || this;
|
|
@@ -1779,7 +1875,7 @@ function ObjectValues(obj) {
|
|
|
1779
1875
|
_proto.getCharInfo = function getCharInfo(char) {
|
|
1780
1876
|
return this._charInfoMap[char.charCodeAt(0)];
|
|
1781
1877
|
};
|
|
1782
|
-
|
|
1878
|
+
_create_class(FontAtlas, [
|
|
1783
1879
|
{
|
|
1784
1880
|
key: "texture",
|
|
1785
1881
|
get: function get() {
|
|
@@ -1876,7 +1972,7 @@ function ObjectValues(obj) {
|
|
|
1876
1972
|
/**
|
|
1877
1973
|
* Font.
|
|
1878
1974
|
*/ var Font = /*#__PURE__*/ function(RefObject) {
|
|
1879
|
-
|
|
1975
|
+
_inherits(Font, RefObject);
|
|
1880
1976
|
function Font(engine, name) {
|
|
1881
1977
|
if (name === void 0) name = "";
|
|
1882
1978
|
var _this;
|
|
@@ -1928,7 +2024,7 @@ function ObjectValues(obj) {
|
|
|
1928
2024
|
}
|
|
1929
2025
|
return null;
|
|
1930
2026
|
};
|
|
1931
|
-
|
|
2027
|
+
_create_class(Font, [
|
|
1932
2028
|
{
|
|
1933
2029
|
key: "name",
|
|
1934
2030
|
get: /**
|
|
@@ -1940,9 +2036,10 @@ function ObjectValues(obj) {
|
|
|
1940
2036
|
]);
|
|
1941
2037
|
return Font;
|
|
1942
2038
|
}(RefObject);
|
|
1943
|
-
|
|
2039
|
+
(function() {
|
|
2040
|
+
Font._fontMap = {};
|
|
2041
|
+
})();
|
|
1944
2042
|
|
|
1945
|
-
var _Symbol_toStringTag = Symbol.toStringTag;
|
|
1946
2043
|
var AssetPromise = /*#__PURE__*/ function() {
|
|
1947
2044
|
function AssetPromise(executor) {
|
|
1948
2045
|
var _this = this;
|
|
@@ -2040,7 +2137,7 @@ var AssetPromise = /*#__PURE__*/ function() {
|
|
|
2040
2137
|
}
|
|
2041
2138
|
};
|
|
2042
2139
|
var onProgress = function onProgress(promise, index) {
|
|
2043
|
-
if (
|
|
2140
|
+
if (_instanceof(promise, Promise) || _instanceof(promise, AssetPromise)) {
|
|
2044
2141
|
promise.then(function(value) {
|
|
2045
2142
|
onComplete(index, value);
|
|
2046
2143
|
}, reject);
|
|
@@ -2061,9 +2158,9 @@ var AssetPromise = /*#__PURE__*/ function() {
|
|
|
2061
2158
|
}
|
|
2062
2159
|
});
|
|
2063
2160
|
};
|
|
2064
|
-
|
|
2161
|
+
_create_class(AssetPromise, [
|
|
2065
2162
|
{
|
|
2066
|
-
key:
|
|
2163
|
+
key: Symbol.toStringTag,
|
|
2067
2164
|
get: /** compatible with Promise */ function get() {
|
|
2068
2165
|
return "AssetPromise";
|
|
2069
2166
|
}
|
|
@@ -2262,7 +2359,7 @@ var /** @internal */ PromiseState;
|
|
|
2262
2359
|
// Load asset
|
|
2263
2360
|
item.url = assetBaseURL;
|
|
2264
2361
|
var promise = loader.load(item, this);
|
|
2265
|
-
if (
|
|
2362
|
+
if (_instanceof(promise, AssetPromise)) {
|
|
2266
2363
|
loadingPromises[assetBaseURL] = promise;
|
|
2267
2364
|
promise.then(function(resource) {
|
|
2268
2365
|
if (loader.useCache) {
|
|
@@ -2334,13 +2431,13 @@ var /** @internal */ PromiseState;
|
|
|
2334
2431
|
};
|
|
2335
2432
|
_proto._parseQueryPath = function _parseQueryPath(string) {
|
|
2336
2433
|
var result = [];
|
|
2337
|
-
if (string.charCodeAt(0) === charCodeOfDot) {
|
|
2434
|
+
if (string.charCodeAt(0) === charCodeOfDot$1) {
|
|
2338
2435
|
result.push("");
|
|
2339
2436
|
}
|
|
2340
|
-
string.replace(rePropName, function(match, expression, quote, subString) {
|
|
2437
|
+
string.replace(rePropName$1, function(match, expression, quote, subString) {
|
|
2341
2438
|
var key = match;
|
|
2342
2439
|
if (quote) {
|
|
2343
|
-
key = subString.replace(reEscapeChar, "$1");
|
|
2440
|
+
key = subString.replace(reEscapeChar$1, "$1");
|
|
2344
2441
|
} else if (expression) {
|
|
2345
2442
|
key = expression.trim();
|
|
2346
2443
|
}
|
|
@@ -2398,8 +2495,12 @@ var /** @internal */ PromiseState;
|
|
|
2398
2495
|
};
|
|
2399
2496
|
return ResourceManager;
|
|
2400
2497
|
}();
|
|
2401
|
-
|
|
2402
|
-
ResourceManager.
|
|
2498
|
+
(function() {
|
|
2499
|
+
/** Loader collection. */ ResourceManager._loaders = {};
|
|
2500
|
+
})();
|
|
2501
|
+
(function() {
|
|
2502
|
+
ResourceManager._extTypeMapping = {};
|
|
2503
|
+
})();
|
|
2403
2504
|
/**
|
|
2404
2505
|
* Declare ResourceLoader's decorator.
|
|
2405
2506
|
* @param assetType - Type of asset
|
|
@@ -2411,9 +2512,9 @@ ResourceManager._extTypeMapping = {};
|
|
|
2411
2512
|
ResourceManager._addLoader(assetType, loader, extnames);
|
|
2412
2513
|
};
|
|
2413
2514
|
}
|
|
2414
|
-
var charCodeOfDot = ".".charCodeAt(0);
|
|
2415
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
2416
|
-
var rePropName = RegExp(// Match anything that isn't a dot or bracket.
|
|
2515
|
+
var charCodeOfDot$1 = ".".charCodeAt(0);
|
|
2516
|
+
var reEscapeChar$1 = /\\(\\)?/g;
|
|
2517
|
+
var rePropName$1 = RegExp(// Match anything that isn't a dot or bracket.
|
|
2417
2518
|
"[^.[\\]]+" + "|" + // Or match property names within brackets.
|
|
2418
2519
|
"\\[(?:" + // Match a non-string expression.
|
|
2419
2520
|
"([^\"'][^[]*)" + "|" + // Or match strings (supports escaping characters).
|
|
@@ -2680,7 +2781,7 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
2680
2781
|
break;
|
|
2681
2782
|
case CloneMode.Shallow:
|
|
2682
2783
|
var sourcePropS = source[k];
|
|
2683
|
-
if (
|
|
2784
|
+
if (_instanceof(sourcePropS, Object)) {
|
|
2684
2785
|
var tarProp = target[k];
|
|
2685
2786
|
tarProp == null && (tarProp = target[k] = sourcePropS.constructor());
|
|
2686
2787
|
Object.assign(tarProp, sourcePropS);
|
|
@@ -2691,7 +2792,7 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
2691
2792
|
break;
|
|
2692
2793
|
case CloneMode.Deep:
|
|
2693
2794
|
var sourcePropD = source[k];
|
|
2694
|
-
if (
|
|
2795
|
+
if (_instanceof(sourcePropD, Object)) {
|
|
2695
2796
|
var tarProp1 = target[k];
|
|
2696
2797
|
tarProp1 == null && (tarProp1 = target[k] = sourcePropD.constructor());
|
|
2697
2798
|
CloneManager.deepCloneObject(sourcePropD, tarProp1);
|
|
@@ -2757,10 +2858,14 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
2757
2858
|
};
|
|
2758
2859
|
return ComponentsDependencies;
|
|
2759
2860
|
}();
|
|
2760
|
-
|
|
2861
|
+
(function() {
|
|
2862
|
+
/**
|
|
2761
2863
|
* @internal
|
|
2762
2864
|
*/ ComponentsDependencies._dependenciesMap = new Map();
|
|
2763
|
-
|
|
2865
|
+
})();
|
|
2866
|
+
(function() {
|
|
2867
|
+
ComponentsDependencies._invDependenciesMap = new Map();
|
|
2868
|
+
})();
|
|
2764
2869
|
/**
|
|
2765
2870
|
* Dependent components, automatically added if they do not exist.
|
|
2766
2871
|
* @param components - Dependent components
|
|
@@ -2775,6 +2880,9 @@ ComponentsDependencies._invDependenciesMap = new Map();
|
|
|
2775
2880
|
};
|
|
2776
2881
|
}
|
|
2777
2882
|
|
|
2883
|
+
/**
|
|
2884
|
+
* Layer, used for bit operations.
|
|
2885
|
+
*/ exports.Layer = void 0;
|
|
2778
2886
|
(function(Layer) {
|
|
2779
2887
|
Layer[Layer[/** Layer 0. */ "Layer0"] = 0x1] = "Layer0";
|
|
2780
2888
|
Layer[Layer[/** Layer 1. */ "Layer1"] = 0x2] = "Layer1";
|
|
@@ -2843,7 +2951,7 @@ ComponentsDependencies._invDependenciesMap = new Map();
|
|
|
2843
2951
|
/**
|
|
2844
2952
|
* Bool update flag.
|
|
2845
2953
|
*/ var BoolUpdateFlag = /*#__PURE__*/ function(UpdateFlag) {
|
|
2846
|
-
|
|
2954
|
+
_inherits(BoolUpdateFlag, UpdateFlag);
|
|
2847
2955
|
function BoolUpdateFlag() {
|
|
2848
2956
|
var _this;
|
|
2849
2957
|
_this = UpdateFlag.apply(this, arguments) || this;
|
|
@@ -2862,7 +2970,7 @@ ComponentsDependencies._invDependenciesMap = new Map();
|
|
|
2862
2970
|
/**
|
|
2863
2971
|
* The base class of the components.
|
|
2864
2972
|
*/ var Component = /*#__PURE__*/ function(EngineObject) {
|
|
2865
|
-
|
|
2973
|
+
_inherits(Component, EngineObject);
|
|
2866
2974
|
function Component(entity) {
|
|
2867
2975
|
var _this;
|
|
2868
2976
|
_this = EngineObject.call(this, entity.engine) || this;
|
|
@@ -2923,7 +3031,7 @@ ComponentsDependencies._invDependenciesMap = new Map();
|
|
|
2923
3031
|
}
|
|
2924
3032
|
}
|
|
2925
3033
|
};
|
|
2926
|
-
|
|
3034
|
+
_create_class(Component, [
|
|
2927
3035
|
{
|
|
2928
3036
|
key: "enabled",
|
|
2929
3037
|
get: /**
|
|
@@ -2973,19 +3081,19 @@ ComponentsDependencies._invDependenciesMap = new Map();
|
|
|
2973
3081
|
]);
|
|
2974
3082
|
return Component;
|
|
2975
3083
|
}(EngineObject);
|
|
2976
|
-
|
|
3084
|
+
__decorate([
|
|
2977
3085
|
ignoreClone
|
|
2978
3086
|
], Component.prototype, "_entity", void 0);
|
|
2979
|
-
|
|
3087
|
+
__decorate([
|
|
2980
3088
|
ignoreClone
|
|
2981
3089
|
], Component.prototype, "_awoken", void 0);
|
|
2982
|
-
|
|
3090
|
+
__decorate([
|
|
2983
3091
|
ignoreClone
|
|
2984
3092
|
], Component.prototype, "_destroyed", void 0);
|
|
2985
|
-
|
|
3093
|
+
__decorate([
|
|
2986
3094
|
ignoreClone
|
|
2987
3095
|
], Component.prototype, "_phasedActive", void 0);
|
|
2988
|
-
|
|
3096
|
+
__decorate([
|
|
2989
3097
|
assignmentClone
|
|
2990
3098
|
], Component.prototype, "_enabled", void 0);
|
|
2991
3099
|
|
|
@@ -3053,11 +3161,10 @@ _ts_decorate__default['default']([
|
|
|
3053
3161
|
/**
|
|
3054
3162
|
* Used to implement transformation related functions.
|
|
3055
3163
|
*/ var Transform = /*#__PURE__*/ function(Component) {
|
|
3056
|
-
|
|
3164
|
+
_inherits(Transform, Component);
|
|
3057
3165
|
function Transform(entity) {
|
|
3058
3166
|
var _this;
|
|
3059
3167
|
_this = Component.call(this, entity) || this;
|
|
3060
|
-
_this._dirtyFlag = 0xbc;
|
|
3061
3168
|
_this._position = new engineMath.Vector3();
|
|
3062
3169
|
_this._rotation = new engineMath.Vector3();
|
|
3063
3170
|
_this._rotationQuaternion = new engineMath.Quaternion();
|
|
@@ -3070,14 +3177,15 @@ _ts_decorate__default['default']([
|
|
|
3070
3177
|
_this._worldMatrix = new engineMath.Matrix();
|
|
3071
3178
|
_this._isParentDirty = true;
|
|
3072
3179
|
_this._parentTransformCache = null;
|
|
3180
|
+
_this._dirtyFlag = 0xbc;
|
|
3073
3181
|
/** @internal */ _this._updateFlagManager = new UpdateFlagManager();
|
|
3074
|
-
_this._onPositionChanged = _this._onPositionChanged.bind(
|
|
3075
|
-
_this._onWorldPositionChanged = _this._onWorldPositionChanged.bind(
|
|
3076
|
-
_this._onRotationChanged = _this._onRotationChanged.bind(
|
|
3077
|
-
_this._onWorldRotationChanged = _this._onWorldRotationChanged.bind(
|
|
3078
|
-
_this._onRotationQuaternionChanged = _this._onRotationQuaternionChanged.bind(
|
|
3079
|
-
_this._onWorldRotationQuaternionChanged = _this._onWorldRotationQuaternionChanged.bind(
|
|
3080
|
-
_this._onScaleChanged = _this._onScaleChanged.bind(
|
|
3182
|
+
_this._onPositionChanged = _this._onPositionChanged.bind(_assert_this_initialized(_this));
|
|
3183
|
+
_this._onWorldPositionChanged = _this._onWorldPositionChanged.bind(_assert_this_initialized(_this));
|
|
3184
|
+
_this._onRotationChanged = _this._onRotationChanged.bind(_assert_this_initialized(_this));
|
|
3185
|
+
_this._onWorldRotationChanged = _this._onWorldRotationChanged.bind(_assert_this_initialized(_this));
|
|
3186
|
+
_this._onRotationQuaternionChanged = _this._onRotationQuaternionChanged.bind(_assert_this_initialized(_this));
|
|
3187
|
+
_this._onWorldRotationQuaternionChanged = _this._onWorldRotationQuaternionChanged.bind(_assert_this_initialized(_this));
|
|
3188
|
+
_this._onScaleChanged = _this._onScaleChanged.bind(_assert_this_initialized(_this));
|
|
3081
3189
|
//@ts-ignore
|
|
3082
3190
|
_this._position._onValueChanged = _this._onPositionChanged;
|
|
3083
3191
|
//@ts-ignore
|
|
@@ -3469,7 +3577,7 @@ _ts_decorate__default['default']([
|
|
|
3469
3577
|
this._setDirtyFlagTrue(0x40);
|
|
3470
3578
|
this._updateWorldScaleFlag();
|
|
3471
3579
|
};
|
|
3472
|
-
|
|
3580
|
+
_create_class(Transform, [
|
|
3473
3581
|
{
|
|
3474
3582
|
key: "position",
|
|
3475
3583
|
get: /**
|
|
@@ -3715,73 +3823,91 @@ _ts_decorate__default['default']([
|
|
|
3715
3823
|
]);
|
|
3716
3824
|
return Transform;
|
|
3717
3825
|
}(Component);
|
|
3718
|
-
|
|
3719
|
-
Transform.
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
Transform.
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
Transform.
|
|
3726
|
-
|
|
3727
|
-
|
|
3826
|
+
(function() {
|
|
3827
|
+
Transform._tempQuat0 = new engineMath.Quaternion();
|
|
3828
|
+
})();
|
|
3829
|
+
(function() {
|
|
3830
|
+
Transform._tempVec30 = new engineMath.Vector3();
|
|
3831
|
+
})();
|
|
3832
|
+
(function() {
|
|
3833
|
+
Transform._tempVec31 = new engineMath.Vector3();
|
|
3834
|
+
})();
|
|
3835
|
+
(function() {
|
|
3836
|
+
Transform._tempVec32 = new engineMath.Vector3();
|
|
3837
|
+
})();
|
|
3838
|
+
(function() {
|
|
3839
|
+
Transform._tempMat30 = new engineMath.Matrix3x3();
|
|
3840
|
+
})();
|
|
3841
|
+
(function() {
|
|
3842
|
+
Transform._tempMat31 = new engineMath.Matrix3x3();
|
|
3843
|
+
})();
|
|
3844
|
+
(function() {
|
|
3845
|
+
Transform._tempMat32 = new engineMath.Matrix3x3();
|
|
3846
|
+
})();
|
|
3847
|
+
(function() {
|
|
3848
|
+
Transform._tempMat41 = new engineMath.Matrix();
|
|
3849
|
+
})();
|
|
3850
|
+
(function() {
|
|
3851
|
+
Transform._tempMat42 = new engineMath.Matrix();
|
|
3852
|
+
})();
|
|
3853
|
+
__decorate([
|
|
3728
3854
|
deepClone
|
|
3729
3855
|
], Transform.prototype, "_position", void 0);
|
|
3730
|
-
|
|
3856
|
+
__decorate([
|
|
3731
3857
|
deepClone
|
|
3732
3858
|
], Transform.prototype, "_rotation", void 0);
|
|
3733
|
-
|
|
3859
|
+
__decorate([
|
|
3734
3860
|
deepClone
|
|
3735
3861
|
], Transform.prototype, "_rotationQuaternion", void 0);
|
|
3736
|
-
|
|
3862
|
+
__decorate([
|
|
3737
3863
|
deepClone
|
|
3738
3864
|
], Transform.prototype, "_scale", void 0);
|
|
3739
|
-
|
|
3865
|
+
__decorate([
|
|
3740
3866
|
deepClone
|
|
3741
3867
|
], Transform.prototype, "_worldPosition", void 0);
|
|
3742
|
-
|
|
3868
|
+
__decorate([
|
|
3743
3869
|
deepClone
|
|
3744
3870
|
], Transform.prototype, "_worldRotation", void 0);
|
|
3745
|
-
|
|
3871
|
+
__decorate([
|
|
3746
3872
|
deepClone
|
|
3747
3873
|
], Transform.prototype, "_worldRotationQuaternion", void 0);
|
|
3748
|
-
|
|
3874
|
+
__decorate([
|
|
3749
3875
|
deepClone
|
|
3750
3876
|
], Transform.prototype, "_lossyWorldScale", void 0);
|
|
3751
|
-
|
|
3877
|
+
__decorate([
|
|
3752
3878
|
deepClone
|
|
3753
3879
|
], Transform.prototype, "_localMatrix", void 0);
|
|
3754
|
-
|
|
3880
|
+
__decorate([
|
|
3755
3881
|
deepClone
|
|
3756
3882
|
], Transform.prototype, "_worldMatrix", void 0);
|
|
3757
|
-
|
|
3883
|
+
__decorate([
|
|
3758
3884
|
ignoreClone
|
|
3759
3885
|
], Transform.prototype, "_isParentDirty", void 0);
|
|
3760
|
-
|
|
3886
|
+
__decorate([
|
|
3761
3887
|
ignoreClone
|
|
3762
3888
|
], Transform.prototype, "_parentTransformCache", void 0);
|
|
3763
|
-
|
|
3889
|
+
__decorate([
|
|
3764
3890
|
ignoreClone
|
|
3765
3891
|
], Transform.prototype, "_updateFlagManager", void 0);
|
|
3766
|
-
|
|
3892
|
+
__decorate([
|
|
3767
3893
|
ignoreClone
|
|
3768
3894
|
], Transform.prototype, "_onPositionChanged", null);
|
|
3769
|
-
|
|
3895
|
+
__decorate([
|
|
3770
3896
|
ignoreClone
|
|
3771
3897
|
], Transform.prototype, "_onWorldPositionChanged", null);
|
|
3772
|
-
|
|
3898
|
+
__decorate([
|
|
3773
3899
|
ignoreClone
|
|
3774
3900
|
], Transform.prototype, "_onRotationChanged", null);
|
|
3775
|
-
|
|
3901
|
+
__decorate([
|
|
3776
3902
|
ignoreClone
|
|
3777
3903
|
], Transform.prototype, "_onWorldRotationChanged", null);
|
|
3778
|
-
|
|
3904
|
+
__decorate([
|
|
3779
3905
|
ignoreClone
|
|
3780
3906
|
], Transform.prototype, "_onRotationQuaternionChanged", null);
|
|
3781
|
-
|
|
3907
|
+
__decorate([
|
|
3782
3908
|
ignoreClone
|
|
3783
3909
|
], Transform.prototype, "_onWorldRotationQuaternionChanged", null);
|
|
3784
|
-
|
|
3910
|
+
__decorate([
|
|
3785
3911
|
ignoreClone
|
|
3786
3912
|
], Transform.prototype, "_onScaleChanged", null);
|
|
3787
3913
|
var TransformModifyFlags;
|
|
@@ -3805,7 +3931,7 @@ var TransformModifyFlags;
|
|
|
3805
3931
|
/**
|
|
3806
3932
|
* Entity, be used as components container.
|
|
3807
3933
|
*/ var Entity = /*#__PURE__*/ function(EngineObject) {
|
|
3808
|
-
|
|
3934
|
+
_inherits(Entity, EngineObject);
|
|
3809
3935
|
function Entity(engine, name) {
|
|
3810
3936
|
var _this;
|
|
3811
3937
|
_this = EngineObject.call(this, engine) || this;
|
|
@@ -3846,7 +3972,7 @@ var TransformModifyFlags;
|
|
|
3846
3972
|
// @todo: should inverse traversal
|
|
3847
3973
|
for(var i = components.length - 1; i >= 0; i--){
|
|
3848
3974
|
var component = components[i];
|
|
3849
|
-
if (
|
|
3975
|
+
if (_instanceof(component, type)) {
|
|
3850
3976
|
return component;
|
|
3851
3977
|
}
|
|
3852
3978
|
}
|
|
@@ -3861,7 +3987,7 @@ var TransformModifyFlags;
|
|
|
3861
3987
|
var components = this._components;
|
|
3862
3988
|
for(var i = 0, n = components.length; i < n; i++){
|
|
3863
3989
|
var component = components[i];
|
|
3864
|
-
if (
|
|
3990
|
+
if (_instanceof(component, type)) {
|
|
3865
3991
|
results.push(component);
|
|
3866
3992
|
}
|
|
3867
3993
|
}
|
|
@@ -3995,7 +4121,7 @@ var TransformModifyFlags;
|
|
|
3995
4121
|
var components = this._components;
|
|
3996
4122
|
for(var i1 = 0, n = components.length; i1 < n; i1++){
|
|
3997
4123
|
var sourceComp = components[i1];
|
|
3998
|
-
if (!
|
|
4124
|
+
if (!_instanceof(sourceComp, Transform)) {
|
|
3999
4125
|
var targetComp = cloneEntity.addComponent(sourceComp.constructor);
|
|
4000
4126
|
ComponentCloner.cloneComponent(sourceComp, targetComp);
|
|
4001
4127
|
}
|
|
@@ -4129,7 +4255,7 @@ var TransformModifyFlags;
|
|
|
4129
4255
|
_proto._getComponentsInChildren = function _getComponentsInChildren(type, results) {
|
|
4130
4256
|
for(var i = this._components.length - 1; i >= 0; i--){
|
|
4131
4257
|
var component = this._components[i];
|
|
4132
|
-
if (
|
|
4258
|
+
if (_instanceof(component, type)) {
|
|
4133
4259
|
results.push(component);
|
|
4134
4260
|
}
|
|
4135
4261
|
}
|
|
@@ -4232,7 +4358,7 @@ var TransformModifyFlags;
|
|
|
4232
4358
|
this._traverseSetOwnerScene(children[i], scene);
|
|
4233
4359
|
}
|
|
4234
4360
|
};
|
|
4235
|
-
|
|
4361
|
+
_create_class(Entity, [
|
|
4236
4362
|
{
|
|
4237
4363
|
key: "isActive",
|
|
4238
4364
|
get: /**
|
|
@@ -4318,11 +4444,17 @@ var TransformModifyFlags;
|
|
|
4318
4444
|
return Entity;
|
|
4319
4445
|
}(EngineObject);
|
|
4320
4446
|
|
|
4447
|
+
/**
|
|
4448
|
+
* Color Space.
|
|
4449
|
+
*/ exports.ColorSpace = void 0;
|
|
4321
4450
|
(function(ColorSpace) {
|
|
4322
4451
|
ColorSpace[ColorSpace[/** Linear color space. */ "Linear"] = 0] = "Linear";
|
|
4323
4452
|
ColorSpace[ColorSpace[/** Gamma color space. */ "Gamma"] = 1] = "Gamma";
|
|
4324
4453
|
})(exports.ColorSpace || (exports.ColorSpace = {}));
|
|
4325
4454
|
|
|
4455
|
+
/**
|
|
4456
|
+
* The current phase of the pointer.
|
|
4457
|
+
*/ exports.PointerPhase = void 0;
|
|
4326
4458
|
(function(PointerPhase) {
|
|
4327
4459
|
PointerPhase[PointerPhase[/** A Pointer pressed on the screen. */ "Down"] = 0] = "Down";
|
|
4328
4460
|
PointerPhase[PointerPhase[/** A pointer moved on the screen. */ "Move"] = 1] = "Move";
|
|
@@ -4444,7 +4576,7 @@ var TransformModifyFlags;
|
|
|
4444
4576
|
}
|
|
4445
4577
|
}
|
|
4446
4578
|
};
|
|
4447
|
-
|
|
4579
|
+
_create_class(SystemInfo, null, [
|
|
4448
4580
|
{
|
|
4449
4581
|
key: "devicePixelRatio",
|
|
4450
4582
|
get: /**
|
|
@@ -4456,10 +4588,18 @@ var TransformModifyFlags;
|
|
|
4456
4588
|
]);
|
|
4457
4589
|
return SystemInfo;
|
|
4458
4590
|
}();
|
|
4459
|
-
|
|
4460
|
-
/** The
|
|
4591
|
+
(function() {
|
|
4592
|
+
/** The platform is running on. */ SystemInfo.platform = exports.Platform.Unknown;
|
|
4593
|
+
})();
|
|
4594
|
+
(function() {
|
|
4595
|
+
/** The operating system is running on. */ SystemInfo.operatingSystem = "";
|
|
4596
|
+
})();
|
|
4461
4597
|
SystemInfo._initialize();
|
|
4462
4598
|
|
|
4599
|
+
/**
|
|
4600
|
+
* The keys of the keyboard.
|
|
4601
|
+
* Keep up with W3C standards.(https://www.w3.org/TR/2017/CR-uievents-code-20170601/)
|
|
4602
|
+
*/ exports.Keys = void 0;
|
|
4463
4603
|
(function(Keys) {
|
|
4464
4604
|
Keys[Keys[/** `~ on a US keyboard. This is the 半角/全角/漢字 (hankaku/zenkaku/kanji) key on Japanese keyboards. */ "Backquote"] = 0] = "Backquote";
|
|
4465
4605
|
Keys[Keys[/** Used for both the US \| (on the 101-key layout) and also for the key located between the " and Enter keys on row C of the 102-, 104- and 106-key layouts. Labelled #~ on a UK (102) keyboard. */ "Backslash"] = 1] = "Backslash";
|
|
@@ -4793,6 +4933,9 @@ SystemInfo._initialize();
|
|
|
4793
4933
|
return KeyboardManager;
|
|
4794
4934
|
}();
|
|
4795
4935
|
|
|
4936
|
+
/**
|
|
4937
|
+
* Camera clear flags enumeration.
|
|
4938
|
+
*/ exports.CameraClearFlags = void 0;
|
|
4796
4939
|
(function(CameraClearFlags) {
|
|
4797
4940
|
CameraClearFlags[CameraClearFlags[/* Do nothing. */ "None"] = 0x0] = "None";
|
|
4798
4941
|
CameraClearFlags[CameraClearFlags[/* Clear color with scene background. */ "Color"] = 0x1] = "Color";
|
|
@@ -5067,7 +5210,7 @@ SystemInfo._initialize();
|
|
|
5067
5210
|
_proto._setGravity = function _setGravity() {
|
|
5068
5211
|
this._nativePhysicsManager.setGravity(this._gravity);
|
|
5069
5212
|
};
|
|
5070
|
-
|
|
5213
|
+
_create_class(PhysicsManager, [
|
|
5071
5214
|
{
|
|
5072
5215
|
key: "gravity",
|
|
5073
5216
|
get: /**
|
|
@@ -5098,6 +5241,9 @@ SystemInfo._initialize();
|
|
|
5098
5241
|
return PhysicsManager;
|
|
5099
5242
|
}();
|
|
5100
5243
|
|
|
5244
|
+
/**
|
|
5245
|
+
* Describes how physics materials of the colliding objects are combined.
|
|
5246
|
+
*/ exports.PhysicsMaterialCombineMode = void 0;
|
|
5101
5247
|
(function(PhysicsMaterialCombineMode) {
|
|
5102
5248
|
PhysicsMaterialCombineMode[PhysicsMaterialCombineMode[/** Averages the friction/bounce of the two colliding materials. */ "Average"] = 0] = "Average";
|
|
5103
5249
|
PhysicsMaterialCombineMode[PhysicsMaterialCombineMode[/** Uses the smaller friction/bounce of the two colliding materials. */ "Minimum"] = 1] = "Minimum";
|
|
@@ -5122,7 +5268,7 @@ SystemInfo._initialize();
|
|
|
5122
5268
|
*/ _proto._destroy = function _destroy() {
|
|
5123
5269
|
this._nativeMaterial.destroy();
|
|
5124
5270
|
};
|
|
5125
|
-
|
|
5271
|
+
_create_class(PhysicsMaterial, [
|
|
5126
5272
|
{
|
|
5127
5273
|
key: "bounciness",
|
|
5128
5274
|
get: /**
|
|
@@ -5198,12 +5344,12 @@ SystemInfo._initialize();
|
|
|
5198
5344
|
}();
|
|
5199
5345
|
|
|
5200
5346
|
exports.Collider = /*#__PURE__*/ function(Component) {
|
|
5201
|
-
|
|
5347
|
+
_inherits(Collider, Component);
|
|
5202
5348
|
function Collider(entity) {
|
|
5203
5349
|
var _this;
|
|
5204
5350
|
_this = Component.call(this, entity) || this;
|
|
5205
|
-
_this._shapes = [];
|
|
5206
5351
|
/** @internal */ _this._index = -1;
|
|
5352
|
+
_this._shapes = [];
|
|
5207
5353
|
_this._updateFlag = _this.entity.transform.registerWorldChangeFlag();
|
|
5208
5354
|
return _this;
|
|
5209
5355
|
}
|
|
@@ -5282,7 +5428,7 @@ exports.Collider = /*#__PURE__*/ function(Component) {
|
|
|
5282
5428
|
this.clearShapes();
|
|
5283
5429
|
this._nativeCollider.destroy();
|
|
5284
5430
|
};
|
|
5285
|
-
|
|
5431
|
+
_create_class(Collider, [
|
|
5286
5432
|
{
|
|
5287
5433
|
key: "shapes",
|
|
5288
5434
|
get: /**
|
|
@@ -5294,13 +5440,16 @@ exports.Collider = /*#__PURE__*/ function(Component) {
|
|
|
5294
5440
|
]);
|
|
5295
5441
|
return Collider;
|
|
5296
5442
|
}(Component);
|
|
5297
|
-
|
|
5443
|
+
__decorate([
|
|
5298
5444
|
ignoreClone
|
|
5299
5445
|
], exports.Collider.prototype, "_index", void 0);
|
|
5300
|
-
exports.Collider =
|
|
5446
|
+
exports.Collider = __decorate([
|
|
5301
5447
|
dependentComponents(Transform)
|
|
5302
5448
|
], exports.Collider);
|
|
5303
5449
|
|
|
5450
|
+
/**
|
|
5451
|
+
* The up axis of the collider shape.
|
|
5452
|
+
*/ exports.ControllerNonWalkableMode = void 0;
|
|
5304
5453
|
(function(ControllerNonWalkableMode) {
|
|
5305
5454
|
ControllerNonWalkableMode[ControllerNonWalkableMode[/** Stops character from climbing up non-walkable slopes, but doesn't move it otherwise. */ "PreventClimbing"] = 0] = "PreventClimbing";
|
|
5306
5455
|
ControllerNonWalkableMode[ControllerNonWalkableMode[/** Stops character from climbing up non-walkable slopes, and forces it to slide down those slopes. */ "PreventClimbingAndForceSliding"] = 1] = "PreventClimbingAndForceSliding";
|
|
@@ -5309,7 +5458,7 @@ exports.Collider = _ts_decorate__default['default']([
|
|
|
5309
5458
|
/**
|
|
5310
5459
|
* The character controllers.
|
|
5311
5460
|
*/ var CharacterController = /*#__PURE__*/ function(Collider) {
|
|
5312
|
-
|
|
5461
|
+
_inherits(CharacterController, Collider);
|
|
5313
5462
|
function CharacterController(entity) {
|
|
5314
5463
|
var _this;
|
|
5315
5464
|
_this = Collider.call(this, entity) || this;
|
|
@@ -5319,7 +5468,7 @@ exports.Collider = _ts_decorate__default['default']([
|
|
|
5319
5468
|
_this._upDirection = new engineMath.Vector3(0, 1, 0);
|
|
5320
5469
|
_this._slopeLimit = 0.707;
|
|
5321
5470
|
_this._nativeCollider = PhysicsManager._nativePhysics.createCharacterController();
|
|
5322
|
-
_this._setUpDirection = _this._setUpDirection.bind(
|
|
5471
|
+
_this._setUpDirection = _this._setUpDirection.bind(_assert_this_initialized(_this));
|
|
5323
5472
|
//@ts-ignore
|
|
5324
5473
|
_this._upDirection._onValueChanged = _this._setUpDirection;
|
|
5325
5474
|
return _this;
|
|
@@ -5392,7 +5541,7 @@ exports.Collider = _ts_decorate__default['default']([
|
|
|
5392
5541
|
_proto._setUpDirection = function _setUpDirection() {
|
|
5393
5542
|
this._nativeCollider.setUpDirection(this._upDirection);
|
|
5394
5543
|
};
|
|
5395
|
-
|
|
5544
|
+
_create_class(CharacterController, [
|
|
5396
5545
|
{
|
|
5397
5546
|
key: "stepOffset",
|
|
5398
5547
|
get: /**
|
|
@@ -5487,7 +5636,7 @@ exports.Collider = _ts_decorate__default['default']([
|
|
|
5487
5636
|
_proto._setRotation = function _setRotation() {
|
|
5488
5637
|
this._nativeShape.setRotation(this._rotation);
|
|
5489
5638
|
};
|
|
5490
|
-
|
|
5639
|
+
_create_class(ColliderShape, [
|
|
5491
5640
|
{
|
|
5492
5641
|
key: "collider",
|
|
5493
5642
|
get: /**
|
|
@@ -5575,18 +5724,20 @@ exports.Collider = _ts_decorate__default['default']([
|
|
|
5575
5724
|
]);
|
|
5576
5725
|
return ColliderShape;
|
|
5577
5726
|
}();
|
|
5578
|
-
|
|
5727
|
+
(function() {
|
|
5728
|
+
ColliderShape._idGenerator = 0;
|
|
5729
|
+
})();
|
|
5579
5730
|
|
|
5580
5731
|
/**
|
|
5581
5732
|
* Physical collider shape for box.
|
|
5582
5733
|
*/ var BoxColliderShape = /*#__PURE__*/ function(ColliderShape) {
|
|
5583
|
-
|
|
5734
|
+
_inherits(BoxColliderShape, ColliderShape);
|
|
5584
5735
|
function BoxColliderShape() {
|
|
5585
5736
|
var _this;
|
|
5586
5737
|
_this = ColliderShape.call(this) || this;
|
|
5587
5738
|
_this._size = new engineMath.Vector3(1, 1, 1);
|
|
5588
5739
|
_this._nativeShape = PhysicsManager._nativePhysics.createBoxColliderShape(_this._id, _this._size, _this._material._nativeMaterial);
|
|
5589
|
-
_this._setSize = _this._setSize.bind(
|
|
5740
|
+
_this._setSize = _this._setSize.bind(_assert_this_initialized(_this));
|
|
5590
5741
|
//@ts-ignore
|
|
5591
5742
|
_this._size._onValueChanged = _this._setSize;
|
|
5592
5743
|
return _this;
|
|
@@ -5595,7 +5746,7 @@ ColliderShape._idGenerator = 0;
|
|
|
5595
5746
|
_proto._setSize = function _setSize() {
|
|
5596
5747
|
this._nativeShape.setSize(this._size);
|
|
5597
5748
|
};
|
|
5598
|
-
|
|
5749
|
+
_create_class(BoxColliderShape, [
|
|
5599
5750
|
{
|
|
5600
5751
|
key: "size",
|
|
5601
5752
|
get: /**
|
|
@@ -5616,7 +5767,7 @@ ColliderShape._idGenerator = 0;
|
|
|
5616
5767
|
/**
|
|
5617
5768
|
* Physical collider shape for sphere.
|
|
5618
5769
|
*/ var SphereColliderShape = /*#__PURE__*/ function(ColliderShape) {
|
|
5619
|
-
|
|
5770
|
+
_inherits(SphereColliderShape, ColliderShape);
|
|
5620
5771
|
function SphereColliderShape() {
|
|
5621
5772
|
var _this;
|
|
5622
5773
|
_this = ColliderShape.call(this) || this;
|
|
@@ -5624,7 +5775,7 @@ ColliderShape._idGenerator = 0;
|
|
|
5624
5775
|
_this._nativeShape = PhysicsManager._nativePhysics.createSphereColliderShape(_this._id, _this._radius, _this._material._nativeMaterial);
|
|
5625
5776
|
return _this;
|
|
5626
5777
|
}
|
|
5627
|
-
|
|
5778
|
+
_create_class(SphereColliderShape, [
|
|
5628
5779
|
{
|
|
5629
5780
|
key: "radius",
|
|
5630
5781
|
get: /**
|
|
@@ -5646,7 +5797,7 @@ ColliderShape._idGenerator = 0;
|
|
|
5646
5797
|
/**
|
|
5647
5798
|
* Physical collider shape plane.
|
|
5648
5799
|
*/ var PlaneColliderShape = /*#__PURE__*/ function(ColliderShape) {
|
|
5649
|
-
|
|
5800
|
+
_inherits(PlaneColliderShape, ColliderShape);
|
|
5650
5801
|
function PlaneColliderShape() {
|
|
5651
5802
|
var _this;
|
|
5652
5803
|
_this = ColliderShape.call(this) || this;
|
|
@@ -5656,6 +5807,9 @@ ColliderShape._idGenerator = 0;
|
|
|
5656
5807
|
return PlaneColliderShape;
|
|
5657
5808
|
}(ColliderShape);
|
|
5658
5809
|
|
|
5810
|
+
/**
|
|
5811
|
+
* The up axis of the collider shape.
|
|
5812
|
+
*/ exports.ColliderShapeUpAxis = void 0;
|
|
5659
5813
|
(function(ColliderShapeUpAxis) {
|
|
5660
5814
|
ColliderShapeUpAxis[ColliderShapeUpAxis[/** Up axis is X. */ "X"] = 0] = "X";
|
|
5661
5815
|
ColliderShapeUpAxis[ColliderShapeUpAxis[/** Up axis is Y. */ "Y"] = 1] = "Y";
|
|
@@ -5665,7 +5819,7 @@ ColliderShape._idGenerator = 0;
|
|
|
5665
5819
|
/**
|
|
5666
5820
|
* Physical collider shape for capsule.
|
|
5667
5821
|
*/ var CapsuleColliderShape = /*#__PURE__*/ function(ColliderShape) {
|
|
5668
|
-
|
|
5822
|
+
_inherits(CapsuleColliderShape, ColliderShape);
|
|
5669
5823
|
function CapsuleColliderShape() {
|
|
5670
5824
|
var _this;
|
|
5671
5825
|
_this = ColliderShape.call(this) || this;
|
|
@@ -5675,7 +5829,7 @@ ColliderShape._idGenerator = 0;
|
|
|
5675
5829
|
_this._nativeShape = PhysicsManager._nativePhysics.createCapsuleColliderShape(_this._id, _this._radius, _this._height, _this._material._nativeMaterial);
|
|
5676
5830
|
return _this;
|
|
5677
5831
|
}
|
|
5678
|
-
|
|
5832
|
+
_create_class(CapsuleColliderShape, [
|
|
5679
5833
|
{
|
|
5680
5834
|
key: "radius",
|
|
5681
5835
|
get: /**
|
|
@@ -5723,7 +5877,7 @@ ColliderShape._idGenerator = 0;
|
|
|
5723
5877
|
}(ColliderShape);
|
|
5724
5878
|
|
|
5725
5879
|
exports.Joint = /*#__PURE__*/ function(Component) {
|
|
5726
|
-
|
|
5880
|
+
_inherits(Joint, Component);
|
|
5727
5881
|
function Joint(entity) {
|
|
5728
5882
|
var _this;
|
|
5729
5883
|
_this = Component.call(this, entity) || this;
|
|
@@ -5734,7 +5888,7 @@ exports.Joint = /*#__PURE__*/ function(Component) {
|
|
|
5734
5888
|
_this._connectedCollider.localPosition = new engineMath.Vector3();
|
|
5735
5889
|
return _this;
|
|
5736
5890
|
}
|
|
5737
|
-
|
|
5891
|
+
_create_class(Joint, [
|
|
5738
5892
|
{
|
|
5739
5893
|
key: "connectedCollider",
|
|
5740
5894
|
get: /**
|
|
@@ -5852,7 +6006,7 @@ exports.Joint = /*#__PURE__*/ function(Component) {
|
|
|
5852
6006
|
]);
|
|
5853
6007
|
return Joint;
|
|
5854
6008
|
}(Component);
|
|
5855
|
-
exports.Joint =
|
|
6009
|
+
exports.Joint = __decorate([
|
|
5856
6010
|
dependentComponents(exports.Collider)
|
|
5857
6011
|
], exports.Joint);
|
|
5858
6012
|
/**
|
|
@@ -5866,7 +6020,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
5866
6020
|
/*
|
|
5867
6021
|
* A fixed joint permits no relative movement between two colliders. ie the colliders are glued together.
|
|
5868
6022
|
*/ var FixedJoint = /*#__PURE__*/ function(Joint) {
|
|
5869
|
-
|
|
6023
|
+
_inherits(FixedJoint, Joint);
|
|
5870
6024
|
function FixedJoint() {
|
|
5871
6025
|
return Joint.apply(this, arguments);
|
|
5872
6026
|
}
|
|
@@ -5895,7 +6049,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
5895
6049
|
/**
|
|
5896
6050
|
* A joint which behaves in a similar way to a hinge or axle.
|
|
5897
6051
|
*/ var HingeJoint = /*#__PURE__*/ function(Joint) {
|
|
5898
|
-
|
|
6052
|
+
_inherits(HingeJoint, Joint);
|
|
5899
6053
|
function HingeJoint() {
|
|
5900
6054
|
var _this;
|
|
5901
6055
|
_this = Joint.apply(this, arguments) || this;
|
|
@@ -5914,7 +6068,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
5914
6068
|
collider.collider = this.entity.getComponent(exports.Collider);
|
|
5915
6069
|
this._nativeJoint = PhysicsManager._nativePhysics.createHingeJoint(collider.collider._nativeCollider);
|
|
5916
6070
|
};
|
|
5917
|
-
|
|
6071
|
+
_create_class(HingeJoint, [
|
|
5918
6072
|
{
|
|
5919
6073
|
key: "axis",
|
|
5920
6074
|
get: /**
|
|
@@ -6045,7 +6199,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6045
6199
|
/**
|
|
6046
6200
|
* A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
|
|
6047
6201
|
*/ var SpringJoint = /*#__PURE__*/ function(Joint) {
|
|
6048
|
-
|
|
6202
|
+
_inherits(SpringJoint, Joint);
|
|
6049
6203
|
function SpringJoint() {
|
|
6050
6204
|
var _this;
|
|
6051
6205
|
_this = Joint.apply(this, arguments) || this;
|
|
@@ -6066,7 +6220,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6066
6220
|
collider.collider = this.entity.getComponent(exports.Collider);
|
|
6067
6221
|
this._nativeJoint = PhysicsManager._nativePhysics.createSpringJoint(collider.collider._nativeCollider);
|
|
6068
6222
|
};
|
|
6069
|
-
|
|
6223
|
+
_create_class(SpringJoint, [
|
|
6070
6224
|
{
|
|
6071
6225
|
key: "swingOffset",
|
|
6072
6226
|
get: /**
|
|
@@ -6175,6 +6329,9 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6175
6329
|
/** If freeSpin is enabled the motor will only accelerate but never slow down. */ this.freeSpin = false;
|
|
6176
6330
|
};
|
|
6177
6331
|
|
|
6332
|
+
/**
|
|
6333
|
+
* The up axis of the collider shape.
|
|
6334
|
+
*/ exports.ControllerCollisionFlag = void 0;
|
|
6178
6335
|
(function(ControllerCollisionFlag) {
|
|
6179
6336
|
ControllerCollisionFlag[ControllerCollisionFlag[/** Character is colliding to the sides. */ "Sides"] = 1] = "Sides";
|
|
6180
6337
|
ControllerCollisionFlag[ControllerCollisionFlag[/** Character has collision above. */ "Up"] = 2] = "Up";
|
|
@@ -6185,7 +6342,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6185
6342
|
* A static collider component that will not move.
|
|
6186
6343
|
* @remarks Mostly used for object which always stays at the same place and never moves around.
|
|
6187
6344
|
*/ var StaticCollider = /*#__PURE__*/ function(Collider) {
|
|
6188
|
-
|
|
6345
|
+
_inherits(StaticCollider, Collider);
|
|
6189
6346
|
function StaticCollider(entity) {
|
|
6190
6347
|
var _this;
|
|
6191
6348
|
_this = Collider.call(this, entity) || this;
|
|
@@ -6199,7 +6356,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6199
6356
|
/**
|
|
6200
6357
|
* A dynamic collider can act with self-defined movement or physical force.
|
|
6201
6358
|
*/ var DynamicCollider = /*#__PURE__*/ function(Collider) {
|
|
6202
|
-
|
|
6359
|
+
_inherits(DynamicCollider, Collider);
|
|
6203
6360
|
function DynamicCollider(entity) {
|
|
6204
6361
|
var _this;
|
|
6205
6362
|
_this = Collider.call(this, entity) || this;
|
|
@@ -6219,10 +6376,10 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6219
6376
|
_this._sleepThreshold = 5e-3;
|
|
6220
6377
|
var transform = _this.entity.transform;
|
|
6221
6378
|
_this._nativeCollider = PhysicsManager._nativePhysics.createDynamicCollider(transform.worldPosition, transform.worldRotationQuaternion);
|
|
6222
|
-
_this._setLinearVelocity = _this._setLinearVelocity.bind(
|
|
6223
|
-
_this._setAngularVelocity = _this._setAngularVelocity.bind(
|
|
6224
|
-
_this._setCenterOfMass = _this._setCenterOfMass.bind(
|
|
6225
|
-
_this._setInertiaTensor = _this._setInertiaTensor.bind(
|
|
6379
|
+
_this._setLinearVelocity = _this._setLinearVelocity.bind(_assert_this_initialized(_this));
|
|
6380
|
+
_this._setAngularVelocity = _this._setAngularVelocity.bind(_assert_this_initialized(_this));
|
|
6381
|
+
_this._setCenterOfMass = _this._setCenterOfMass.bind(_assert_this_initialized(_this));
|
|
6382
|
+
_this._setInertiaTensor = _this._setInertiaTensor.bind(_assert_this_initialized(_this));
|
|
6226
6383
|
//@ts-ignore
|
|
6227
6384
|
_this._linearVelocity._onValueChanged = _this._setLinearVelocity;
|
|
6228
6385
|
//@ts-ignore
|
|
@@ -6280,7 +6437,7 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6280
6437
|
_proto._setInertiaTensor = function _setInertiaTensor() {
|
|
6281
6438
|
this._nativeCollider.setInertiaTensor(this._inertiaTensor);
|
|
6282
6439
|
};
|
|
6283
|
-
|
|
6440
|
+
_create_class(DynamicCollider, [
|
|
6284
6441
|
{
|
|
6285
6442
|
key: "linearDamping",
|
|
6286
6443
|
get: /**
|
|
@@ -6476,12 +6633,14 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6476
6633
|
]);
|
|
6477
6634
|
return DynamicCollider;
|
|
6478
6635
|
}(exports.Collider);
|
|
6636
|
+
exports.CollisionDetectionMode = void 0;
|
|
6479
6637
|
(function(CollisionDetectionMode) {
|
|
6480
6638
|
CollisionDetectionMode[CollisionDetectionMode["Discrete"] = 0] = "Discrete";
|
|
6481
6639
|
CollisionDetectionMode[CollisionDetectionMode[/** Continuous collision detection is on for colliding with static mesh geometry. */ "Continuous"] = 1] = "Continuous";
|
|
6482
6640
|
CollisionDetectionMode[CollisionDetectionMode[/** Continuous collision detection is on for colliding with static and dynamic geometry. */ "ContinuousDynamic"] = 2] = "ContinuousDynamic";
|
|
6483
6641
|
CollisionDetectionMode[CollisionDetectionMode[/** Speculative continuous collision detection is on for static and dynamic geometries */ "ContinuousSpeculative"] = 3] = "ContinuousSpeculative";
|
|
6484
6642
|
})(exports.CollisionDetectionMode || (exports.CollisionDetectionMode = {}));
|
|
6643
|
+
exports.DynamicColliderConstraints = void 0;
|
|
6485
6644
|
(function(DynamicColliderConstraints) {
|
|
6486
6645
|
DynamicColliderConstraints[DynamicColliderConstraints[/** Not Freeze. */ "None"] = 0] = "None";
|
|
6487
6646
|
DynamicColliderConstraints[DynamicColliderConstraints[/** Freeze motion along the X-axis. */ "FreezePositionX"] = 1] = "FreezePositionX";
|
|
@@ -6492,6 +6651,13 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6492
6651
|
DynamicColliderConstraints[DynamicColliderConstraints[/** Freeze rotation along the Z-axis. */ "FreezeRotationZ"] = 32] = "FreezeRotationZ";
|
|
6493
6652
|
})(exports.DynamicColliderConstraints || (exports.DynamicColliderConstraints = {}));
|
|
6494
6653
|
|
|
6654
|
+
/**
|
|
6655
|
+
* Defines values that specify the buttons on a pointer device.
|
|
6656
|
+
* Refer to the W3C standards:
|
|
6657
|
+
* (https://www.w3.org/TR/uievents/#dom-mouseevent-button)
|
|
6658
|
+
* (https://www.w3.org/TR/uievents/#dom-mouseevent-buttons)
|
|
6659
|
+
* Refer to Microsoft's documentation.(https://docs.microsoft.com/en-us/dotnet/api/system.windows.input.mousebutton?view=windowsdesktop-6.0)
|
|
6660
|
+
*/ exports.PointerButton = void 0;
|
|
6495
6661
|
(function(PointerButton) {
|
|
6496
6662
|
PointerButton[PointerButton[/** No button. */ "None"] = 0x0] = "None";
|
|
6497
6663
|
PointerButton[PointerButton[/** Indicate the primary pointer of the device (in general, the left button or the only button on single-button devices, used to activate a user interface control or select text) or the un-initialized value. */ "Primary"] = 0x1] = "Primary";
|
|
@@ -6815,9 +6981,15 @@ exports.Joint = _ts_decorate__default['default']([
|
|
|
6815
6981
|
};
|
|
6816
6982
|
return PointerManager;
|
|
6817
6983
|
}();
|
|
6818
|
-
|
|
6819
|
-
PointerManager.
|
|
6820
|
-
|
|
6984
|
+
(function() {
|
|
6985
|
+
PointerManager._tempRay = new engineMath.Ray();
|
|
6986
|
+
})();
|
|
6987
|
+
(function() {
|
|
6988
|
+
PointerManager._tempPoint = new engineMath.Vector2();
|
|
6989
|
+
})();
|
|
6990
|
+
(function() {
|
|
6991
|
+
PointerManager._tempHitResult = new HitResult();
|
|
6992
|
+
})();
|
|
6821
6993
|
|
|
6822
6994
|
/**
|
|
6823
6995
|
* Wheel Manager.
|
|
@@ -6890,7 +7062,7 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
6890
7062
|
this._curFrameCount = 0;
|
|
6891
7063
|
// @ts-ignore
|
|
6892
7064
|
var canvas = engine._canvas._webCanvas;
|
|
6893
|
-
if (typeof OffscreenCanvas === "undefined" || !
|
|
7065
|
+
if (typeof OffscreenCanvas === "undefined" || !_instanceof(canvas, OffscreenCanvas)) {
|
|
6894
7066
|
this._wheelManager = new WheelManager(canvas);
|
|
6895
7067
|
this._pointerManager = new PointerManager(engine, canvas);
|
|
6896
7068
|
this._keyboardManager = new KeyboardManager(canvas);
|
|
@@ -7023,7 +7195,7 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7023
7195
|
this._pointerManager._onFocus();
|
|
7024
7196
|
this._keyboardManager._onFocus();
|
|
7025
7197
|
};
|
|
7026
|
-
|
|
7198
|
+
_create_class(InputManager, [
|
|
7027
7199
|
{
|
|
7028
7200
|
key: "pointers",
|
|
7029
7201
|
get: /**
|
|
@@ -7056,12 +7228,18 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7056
7228
|
return InputManager;
|
|
7057
7229
|
}();
|
|
7058
7230
|
|
|
7231
|
+
/**
|
|
7232
|
+
* Number of cascades to use for directional light shadows.
|
|
7233
|
+
*/ exports.ShadowCascadesMode = void 0;
|
|
7059
7234
|
(function(ShadowCascadesMode) {
|
|
7060
7235
|
ShadowCascadesMode[ShadowCascadesMode[/** No cascades */ "NoCascades"] = 1] = "NoCascades";
|
|
7061
7236
|
ShadowCascadesMode[ShadowCascadesMode[/** Two cascades */ "TwoCascades"] = 2] = "TwoCascades";
|
|
7062
7237
|
ShadowCascadesMode[ShadowCascadesMode[/** Four cascades */ "FourCascades"] = 4] = "FourCascades";
|
|
7063
7238
|
})(exports.ShadowCascadesMode || (exports.ShadowCascadesMode = {}));
|
|
7064
7239
|
|
|
7240
|
+
/**
|
|
7241
|
+
* Default shadow resolution.
|
|
7242
|
+
*/ exports.ShadowResolution = void 0;
|
|
7065
7243
|
(function(ShadowResolution) {
|
|
7066
7244
|
ShadowResolution[ShadowResolution[/** Low shadow map resolution. */ "Low"] = 0] = "Low";
|
|
7067
7245
|
ShadowResolution[ShadowResolution[/** Medium shadow map resolution. */ "Medium"] = 1] = "Medium";
|
|
@@ -7069,6 +7247,9 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7069
7247
|
ShadowResolution[ShadowResolution[/** Very high shadow map resolution. */ "VeryHigh"] = 3] = "VeryHigh";
|
|
7070
7248
|
})(exports.ShadowResolution || (exports.ShadowResolution = {}));
|
|
7071
7249
|
|
|
7250
|
+
/**
|
|
7251
|
+
* Determines which type of shadows should be used.
|
|
7252
|
+
*/ exports.ShadowType = void 0;
|
|
7072
7253
|
(function(ShadowType) {
|
|
7073
7254
|
ShadowType[ShadowType[/** Disable Shadows. */ "None"] = 0] = "None";
|
|
7074
7255
|
ShadowType[ShadowType[/** Hard Shadows Only. */ "Hard"] = 1] = "Hard";
|
|
@@ -7076,12 +7257,19 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7076
7257
|
ShadowType[ShadowType[/** Cast "soft" shadows with large range. */ "SoftHigh"] = 3] = "SoftHigh";
|
|
7077
7258
|
})(exports.ShadowType || (exports.ShadowType = {}));
|
|
7078
7259
|
|
|
7260
|
+
/**
|
|
7261
|
+
* Render queue type.
|
|
7262
|
+
*/ exports.RenderQueueType = void 0;
|
|
7079
7263
|
(function(RenderQueueType) {
|
|
7080
7264
|
RenderQueueType[RenderQueueType[/** Opaque queue. */ "Opaque"] = 0] = "Opaque";
|
|
7081
7265
|
RenderQueueType[RenderQueueType[/** Opaque queue, alpha cutoff. */ "AlphaTest"] = 1] = "AlphaTest";
|
|
7082
7266
|
RenderQueueType[RenderQueueType[/** Transparent queue, rendering from back to front to ensure correct rendering of transparent objects. */ "Transparent"] = 2] = "Transparent";
|
|
7083
7267
|
})(exports.RenderQueueType || (exports.RenderQueueType = {}));
|
|
7084
7268
|
|
|
7269
|
+
/**
|
|
7270
|
+
* Blend factor.
|
|
7271
|
+
* @remarks defines which function is used for blending pixel arithmetic
|
|
7272
|
+
*/ exports.BlendFactor = void 0;
|
|
7085
7273
|
(function(BlendFactor) {
|
|
7086
7274
|
BlendFactor[BlendFactor[/** (0, 0, 0, 0)*/ "Zero"] = 0] = "Zero";
|
|
7087
7275
|
BlendFactor[BlendFactor[/** (1, 1, 1, 1)*/ "One"] = 1] = "One";
|
|
@@ -7098,6 +7286,10 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7098
7286
|
BlendFactor[BlendFactor[/** (1 - Rc, 1 - Gc, 1 - Bc, 1 - Ac)*/ "OneMinusBlendColor"] = 12] = "OneMinusBlendColor";
|
|
7099
7287
|
})(exports.BlendFactor || (exports.BlendFactor = {}));
|
|
7100
7288
|
|
|
7289
|
+
/**
|
|
7290
|
+
* Blend operation function.
|
|
7291
|
+
* @remarks defines how a new pixel is combined with a pixel.
|
|
7292
|
+
*/ exports.BlendOperation = void 0;
|
|
7101
7293
|
(function(BlendOperation) {
|
|
7102
7294
|
BlendOperation[BlendOperation[/** src + dst. */ "Add"] = 0] = "Add";
|
|
7103
7295
|
BlendOperation[BlendOperation[/** src - dst. */ "Subtract"] = 1] = "Subtract";
|
|
@@ -7106,6 +7298,10 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7106
7298
|
BlendOperation[BlendOperation[/** Maximum of source and destination. */ "Max"] = 4] = "Max";
|
|
7107
7299
|
})(exports.BlendOperation || (exports.BlendOperation = {}));
|
|
7108
7300
|
|
|
7301
|
+
/**
|
|
7302
|
+
* Set which color channels can be rendered to frame buffer.
|
|
7303
|
+
* @remarks enumeration can be combined using bit operations.
|
|
7304
|
+
*/ exports.ColorWriteMask = void 0;
|
|
7109
7305
|
(function(ColorWriteMask) {
|
|
7110
7306
|
ColorWriteMask[ColorWriteMask[/** Do not write to any channel. */ "None"] = 0] = "None";
|
|
7111
7307
|
ColorWriteMask[ColorWriteMask[/** Write to the red channel. */ "Red"] = 0x1] = "Red";
|
|
@@ -7115,6 +7311,10 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7115
7311
|
ColorWriteMask[ColorWriteMask[/** Write to all channel. */ "All"] = 0xf] = "All";
|
|
7116
7312
|
})(exports.ColorWriteMask || (exports.ColorWriteMask = {}));
|
|
7117
7313
|
|
|
7314
|
+
/**
|
|
7315
|
+
* Depth/Stencil comparison function.
|
|
7316
|
+
* @remarks Specifies a function that compares incoming pixel depth/stencil to the current depth/stencil buffer value.
|
|
7317
|
+
*/ exports.CompareFunction = void 0;
|
|
7118
7318
|
(function(CompareFunction) {
|
|
7119
7319
|
CompareFunction[CompareFunction[/** never pass. */ "Never"] = 0] = "Never";
|
|
7120
7320
|
CompareFunction[CompareFunction[/** pass if the incoming value is less than the depth/stencil buffer value. */ "Less"] = 1] = "Less";
|
|
@@ -7126,12 +7326,19 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7126
7326
|
CompareFunction[CompareFunction[/** always pass. */ "Always"] = 7] = "Always";
|
|
7127
7327
|
})(exports.CompareFunction || (exports.CompareFunction = {}));
|
|
7128
7328
|
|
|
7329
|
+
/**
|
|
7330
|
+
* Culling mode.
|
|
7331
|
+
* @remarks specifies whether or not front- and/or back-facing polygons can be culled.
|
|
7332
|
+
*/ exports.CullMode = void 0;
|
|
7129
7333
|
(function(CullMode) {
|
|
7130
7334
|
CullMode[CullMode[/** Disable culling. */ "Off"] = 0] = "Off";
|
|
7131
7335
|
CullMode[CullMode[/** cut the front-face of the polygons. */ "Front"] = 1] = "Front";
|
|
7132
7336
|
CullMode[CullMode[/** cut the back-face of the polygons. */ "Back"] = 2] = "Back";
|
|
7133
7337
|
})(exports.CullMode || (exports.CullMode = {}));
|
|
7134
7338
|
|
|
7339
|
+
/**
|
|
7340
|
+
* Shader Property type.
|
|
7341
|
+
*/ exports.ShaderPropertyType = void 0;
|
|
7135
7342
|
(function(ShaderPropertyType) {
|
|
7136
7343
|
ShaderPropertyType[ShaderPropertyType[/** Float type. */ "Float"] = 0] = "Float";
|
|
7137
7344
|
ShaderPropertyType[ShaderPropertyType[/** Int type. */ "Int"] = 1] = "Int";
|
|
@@ -7146,6 +7353,10 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7146
7353
|
ShaderPropertyType[ShaderPropertyType[/** Texture array type. */ "TextureArray"] = 10] = "TextureArray";
|
|
7147
7354
|
})(exports.ShaderPropertyType || (exports.ShaderPropertyType = {}));
|
|
7148
7355
|
|
|
7356
|
+
/**
|
|
7357
|
+
* Stencil operation mode.
|
|
7358
|
+
* @remarks sets the front and/or back-facing stencil test actions.
|
|
7359
|
+
*/ exports.StencilOperation = void 0;
|
|
7149
7360
|
(function(StencilOperation) {
|
|
7150
7361
|
StencilOperation[StencilOperation[/** Keeps the current value. */ "Keep"] = 0] = "Keep";
|
|
7151
7362
|
StencilOperation[StencilOperation[/** Sets the stencil buffer value to 0. */ "Zero"] = 1] = "Zero";
|
|
@@ -7171,8 +7382,12 @@ PointerManager._tempHitResult = new HitResult();
|
|
|
7171
7382
|
}
|
|
7172
7383
|
this._nameId = nameID;
|
|
7173
7384
|
};
|
|
7174
|
-
|
|
7175
|
-
ShaderMacro.
|
|
7385
|
+
(function() {
|
|
7386
|
+
/** @internal */ ShaderMacro._macroNameIdMap = Object.create(null);
|
|
7387
|
+
})();
|
|
7388
|
+
(function() {
|
|
7389
|
+
ShaderMacro._macroNameCounter = 0;
|
|
7390
|
+
})();
|
|
7176
7391
|
|
|
7177
7392
|
/**
|
|
7178
7393
|
* Shader macro collection.
|
|
@@ -7324,6 +7539,19 @@ ShaderMacro._macroNameCounter = 0;
|
|
|
7324
7539
|
return ShaderMacroCollection;
|
|
7325
7540
|
}();
|
|
7326
7541
|
|
|
7542
|
+
function _extends() {
|
|
7543
|
+
_extends = Object.assign || function assign(target) {
|
|
7544
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
7545
|
+
var source = arguments[i];
|
|
7546
|
+
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7547
|
+
}
|
|
7548
|
+
|
|
7549
|
+
return target;
|
|
7550
|
+
};
|
|
7551
|
+
|
|
7552
|
+
return _extends.apply(this, arguments);
|
|
7553
|
+
}
|
|
7554
|
+
|
|
7327
7555
|
var camera_declare = "#define GLSLIFY 1\nuniform vec3 u_cameraPos;"; // eslint-disable-line
|
|
7328
7556
|
|
|
7329
7557
|
var common = "#define GLSLIFY 1\n#define PI 3.14159265359\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n#define LOG2 1.442695\n#define saturate( a ) clamp( a, 0.0, 1.0 )\nfloat pow2(float x){return x*x;}vec4 RGBMToLinear(vec4 value,float maxRange){return vec4(value.rgb*value.a*maxRange,1.0);}vec4 gammaToLinear(vec4 srgbIn){return vec4(pow(srgbIn.rgb,vec3(2.2)),srgbIn.a);}vec4 linearToGamma(vec4 linearIn){return vec4(pow(linearIn.rgb,vec3(1.0/2.2)),linearIn.a);}\n#ifdef GRAPHICS_API_WEBGL2\n#define INVERSE_MAT(mat) inverse(mat)\n#else\nmat2 inverseMat(mat2 m){return mat2(m[1][1],-m[0][1],-m[1][0],m[0][0])/(m[0][0]*m[1][1]-m[0][1]*m[1][0]);}mat3 inverseMat(mat3 m){float a00=m[0][0],a01=m[0][1],a02=m[0][2];float a10=m[1][0],a11=m[1][1],a12=m[1][2];float a20=m[2][0],a21=m[2][1],a22=m[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}mat4 inverseMat(mat4 m){float a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],b00=a00*a11-a01*a10,b01=a00*a12-a02*a10,b02=a00*a13-a03*a10,b03=a01*a12-a02*a11,b04=a01*a13-a03*a11,b05=a02*a13-a03*a12,b06=a20*a31-a21*a30,b07=a20*a32-a22*a30,b08=a20*a33-a23*a30,b09=a21*a32-a22*a31,b10=a21*a33-a23*a31,b11=a22*a33-a23*a32,det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;return mat4(a11*b11-a12*b10+a13*b09,a02*b10-a01*b11-a03*b09,a31*b05-a32*b04+a33*b03,a22*b04-a21*b05-a23*b03,a12*b08-a10*b11-a13*b07,a00*b11-a02*b08+a03*b07,a32*b02-a30*b05-a33*b01,a20*b05-a22*b02+a23*b01,a10*b10-a11*b08+a13*b06,a01*b08-a00*b10-a03*b06,a30*b04-a31*b02+a33*b00,a21*b02-a20*b04-a23*b00,a11*b07-a10*b09-a12*b06,a00*b09-a01*b07+a02*b06,a31*b01-a30*b03-a32*b00,a20*b03-a21*b01+a22*b00)/det;}\n#define INVERSE_MAT(mat) inverseMat(mat)\n#endif\n"; // eslint-disable-line
|
|
@@ -7433,7 +7661,7 @@ var PBRShaderLib = {
|
|
|
7433
7661
|
|
|
7434
7662
|
var ShadowCoord = "#define GLSLIFY 1\nuniform mat4 u_shadowMatrices[CASCADED_COUNT+1];uniform vec4 u_shadowSplitSpheres[4];mediump int computeCascadeIndex(vec3 positionWS){vec3 fromCenter0=positionWS-u_shadowSplitSpheres[0].xyz;vec3 fromCenter1=positionWS-u_shadowSplitSpheres[1].xyz;vec3 fromCenter2=positionWS-u_shadowSplitSpheres[2].xyz;vec3 fromCenter3=positionWS-u_shadowSplitSpheres[3].xyz;mediump vec4 comparison=vec4(dot(fromCenter0,fromCenter0)<u_shadowSplitSpheres[0].w,dot(fromCenter1,fromCenter1)<u_shadowSplitSpheres[1].w,dot(fromCenter2,fromCenter2)<u_shadowSplitSpheres[2].w,dot(fromCenter3,fromCenter3)<u_shadowSplitSpheres[3].w);comparison.yzw=clamp(comparison.yzw-comparison.xyz,0.0,1.0);mediump vec4 indexCoefficient=vec4(4.0,3.0,2.0,1.0);mediump int index=4-int(dot(comparison,indexCoefficient));return index;}vec3 getShadowCoord(){\n#if CASCADED_COUNT == 1\nmediump int cascadeIndex=0;\n#else\nmediump int cascadeIndex=computeCascadeIndex(v_pos);\n#endif\n#ifdef GRAPHICS_API_WEBGL2\nmat4 shadowMatrix=u_shadowMatrices[cascadeIndex];\n#else\nmat4 shadowMatrix;\n#if CASCADED_COUNT == 4\nif(cascadeIndex==0){shadowMatrix=u_shadowMatrices[0];}else if(cascadeIndex==1){shadowMatrix=u_shadowMatrices[1];}else if(cascadeIndex==2){shadowMatrix=u_shadowMatrices[2];}else if(cascadeIndex==3){shadowMatrix=u_shadowMatrices[3];}else{shadowMatrix=u_shadowMatrices[4];}\n#endif\n#if CASCADED_COUNT == 2\nif(cascadeIndex==0){shadowMatrix=u_shadowMatrices[0];}else if(cascadeIndex==1){shadowMatrix=u_shadowMatrices[1];}else{shadowMatrix=u_shadowMatrices[2];}\n#endif\n#if CASCADED_COUNT == 1\nif(cascadeIndex==0){shadowMatrix=u_shadowMatrices[0];}else{shadowMatrix=u_shadowMatrices[1];}\n#endif\n#endif\nvec4 shadowCoord=shadowMatrix*vec4(v_pos,1.0);return shadowCoord.xyz;}"; // eslint-disable-line
|
|
7435
7663
|
|
|
7436
|
-
var ShadowFragmentDeclaration = "#define GLSLIFY 1\n#if defined(SHADOW_TYPE) && defined(OASIS_RECEIVE_SHADOWS)\n#define OASIS_CALCULATE_SHADOWS\n#endif\n#ifdef OASIS_CALCULATE_SHADOWS\n#if CASCADED_COUNT == 1\nvarying vec3 v_shadowCoord;\n#else\n#include <ShadowCoord>\n#endif\nuniform vec3 u_shadowInfo;uniform vec4 u_shadowMapSize;\n#ifdef GRAPHICS_API_WEBGL2\nuniform mediump sampler2DShadow u_shadowMap;\n#define SAMPLE_TEXTURE2D_SHADOW(textureName, coord3) textureLod(textureName, coord3 , 0.0)\n#define TEXTURE2D_SHADOW_PARAM(shadowMap) mediump sampler2DShadow shadowMap\n#else\nuniform sampler2D u_shadowMap;\n#ifdef OASIS_NO_DEPTH_TEXTURE\nconst vec4 bitShift=vec4(1.0,1.0/256.0,1.0/(256.0*256.0),1.0/(256.0*256.0*256.0))
|
|
7664
|
+
var ShadowFragmentDeclaration = "#define GLSLIFY 1\n#if defined(SHADOW_TYPE) && defined(OASIS_RECEIVE_SHADOWS)\n#define OASIS_CALCULATE_SHADOWS\n#endif\n#ifdef OASIS_CALCULATE_SHADOWS\n#if CASCADED_COUNT == 1\nvarying vec3 v_shadowCoord;\n#else\n#include <ShadowCoord>\n#endif\nuniform vec3 u_shadowInfo;uniform vec4 u_shadowMapSize;\n#ifdef GRAPHICS_API_WEBGL2\nuniform mediump sampler2DShadow u_shadowMap;\n#define SAMPLE_TEXTURE2D_SHADOW(textureName, coord3) textureLod(textureName, coord3 , 0.0)\n#define TEXTURE2D_SHADOW_PARAM(shadowMap) mediump sampler2DShadow shadowMap\n#else\nuniform sampler2D u_shadowMap;\n#ifdef OASIS_NO_DEPTH_TEXTURE\nconst vec4 bitShift=vec4(1.0,1.0/256.0,1.0/(256.0*256.0),1.0/(256.0*256.0*256.0));float unpack(const in vec4 rgbaDepth){return dot(rgbaDepth,bitShift);}\n#define SAMPLE_TEXTURE2D_SHADOW(textureName, coord3) (unpack(texture2D(textureName, coord3.xy)) < coord3.z ? 0.0 : 1.0)\n#else\n#define SAMPLE_TEXTURE2D_SHADOW(textureName, coord3) (texture2D(textureName, coord3.xy).r < coord3.z ? 0.0 : 1.0)\n#endif\n#define TEXTURE2D_SHADOW_PARAM(shadowMap) mediump sampler2D shadowMap\n#endif\n#if SHADOW_TYPE == 2\nfloat sampleShadowMapFiltered4(TEXTURE2D_SHADOW_PARAM(shadowMap),vec3 shadowCoord,vec4 shadowMapSize){float attenuation;vec4 attenuation4;vec2 offset=shadowMapSize.xy/2.0;vec3 shadowCoord0=shadowCoord+vec3(-offset,0.0);vec3 shadowCoord1=shadowCoord+vec3(offset.x,-offset.y,0.0);vec3 shadowCoord2=shadowCoord+vec3(-offset.x,offset.y,0.0);vec3 shadowCoord3=shadowCoord+vec3(offset,0.0);attenuation4.x=SAMPLE_TEXTURE2D_SHADOW(shadowMap,shadowCoord0);attenuation4.y=SAMPLE_TEXTURE2D_SHADOW(shadowMap,shadowCoord1);attenuation4.z=SAMPLE_TEXTURE2D_SHADOW(shadowMap,shadowCoord2);attenuation4.w=SAMPLE_TEXTURE2D_SHADOW(shadowMap,shadowCoord3);attenuation=dot(attenuation4,vec4(0.25));return attenuation;}\n#endif\n#if SHADOW_TYPE == 3\n#include <shadow_sample_tent>\nfloat sampleShadowMapFiltered9(TEXTURE2D_SHADOW_PARAM(shadowMap),vec3 shadowCoord,vec4 shadowmapSize){float attenuation;float fetchesWeights[9];vec2 fetchesUV[9];sampleShadowComputeSamplesTent5x5(shadowmapSize,shadowCoord.xy,fetchesWeights,fetchesUV);attenuation=fetchesWeights[0]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[0].xy,shadowCoord.z));attenuation+=fetchesWeights[1]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[1].xy,shadowCoord.z));attenuation+=fetchesWeights[2]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[2].xy,shadowCoord.z));attenuation+=fetchesWeights[3]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[3].xy,shadowCoord.z));attenuation+=fetchesWeights[4]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[4].xy,shadowCoord.z));attenuation+=fetchesWeights[5]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[5].xy,shadowCoord.z));attenuation+=fetchesWeights[6]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[6].xy,shadowCoord.z));attenuation+=fetchesWeights[7]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[7].xy,shadowCoord.z));attenuation+=fetchesWeights[8]*SAMPLE_TEXTURE2D_SHADOW(shadowMap,vec3(fetchesUV[8].xy,shadowCoord.z));return attenuation;}\n#endif\nfloat sampleShadowMap(){\n#if CASCADED_COUNT == 1\nvec3 shadowCoord=v_shadowCoord;\n#else\nvec3 shadowCoord=getShadowCoord();\n#endif\nfloat attenuation=1.0;if(shadowCoord.z>0.0&&shadowCoord.z<1.0){\n#if SHADOW_TYPE == 1\nattenuation=SAMPLE_TEXTURE2D_SHADOW(u_shadowMap,shadowCoord);\n#endif\n#if SHADOW_TYPE == 2\nattenuation=sampleShadowMapFiltered4(u_shadowMap,shadowCoord,u_shadowMapSize);\n#endif\n#if SHADOW_TYPE == 3\nattenuation=sampleShadowMapFiltered9(u_shadowMap,shadowCoord,u_shadowMapSize);\n#endif\nattenuation=mix(1.0,attenuation,u_shadowInfo.x);}return attenuation;}\n#endif\n"; // eslint-disable-line
|
|
7437
7665
|
|
|
7438
7666
|
var shadow_sample_tent = "#define GLSLIFY 1\nfloat sampleShadowGetIRTriangleTexelArea(float triangleHeight){return triangleHeight-0.5;}void sampleShadowGetTexelAreasTent3x3(float offset,out vec4 computedArea,out vec4 computedAreaUncut){float a=offset+0.5;float offsetSquaredHalved=a*a*0.5;computedAreaUncut.x=computedArea.x=offsetSquaredHalved-offset;computedAreaUncut.w=computedArea.w=offsetSquaredHalved;computedAreaUncut.y=sampleShadowGetIRTriangleTexelArea(1.5-offset);float clampedOffsetLeft=min(offset,0.0);float areaOfSmallLeftTriangle=clampedOffsetLeft*clampedOffsetLeft;computedArea.y=computedAreaUncut.y-areaOfSmallLeftTriangle;computedAreaUncut.z=sampleShadowGetIRTriangleTexelArea(1.5+offset);float clampedOffsetRight=max(offset,0.0);float areaOfSmallRightTriangle=clampedOffsetRight*clampedOffsetRight;computedArea.z=computedAreaUncut.z-areaOfSmallRightTriangle;}void sampleShadowGetTexelWeightsTent5x5(float offset,out vec3 texelsWeightsA,out vec3 texelsWeightsB){vec4 areaFrom3texelTriangle;vec4 areaUncutFrom3texelTriangle;sampleShadowGetTexelAreasTent3x3(offset,areaFrom3texelTriangle,areaUncutFrom3texelTriangle);texelsWeightsA.x=0.16*(areaFrom3texelTriangle.x);texelsWeightsA.y=0.16*(areaUncutFrom3texelTriangle.y);texelsWeightsA.z=0.16*(areaFrom3texelTriangle.y+1.0);texelsWeightsB.x=0.16*(areaFrom3texelTriangle.z+1.0);texelsWeightsB.y=0.16*(areaUncutFrom3texelTriangle.z);texelsWeightsB.z=0.16*(areaFrom3texelTriangle.w);}void sampleShadowComputeSamplesTent5x5(vec4 shadowMapTextureTexelSize,vec2 coord,out float fetchesWeights[9],out vec2 fetchesUV[9]){vec2 tentCenterInTexelSpace=coord.xy*shadowMapTextureTexelSize.zw;vec2 centerOfFetchesInTexelSpace=floor(tentCenterInTexelSpace+0.5);vec2 offsetFromTentCenterToCenterOfFetches=tentCenterInTexelSpace-centerOfFetchesInTexelSpace;vec3 texelsWeightsUA,texelsWeightsUB;vec3 texelsWeightsVA,texelsWeightsVB;sampleShadowGetTexelWeightsTent5x5(offsetFromTentCenterToCenterOfFetches.x,texelsWeightsUA,texelsWeightsUB);sampleShadowGetTexelWeightsTent5x5(offsetFromTentCenterToCenterOfFetches.y,texelsWeightsVA,texelsWeightsVB);vec3 fetchesWeightsU=vec3(texelsWeightsUA.xz,texelsWeightsUB.y)+vec3(texelsWeightsUA.y,texelsWeightsUB.xz);vec3 fetchesWeightsV=vec3(texelsWeightsVA.xz,texelsWeightsVB.y)+vec3(texelsWeightsVA.y,texelsWeightsVB.xz);vec3 fetchesOffsetsU=vec3(texelsWeightsUA.y,texelsWeightsUB.xz)/fetchesWeightsU.xyz+vec3(-2.5,-0.5,1.5);vec3 fetchesOffsetsV=vec3(texelsWeightsVA.y,texelsWeightsVB.xz)/fetchesWeightsV.xyz+vec3(-2.5,-0.5,1.5);fetchesOffsetsU*=shadowMapTextureTexelSize.xxx;fetchesOffsetsV*=shadowMapTextureTexelSize.yyy;vec2 bilinearFetchOrigin=centerOfFetchesInTexelSpace*shadowMapTextureTexelSize.xy;fetchesUV[0]=bilinearFetchOrigin+vec2(fetchesOffsetsU.x,fetchesOffsetsV.x);fetchesUV[1]=bilinearFetchOrigin+vec2(fetchesOffsetsU.y,fetchesOffsetsV.x);fetchesUV[2]=bilinearFetchOrigin+vec2(fetchesOffsetsU.z,fetchesOffsetsV.x);fetchesUV[3]=bilinearFetchOrigin+vec2(fetchesOffsetsU.x,fetchesOffsetsV.y);fetchesUV[4]=bilinearFetchOrigin+vec2(fetchesOffsetsU.y,fetchesOffsetsV.y);fetchesUV[5]=bilinearFetchOrigin+vec2(fetchesOffsetsU.z,fetchesOffsetsV.y);fetchesUV[6]=bilinearFetchOrigin+vec2(fetchesOffsetsU.x,fetchesOffsetsV.z);fetchesUV[7]=bilinearFetchOrigin+vec2(fetchesOffsetsU.y,fetchesOffsetsV.z);fetchesUV[8]=bilinearFetchOrigin+vec2(fetchesOffsetsU.z,fetchesOffsetsV.z);fetchesWeights[0]=fetchesWeightsU.x*fetchesWeightsV.x;fetchesWeights[1]=fetchesWeightsU.y*fetchesWeightsV.x;fetchesWeights[2]=fetchesWeightsU.z*fetchesWeightsV.x;fetchesWeights[3]=fetchesWeightsU.x*fetchesWeightsV.y;fetchesWeights[4]=fetchesWeightsU.y*fetchesWeightsV.y;fetchesWeights[5]=fetchesWeightsU.z*fetchesWeightsV.y;fetchesWeights[6]=fetchesWeightsU.x*fetchesWeightsV.z;fetchesWeights[7]=fetchesWeightsU.y*fetchesWeightsV.z;fetchesWeights[8]=fetchesWeightsU.z*fetchesWeightsV.z;}"; // eslint-disable-line
|
|
7439
7667
|
|
|
@@ -7451,7 +7679,7 @@ var ShadowLib = {
|
|
|
7451
7679
|
|
|
7452
7680
|
var normal_get = "#define GLSLIFY 1\nvec3 getNormal(bool isFrontFacing){\n#ifdef O3_HAS_NORMAL\nvec3 normal=normalize(v_normal);\n#elif defined(HAS_DERIVATIVES)\nvec3 pos_dx=dFdx(v_pos);vec3 pos_dy=dFdy(v_pos);vec3 normal=normalize(cross(pos_dx,pos_dy));\n#else\nvec3 normal=vec3(0,0,1);\n#endif\nnormal*=float(isFrontFacing)*2.0-1.0;return normal;}vec3 getNormalByNormalTexture(mat3 tbn,sampler2D normalTexture,float normalIntensity,vec2 uv,bool isFrontFacing){vec3 normal=texture2D(normalTexture,uv).rgb;normal=normalize(tbn*((2.0*normal-1.0)*vec3(normalIntensity,normalIntensity,1.0)));normal*=float(isFrontFacing)*2.0-1.0;return normal;}mat3 getTBN(bool isFrontFacing){\n#if defined(O3_HAS_NORMAL) && defined(O3_HAS_TANGENT) && ( defined(NORMALTEXTURE) || defined(HAS_CLEARCOATNORMALTEXTURE) )\nmat3 tbn=v_TBN;\n#else\nvec3 normal=getNormal(isFrontFacing);vec3 position=v_pos;vec2 uv=isFrontFacing? v_uv:-v_uv;\n#ifdef HAS_DERIVATIVES\nvec3 dp1=dFdx(position);vec3 dp2=dFdy(position);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));mat3 tbn=mat3(tangent*invmax,binormal*invmax,normal);\n#else\nmat3 tbn=mat3(vec3(0.0),vec3(0.0),normal);\n#endif\n#endif\nreturn tbn;}"; // eslint-disable-line
|
|
7453
7681
|
|
|
7454
|
-
var ShaderLib =
|
|
7682
|
+
var ShaderLib = _extends({
|
|
7455
7683
|
common: common,
|
|
7456
7684
|
common_vert: common_vert,
|
|
7457
7685
|
transform_declare: transform_declare,
|
|
@@ -8163,7 +8391,7 @@ var ShaderFactory = /*#__PURE__*/ function() {
|
|
|
8163
8391
|
return prefix + line;
|
|
8164
8392
|
}).join("\n");
|
|
8165
8393
|
};
|
|
8166
|
-
|
|
8394
|
+
_create_class(ShaderProgram, [
|
|
8167
8395
|
{
|
|
8168
8396
|
key: "isValid",
|
|
8169
8397
|
get: /**
|
|
@@ -8175,7 +8403,9 @@ var ShaderFactory = /*#__PURE__*/ function() {
|
|
|
8175
8403
|
]);
|
|
8176
8404
|
return ShaderProgram;
|
|
8177
8405
|
}();
|
|
8178
|
-
|
|
8406
|
+
(function() {
|
|
8407
|
+
ShaderProgram._counter = 0;
|
|
8408
|
+
})();
|
|
8179
8409
|
|
|
8180
8410
|
/**
|
|
8181
8411
|
* Shader pass containing vertex and fragment source.
|
|
@@ -8220,7 +8450,9 @@ ShaderProgram._counter = 0;
|
|
|
8220
8450
|
};
|
|
8221
8451
|
return ShaderPass;
|
|
8222
8452
|
}();
|
|
8223
|
-
|
|
8453
|
+
(function() {
|
|
8454
|
+
ShaderPass._shaderPassCounter = 0;
|
|
8455
|
+
})();
|
|
8224
8456
|
|
|
8225
8457
|
/**
|
|
8226
8458
|
* Shader property.
|
|
@@ -8229,7 +8461,7 @@ ShaderPass._shaderPassCounter = 0;
|
|
|
8229
8461
|
this.name = name;
|
|
8230
8462
|
this._uniqueId = ShaderProperty._propertyNameCounter++;
|
|
8231
8463
|
}
|
|
8232
|
-
|
|
8464
|
+
_create_class(ShaderProperty, [
|
|
8233
8465
|
{
|
|
8234
8466
|
key: "type",
|
|
8235
8467
|
get: /**
|
|
@@ -8241,7 +8473,9 @@ ShaderPass._shaderPassCounter = 0;
|
|
|
8241
8473
|
]);
|
|
8242
8474
|
return ShaderProperty;
|
|
8243
8475
|
}();
|
|
8244
|
-
|
|
8476
|
+
(function() {
|
|
8477
|
+
ShaderProperty._propertyNameCounter = 0;
|
|
8478
|
+
})();
|
|
8245
8479
|
|
|
8246
8480
|
/**
|
|
8247
8481
|
* Shader for rendering.
|
|
@@ -8354,7 +8588,7 @@ ShaderProperty._propertyNameCounter = 0;
|
|
|
8354
8588
|
}
|
|
8355
8589
|
}
|
|
8356
8590
|
};
|
|
8357
|
-
|
|
8591
|
+
_create_class(Shader, [
|
|
8358
8592
|
{
|
|
8359
8593
|
key: "passes",
|
|
8360
8594
|
get: /**
|
|
@@ -8366,18 +8600,34 @@ ShaderProperty._propertyNameCounter = 0;
|
|
|
8366
8600
|
]);
|
|
8367
8601
|
return Shader;
|
|
8368
8602
|
}();
|
|
8369
|
-
|
|
8370
|
-
/** @internal */ Shader.
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
Shader.
|
|
8603
|
+
(function() {
|
|
8604
|
+
/** @internal */ Shader._compileMacros = new ShaderMacroCollection();
|
|
8605
|
+
})();
|
|
8606
|
+
(function() {
|
|
8607
|
+
/** @internal */ Shader._shaderExtension = [
|
|
8608
|
+
"GL_EXT_shader_texture_lod",
|
|
8609
|
+
"GL_OES_standard_derivatives",
|
|
8610
|
+
"GL_EXT_draw_buffers"
|
|
8611
|
+
];
|
|
8612
|
+
})();
|
|
8613
|
+
(function() {
|
|
8614
|
+
/** @internal */ Shader._propertyIdMap = Object.create(null);
|
|
8615
|
+
})();
|
|
8616
|
+
(function() {
|
|
8617
|
+
Shader._shaderMap = Object.create(null);
|
|
8618
|
+
})();
|
|
8619
|
+
(function() {
|
|
8620
|
+
Shader._propertyNameMap = Object.create(null);
|
|
8621
|
+
})();
|
|
8622
|
+
(function() {
|
|
8623
|
+
Shader._macroMaskMap = [];
|
|
8624
|
+
})();
|
|
8625
|
+
(function() {
|
|
8626
|
+
Shader._macroCounter = 0;
|
|
8627
|
+
})();
|
|
8628
|
+
(function() {
|
|
8629
|
+
Shader._macroMap = Object.create(null);
|
|
8630
|
+
})();
|
|
8381
8631
|
|
|
8382
8632
|
/**
|
|
8383
8633
|
* Shader data collection,Correspondence includes shader properties data and macros data.
|
|
@@ -8559,10 +8809,10 @@ Shader._macroMap = Object.create(null);
|
|
|
8559
8809
|
if (property != null) {
|
|
8560
8810
|
if (typeof property === "number") {
|
|
8561
8811
|
targetPropertyValueMap[k] = property;
|
|
8562
|
-
} else if (
|
|
8812
|
+
} else if (_instanceof(property, Texture)) {
|
|
8563
8813
|
targetPropertyValueMap[k] = property;
|
|
8564
8814
|
referCount > 0 && property._addRefCount(referCount);
|
|
8565
|
-
} else if (
|
|
8815
|
+
} else if (_instanceof(property, Array) || _instanceof(property, Float32Array) || _instanceof(property, Int32Array)) {
|
|
8566
8816
|
targetPropertyValueMap[k] = property.slice();
|
|
8567
8817
|
} else {
|
|
8568
8818
|
var targetProperty = targetPropertyValueMap[k];
|
|
@@ -8612,7 +8862,7 @@ Shader._macroMap = Object.create(null);
|
|
|
8612
8862
|
for(var k in properties){
|
|
8613
8863
|
var property = properties[k];
|
|
8614
8864
|
// @todo: Separate array to speed performance.
|
|
8615
|
-
if (property &&
|
|
8865
|
+
if (property && _instanceof(property, Texture)) {
|
|
8616
8866
|
property._addRefCount(value);
|
|
8617
8867
|
}
|
|
8618
8868
|
}
|
|
@@ -8623,7 +8873,7 @@ Shader._macroMap = Object.create(null);
|
|
|
8623
8873
|
/**
|
|
8624
8874
|
* Light base class.
|
|
8625
8875
|
*/ var Light = /*#__PURE__*/ function(Component) {
|
|
8626
|
-
|
|
8876
|
+
_inherits(Light, Component);
|
|
8627
8877
|
function Light() {
|
|
8628
8878
|
var _this;
|
|
8629
8879
|
_this = Component.apply(this, arguments) || this;
|
|
@@ -8637,9 +8887,9 @@ Shader._macroMap = Object.create(null);
|
|
|
8637
8887
|
/** Shadow mapping normal-based bias. */ _this.shadowNormalBias = 1;
|
|
8638
8888
|
/** Near plane value to use for shadow frustums. */ _this.shadowNearPlane = 0.1;
|
|
8639
8889
|
/** Shadow intensity, the larger the value, the clearer and darker the shadow. */ _this.shadowStrength = 1.0;
|
|
8890
|
+
/** @internal */ _this._lightIndex = -1;
|
|
8640
8891
|
_this._color = new engineMath.Color(1, 1, 1, 1);
|
|
8641
8892
|
_this._lightColor = new engineMath.Color();
|
|
8642
|
-
/** @internal */ _this._lightIndex = -1;
|
|
8643
8893
|
return _this;
|
|
8644
8894
|
}
|
|
8645
8895
|
var _proto = Light.prototype;
|
|
@@ -8650,7 +8900,7 @@ Shader._macroMap = Object.create(null);
|
|
|
8650
8900
|
this._lightColor.a = this.color.a * this.intensity;
|
|
8651
8901
|
return this._lightColor;
|
|
8652
8902
|
};
|
|
8653
|
-
|
|
8903
|
+
_create_class(Light, [
|
|
8654
8904
|
{
|
|
8655
8905
|
key: "color",
|
|
8656
8906
|
get: /**
|
|
@@ -8687,17 +8937,19 @@ Shader._macroMap = Object.create(null);
|
|
|
8687
8937
|
]);
|
|
8688
8938
|
return Light;
|
|
8689
8939
|
}(Component);
|
|
8690
|
-
|
|
8940
|
+
(function() {
|
|
8941
|
+
/**
|
|
8691
8942
|
* Each type of light source is at most 10, beyond which it will not take effect.
|
|
8692
8943
|
* */ Light._maxLight = 10;
|
|
8693
|
-
|
|
8944
|
+
})();
|
|
8945
|
+
__decorate([
|
|
8694
8946
|
ignoreClone
|
|
8695
8947
|
], Light.prototype, "_lightIndex", void 0);
|
|
8696
8948
|
|
|
8697
8949
|
/**
|
|
8698
8950
|
* Directional light.
|
|
8699
8951
|
*/ var DirectLight = /*#__PURE__*/ function(Light) {
|
|
8700
|
-
|
|
8952
|
+
_inherits(DirectLight, Light);
|
|
8701
8953
|
function DirectLight() {
|
|
8702
8954
|
var _this;
|
|
8703
8955
|
_this = Light.apply(this, arguments) || this;
|
|
@@ -8747,7 +8999,7 @@ _ts_decorate__default['default']([
|
|
|
8747
8999
|
shaderData.setFloatArray(DirectLight._colorProperty, data.color);
|
|
8748
9000
|
shaderData.setFloatArray(DirectLight._directionProperty, data.direction);
|
|
8749
9001
|
};
|
|
8750
|
-
|
|
9002
|
+
_create_class(DirectLight, [
|
|
8751
9003
|
{
|
|
8752
9004
|
key: "direction",
|
|
8753
9005
|
get: /**
|
|
@@ -8778,19 +9030,27 @@ _ts_decorate__default['default']([
|
|
|
8778
9030
|
]);
|
|
8779
9031
|
return DirectLight;
|
|
8780
9032
|
}(Light);
|
|
8781
|
-
|
|
8782
|
-
DirectLight.
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
9033
|
+
(function() {
|
|
9034
|
+
DirectLight._cullingMaskProperty = Shader.getPropertyByName("u_directLightCullingMask");
|
|
9035
|
+
})();
|
|
9036
|
+
(function() {
|
|
9037
|
+
DirectLight._colorProperty = Shader.getPropertyByName("u_directLightColor");
|
|
9038
|
+
})();
|
|
9039
|
+
(function() {
|
|
9040
|
+
DirectLight._directionProperty = Shader.getPropertyByName("u_directLightDirection");
|
|
9041
|
+
})();
|
|
9042
|
+
(function() {
|
|
9043
|
+
DirectLight._combinedData = {
|
|
9044
|
+
cullingMask: new Int32Array(Light._maxLight * 2),
|
|
9045
|
+
color: new Float32Array(Light._maxLight * 3),
|
|
9046
|
+
direction: new Float32Array(Light._maxLight * 3)
|
|
9047
|
+
};
|
|
9048
|
+
})();
|
|
8789
9049
|
|
|
8790
9050
|
/**
|
|
8791
9051
|
* Point light.
|
|
8792
9052
|
*/ var PointLight = /*#__PURE__*/ function(Light) {
|
|
8793
|
-
|
|
9053
|
+
_inherits(PointLight, Light);
|
|
8794
9054
|
function PointLight() {
|
|
8795
9055
|
var _this;
|
|
8796
9056
|
_this = Light.apply(this, arguments) || this;
|
|
@@ -8842,7 +9102,7 @@ DirectLight._combinedData = {
|
|
|
8842
9102
|
shaderData.setFloatArray(PointLight._positionProperty, data.position);
|
|
8843
9103
|
shaderData.setFloatArray(PointLight._distanceProperty, data.distance);
|
|
8844
9104
|
};
|
|
8845
|
-
|
|
9105
|
+
_create_class(PointLight, [
|
|
8846
9106
|
{
|
|
8847
9107
|
key: "position",
|
|
8848
9108
|
get: /**
|
|
@@ -8863,21 +9123,31 @@ DirectLight._combinedData = {
|
|
|
8863
9123
|
]);
|
|
8864
9124
|
return PointLight;
|
|
8865
9125
|
}(Light);
|
|
8866
|
-
|
|
8867
|
-
PointLight.
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
PointLight.
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
9126
|
+
(function() {
|
|
9127
|
+
PointLight._cullingMaskProperty = Shader.getPropertyByName("u_pointLightCullingMask");
|
|
9128
|
+
})();
|
|
9129
|
+
(function() {
|
|
9130
|
+
PointLight._colorProperty = Shader.getPropertyByName("u_pointLightColor");
|
|
9131
|
+
})();
|
|
9132
|
+
(function() {
|
|
9133
|
+
PointLight._positionProperty = Shader.getPropertyByName("u_pointLightPosition");
|
|
9134
|
+
})();
|
|
9135
|
+
(function() {
|
|
9136
|
+
PointLight._distanceProperty = Shader.getPropertyByName("u_pointLightDistance");
|
|
9137
|
+
})();
|
|
9138
|
+
(function() {
|
|
9139
|
+
PointLight._combinedData = {
|
|
9140
|
+
cullingMask: new Int32Array(Light._maxLight * 2),
|
|
9141
|
+
color: new Float32Array(Light._maxLight * 3),
|
|
9142
|
+
position: new Float32Array(Light._maxLight * 3),
|
|
9143
|
+
distance: new Float32Array(Light._maxLight)
|
|
9144
|
+
};
|
|
9145
|
+
})();
|
|
8876
9146
|
|
|
8877
9147
|
/**
|
|
8878
9148
|
* Spot light.
|
|
8879
9149
|
*/ var SpotLight = /*#__PURE__*/ function(Light) {
|
|
8880
|
-
|
|
9150
|
+
_inherits(SpotLight, Light);
|
|
8881
9151
|
function SpotLight() {
|
|
8882
9152
|
var _this;
|
|
8883
9153
|
_this = Light.apply(this, arguments) || this;
|
|
@@ -8946,7 +9216,7 @@ PointLight._combinedData = {
|
|
|
8946
9216
|
shaderData.setFloatArray(SpotLight._angleCosProperty, data.angleCos);
|
|
8947
9217
|
shaderData.setFloatArray(SpotLight._penumbraCosProperty, data.penumbraCos);
|
|
8948
9218
|
};
|
|
8949
|
-
|
|
9219
|
+
_create_class(SpotLight, [
|
|
8950
9220
|
{
|
|
8951
9221
|
key: "position",
|
|
8952
9222
|
get: /**
|
|
@@ -8988,22 +9258,38 @@ PointLight._combinedData = {
|
|
|
8988
9258
|
]);
|
|
8989
9259
|
return SpotLight;
|
|
8990
9260
|
}(Light);
|
|
8991
|
-
|
|
8992
|
-
SpotLight.
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
SpotLight.
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
SpotLight.
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9261
|
+
(function() {
|
|
9262
|
+
SpotLight._cullingMaskProperty = Shader.getPropertyByName("u_spotLightCullingMask");
|
|
9263
|
+
})();
|
|
9264
|
+
(function() {
|
|
9265
|
+
SpotLight._colorProperty = Shader.getPropertyByName("u_spotLightColor");
|
|
9266
|
+
})();
|
|
9267
|
+
(function() {
|
|
9268
|
+
SpotLight._positionProperty = Shader.getPropertyByName("u_spotLightPosition");
|
|
9269
|
+
})();
|
|
9270
|
+
(function() {
|
|
9271
|
+
SpotLight._directionProperty = Shader.getPropertyByName("u_spotLightDirection");
|
|
9272
|
+
})();
|
|
9273
|
+
(function() {
|
|
9274
|
+
SpotLight._distanceProperty = Shader.getPropertyByName("u_spotLightDistance");
|
|
9275
|
+
})();
|
|
9276
|
+
(function() {
|
|
9277
|
+
SpotLight._angleCosProperty = Shader.getPropertyByName("u_spotLightAngleCos");
|
|
9278
|
+
})();
|
|
9279
|
+
(function() {
|
|
9280
|
+
SpotLight._penumbraCosProperty = Shader.getPropertyByName("u_spotLightPenumbraCos");
|
|
9281
|
+
})();
|
|
9282
|
+
(function() {
|
|
9283
|
+
SpotLight._combinedData = {
|
|
9284
|
+
cullingMask: new Int32Array(Light._maxLight * 2),
|
|
9285
|
+
color: new Float32Array(Light._maxLight * 3),
|
|
9286
|
+
position: new Float32Array(Light._maxLight * 3),
|
|
9287
|
+
direction: new Float32Array(Light._maxLight * 3),
|
|
9288
|
+
distance: new Float32Array(Light._maxLight),
|
|
9289
|
+
angleCos: new Float32Array(Light._maxLight),
|
|
9290
|
+
penumbraCos: new Float32Array(Light._maxLight)
|
|
9291
|
+
};
|
|
9292
|
+
})();
|
|
9007
9293
|
|
|
9008
9294
|
/**
|
|
9009
9295
|
* Light manager.
|
|
@@ -9525,7 +9811,7 @@ SpotLight._combinedData = {
|
|
|
9525
9811
|
/**
|
|
9526
9812
|
* Material.
|
|
9527
9813
|
*/ var Material = /*#__PURE__*/ function(RefObject) {
|
|
9528
|
-
|
|
9814
|
+
_inherits(Material, RefObject);
|
|
9529
9815
|
function Material(engine, shader) {
|
|
9530
9816
|
var _this;
|
|
9531
9817
|
_this = RefObject.call(this, engine) || this;
|
|
@@ -9569,7 +9855,7 @@ SpotLight._combinedData = {
|
|
|
9569
9855
|
this._renderStates.length = 0;
|
|
9570
9856
|
this._renderStates = null;
|
|
9571
9857
|
};
|
|
9572
|
-
|
|
9858
|
+
_create_class(Material, [
|
|
9573
9859
|
{
|
|
9574
9860
|
key: "shaderData",
|
|
9575
9861
|
get: /**
|
|
@@ -9661,7 +9947,7 @@ var RenderElement = function RenderElement() {
|
|
|
9661
9947
|
/**
|
|
9662
9948
|
* Render element.
|
|
9663
9949
|
*/ var MeshRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
9664
|
-
|
|
9950
|
+
_inherits(MeshRenderElement, RenderElement);
|
|
9665
9951
|
function MeshRenderElement() {
|
|
9666
9952
|
return RenderElement.apply(this, arguments);
|
|
9667
9953
|
}
|
|
@@ -9695,12 +9981,18 @@ var RenderElement = function RenderElement() {
|
|
|
9695
9981
|
};
|
|
9696
9982
|
return RenderContext;
|
|
9697
9983
|
}();
|
|
9698
|
-
|
|
9699
|
-
RenderContext.
|
|
9700
|
-
|
|
9984
|
+
(function() {
|
|
9985
|
+
/** @internal */ RenderContext._vpMatrixProperty = Shader.getPropertyByName("u_VPMat");
|
|
9986
|
+
})();
|
|
9987
|
+
(function() {
|
|
9988
|
+
RenderContext._viewMatrixProperty = Shader.getPropertyByName("u_viewMat");
|
|
9989
|
+
})();
|
|
9990
|
+
(function() {
|
|
9991
|
+
RenderContext._projectionMatrixProperty = Shader.getPropertyByName("u_projMat");
|
|
9992
|
+
})();
|
|
9701
9993
|
|
|
9702
9994
|
var SpriteElement = /*#__PURE__*/ function(RenderElement) {
|
|
9703
|
-
|
|
9995
|
+
_inherits(SpriteElement, RenderElement);
|
|
9704
9996
|
function SpriteElement() {
|
|
9705
9997
|
var _this;
|
|
9706
9998
|
_this = RenderElement.call(this) || this;
|
|
@@ -9723,7 +10015,7 @@ var SpriteElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
9723
10015
|
}(RenderElement);
|
|
9724
10016
|
|
|
9725
10017
|
var SpriteMaskElement = /*#__PURE__*/ function(RenderElement) {
|
|
9726
|
-
|
|
10018
|
+
_inherits(SpriteMaskElement, RenderElement);
|
|
9727
10019
|
function SpriteMaskElement() {
|
|
9728
10020
|
var _this;
|
|
9729
10021
|
_this = RenderElement.call(this) || this;
|
|
@@ -9743,6 +10035,9 @@ var SpriteMaskElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
9743
10035
|
return SpriteMaskElement;
|
|
9744
10036
|
}(RenderElement);
|
|
9745
10037
|
|
|
10038
|
+
/**
|
|
10039
|
+
* Sprite mask interaction.
|
|
10040
|
+
*/ exports.SpriteMaskInteraction = void 0;
|
|
9746
10041
|
(function(SpriteMaskInteraction) {
|
|
9747
10042
|
SpriteMaskInteraction[SpriteMaskInteraction[/** The sprite will not interact with the masking system. */ "None"] = 0] = "None";
|
|
9748
10043
|
SpriteMaskInteraction[SpriteMaskInteraction[/** The sprite will be visible only in areas where a mask is present. */ "VisibleInsideMask"] = 1] = "VisibleInsideMask";
|
|
@@ -9751,11 +10046,10 @@ var SpriteMaskElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
9751
10046
|
|
|
9752
10047
|
var _Renderer;
|
|
9753
10048
|
exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
9754
|
-
|
|
10049
|
+
_inherits(Renderer1, Component);
|
|
9755
10050
|
function Renderer1(entity) {
|
|
9756
10051
|
var _this;
|
|
9757
10052
|
_this = Component.call(this, entity) || this;
|
|
9758
|
-
/** Whether cast shadow. */ _this.castShadows = true;
|
|
9759
10053
|
/** @internal */ _this._onUpdateIndex = -1;
|
|
9760
10054
|
/** @internal */ _this._rendererIndex = -1;
|
|
9761
10055
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
@@ -9772,11 +10066,12 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
9772
10066
|
_this._priority = 0;
|
|
9773
10067
|
_this._receiveShadows = true;
|
|
9774
10068
|
_this._rendererLayer = new engineMath.Vector4();
|
|
10069
|
+
/** Whether cast shadow. */ _this.castShadows = true;
|
|
9775
10070
|
var prototype = exports.Renderer.prototype;
|
|
9776
10071
|
var shaderData = _this.shaderData;
|
|
9777
10072
|
_this._overrideUpdate = _this.update !== prototype.update;
|
|
9778
10073
|
shaderData._addRefCount(1);
|
|
9779
|
-
_this._onTransformChanged = _this._onTransformChanged.bind(
|
|
10074
|
+
_this._onTransformChanged = _this._onTransformChanged.bind(_assert_this_initialized(_this));
|
|
9780
10075
|
_this._registerEntityTransformListener();
|
|
9781
10076
|
shaderData.enableMacro(exports.Renderer._receiveShadowMacro);
|
|
9782
10077
|
shaderData.setVector4(exports.Renderer._rendererLayerProperty, _this._rendererLayer);
|
|
@@ -9980,7 +10275,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
9980
10275
|
_proto._onTransformChanged = function _onTransformChanged(type) {
|
|
9981
10276
|
this._dirtyUpdateFlag |= 0x1;
|
|
9982
10277
|
};
|
|
9983
|
-
|
|
10278
|
+
_create_class(Renderer1, [
|
|
9984
10279
|
{
|
|
9985
10280
|
key: "shaderData",
|
|
9986
10281
|
get: /**
|
|
@@ -10054,65 +10349,83 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10054
10349
|
}
|
|
10055
10350
|
]);
|
|
10056
10351
|
return Renderer1;
|
|
10057
|
-
}(Component),
|
|
10058
|
-
|
|
10352
|
+
}(Component), function() {
|
|
10353
|
+
_Renderer._tempVector0 = new engineMath.Vector3();
|
|
10354
|
+
}(), function() {
|
|
10355
|
+
_Renderer._receiveShadowMacro = Shader.getMacroByName("OASIS_RECEIVE_SHADOWS");
|
|
10356
|
+
}(), function() {
|
|
10357
|
+
_Renderer._localMatrixProperty = Shader.getPropertyByName("u_localMat");
|
|
10358
|
+
}(), function() {
|
|
10359
|
+
_Renderer._worldMatrixProperty = Shader.getPropertyByName("u_modelMat");
|
|
10360
|
+
}(), function() {
|
|
10361
|
+
_Renderer._mvMatrixProperty = Shader.getPropertyByName("u_MVMat");
|
|
10362
|
+
}(), function() {
|
|
10363
|
+
_Renderer._mvpMatrixProperty = Shader.getPropertyByName("u_MVPMat");
|
|
10364
|
+
}(), function() {
|
|
10365
|
+
_Renderer._mvInvMatrixProperty = Shader.getPropertyByName("u_MVInvMat");
|
|
10366
|
+
}(), function() {
|
|
10367
|
+
_Renderer._normalMatrixProperty = Shader.getPropertyByName("u_normalMat");
|
|
10368
|
+
}(), function() {
|
|
10369
|
+
_Renderer._rendererLayerProperty = Shader.getPropertyByName("oasis_RendererLayer");
|
|
10370
|
+
}(), _Renderer);
|
|
10371
|
+
__decorate([
|
|
10059
10372
|
ignoreClone
|
|
10060
10373
|
], exports.Renderer.prototype, "_distanceForSort", void 0);
|
|
10061
|
-
|
|
10374
|
+
__decorate([
|
|
10062
10375
|
ignoreClone
|
|
10063
10376
|
], exports.Renderer.prototype, "_onUpdateIndex", void 0);
|
|
10064
|
-
|
|
10377
|
+
__decorate([
|
|
10065
10378
|
ignoreClone
|
|
10066
10379
|
], exports.Renderer.prototype, "_rendererIndex", void 0);
|
|
10067
|
-
|
|
10380
|
+
__decorate([
|
|
10068
10381
|
ignoreClone
|
|
10069
10382
|
], exports.Renderer.prototype, "_globalShaderMacro", void 0);
|
|
10070
|
-
|
|
10383
|
+
__decorate([
|
|
10071
10384
|
deepClone
|
|
10072
10385
|
], exports.Renderer.prototype, "_bounds", void 0);
|
|
10073
|
-
|
|
10386
|
+
__decorate([
|
|
10074
10387
|
ignoreClone
|
|
10075
10388
|
], exports.Renderer.prototype, "_renderFrameCount", void 0);
|
|
10076
|
-
|
|
10389
|
+
__decorate([
|
|
10077
10390
|
ignoreClone
|
|
10078
10391
|
], exports.Renderer.prototype, "_overrideUpdate", void 0);
|
|
10079
|
-
|
|
10392
|
+
__decorate([
|
|
10080
10393
|
ignoreClone
|
|
10081
10394
|
], exports.Renderer.prototype, "_materials", void 0);
|
|
10082
|
-
|
|
10395
|
+
__decorate([
|
|
10083
10396
|
ignoreClone
|
|
10084
10397
|
], exports.Renderer.prototype, "_dirtyUpdateFlag", void 0);
|
|
10085
|
-
|
|
10398
|
+
__decorate([
|
|
10086
10399
|
deepClone
|
|
10087
10400
|
], exports.Renderer.prototype, "_shaderData", void 0);
|
|
10088
|
-
|
|
10401
|
+
__decorate([
|
|
10089
10402
|
ignoreClone
|
|
10090
10403
|
], exports.Renderer.prototype, "_mvMatrix", void 0);
|
|
10091
|
-
|
|
10404
|
+
__decorate([
|
|
10092
10405
|
ignoreClone
|
|
10093
10406
|
], exports.Renderer.prototype, "_mvpMatrix", void 0);
|
|
10094
|
-
|
|
10407
|
+
__decorate([
|
|
10095
10408
|
ignoreClone
|
|
10096
10409
|
], exports.Renderer.prototype, "_mvInvMatrix", void 0);
|
|
10097
|
-
|
|
10410
|
+
__decorate([
|
|
10098
10411
|
ignoreClone
|
|
10099
10412
|
], exports.Renderer.prototype, "_normalMatrix", void 0);
|
|
10100
|
-
|
|
10413
|
+
__decorate([
|
|
10101
10414
|
ignoreClone
|
|
10102
10415
|
], exports.Renderer.prototype, "_materialsInstanced", void 0);
|
|
10103
|
-
|
|
10416
|
+
__decorate([
|
|
10104
10417
|
ignoreClone
|
|
10105
10418
|
], exports.Renderer.prototype, "_priority", void 0);
|
|
10106
|
-
|
|
10419
|
+
__decorate([
|
|
10107
10420
|
assignmentClone
|
|
10108
10421
|
], exports.Renderer.prototype, "_receiveShadows", void 0);
|
|
10109
|
-
|
|
10422
|
+
__decorate([
|
|
10110
10423
|
ignoreClone
|
|
10111
10424
|
], exports.Renderer.prototype, "_rendererLayer", void 0);
|
|
10112
|
-
|
|
10425
|
+
__decorate([
|
|
10113
10426
|
ignoreClone
|
|
10114
10427
|
], exports.Renderer.prototype, "_onTransformChanged", null);
|
|
10115
|
-
exports.Renderer =
|
|
10428
|
+
exports.Renderer = __decorate([
|
|
10116
10429
|
dependentComponents(Transform)
|
|
10117
10430
|
], exports.Renderer);
|
|
10118
10431
|
var RendererUpdateFlags;
|
|
@@ -10184,15 +10497,19 @@ var SimpleSpriteAssembler = (_SimpleSpriteAssembler = /*#__PURE__*/ function() {
|
|
|
10184
10497
|
renderUVs[3].set(right, top);
|
|
10185
10498
|
};
|
|
10186
10499
|
return SimpleSpriteAssembler1;
|
|
10187
|
-
}(),
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10500
|
+
}(), function() {
|
|
10501
|
+
_SimpleSpriteAssembler._rectangleTriangles = [
|
|
10502
|
+
0,
|
|
10503
|
+
1,
|
|
10504
|
+
2,
|
|
10505
|
+
2,
|
|
10506
|
+
1,
|
|
10507
|
+
3
|
|
10508
|
+
];
|
|
10509
|
+
}(), function() {
|
|
10510
|
+
_SimpleSpriteAssembler._worldMatrix = new engineMath.Matrix();
|
|
10511
|
+
}(), _SimpleSpriteAssembler);
|
|
10512
|
+
SimpleSpriteAssembler = __decorate([
|
|
10196
10513
|
StaticInterfaceImplement()
|
|
10197
10514
|
], SimpleSpriteAssembler);
|
|
10198
10515
|
|
|
@@ -10208,6 +10525,9 @@ SimpleSpriteAssembler = _ts_decorate__default['default']([
|
|
|
10208
10525
|
this.color = color;
|
|
10209
10526
|
};
|
|
10210
10527
|
|
|
10528
|
+
/**
|
|
10529
|
+
* Sprite mask layer.
|
|
10530
|
+
*/ exports.SpriteMaskLayer = void 0;
|
|
10211
10531
|
(function(SpriteMaskLayer) {
|
|
10212
10532
|
SpriteMaskLayer[SpriteMaskLayer[/** Mask layer 0. */ "Layer0"] = 0x1] = "Layer0";
|
|
10213
10533
|
SpriteMaskLayer[SpriteMaskLayer[/** Mask layer 1. */ "Layer1"] = 0x2] = "Layer1";
|
|
@@ -10261,7 +10581,7 @@ SimpleSpriteAssembler = _ts_decorate__default['default']([
|
|
|
10261
10581
|
/**
|
|
10262
10582
|
* A component for masking Sprites.
|
|
10263
10583
|
*/ var SpriteMask = /*#__PURE__*/ function(Renderer) {
|
|
10264
|
-
|
|
10584
|
+
_inherits(SpriteMask, Renderer);
|
|
10265
10585
|
function SpriteMask(entity) {
|
|
10266
10586
|
var _this;
|
|
10267
10587
|
_this = Renderer.call(this, entity) || this;
|
|
@@ -10275,10 +10595,10 @@ SimpleSpriteAssembler = _ts_decorate__default['default']([
|
|
|
10275
10595
|
_this._flipY = false;
|
|
10276
10596
|
_this._alphaCutoff = 0.5;
|
|
10277
10597
|
_this._renderData = new RenderData2D(4, [], []);
|
|
10278
|
-
SimpleSpriteAssembler.resetData(
|
|
10598
|
+
SimpleSpriteAssembler.resetData(_assert_this_initialized(_this));
|
|
10279
10599
|
_this.setMaterial(_this._engine._spriteMaskDefaultMaterial);
|
|
10280
10600
|
_this.shaderData.setFloat(SpriteMask._alphaCutoffProperty, _this._alphaCutoff);
|
|
10281
|
-
_this._onSpriteChange = _this._onSpriteChange.bind(
|
|
10601
|
+
_this._onSpriteChange = _this._onSpriteChange.bind(_assert_this_initialized(_this));
|
|
10282
10602
|
return _this;
|
|
10283
10603
|
}
|
|
10284
10604
|
var _proto = SpriteMask.prototype;
|
|
@@ -10369,7 +10689,7 @@ SimpleSpriteAssembler = _ts_decorate__default['default']([
|
|
|
10369
10689
|
break;
|
|
10370
10690
|
}
|
|
10371
10691
|
};
|
|
10372
|
-
|
|
10692
|
+
_create_class(SpriteMask, [
|
|
10373
10693
|
{
|
|
10374
10694
|
key: "width",
|
|
10375
10695
|
get: /**
|
|
@@ -10487,36 +10807,40 @@ SimpleSpriteAssembler = _ts_decorate__default['default']([
|
|
|
10487
10807
|
]);
|
|
10488
10808
|
return SpriteMask;
|
|
10489
10809
|
}(exports.Renderer);
|
|
10490
|
-
|
|
10491
|
-
/** @internal */ SpriteMask.
|
|
10492
|
-
|
|
10810
|
+
(function() {
|
|
10811
|
+
/** @internal */ SpriteMask._textureProperty = Shader.getPropertyByName("u_maskTexture");
|
|
10812
|
+
})();
|
|
10813
|
+
(function() {
|
|
10814
|
+
/** @internal */ SpriteMask._alphaCutoffProperty = Shader.getPropertyByName("u_maskAlphaCutoff");
|
|
10815
|
+
})();
|
|
10816
|
+
__decorate([
|
|
10493
10817
|
assignmentClone
|
|
10494
10818
|
], SpriteMask.prototype, "influenceLayers", void 0);
|
|
10495
|
-
|
|
10819
|
+
__decorate([
|
|
10496
10820
|
ignoreClone
|
|
10497
10821
|
], SpriteMask.prototype, "_sprite", void 0);
|
|
10498
|
-
|
|
10822
|
+
__decorate([
|
|
10499
10823
|
ignoreClone
|
|
10500
10824
|
], SpriteMask.prototype, "_automaticWidth", void 0);
|
|
10501
|
-
|
|
10825
|
+
__decorate([
|
|
10502
10826
|
ignoreClone
|
|
10503
10827
|
], SpriteMask.prototype, "_automaticHeight", void 0);
|
|
10504
|
-
|
|
10828
|
+
__decorate([
|
|
10505
10829
|
assignmentClone
|
|
10506
10830
|
], SpriteMask.prototype, "_customWidth", void 0);
|
|
10507
|
-
|
|
10831
|
+
__decorate([
|
|
10508
10832
|
assignmentClone
|
|
10509
10833
|
], SpriteMask.prototype, "_customHeight", void 0);
|
|
10510
|
-
|
|
10834
|
+
__decorate([
|
|
10511
10835
|
assignmentClone
|
|
10512
10836
|
], SpriteMask.prototype, "_flipX", void 0);
|
|
10513
|
-
|
|
10837
|
+
__decorate([
|
|
10514
10838
|
assignmentClone
|
|
10515
10839
|
], SpriteMask.prototype, "_flipY", void 0);
|
|
10516
|
-
|
|
10840
|
+
__decorate([
|
|
10517
10841
|
assignmentClone
|
|
10518
10842
|
], SpriteMask.prototype, "_alphaCutoff", void 0);
|
|
10519
|
-
|
|
10843
|
+
__decorate([
|
|
10520
10844
|
ignoreClone
|
|
10521
10845
|
], SpriteMask.prototype, "_onSpriteChange", null);
|
|
10522
10846
|
var /**
|
|
@@ -10529,6 +10853,9 @@ var /**
|
|
|
10529
10853
|
SpriteMaskUpdateFlags[SpriteMaskUpdateFlags[/** All. */ "All"] = 0x7] = "All";
|
|
10530
10854
|
})(SpriteMaskUpdateFlags || (SpriteMaskUpdateFlags = {}));
|
|
10531
10855
|
|
|
10856
|
+
/**
|
|
10857
|
+
* Vertex element format.
|
|
10858
|
+
*/ exports.VertexElementFormat = void 0;
|
|
10532
10859
|
(function(VertexElementFormat) {
|
|
10533
10860
|
VertexElementFormat[VertexElementFormat[/** 32-bit float */ "Float"] = 0] = "Float";
|
|
10534
10861
|
VertexElementFormat[VertexElementFormat[/** Two-dimensional 32-bit float */ "Vector2"] = 1] = "Vector2";
|
|
@@ -10548,12 +10875,18 @@ var /**
|
|
|
10548
10875
|
VertexElementFormat[VertexElementFormat[/** Four-dimensional 16-bit Normalized unsigned integer, range is [0, 1] */ "NormalizedUShort4"] = 15] = "NormalizedUShort4";
|
|
10549
10876
|
})(exports.VertexElementFormat || (exports.VertexElementFormat = {}));
|
|
10550
10877
|
|
|
10878
|
+
/**
|
|
10879
|
+
* Buffer usage.
|
|
10880
|
+
*/ exports.BufferUsage = void 0;
|
|
10551
10881
|
(function(BufferUsage) {
|
|
10552
10882
|
BufferUsage[BufferUsage[/** The buffer content are intended to be specified once, and used many times */ "Static"] = 0] = "Static";
|
|
10553
10883
|
BufferUsage[BufferUsage[/** The buffer contents are intended to be respecified repeatedly, and used many times */ "Dynamic"] = 1] = "Dynamic";
|
|
10554
10884
|
BufferUsage[BufferUsage[/** The buffer contents are intended to be specified once, and used at most a few times */ "Stream"] = 2] = "Stream";
|
|
10555
10885
|
})(exports.BufferUsage || (exports.BufferUsage = {}));
|
|
10556
10886
|
|
|
10887
|
+
/**
|
|
10888
|
+
* Index format.
|
|
10889
|
+
*/ exports.IndexFormat = void 0;
|
|
10557
10890
|
(function(IndexFormat) {
|
|
10558
10891
|
IndexFormat[IndexFormat[/** 8 bit */ "UInt8"] = 0] = "UInt8";
|
|
10559
10892
|
IndexFormat[IndexFormat[/** 16 bit */ "UInt16"] = 1] = "UInt16";
|
|
@@ -10693,7 +11026,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10693
11026
|
this._glElementInfo = BufferUtil._getElementInfo(this.format);
|
|
10694
11027
|
this._instanceStepRate = Math.floor(instanceStepRate);
|
|
10695
11028
|
}
|
|
10696
|
-
|
|
11029
|
+
_create_class(VertexElement, [
|
|
10697
11030
|
{
|
|
10698
11031
|
key: "semantic",
|
|
10699
11032
|
get: /**
|
|
@@ -10744,11 +11077,17 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10744
11077
|
return VertexElement;
|
|
10745
11078
|
}();
|
|
10746
11079
|
|
|
11080
|
+
/**
|
|
11081
|
+
* Buffer binding flag.
|
|
11082
|
+
*/ exports.BufferBindFlag = void 0;
|
|
10747
11083
|
(function(BufferBindFlag) {
|
|
10748
11084
|
BufferBindFlag[BufferBindFlag[/** Vertex buffer binding flag */ "VertexBuffer"] = 0] = "VertexBuffer";
|
|
10749
11085
|
BufferBindFlag[BufferBindFlag[/** Index buffer binding flag */ "IndexBuffer"] = 1] = "IndexBuffer";
|
|
10750
11086
|
})(exports.BufferBindFlag || (exports.BufferBindFlag = {}));
|
|
10751
11087
|
|
|
11088
|
+
/**
|
|
11089
|
+
* Define update strategy when call bufferData/bufferSubData func.
|
|
11090
|
+
*/ exports.SetDataOptions = void 0;
|
|
10752
11091
|
(function(SetDataOptions) {
|
|
10753
11092
|
SetDataOptions[SetDataOptions[/** Can overwrite part of used buffer data and ensure correct rendering */ "None"] = 0] = "None";
|
|
10754
11093
|
SetDataOptions[SetDataOptions[/** Discard old buffer and create a new buffer, and won't affect the previous rendering */ "Discard"] = 1] = "Discard";
|
|
@@ -10757,7 +11096,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10757
11096
|
/**
|
|
10758
11097
|
* Buffer.
|
|
10759
11098
|
*/ var Buffer = /*#__PURE__*/ function(RefObject) {
|
|
10760
|
-
|
|
11099
|
+
_inherits(Buffer, RefObject);
|
|
10761
11100
|
function Buffer(engine, type, byteLengthOrData, bufferUsage) {
|
|
10762
11101
|
if (bufferUsage === void 0) bufferUsage = exports.BufferUsage.Static;
|
|
10763
11102
|
var _this;
|
|
@@ -10847,7 +11186,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10847
11186
|
gl.bufferData(this._glBindTarget, dataLength, this._glBufferUsage);
|
|
10848
11187
|
this._byteLength = dataLength;
|
|
10849
11188
|
};
|
|
10850
|
-
|
|
11189
|
+
_create_class(Buffer, [
|
|
10851
11190
|
{
|
|
10852
11191
|
key: "type",
|
|
10853
11192
|
get: /**
|
|
@@ -10876,6 +11215,9 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10876
11215
|
return Buffer;
|
|
10877
11216
|
}(RefObject);
|
|
10878
11217
|
|
|
11218
|
+
/**
|
|
11219
|
+
* Mesh topology.
|
|
11220
|
+
*/ exports.MeshTopology = void 0;
|
|
10879
11221
|
(function(MeshTopology) {
|
|
10880
11222
|
MeshTopology[MeshTopology[/** Draws a single dot */ "Points"] = 0] = "Points";
|
|
10881
11223
|
MeshTopology[MeshTopology[/** Draws a line between a pair of vertices */ "Lines"] = 1] = "Lines";
|
|
@@ -10893,7 +11235,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10893
11235
|
this._buffer = buffer;
|
|
10894
11236
|
this._format = format;
|
|
10895
11237
|
}
|
|
10896
|
-
|
|
11238
|
+
_create_class(IndexBufferBinding, [
|
|
10897
11239
|
{
|
|
10898
11240
|
key: "buffer",
|
|
10899
11241
|
get: /**
|
|
@@ -10933,7 +11275,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10933
11275
|
/**
|
|
10934
11276
|
* Mesh.
|
|
10935
11277
|
*/ var Mesh = /*#__PURE__*/ function(RefObject) {
|
|
10936
|
-
|
|
11278
|
+
_inherits(Mesh, RefObject);
|
|
10937
11279
|
function Mesh(engine, name) {
|
|
10938
11280
|
var _this;
|
|
10939
11281
|
_this = RefObject.call(this, engine) || this;
|
|
@@ -10947,8 +11289,8 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
10947
11289
|
_this._bounds = new engineMath.BoundingBox();
|
|
10948
11290
|
_this._subMeshes = [];
|
|
10949
11291
|
_this.name = name;
|
|
10950
|
-
_this._platformPrimitive = _this._engine._hardwareRenderer.createPlatformPrimitive(
|
|
10951
|
-
_this._onBoundsChanged = _this._onBoundsChanged.bind(
|
|
11292
|
+
_this._platformPrimitive = _this._engine._hardwareRenderer.createPlatformPrimitive(_assert_this_initialized(_this));
|
|
11293
|
+
_this._onBoundsChanged = _this._onBoundsChanged.bind(_assert_this_initialized(_this));
|
|
10952
11294
|
var bounds = _this._bounds;
|
|
10953
11295
|
// @ts-ignore
|
|
10954
11296
|
bounds.min._onValueChanged = _this._onBoundsChanged;
|
|
@@ -11074,7 +11416,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11074
11416
|
_proto._onBoundsChanged = function _onBoundsChanged() {
|
|
11075
11417
|
this._updateFlagManager.dispatch(0x1);
|
|
11076
11418
|
};
|
|
11077
|
-
|
|
11419
|
+
_create_class(Mesh, [
|
|
11078
11420
|
{
|
|
11079
11421
|
key: "bounds",
|
|
11080
11422
|
get: /**
|
|
@@ -11120,7 +11462,7 @@ var MeshModifyFlags;
|
|
|
11120
11462
|
this._buffer = buffer;
|
|
11121
11463
|
this._stride = stride;
|
|
11122
11464
|
}
|
|
11123
|
-
|
|
11465
|
+
_create_class(VertexBufferBinding, [
|
|
11124
11466
|
{
|
|
11125
11467
|
key: "buffer",
|
|
11126
11468
|
get: /**
|
|
@@ -11567,13 +11909,27 @@ var MeshModifyFlags;
|
|
|
11567
11909
|
};
|
|
11568
11910
|
return BlendShapeManager;
|
|
11569
11911
|
}();
|
|
11570
|
-
|
|
11571
|
-
BlendShapeManager.
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
BlendShapeManager.
|
|
11575
|
-
|
|
11576
|
-
|
|
11912
|
+
(function() {
|
|
11913
|
+
BlendShapeManager._blendShapeMacro = Shader.getMacroByName("OASIS_BLENDSHAPE");
|
|
11914
|
+
})();
|
|
11915
|
+
(function() {
|
|
11916
|
+
BlendShapeManager._blendShapeTextureMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_TEXTURE");
|
|
11917
|
+
})();
|
|
11918
|
+
(function() {
|
|
11919
|
+
BlendShapeManager._blendShapeNormalMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_NORMAL");
|
|
11920
|
+
})();
|
|
11921
|
+
(function() {
|
|
11922
|
+
BlendShapeManager._blendShapeTangentMacro = Shader.getMacroByName("OASIS_BLENDSHAPE_TANGENT");
|
|
11923
|
+
})();
|
|
11924
|
+
(function() {
|
|
11925
|
+
BlendShapeManager._blendShapeWeightsProperty = Shader.getPropertyByName("u_blendShapeWeights");
|
|
11926
|
+
})();
|
|
11927
|
+
(function() {
|
|
11928
|
+
BlendShapeManager._blendShapeTextureProperty = Shader.getPropertyByName("u_blendShapeTexture");
|
|
11929
|
+
})();
|
|
11930
|
+
(function() {
|
|
11931
|
+
BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_blendShapeTextureInfo");
|
|
11932
|
+
})();
|
|
11577
11933
|
|
|
11578
11934
|
/**
|
|
11579
11935
|
* Vertex attribute types of a vertex in a ModelMesh.
|
|
@@ -11598,7 +11954,7 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
|
|
|
11598
11954
|
/**
|
|
11599
11955
|
* Mesh containing common vertex elements of the model.
|
|
11600
11956
|
*/ var ModelMesh = /*#__PURE__*/ function(Mesh) {
|
|
11601
|
-
|
|
11957
|
+
_inherits(ModelMesh, Mesh);
|
|
11602
11958
|
function ModelMesh(engine, name) {
|
|
11603
11959
|
var _this;
|
|
11604
11960
|
_this = Mesh.call(this, engine) || this;
|
|
@@ -11630,7 +11986,7 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
|
|
|
11630
11986
|
_this._customVertexElements = [];
|
|
11631
11987
|
_this._vertexCountChanged = false;
|
|
11632
11988
|
_this.name = name;
|
|
11633
|
-
_this._blendShapeManager = new BlendShapeManager(engine,
|
|
11989
|
+
_this._blendShapeManager = new BlendShapeManager(engine, _assert_this_initialized(_this));
|
|
11634
11990
|
return _this;
|
|
11635
11991
|
}
|
|
11636
11992
|
var _proto = ModelMesh.prototype;
|
|
@@ -11920,11 +12276,11 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
|
|
|
11920
12276
|
}
|
|
11921
12277
|
if (this._indices !== indices) {
|
|
11922
12278
|
this._indices = indices;
|
|
11923
|
-
if (
|
|
12279
|
+
if (_instanceof(indices, Uint8Array)) {
|
|
11924
12280
|
this._indicesFormat = exports.IndexFormat.UInt8;
|
|
11925
|
-
} else if (
|
|
12281
|
+
} else if (_instanceof(indices, Uint16Array)) {
|
|
11926
12282
|
this._indicesFormat = exports.IndexFormat.UInt16;
|
|
11927
|
-
} else if (
|
|
12283
|
+
} else if (_instanceof(indices, Uint32Array)) {
|
|
11928
12284
|
this._indicesFormat = exports.IndexFormat.UInt32;
|
|
11929
12285
|
}
|
|
11930
12286
|
}
|
|
@@ -12580,7 +12936,7 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
|
|
|
12580
12936
|
this._uv7 = null;
|
|
12581
12937
|
this._blendShapeManager._releaseMemoryCache();
|
|
12582
12938
|
};
|
|
12583
|
-
|
|
12939
|
+
_create_class(ModelMesh, [
|
|
12584
12940
|
{
|
|
12585
12941
|
key: "accessible",
|
|
12586
12942
|
get: /**
|
|
@@ -12648,11 +13004,21 @@ BlendShapeManager._blendShapeTextureInfoProperty = Shader.getPropertyByName("u_b
|
|
|
12648
13004
|
]);
|
|
12649
13005
|
return ModelMesh;
|
|
12650
13006
|
}(Mesh);
|
|
12651
|
-
|
|
12652
|
-
ModelMesh.
|
|
12653
|
-
|
|
12654
|
-
|
|
12655
|
-
ModelMesh.
|
|
13007
|
+
(function() {
|
|
13008
|
+
ModelMesh._tempVec0 = new engineMath.Vector3();
|
|
13009
|
+
})();
|
|
13010
|
+
(function() {
|
|
13011
|
+
ModelMesh._tempVec1 = new engineMath.Vector3();
|
|
13012
|
+
})();
|
|
13013
|
+
(function() {
|
|
13014
|
+
ModelMesh._tempVec2 = new engineMath.Vector3();
|
|
13015
|
+
})();
|
|
13016
|
+
(function() {
|
|
13017
|
+
ModelMesh._tempVec3 = new engineMath.Vector3();
|
|
13018
|
+
})();
|
|
13019
|
+
(function() {
|
|
13020
|
+
ModelMesh._tempVec4 = new engineMath.Vector3();
|
|
13021
|
+
})();
|
|
12656
13022
|
var VertexChangedFlags;
|
|
12657
13023
|
(function(VertexChangedFlags) {
|
|
12658
13024
|
VertexChangedFlags[VertexChangedFlags["Position"] = 0x1] = "Position";
|
|
@@ -12675,7 +13041,7 @@ var VertexChangedFlags;
|
|
|
12675
13041
|
/**
|
|
12676
13042
|
* Mesh skin data, equal glTF skins define
|
|
12677
13043
|
*/ var Skin = /*#__PURE__*/ function(EngineObject) {
|
|
12678
|
-
|
|
13044
|
+
_inherits(Skin, EngineObject);
|
|
12679
13045
|
function Skin(name) {
|
|
12680
13046
|
var _this;
|
|
12681
13047
|
_this = EngineObject.call(this, null) || this;
|
|
@@ -12691,12 +13057,12 @@ var VertexChangedFlags;
|
|
|
12691
13057
|
/**
|
|
12692
13058
|
* MeshRenderer Component.
|
|
12693
13059
|
*/ var MeshRenderer = /*#__PURE__*/ function(Renderer) {
|
|
12694
|
-
|
|
13060
|
+
_inherits(MeshRenderer, Renderer);
|
|
12695
13061
|
function MeshRenderer(entity) {
|
|
12696
13062
|
var _this;
|
|
12697
13063
|
_this = Renderer.call(this, entity) || this;
|
|
12698
13064
|
_this._enableVertexColor = false;
|
|
12699
|
-
_this._onMeshChanged = _this._onMeshChanged.bind(
|
|
13065
|
+
_this._onMeshChanged = _this._onMeshChanged.bind(_assert_this_initialized(_this));
|
|
12700
13066
|
return _this;
|
|
12701
13067
|
}
|
|
12702
13068
|
var _proto = MeshRenderer.prototype;
|
|
@@ -12801,7 +13167,7 @@ var VertexChangedFlags;
|
|
|
12801
13167
|
type & MeshModifyFlags.Bounds && (this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume);
|
|
12802
13168
|
type & MeshModifyFlags.VertexElements && (this._dirtyUpdateFlag |= 0x2);
|
|
12803
13169
|
};
|
|
12804
|
-
|
|
13170
|
+
_create_class(MeshRenderer, [
|
|
12805
13171
|
{
|
|
12806
13172
|
key: "mesh",
|
|
12807
13173
|
get: /**
|
|
@@ -12832,15 +13198,25 @@ var VertexChangedFlags;
|
|
|
12832
13198
|
]);
|
|
12833
13199
|
return MeshRenderer;
|
|
12834
13200
|
}(exports.Renderer);
|
|
12835
|
-
|
|
12836
|
-
MeshRenderer.
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
MeshRenderer.
|
|
12840
|
-
|
|
13201
|
+
(function() {
|
|
13202
|
+
MeshRenderer._uvMacro = Shader.getMacroByName("O3_HAS_UV");
|
|
13203
|
+
})();
|
|
13204
|
+
(function() {
|
|
13205
|
+
MeshRenderer._uv1Macro = Shader.getMacroByName("O3_HAS_UV1");
|
|
13206
|
+
})();
|
|
13207
|
+
(function() {
|
|
13208
|
+
MeshRenderer._normalMacro = Shader.getMacroByName("O3_HAS_NORMAL");
|
|
13209
|
+
})();
|
|
13210
|
+
(function() {
|
|
13211
|
+
MeshRenderer._tangentMacro = Shader.getMacroByName("O3_HAS_TANGENT");
|
|
13212
|
+
})();
|
|
13213
|
+
(function() {
|
|
13214
|
+
MeshRenderer._vertexColorMacro = Shader.getMacroByName("O3_HAS_VERTEXCOLOR");
|
|
13215
|
+
})();
|
|
13216
|
+
__decorate([
|
|
12841
13217
|
ignoreClone
|
|
12842
13218
|
], MeshRenderer.prototype, "_mesh", void 0);
|
|
12843
|
-
|
|
13219
|
+
__decorate([
|
|
12844
13220
|
ignoreClone
|
|
12845
13221
|
], MeshRenderer.prototype, "_onMeshChanged", null);
|
|
12846
13222
|
var /**
|
|
@@ -12896,13 +13272,13 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
12896
13272
|
};
|
|
12897
13273
|
Utils._stringToPath = function _stringToPath(string) {
|
|
12898
13274
|
var result = [];
|
|
12899
|
-
if (string.charCodeAt(0) === charCodeOfDot
|
|
13275
|
+
if (string.charCodeAt(0) === charCodeOfDot) {
|
|
12900
13276
|
result.push("");
|
|
12901
13277
|
}
|
|
12902
|
-
string.replace(rePropName
|
|
13278
|
+
string.replace(rePropName, function(match, expression, quote, subString) {
|
|
12903
13279
|
var key = match;
|
|
12904
13280
|
if (quote) {
|
|
12905
|
-
key = subString.replace(reEscapeChar
|
|
13281
|
+
key = subString.replace(reEscapeChar, "$1");
|
|
12906
13282
|
} else if (expression) {
|
|
12907
13283
|
key = expression.trim();
|
|
12908
13284
|
}
|
|
@@ -12912,9 +13288,9 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
12912
13288
|
};
|
|
12913
13289
|
return Utils;
|
|
12914
13290
|
}();
|
|
12915
|
-
var charCodeOfDot
|
|
12916
|
-
var reEscapeChar
|
|
12917
|
-
var rePropName
|
|
13291
|
+
var charCodeOfDot = ".".charCodeAt(0);
|
|
13292
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
13293
|
+
var rePropName = RegExp(// Match anything that isn't a dot or bracket.
|
|
12918
13294
|
"[^.[\\]]+" + "|" + // Or match property names within brackets.
|
|
12919
13295
|
"\\[(?:" + // Match a non-string expression.
|
|
12920
13296
|
"([^\"'][^[]*)" + "|" + // Or match strings (supports escaping characters).
|
|
@@ -12924,7 +13300,7 @@ var rePropName$1 = RegExp(// Match anything that isn't a dot or bracket.
|
|
|
12924
13300
|
/**
|
|
12925
13301
|
* SkinnedMeshRenderer.
|
|
12926
13302
|
*/ var SkinnedMeshRenderer = /*#__PURE__*/ function(MeshRenderer) {
|
|
12927
|
-
|
|
13303
|
+
_inherits(SkinnedMeshRenderer, MeshRenderer);
|
|
12928
13304
|
function SkinnedMeshRenderer(entity) {
|
|
12929
13305
|
var _this;
|
|
12930
13306
|
_this = MeshRenderer.call(this, entity) || this;
|
|
@@ -12940,7 +13316,7 @@ var rePropName$1 = RegExp(// Match anything that isn't a dot or bracket.
|
|
|
12940
13316
|
// 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.
|
|
12941
13317
|
maxVertexUniformVectors = Math.min(maxVertexUniformVectors, rhi._options._maxAllowSkinUniformVectorCount);
|
|
12942
13318
|
_this._maxVertexUniformVectors = maxVertexUniformVectors;
|
|
12943
|
-
_this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(
|
|
13319
|
+
_this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(_assert_this_initialized(_this));
|
|
12944
13320
|
var localBounds = _this._localBounds;
|
|
12945
13321
|
// @ts-ignore
|
|
12946
13322
|
localBounds.min._onValueChanged = _this._onLocalBoundsChanged;
|
|
@@ -13164,7 +13540,7 @@ var rePropName$1 = RegExp(// Match anything that isn't a dot or bracket.
|
|
|
13164
13540
|
_proto._onLocalBoundsChanged = function _onLocalBoundsChanged() {
|
|
13165
13541
|
this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
|
|
13166
13542
|
};
|
|
13167
|
-
|
|
13543
|
+
_create_class(SkinnedMeshRenderer, [
|
|
13168
13544
|
{
|
|
13169
13545
|
key: "blendShapeWeights",
|
|
13170
13546
|
get: /**
|
|
@@ -13229,44 +13605,52 @@ var rePropName$1 = RegExp(// Match anything that isn't a dot or bracket.
|
|
|
13229
13605
|
]);
|
|
13230
13606
|
return SkinnedMeshRenderer;
|
|
13231
13607
|
}(MeshRenderer);
|
|
13232
|
-
|
|
13233
|
-
SkinnedMeshRenderer.
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13608
|
+
(function() {
|
|
13609
|
+
SkinnedMeshRenderer._tempMatrix = new engineMath.Matrix();
|
|
13610
|
+
})();
|
|
13611
|
+
(function() {
|
|
13612
|
+
SkinnedMeshRenderer._jointCountProperty = Shader.getPropertyByName("u_jointCount");
|
|
13613
|
+
})();
|
|
13614
|
+
(function() {
|
|
13615
|
+
SkinnedMeshRenderer._jointSamplerProperty = Shader.getPropertyByName("u_jointSampler");
|
|
13616
|
+
})();
|
|
13617
|
+
(function() {
|
|
13618
|
+
SkinnedMeshRenderer._jointMatrixProperty = Shader.getPropertyByName("u_jointMatrix");
|
|
13619
|
+
})();
|
|
13620
|
+
__decorate([
|
|
13237
13621
|
ignoreClone
|
|
13238
13622
|
], SkinnedMeshRenderer.prototype, "_supportSkinning", void 0);
|
|
13239
|
-
|
|
13623
|
+
__decorate([
|
|
13240
13624
|
ignoreClone
|
|
13241
13625
|
], SkinnedMeshRenderer.prototype, "_hasInitSkin", void 0);
|
|
13242
|
-
|
|
13626
|
+
__decorate([
|
|
13243
13627
|
ignoreClone
|
|
13244
13628
|
], SkinnedMeshRenderer.prototype, "_jointDataCreateCache", void 0);
|
|
13245
|
-
|
|
13629
|
+
__decorate([
|
|
13246
13630
|
ignoreClone
|
|
13247
13631
|
], SkinnedMeshRenderer.prototype, "_blendShapeWeights", void 0);
|
|
13248
|
-
|
|
13632
|
+
__decorate([
|
|
13249
13633
|
ignoreClone
|
|
13250
13634
|
], SkinnedMeshRenderer.prototype, "_maxVertexUniformVectors", void 0);
|
|
13251
|
-
|
|
13635
|
+
__decorate([
|
|
13252
13636
|
ignoreClone
|
|
13253
13637
|
], SkinnedMeshRenderer.prototype, "_rootBone", void 0);
|
|
13254
|
-
|
|
13638
|
+
__decorate([
|
|
13255
13639
|
ignoreClone
|
|
13256
13640
|
], SkinnedMeshRenderer.prototype, "_localBounds", void 0);
|
|
13257
|
-
|
|
13641
|
+
__decorate([
|
|
13258
13642
|
ignoreClone
|
|
13259
13643
|
], SkinnedMeshRenderer.prototype, "_jointMatrices", void 0);
|
|
13260
|
-
|
|
13644
|
+
__decorate([
|
|
13261
13645
|
ignoreClone
|
|
13262
13646
|
], SkinnedMeshRenderer.prototype, "_jointTexture", void 0);
|
|
13263
|
-
|
|
13647
|
+
__decorate([
|
|
13264
13648
|
ignoreClone
|
|
13265
13649
|
], SkinnedMeshRenderer.prototype, "_jointEntities", void 0);
|
|
13266
|
-
|
|
13650
|
+
__decorate([
|
|
13267
13651
|
ignoreClone
|
|
13268
13652
|
], SkinnedMeshRenderer.prototype, "_condensedBlendShapeWeights", void 0);
|
|
13269
|
-
|
|
13653
|
+
__decorate([
|
|
13270
13654
|
ignoreClone
|
|
13271
13655
|
], SkinnedMeshRenderer.prototype, "_onLocalBoundsChanged", null);
|
|
13272
13656
|
|
|
@@ -13958,7 +14342,7 @@ _ts_decorate__default['default']([
|
|
|
13958
14342
|
/**
|
|
13959
14343
|
* BufferMesh.
|
|
13960
14344
|
*/ var BufferMesh = /*#__PURE__*/ function(Mesh) {
|
|
13961
|
-
|
|
14345
|
+
_inherits(BufferMesh, Mesh);
|
|
13962
14346
|
function BufferMesh() {
|
|
13963
14347
|
return Mesh.apply(this, arguments);
|
|
13964
14348
|
}
|
|
@@ -14001,7 +14385,7 @@ _ts_decorate__default['default']([
|
|
|
14001
14385
|
}
|
|
14002
14386
|
this._setIndexBufferBinding(binding);
|
|
14003
14387
|
};
|
|
14004
|
-
|
|
14388
|
+
_create_class(BufferMesh, [
|
|
14005
14389
|
{
|
|
14006
14390
|
key: "instanceCount",
|
|
14007
14391
|
get: /**
|
|
@@ -14115,7 +14499,7 @@ _ts_decorate__default['default']([
|
|
|
14115
14499
|
this._layoutChangeManager.dispatch(0, this);
|
|
14116
14500
|
}
|
|
14117
14501
|
};
|
|
14118
|
-
|
|
14502
|
+
_create_class(BlendShape, [
|
|
14119
14503
|
{
|
|
14120
14504
|
key: "frames",
|
|
14121
14505
|
get: /**
|
|
@@ -14276,11 +14660,15 @@ var Basic2DBatcher = /*#__PURE__*/ function() {
|
|
|
14276
14660
|
};
|
|
14277
14661
|
return Basic2DBatcher;
|
|
14278
14662
|
}();
|
|
14279
|
-
|
|
14280
|
-
Basic2DBatcher.
|
|
14663
|
+
(function() {
|
|
14664
|
+
/** The maximum number of vertex. */ Basic2DBatcher.MAX_VERTEX_COUNT = 4096;
|
|
14665
|
+
})();
|
|
14666
|
+
(function() {
|
|
14667
|
+
Basic2DBatcher._canUploadSameBuffer = true;
|
|
14668
|
+
})();
|
|
14281
14669
|
|
|
14282
14670
|
var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher) {
|
|
14283
|
-
|
|
14671
|
+
_inherits(SpriteMaskBatcher, Basic2DBatcher);
|
|
14284
14672
|
function SpriteMaskBatcher() {
|
|
14285
14673
|
return Basic2DBatcher.apply(this, arguments);
|
|
14286
14674
|
}
|
|
@@ -14416,7 +14804,7 @@ var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher) {
|
|
|
14416
14804
|
}();
|
|
14417
14805
|
|
|
14418
14806
|
var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
14419
|
-
|
|
14807
|
+
_inherits(TextRenderElement, RenderElement);
|
|
14420
14808
|
function TextRenderElement() {
|
|
14421
14809
|
var _this;
|
|
14422
14810
|
_this = RenderElement.call(this) || this;
|
|
@@ -14432,12 +14820,18 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14432
14820
|
return TextRenderElement;
|
|
14433
14821
|
}(RenderElement);
|
|
14434
14822
|
|
|
14823
|
+
/**
|
|
14824
|
+
* The Background mode enumeration.
|
|
14825
|
+
*/ exports.BackgroundMode = void 0;
|
|
14435
14826
|
(function(BackgroundMode) {
|
|
14436
14827
|
BackgroundMode[BackgroundMode[/* Solid color. */ "SolidColor"] = 0] = "SolidColor";
|
|
14437
14828
|
BackgroundMode[BackgroundMode[/* Sky. */ "Sky"] = 1] = "Sky";
|
|
14438
14829
|
BackgroundMode[BackgroundMode[/** Texture */ "Texture"] = 2] = "Texture";
|
|
14439
14830
|
})(exports.BackgroundMode || (exports.BackgroundMode = {}));
|
|
14440
14831
|
|
|
14832
|
+
/**
|
|
14833
|
+
* Filling mode of background texture.
|
|
14834
|
+
*/ exports.BackgroundTextureFillMode = void 0;
|
|
14441
14835
|
(function(BackgroundTextureFillMode) {
|
|
14442
14836
|
BackgroundTextureFillMode[BackgroundTextureFillMode[/* Maintain the aspect ratio and scale the texture to fit the width of the canvas. */ "AspectFitWidth"] = 0] = "AspectFitWidth";
|
|
14443
14837
|
BackgroundTextureFillMode[BackgroundTextureFillMode[/* Maintain the aspect ratio and scale the texture to fit the height of the canvas. */ "AspectFitHeight"] = 1] = "AspectFitHeight";
|
|
@@ -14495,7 +14889,7 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14495
14889
|
rhi.drawPrimitive(mesh, mesh.subMesh, program);
|
|
14496
14890
|
cameraShaderData.setMatrix(RenderContext._vpMatrixProperty, originViewProjMatrix);
|
|
14497
14891
|
};
|
|
14498
|
-
|
|
14892
|
+
_create_class(Sky, [
|
|
14499
14893
|
{
|
|
14500
14894
|
key: "material",
|
|
14501
14895
|
get: /**
|
|
@@ -14531,9 +14925,15 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14531
14925
|
]);
|
|
14532
14926
|
return Sky;
|
|
14533
14927
|
}();
|
|
14534
|
-
|
|
14535
|
-
Sky.
|
|
14536
|
-
|
|
14928
|
+
(function() {
|
|
14929
|
+
Sky._epsilon = 1e-6;
|
|
14930
|
+
})();
|
|
14931
|
+
(function() {
|
|
14932
|
+
Sky._viewProjMatrix = new engineMath.Matrix();
|
|
14933
|
+
})();
|
|
14934
|
+
(function() {
|
|
14935
|
+
Sky._projectionMatrix = new engineMath.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky._epsilon - 1, -1, 0, 0, 0, 0);
|
|
14936
|
+
})();
|
|
14537
14937
|
|
|
14538
14938
|
/**
|
|
14539
14939
|
* Background of scene.
|
|
@@ -14631,7 +15031,7 @@ Sky._projectionMatrix = new engineMath.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky.
|
|
|
14631
15031
|
mesh.addSubMesh(0, indices.length);
|
|
14632
15032
|
return mesh;
|
|
14633
15033
|
};
|
|
14634
|
-
|
|
15034
|
+
_create_class(Background, [
|
|
14635
15035
|
{
|
|
14636
15036
|
key: "texture",
|
|
14637
15037
|
get: /**
|
|
@@ -14671,6 +15071,9 @@ Sky._projectionMatrix = new engineMath.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky.
|
|
|
14671
15071
|
return Background;
|
|
14672
15072
|
}();
|
|
14673
15073
|
|
|
15074
|
+
/**
|
|
15075
|
+
* Fog Mode.
|
|
15076
|
+
*/ exports.FogMode = void 0;
|
|
14674
15077
|
(function(FogMode) {
|
|
14675
15078
|
FogMode[FogMode[/** Disable fog. */ "None"] = 0] = "None";
|
|
14676
15079
|
FogMode[FogMode[/** Linear fog. */ "Linear"] = 1] = "Linear";
|
|
@@ -14678,6 +15081,9 @@ Sky._projectionMatrix = new engineMath.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky.
|
|
|
14678
15081
|
FogMode[FogMode[/** Exponential squared fog. */ "ExponentialSquared"] = 3] = "ExponentialSquared";
|
|
14679
15082
|
})(exports.FogMode || (exports.FogMode = {}));
|
|
14680
15083
|
|
|
15084
|
+
/**
|
|
15085
|
+
* Diffuse mode.
|
|
15086
|
+
*/ exports.DiffuseMode = void 0;
|
|
14681
15087
|
(function(DiffuseMode) {
|
|
14682
15088
|
DiffuseMode[DiffuseMode[/** Solid color mode. */ "SolidColor"] = 0] = "SolidColor";
|
|
14683
15089
|
DiffuseMode[DiffuseMode[/**
|
|
@@ -14796,7 +15202,7 @@ Sky._projectionMatrix = new engineMath.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky.
|
|
|
14796
15202
|
out[25] = src[25] * 0.429042;
|
|
14797
15203
|
out[26] = src[26] * 0.429042;
|
|
14798
15204
|
};
|
|
14799
|
-
|
|
15205
|
+
_create_class(AmbientLight, [
|
|
14800
15206
|
{
|
|
14801
15207
|
key: "specularTextureDecodeRGBM",
|
|
14802
15208
|
get: /**
|
|
@@ -14907,20 +15313,38 @@ Sky._projectionMatrix = new engineMath.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky.
|
|
|
14907
15313
|
]);
|
|
14908
15314
|
return AmbientLight;
|
|
14909
15315
|
}();
|
|
14910
|
-
|
|
14911
|
-
AmbientLight.
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
AmbientLight.
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
AmbientLight.
|
|
14918
|
-
|
|
15316
|
+
(function() {
|
|
15317
|
+
AmbientLight._shMacro = Shader.getMacroByName("O3_USE_SH");
|
|
15318
|
+
})();
|
|
15319
|
+
(function() {
|
|
15320
|
+
AmbientLight._specularMacro = Shader.getMacroByName("O3_USE_SPECULAR_ENV");
|
|
15321
|
+
})();
|
|
15322
|
+
(function() {
|
|
15323
|
+
AmbientLight._decodeRGBMMacro = Shader.getMacroByName("O3_DECODE_ENV_RGBM");
|
|
15324
|
+
})();
|
|
15325
|
+
(function() {
|
|
15326
|
+
AmbientLight._diffuseColorProperty = Shader.getPropertyByName("u_envMapLight.diffuse");
|
|
15327
|
+
})();
|
|
15328
|
+
(function() {
|
|
15329
|
+
AmbientLight._diffuseSHProperty = Shader.getPropertyByName("u_env_sh");
|
|
15330
|
+
})();
|
|
15331
|
+
(function() {
|
|
15332
|
+
AmbientLight._diffuseIntensityProperty = Shader.getPropertyByName("u_envMapLight.diffuseIntensity");
|
|
15333
|
+
})();
|
|
15334
|
+
(function() {
|
|
15335
|
+
AmbientLight._specularTextureProperty = Shader.getPropertyByName("u_env_specularSampler");
|
|
15336
|
+
})();
|
|
15337
|
+
(function() {
|
|
15338
|
+
AmbientLight._specularIntensityProperty = Shader.getPropertyByName("u_envMapLight.specularIntensity");
|
|
15339
|
+
})();
|
|
15340
|
+
(function() {
|
|
15341
|
+
AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapLevel");
|
|
15342
|
+
})();
|
|
14919
15343
|
|
|
14920
15344
|
/**
|
|
14921
15345
|
* Scene.
|
|
14922
15346
|
*/ var Scene = /*#__PURE__*/ function(EngineObject) {
|
|
14923
|
-
|
|
15347
|
+
_inherits(Scene, EngineObject);
|
|
14924
15348
|
function Scene(engine, name) {
|
|
14925
15349
|
var _this;
|
|
14926
15350
|
_this = EngineObject.call(this, engine) || this;
|
|
@@ -14946,7 +15370,7 @@ AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapL
|
|
|
14946
15370
|
var shaderData = _this.shaderData;
|
|
14947
15371
|
shaderData._addRefCount(1);
|
|
14948
15372
|
_this.ambientLight = new AmbientLight();
|
|
14949
|
-
engine.sceneManager._allScenes.push(
|
|
15373
|
+
engine.sceneManager._allScenes.push(_assert_this_initialized(_this));
|
|
14950
15374
|
shaderData.enableMacro("OASIS_FOG_MODE", _this._fogMode.toString());
|
|
14951
15375
|
shaderData.enableMacro("CASCADED_COUNT", _this.shadowCascades.toString());
|
|
14952
15376
|
shaderData.setColor(Scene._fogColorProperty, _this._fogColor);
|
|
@@ -15156,7 +15580,7 @@ AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapL
|
|
|
15156
15580
|
this._fogParams.z = density / Math.LN2;
|
|
15157
15581
|
this._fogParams.w = density / Math.sqrt(Math.LN2);
|
|
15158
15582
|
};
|
|
15159
|
-
|
|
15583
|
+
_create_class(Scene, [
|
|
15160
15584
|
{
|
|
15161
15585
|
key: "shaderData",
|
|
15162
15586
|
get: /**
|
|
@@ -15300,8 +15724,12 @@ AmbientLight._mipLevelProperty = Shader.getPropertyByName("u_envMapLight.mipMapL
|
|
|
15300
15724
|
]);
|
|
15301
15725
|
return Scene;
|
|
15302
15726
|
}(EngineObject);
|
|
15303
|
-
|
|
15304
|
-
Scene.
|
|
15727
|
+
(function() {
|
|
15728
|
+
Scene._fogColorProperty = Shader.getPropertyByName("oasis_FogColor");
|
|
15729
|
+
})();
|
|
15730
|
+
(function() {
|
|
15731
|
+
Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
|
|
15732
|
+
})();
|
|
15305
15733
|
|
|
15306
15734
|
/**
|
|
15307
15735
|
* Scene manager.
|
|
@@ -15349,7 +15777,7 @@ Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
|
|
|
15349
15777
|
}
|
|
15350
15778
|
allScenes.length = 0;
|
|
15351
15779
|
};
|
|
15352
|
-
|
|
15780
|
+
_create_class(SceneManager, [
|
|
15353
15781
|
{
|
|
15354
15782
|
key: "activeScene",
|
|
15355
15783
|
get: /**
|
|
@@ -15384,7 +15812,7 @@ var pbrSpecularFs = "#define GLSLIFY 1\n#include <common>\n#include <camera_decl
|
|
|
15384
15812
|
|
|
15385
15813
|
var pbrVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\n#include <blendShape_input>\n#include <uv_share>\n#include <color_share>\n#include <normal_share>\n#include <worldpos_share>\n#include <ShadowVertexDeclaration>\n#include <FogVertexDeclaration>\nvoid main(){\n#include <begin_position_vert>\n#include <begin_normal_vert>\n#include <blendShape_vert>\n#include <skinning_vert>\n#include <uv_vert>\n#include <color_vert>\n#include <normal_vert>\n#include <worldpos_vert>\n#include <position_vert>\n#include <ShadowVertex>\n#include <FogVertex>\n}"; // eslint-disable-line
|
|
15386
15814
|
|
|
15387
|
-
var shadowMapFs = "#define GLSLIFY 1\n#ifdef OASIS_NO_DEPTH_TEXTURE\
|
|
15815
|
+
var shadowMapFs = "#define GLSLIFY 1\n#ifdef OASIS_NO_DEPTH_TEXTURE\nvec4 pack(float depth){const vec4 bitShift=vec4(1.0,256.0,256.0*256.0,256.0*256.0*256.0);const vec4 bitMask=vec4(1.0/256.0,1.0/256.0,1.0/256.0,0.0);vec4 rgbaDepth=fract(depth*bitShift);rgbaDepth-=rgbaDepth.gbaa*bitMask;return rgbaDepth;}\n#endif\nvoid main(){\n#ifdef OASIS_NO_DEPTH_TEXTURE\ngl_FragColor=pack(gl_FragCoord.z);\n#else\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\n#endif\n}"; // eslint-disable-line
|
|
15388
15816
|
|
|
15389
15817
|
var shadowMapVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\n#include <blendShape_input>\n#include <normal_share>\nuniform mat4 u_VPMat;uniform vec2 u_shadowBias;uniform vec3 u_lightDirection;vec3 applyShadowBias(vec3 positionWS){positionWS-=u_lightDirection*u_shadowBias.x;return positionWS;}vec3 applyShadowNormalBias(vec3 positionWS,vec3 normalWS){float invNdotL=1.0-clamp(dot(-u_lightDirection,normalWS),0.0,1.0);float scale=invNdotL*u_shadowBias.y;positionWS+=normalWS*vec3(scale);return positionWS;}void main(){\n#include <begin_position_vert>\n#include <begin_normal_vert>\n#include <blendShape_vert>\n#include <skinning_vert>\nvec4 positionWS=u_modelMat*position;positionWS.xyz=applyShadowBias(positionWS.xyz);\n#ifndef OMIT_NORMAL\n#ifdef O3_HAS_NORMAL\nvec3 normalWS=normalize(mat3(u_normalMat)*normal);positionWS.xyz=applyShadowNormalBias(positionWS.xyz,normalWS);\n#endif\n#endif\nvec4 positionCS=u_VPMat*positionWS;positionCS.z=max(positionCS.z,-1.0);gl_Position=positionCS;}"; // eslint-disable-line
|
|
15390
15818
|
|
|
@@ -15503,7 +15931,7 @@ ShaderPool.init();
|
|
|
15503
15931
|
/**
|
|
15504
15932
|
* Engine.
|
|
15505
15933
|
*/ var Engine = /*#__PURE__*/ function(EventDispatcher) {
|
|
15506
|
-
|
|
15934
|
+
_inherits(Engine, EventDispatcher);
|
|
15507
15935
|
function Engine(canvas, hardwareRenderer, settings) {
|
|
15508
15936
|
var _this;
|
|
15509
15937
|
_this = EventDispatcher.call(this) || this;
|
|
@@ -15520,8 +15948,8 @@ ShaderPool.init();
|
|
|
15520
15948
|
/** @internal */ _this._canSpriteBatch = true;
|
|
15521
15949
|
/** @internal @todo: temporary solution */ _this._macroCollection = new ShaderMacroCollection();
|
|
15522
15950
|
_this._settings = {};
|
|
15523
|
-
_this._resourceManager = new ResourceManager(
|
|
15524
|
-
_this._sceneManager = new SceneManager(
|
|
15951
|
+
_this._resourceManager = new ResourceManager(_assert_this_initialized(_this));
|
|
15952
|
+
_this._sceneManager = new SceneManager(_assert_this_initialized(_this));
|
|
15525
15953
|
_this._vSyncCount = 1;
|
|
15526
15954
|
_this._targetFrameRate = 60;
|
|
15527
15955
|
_this._time = new Time();
|
|
@@ -15545,25 +15973,25 @@ ShaderPool.init();
|
|
|
15545
15973
|
};
|
|
15546
15974
|
_this._hardwareRenderer = hardwareRenderer;
|
|
15547
15975
|
_this._hardwareRenderer.init(canvas);
|
|
15548
|
-
_this.physicsManager = new PhysicsManager(
|
|
15976
|
+
_this.physicsManager = new PhysicsManager(_assert_this_initialized(_this));
|
|
15549
15977
|
_this._canvas = canvas;
|
|
15550
|
-
_this._sceneManager.activeScene = new Scene(
|
|
15551
|
-
_this._spriteMaskManager = new SpriteMaskManager(
|
|
15978
|
+
_this._sceneManager.activeScene = new Scene(_assert_this_initialized(_this), "DefaultScene");
|
|
15979
|
+
_this._spriteMaskManager = new SpriteMaskManager(_assert_this_initialized(_this));
|
|
15552
15980
|
_this._spriteDefaultMaterial = _this._createSpriteMaterial();
|
|
15553
15981
|
_this._spriteMaskDefaultMaterial = _this._createSpriteMaskMaterial();
|
|
15554
|
-
_this._textDefaultFont = Font.createFromOS(
|
|
15982
|
+
_this._textDefaultFont = Font.createFromOS(_assert_this_initialized(_this), "Arial");
|
|
15555
15983
|
_this._textDefaultFont.isGCIgnored = true;
|
|
15556
|
-
_this.inputManager = new InputManager(
|
|
15984
|
+
_this.inputManager = new InputManager(_assert_this_initialized(_this));
|
|
15557
15985
|
var magentaPixel = new Uint8Array([
|
|
15558
15986
|
255,
|
|
15559
15987
|
0,
|
|
15560
15988
|
255,
|
|
15561
15989
|
255
|
|
15562
15990
|
]);
|
|
15563
|
-
var magentaTexture2D = new Texture2D(
|
|
15991
|
+
var magentaTexture2D = new Texture2D(_assert_this_initialized(_this), 1, 1, exports.TextureFormat.R8G8B8A8, false);
|
|
15564
15992
|
magentaTexture2D.setPixelBuffer(magentaPixel);
|
|
15565
15993
|
magentaTexture2D.isGCIgnored = true;
|
|
15566
|
-
var magentaTextureCube = new TextureCube(
|
|
15994
|
+
var magentaTextureCube = new TextureCube(_assert_this_initialized(_this), 1, exports.TextureFormat.R8G8B8A8, false);
|
|
15567
15995
|
magentaTextureCube.setPixelBuffer(exports.TextureCubeFace.PositiveX, magentaPixel);
|
|
15568
15996
|
magentaTextureCube.setPixelBuffer(exports.TextureCubeFace.NegativeX, magentaPixel);
|
|
15569
15997
|
magentaTextureCube.setPixelBuffer(exports.TextureCubeFace.PositiveY, magentaPixel);
|
|
@@ -15574,23 +16002,23 @@ ShaderPool.init();
|
|
|
15574
16002
|
if (!hardwareRenderer.canIUse(exports.GLCapabilityType.depthTexture)) {
|
|
15575
16003
|
_this._macroCollection.enable(Engine._noDepthTextureMacro);
|
|
15576
16004
|
} else {
|
|
15577
|
-
var depthTexture2D = new Texture2D(
|
|
16005
|
+
var depthTexture2D = new Texture2D(_assert_this_initialized(_this), 1, 1, exports.TextureFormat.Depth16, false);
|
|
15578
16006
|
depthTexture2D.isGCIgnored = true;
|
|
15579
16007
|
_this._depthTexture2D = depthTexture2D;
|
|
15580
16008
|
}
|
|
15581
16009
|
_this._magentaTexture2D = magentaTexture2D;
|
|
15582
16010
|
_this._magentaTextureCube = magentaTextureCube;
|
|
15583
16011
|
if (hardwareRenderer.isWebGL2) {
|
|
15584
|
-
var magentaTexture2DArray = new Texture2DArray(
|
|
16012
|
+
var magentaTexture2DArray = new Texture2DArray(_assert_this_initialized(_this), 1, 1, 1, exports.TextureFormat.R8G8B8A8, false);
|
|
15585
16013
|
magentaTexture2DArray.setPixelBuffer(0, magentaPixel);
|
|
15586
16014
|
magentaTexture2DArray.isGCIgnored = true;
|
|
15587
16015
|
_this._magentaTexture2DArray = magentaTexture2DArray;
|
|
15588
16016
|
}
|
|
15589
|
-
var magentaMaterial = new Material(
|
|
16017
|
+
var magentaMaterial = new Material(_assert_this_initialized(_this), Shader.find("unlit"));
|
|
15590
16018
|
magentaMaterial.isGCIgnored = true;
|
|
15591
16019
|
magentaMaterial.shaderData.setColor("u_baseColor", new Color(1.0, 0.0, 1.01, 1.0));
|
|
15592
16020
|
_this._magentaMaterial = magentaMaterial;
|
|
15593
|
-
var backgroundTextureMaterial = new Material(
|
|
16021
|
+
var backgroundTextureMaterial = new Material(_assert_this_initialized(_this), Shader.find("background-texture"));
|
|
15594
16022
|
backgroundTextureMaterial.isGCIgnored = true;
|
|
15595
16023
|
backgroundTextureMaterial.renderState.depthState.compareFunction = exports.CompareFunction.LessEqual;
|
|
15596
16024
|
_this._backgroundTextureMaterial = backgroundTextureMaterial;
|
|
@@ -15761,7 +16189,7 @@ ShaderPool.init();
|
|
|
15761
16189
|
material.isGCIgnored = true;
|
|
15762
16190
|
return material;
|
|
15763
16191
|
};
|
|
15764
|
-
|
|
16192
|
+
_create_class(Engine, [
|
|
15765
16193
|
{
|
|
15766
16194
|
key: "settings",
|
|
15767
16195
|
get: /**
|
|
@@ -15849,14 +16277,20 @@ ShaderPool.init();
|
|
|
15849
16277
|
]);
|
|
15850
16278
|
return Engine;
|
|
15851
16279
|
}(EventDispatcher);
|
|
15852
|
-
|
|
15853
|
-
/** @internal */ Engine.
|
|
15854
|
-
|
|
16280
|
+
(function() {
|
|
16281
|
+
/** @internal */ Engine._gammaMacro = Shader.getMacroByName("OASIS_COLORSPACE_GAMMA");
|
|
16282
|
+
})();
|
|
16283
|
+
(function() {
|
|
16284
|
+
/** @internal */ Engine._noDepthTextureMacro = Shader.getMacroByName("OASIS_NO_DEPTH_TEXTURE");
|
|
16285
|
+
})();
|
|
16286
|
+
(function() {
|
|
16287
|
+
/** @internal Conversion of space units to pixel units for 2D. */ Engine._pixelsPerUnit = 100;
|
|
16288
|
+
})();
|
|
15855
16289
|
|
|
15856
16290
|
/**
|
|
15857
16291
|
* Script class, used for logic writing.
|
|
15858
16292
|
*/ var Script = /*#__PURE__*/ function(Component) {
|
|
15859
|
-
|
|
16293
|
+
_inherits(Script, Component);
|
|
15860
16294
|
function Script() {
|
|
15861
16295
|
var _this;
|
|
15862
16296
|
_this = Component.apply(this, arguments) || this;
|
|
@@ -16025,38 +16459,38 @@ ShaderPool.init();
|
|
|
16025
16459
|
};
|
|
16026
16460
|
return Script;
|
|
16027
16461
|
}(Component);
|
|
16028
|
-
|
|
16462
|
+
__decorate([
|
|
16029
16463
|
ignoreClone
|
|
16030
16464
|
], Script.prototype, "_started", void 0);
|
|
16031
|
-
|
|
16465
|
+
__decorate([
|
|
16032
16466
|
ignoreClone
|
|
16033
16467
|
], Script.prototype, "_onStartIndex", void 0);
|
|
16034
|
-
|
|
16468
|
+
__decorate([
|
|
16035
16469
|
ignoreClone
|
|
16036
16470
|
], Script.prototype, "_onUpdateIndex", void 0);
|
|
16037
|
-
|
|
16471
|
+
__decorate([
|
|
16038
16472
|
ignoreClone
|
|
16039
16473
|
], Script.prototype, "_onLateUpdateIndex", void 0);
|
|
16040
|
-
|
|
16474
|
+
__decorate([
|
|
16041
16475
|
ignoreClone
|
|
16042
16476
|
], Script.prototype, "_onPhysicsUpdateIndex", void 0);
|
|
16043
|
-
|
|
16477
|
+
__decorate([
|
|
16044
16478
|
ignoreClone
|
|
16045
16479
|
], Script.prototype, "_onPreRenderIndex", void 0);
|
|
16046
|
-
|
|
16480
|
+
__decorate([
|
|
16047
16481
|
ignoreClone
|
|
16048
16482
|
], Script.prototype, "_onPostRenderIndex", void 0);
|
|
16049
|
-
|
|
16483
|
+
__decorate([
|
|
16050
16484
|
ignoreClone
|
|
16051
16485
|
], Script.prototype, "_entityScriptsIndex", void 0);
|
|
16052
|
-
|
|
16486
|
+
__decorate([
|
|
16053
16487
|
ignoreClone
|
|
16054
16488
|
], Script.prototype, "_waitHandlingInValid", void 0);
|
|
16055
16489
|
|
|
16056
16490
|
/**
|
|
16057
16491
|
* @internal
|
|
16058
16492
|
*/ var SpriteBatcher = /*#__PURE__*/ function(Basic2DBatcher) {
|
|
16059
|
-
|
|
16493
|
+
_inherits(SpriteBatcher, Basic2DBatcher);
|
|
16060
16494
|
function SpriteBatcher() {
|
|
16061
16495
|
return Basic2DBatcher.apply(this, arguments);
|
|
16062
16496
|
}
|
|
@@ -16166,7 +16600,9 @@ _ts_decorate__default['default']([
|
|
|
16166
16600
|
};
|
|
16167
16601
|
return SpriteBatcher;
|
|
16168
16602
|
}(Basic2DBatcher);
|
|
16169
|
-
|
|
16603
|
+
(function() {
|
|
16604
|
+
SpriteBatcher._textureProperty = Shader.getPropertyByName("u_spriteTexture");
|
|
16605
|
+
})();
|
|
16170
16606
|
|
|
16171
16607
|
/**
|
|
16172
16608
|
* Render queue.
|
|
@@ -16664,227 +17100,247 @@ var /**
|
|
|
16664
17100
|
};
|
|
16665
17101
|
return ShadowUtils;
|
|
16666
17102
|
}();
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
new engineMath.
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
|
|
16677
|
-
|
|
16678
|
-
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
|
|
16683
|
-
|
|
16684
|
-
|
|
16685
|
-
|
|
16686
|
-
|
|
16687
|
-
|
|
16688
|
-
|
|
16689
|
-
|
|
16690
|
-
|
|
16691
|
-
|
|
16692
|
-
|
|
16693
|
-
|
|
16694
|
-
|
|
16695
|
-
|
|
16696
|
-
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
16700
|
-
engineMath.FrustumFace.Top,
|
|
16701
|
-
engineMath.FrustumFace.Bottom
|
|
16702
|
-
],
|
|
16703
|
-
[
|
|
16704
|
-
engineMath.FrustumFace.Near,
|
|
16705
|
-
engineMath.FrustumFace.Far,
|
|
16706
|
-
engineMath.FrustumFace.Top,
|
|
16707
|
-
engineMath.FrustumFace.Bottom
|
|
16708
|
-
],
|
|
16709
|
-
[
|
|
16710
|
-
engineMath.FrustumFace.Near,
|
|
16711
|
-
engineMath.FrustumFace.Far,
|
|
16712
|
-
engineMath.FrustumFace.Left,
|
|
16713
|
-
engineMath.FrustumFace.Right
|
|
16714
|
-
],
|
|
16715
|
-
[
|
|
16716
|
-
engineMath.FrustumFace.Near,
|
|
16717
|
-
engineMath.FrustumFace.Far,
|
|
16718
|
-
engineMath.FrustumFace.Left,
|
|
16719
|
-
engineMath.FrustumFace.Right
|
|
16720
|
-
]
|
|
16721
|
-
];
|
|
16722
|
-
/** near, far, left, right, bottom, top */ ShadowUtils._frustumTwoPlaneCorners = [
|
|
16723
|
-
[
|
|
16724
|
-
// near, far, left, right, bottom, top
|
|
16725
|
-
[
|
|
16726
|
-
8,
|
|
16727
|
-
8
|
|
16728
|
-
],
|
|
16729
|
-
[
|
|
16730
|
-
8,
|
|
16731
|
-
8
|
|
16732
|
-
],
|
|
16733
|
-
[
|
|
16734
|
-
4,
|
|
16735
|
-
5
|
|
16736
|
-
],
|
|
16737
|
-
[
|
|
16738
|
-
6,
|
|
16739
|
-
7
|
|
16740
|
-
],
|
|
16741
|
-
[
|
|
16742
|
-
7,
|
|
16743
|
-
4
|
|
16744
|
-
],
|
|
16745
|
-
[
|
|
16746
|
-
5,
|
|
16747
|
-
6
|
|
16748
|
-
]
|
|
16749
|
-
],
|
|
16750
|
-
[
|
|
16751
|
-
// near, far, left, right, bottom, top
|
|
16752
|
-
[
|
|
16753
|
-
8,
|
|
16754
|
-
8
|
|
16755
|
-
],
|
|
16756
|
-
[
|
|
16757
|
-
8,
|
|
16758
|
-
8
|
|
16759
|
-
],
|
|
16760
|
-
[
|
|
16761
|
-
1,
|
|
16762
|
-
0
|
|
16763
|
-
],
|
|
16764
|
-
[
|
|
16765
|
-
3,
|
|
16766
|
-
2
|
|
16767
|
-
],
|
|
16768
|
-
[
|
|
16769
|
-
0,
|
|
16770
|
-
3
|
|
16771
|
-
],
|
|
16772
|
-
[
|
|
16773
|
-
2,
|
|
16774
|
-
1
|
|
16775
|
-
]
|
|
16776
|
-
],
|
|
16777
|
-
[
|
|
16778
|
-
// near, far, left, right, bottom, top
|
|
16779
|
-
[
|
|
16780
|
-
5,
|
|
16781
|
-
4
|
|
16782
|
-
],
|
|
16783
|
-
[
|
|
16784
|
-
0,
|
|
16785
|
-
1
|
|
16786
|
-
],
|
|
16787
|
-
[
|
|
16788
|
-
8,
|
|
16789
|
-
8
|
|
16790
|
-
],
|
|
16791
|
-
[
|
|
16792
|
-
8,
|
|
16793
|
-
8
|
|
16794
|
-
],
|
|
16795
|
-
[
|
|
16796
|
-
4,
|
|
16797
|
-
0
|
|
16798
|
-
],
|
|
16799
|
-
[
|
|
16800
|
-
1,
|
|
16801
|
-
5
|
|
16802
|
-
]
|
|
16803
|
-
],
|
|
16804
|
-
[
|
|
16805
|
-
// near, far, left, right, bottom, top
|
|
17103
|
+
(function() {
|
|
17104
|
+
ShadowUtils._tempMatrix0 = new engineMath.Matrix();
|
|
17105
|
+
})();
|
|
17106
|
+
(function() {
|
|
17107
|
+
// prettier-ignore
|
|
17108
|
+
/** @internal */ ShadowUtils._shadowMapCoordMatrix = new engineMath.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);
|
|
17109
|
+
})();
|
|
17110
|
+
(function() {
|
|
17111
|
+
ShadowUtils._frustumCorners = [
|
|
17112
|
+
new engineMath.Vector3(),
|
|
17113
|
+
new engineMath.Vector3(),
|
|
17114
|
+
new engineMath.Vector3(),
|
|
17115
|
+
new engineMath.Vector3(),
|
|
17116
|
+
new engineMath.Vector3(),
|
|
17117
|
+
new engineMath.Vector3(),
|
|
17118
|
+
new engineMath.Vector3(),
|
|
17119
|
+
new engineMath.Vector3()
|
|
17120
|
+
];
|
|
17121
|
+
})();
|
|
17122
|
+
(function() {
|
|
17123
|
+
ShadowUtils._adjustNearPlane = new engineMath.Plane(new engineMath.Vector3());
|
|
17124
|
+
})();
|
|
17125
|
+
(function() {
|
|
17126
|
+
ShadowUtils._adjustFarPlane = new engineMath.Plane(new engineMath.Vector3());
|
|
17127
|
+
})();
|
|
17128
|
+
(function() {
|
|
17129
|
+
ShadowUtils._backPlaneFaces = new Array(5);
|
|
17130
|
+
})();
|
|
17131
|
+
(function() {
|
|
17132
|
+
ShadowUtils._edgePlanePoint2 = new engineMath.Vector3();
|
|
17133
|
+
})();
|
|
17134
|
+
(function() {
|
|
17135
|
+
/** near, far, left, right, bottom, top */ ShadowUtils._frustumPlaneNeighbors = [
|
|
16806
17136
|
[
|
|
16807
|
-
|
|
16808
|
-
|
|
17137
|
+
engineMath.FrustumFace.Left,
|
|
17138
|
+
engineMath.FrustumFace.Right,
|
|
17139
|
+
engineMath.FrustumFace.Top,
|
|
17140
|
+
engineMath.FrustumFace.Bottom
|
|
16809
17141
|
],
|
|
16810
17142
|
[
|
|
16811
|
-
|
|
16812
|
-
|
|
17143
|
+
engineMath.FrustumFace.Left,
|
|
17144
|
+
engineMath.FrustumFace.Right,
|
|
17145
|
+
engineMath.FrustumFace.Top,
|
|
17146
|
+
engineMath.FrustumFace.Bottom
|
|
16813
17147
|
],
|
|
16814
17148
|
[
|
|
16815
|
-
|
|
16816
|
-
|
|
17149
|
+
engineMath.FrustumFace.Near,
|
|
17150
|
+
engineMath.FrustumFace.Far,
|
|
17151
|
+
engineMath.FrustumFace.Top,
|
|
17152
|
+
engineMath.FrustumFace.Bottom
|
|
16817
17153
|
],
|
|
16818
17154
|
[
|
|
16819
|
-
|
|
16820
|
-
|
|
17155
|
+
engineMath.FrustumFace.Near,
|
|
17156
|
+
engineMath.FrustumFace.Far,
|
|
17157
|
+
engineMath.FrustumFace.Top,
|
|
17158
|
+
engineMath.FrustumFace.Bottom
|
|
16821
17159
|
],
|
|
16822
17160
|
[
|
|
16823
|
-
|
|
16824
|
-
|
|
17161
|
+
engineMath.FrustumFace.Near,
|
|
17162
|
+
engineMath.FrustumFace.Far,
|
|
17163
|
+
engineMath.FrustumFace.Left,
|
|
17164
|
+
engineMath.FrustumFace.Right
|
|
16825
17165
|
],
|
|
16826
17166
|
[
|
|
16827
|
-
|
|
16828
|
-
|
|
17167
|
+
engineMath.FrustumFace.Near,
|
|
17168
|
+
engineMath.FrustumFace.Far,
|
|
17169
|
+
engineMath.FrustumFace.Left,
|
|
17170
|
+
engineMath.FrustumFace.Right
|
|
16829
17171
|
]
|
|
16830
|
-
]
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
4,
|
|
16835
|
-
7
|
|
16836
|
-
],
|
|
16837
|
-
[
|
|
16838
|
-
3,
|
|
16839
|
-
0
|
|
16840
|
-
],
|
|
16841
|
-
[
|
|
16842
|
-
0,
|
|
16843
|
-
4
|
|
16844
|
-
],
|
|
16845
|
-
[
|
|
16846
|
-
7,
|
|
16847
|
-
3
|
|
16848
|
-
],
|
|
16849
|
-
[
|
|
16850
|
-
8,
|
|
16851
|
-
8
|
|
16852
|
-
],
|
|
16853
|
-
[
|
|
16854
|
-
8,
|
|
16855
|
-
8
|
|
16856
|
-
]
|
|
16857
|
-
],
|
|
16858
|
-
[
|
|
16859
|
-
// near, far, left, right, bottom, top
|
|
17172
|
+
];
|
|
17173
|
+
})();
|
|
17174
|
+
(function() {
|
|
17175
|
+
/** near, far, left, right, bottom, top */ ShadowUtils._frustumTwoPlaneCorners = [
|
|
16860
17176
|
[
|
|
16861
|
-
|
|
16862
|
-
|
|
17177
|
+
// near, far, left, right, bottom, top
|
|
17178
|
+
[
|
|
17179
|
+
8,
|
|
17180
|
+
8
|
|
17181
|
+
],
|
|
17182
|
+
[
|
|
17183
|
+
8,
|
|
17184
|
+
8
|
|
17185
|
+
],
|
|
17186
|
+
[
|
|
17187
|
+
4,
|
|
17188
|
+
5
|
|
17189
|
+
],
|
|
17190
|
+
[
|
|
17191
|
+
6,
|
|
17192
|
+
7
|
|
17193
|
+
],
|
|
17194
|
+
[
|
|
17195
|
+
7,
|
|
17196
|
+
4
|
|
17197
|
+
],
|
|
17198
|
+
[
|
|
17199
|
+
5,
|
|
17200
|
+
6
|
|
17201
|
+
]
|
|
16863
17202
|
],
|
|
16864
17203
|
[
|
|
16865
|
-
|
|
16866
|
-
|
|
17204
|
+
// near, far, left, right, bottom, top
|
|
17205
|
+
[
|
|
17206
|
+
8,
|
|
17207
|
+
8
|
|
17208
|
+
],
|
|
17209
|
+
[
|
|
17210
|
+
8,
|
|
17211
|
+
8
|
|
17212
|
+
],
|
|
17213
|
+
[
|
|
17214
|
+
1,
|
|
17215
|
+
0
|
|
17216
|
+
],
|
|
17217
|
+
[
|
|
17218
|
+
3,
|
|
17219
|
+
2
|
|
17220
|
+
],
|
|
17221
|
+
[
|
|
17222
|
+
0,
|
|
17223
|
+
3
|
|
17224
|
+
],
|
|
17225
|
+
[
|
|
17226
|
+
2,
|
|
17227
|
+
1
|
|
17228
|
+
]
|
|
16867
17229
|
],
|
|
16868
17230
|
[
|
|
16869
|
-
|
|
16870
|
-
|
|
17231
|
+
// near, far, left, right, bottom, top
|
|
17232
|
+
[
|
|
17233
|
+
5,
|
|
17234
|
+
4
|
|
17235
|
+
],
|
|
17236
|
+
[
|
|
17237
|
+
0,
|
|
17238
|
+
1
|
|
17239
|
+
],
|
|
17240
|
+
[
|
|
17241
|
+
8,
|
|
17242
|
+
8
|
|
17243
|
+
],
|
|
17244
|
+
[
|
|
17245
|
+
8,
|
|
17246
|
+
8
|
|
17247
|
+
],
|
|
17248
|
+
[
|
|
17249
|
+
4,
|
|
17250
|
+
0
|
|
17251
|
+
],
|
|
17252
|
+
[
|
|
17253
|
+
1,
|
|
17254
|
+
5
|
|
17255
|
+
]
|
|
16871
17256
|
],
|
|
16872
17257
|
[
|
|
16873
|
-
|
|
16874
|
-
|
|
17258
|
+
// near, far, left, right, bottom, top
|
|
17259
|
+
[
|
|
17260
|
+
7,
|
|
17261
|
+
6
|
|
17262
|
+
],
|
|
17263
|
+
[
|
|
17264
|
+
2,
|
|
17265
|
+
3
|
|
17266
|
+
],
|
|
17267
|
+
[
|
|
17268
|
+
8,
|
|
17269
|
+
8
|
|
17270
|
+
],
|
|
17271
|
+
[
|
|
17272
|
+
8,
|
|
17273
|
+
8
|
|
17274
|
+
],
|
|
17275
|
+
[
|
|
17276
|
+
3,
|
|
17277
|
+
7
|
|
17278
|
+
],
|
|
17279
|
+
[
|
|
17280
|
+
6,
|
|
17281
|
+
2
|
|
17282
|
+
]
|
|
16875
17283
|
],
|
|
16876
17284
|
[
|
|
16877
|
-
|
|
16878
|
-
|
|
17285
|
+
// near, far, left, right, bottom, top
|
|
17286
|
+
[
|
|
17287
|
+
4,
|
|
17288
|
+
7
|
|
17289
|
+
],
|
|
17290
|
+
[
|
|
17291
|
+
3,
|
|
17292
|
+
0
|
|
17293
|
+
],
|
|
17294
|
+
[
|
|
17295
|
+
0,
|
|
17296
|
+
4
|
|
17297
|
+
],
|
|
17298
|
+
[
|
|
17299
|
+
7,
|
|
17300
|
+
3
|
|
17301
|
+
],
|
|
17302
|
+
[
|
|
17303
|
+
8,
|
|
17304
|
+
8
|
|
17305
|
+
],
|
|
17306
|
+
[
|
|
17307
|
+
8,
|
|
17308
|
+
8
|
|
17309
|
+
]
|
|
16879
17310
|
],
|
|
16880
17311
|
[
|
|
16881
|
-
|
|
16882
|
-
|
|
17312
|
+
// near, far, left, right, bottom, top
|
|
17313
|
+
[
|
|
17314
|
+
6,
|
|
17315
|
+
5
|
|
17316
|
+
],
|
|
17317
|
+
[
|
|
17318
|
+
1,
|
|
17319
|
+
2
|
|
17320
|
+
],
|
|
17321
|
+
[
|
|
17322
|
+
5,
|
|
17323
|
+
1
|
|
17324
|
+
],
|
|
17325
|
+
[
|
|
17326
|
+
2,
|
|
17327
|
+
6
|
|
17328
|
+
],
|
|
17329
|
+
[
|
|
17330
|
+
8,
|
|
17331
|
+
8
|
|
17332
|
+
],
|
|
17333
|
+
[
|
|
17334
|
+
8,
|
|
17335
|
+
8
|
|
17336
|
+
]
|
|
16883
17337
|
]
|
|
16884
|
-
]
|
|
16885
|
-
|
|
16886
|
-
|
|
16887
|
-
|
|
17338
|
+
];
|
|
17339
|
+
})();
|
|
17340
|
+
(function() {
|
|
17341
|
+
//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.
|
|
17342
|
+
ShadowUtils.atlasBorderSize = 4.0;
|
|
17343
|
+
})();
|
|
16888
17344
|
|
|
16889
17345
|
/**
|
|
16890
17346
|
* Cascade shadow caster.
|
|
@@ -17125,19 +17581,45 @@ ShadowUtils.atlasBorderSize = 4.0;
|
|
|
17125
17581
|
};
|
|
17126
17582
|
return CascadedShadowCasterPass;
|
|
17127
17583
|
}();
|
|
17128
|
-
|
|
17129
|
-
CascadedShadowCasterPass.
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
CascadedShadowCasterPass.
|
|
17133
|
-
|
|
17134
|
-
|
|
17135
|
-
CascadedShadowCasterPass.
|
|
17136
|
-
|
|
17137
|
-
|
|
17138
|
-
CascadedShadowCasterPass.
|
|
17139
|
-
|
|
17140
|
-
|
|
17584
|
+
(function() {
|
|
17585
|
+
CascadedShadowCasterPass._lightShadowBiasProperty = Shader.getPropertyByName("u_shadowBias");
|
|
17586
|
+
})();
|
|
17587
|
+
(function() {
|
|
17588
|
+
CascadedShadowCasterPass._lightDirectionProperty = Shader.getPropertyByName("u_lightDirection");
|
|
17589
|
+
})();
|
|
17590
|
+
(function() {
|
|
17591
|
+
CascadedShadowCasterPass._shadowMatricesProperty = Shader.getPropertyByName("u_shadowMatrices");
|
|
17592
|
+
})();
|
|
17593
|
+
(function() {
|
|
17594
|
+
CascadedShadowCasterPass._shadowMapSize = Shader.getPropertyByName("u_shadowMapSize");
|
|
17595
|
+
})();
|
|
17596
|
+
(function() {
|
|
17597
|
+
CascadedShadowCasterPass._shadowInfosProperty = Shader.getPropertyByName("u_shadowInfo");
|
|
17598
|
+
})();
|
|
17599
|
+
(function() {
|
|
17600
|
+
CascadedShadowCasterPass._shadowMapsProperty = Shader.getPropertyByName("u_shadowMap");
|
|
17601
|
+
})();
|
|
17602
|
+
(function() {
|
|
17603
|
+
CascadedShadowCasterPass._shadowSplitSpheresProperty = Shader.getPropertyByName("u_shadowSplitSpheres");
|
|
17604
|
+
})();
|
|
17605
|
+
(function() {
|
|
17606
|
+
CascadedShadowCasterPass._maxCascades = 4;
|
|
17607
|
+
})();
|
|
17608
|
+
(function() {
|
|
17609
|
+
CascadedShadowCasterPass._cascadesSplitDistance = new Array(CascadedShadowCasterPass._maxCascades + 1);
|
|
17610
|
+
})();
|
|
17611
|
+
(function() {
|
|
17612
|
+
CascadedShadowCasterPass._viewport = new engineMath.Vector4(0, 0, 1, 1);
|
|
17613
|
+
})();
|
|
17614
|
+
(function() {
|
|
17615
|
+
CascadedShadowCasterPass._clearColor = new engineMath.Color(1, 1, 1, 1);
|
|
17616
|
+
})();
|
|
17617
|
+
(function() {
|
|
17618
|
+
CascadedShadowCasterPass._tempVector = new engineMath.Vector3();
|
|
17619
|
+
})();
|
|
17620
|
+
(function() {
|
|
17621
|
+
CascadedShadowCasterPass._tempMatrix0 = new engineMath.Matrix();
|
|
17622
|
+
})();
|
|
17141
17623
|
|
|
17142
17624
|
var passNum = 0;
|
|
17143
17625
|
/**
|
|
@@ -17214,7 +17696,7 @@ var passNum = 0;
|
|
|
17214
17696
|
if (typeof nameOrPass === "string") {
|
|
17215
17697
|
var renderPass = new RenderPass(nameOrPass, priority, renderTarget, replaceMaterial, mask);
|
|
17216
17698
|
this._renderPassArray.push(renderPass);
|
|
17217
|
-
} else if (
|
|
17699
|
+
} else if (_instanceof(nameOrPass, RenderPass)) {
|
|
17218
17700
|
this._renderPassArray.push(nameOrPass);
|
|
17219
17701
|
}
|
|
17220
17702
|
this._renderPassArray.sort(function(p1, p2) {
|
|
@@ -17227,7 +17709,7 @@ var passNum = 0;
|
|
|
17227
17709
|
*/ _proto.removeRenderPass = function removeRenderPass(nameOrPass) {
|
|
17228
17710
|
var pass;
|
|
17229
17711
|
if (typeof nameOrPass === "string") pass = this.getRenderPass(nameOrPass);
|
|
17230
|
-
else if (
|
|
17712
|
+
else if (_instanceof(nameOrPass, RenderPass)) pass = nameOrPass;
|
|
17231
17713
|
if (pass) {
|
|
17232
17714
|
var idx = this._renderPassArray.indexOf(pass);
|
|
17233
17715
|
this._renderPassArray.splice(idx, 1);
|
|
@@ -17370,7 +17852,7 @@ var passNum = 0;
|
|
|
17370
17852
|
renderer._prepareRender(context);
|
|
17371
17853
|
}
|
|
17372
17854
|
};
|
|
17373
|
-
|
|
17855
|
+
_create_class(BasicRenderPipeline, [
|
|
17374
17856
|
{
|
|
17375
17857
|
key: "defaultRenderPass",
|
|
17376
17858
|
get: /**
|
|
@@ -17382,17 +17864,27 @@ var passNum = 0;
|
|
|
17382
17864
|
]);
|
|
17383
17865
|
return BasicRenderPipeline;
|
|
17384
17866
|
}();
|
|
17385
|
-
|
|
17386
|
-
BasicRenderPipeline.
|
|
17867
|
+
(function() {
|
|
17868
|
+
BasicRenderPipeline._tempVector0 = new engineMath.Vector3();
|
|
17869
|
+
})();
|
|
17870
|
+
(function() {
|
|
17871
|
+
BasicRenderPipeline._tempVector1 = new engineMath.Vector3();
|
|
17872
|
+
})();
|
|
17387
17873
|
|
|
17388
17874
|
var _Camera;
|
|
17389
17875
|
var MathTemp = function MathTemp() {
|
|
17390
17876
|
};
|
|
17391
|
-
|
|
17392
|
-
MathTemp.
|
|
17393
|
-
|
|
17877
|
+
(function() {
|
|
17878
|
+
MathTemp.tempVec4 = new engineMath.Vector4();
|
|
17879
|
+
})();
|
|
17880
|
+
(function() {
|
|
17881
|
+
MathTemp.tempVec3 = new engineMath.Vector3();
|
|
17882
|
+
})();
|
|
17883
|
+
(function() {
|
|
17884
|
+
MathTemp.tempVec2 = new engineMath.Vector2();
|
|
17885
|
+
})();
|
|
17394
17886
|
exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
17395
|
-
|
|
17887
|
+
_inherits(Camera1, Component);
|
|
17396
17888
|
function Camera1(entity) {
|
|
17397
17889
|
var _this;
|
|
17398
17890
|
_this = Component.call(this, entity) || this;
|
|
@@ -17407,6 +17899,8 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17407
17899
|
* @remarks Support bit manipulation, corresponding to `Layer`.
|
|
17408
17900
|
*/ _this.cullingMask = exports.Layer.Everything;
|
|
17409
17901
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
17902
|
+
/** @internal */ _this._frustum = new engineMath.BoundingFrustum();
|
|
17903
|
+
/** @internal */ _this._virtualCamera = new VirtualCamera();
|
|
17410
17904
|
_this._shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
17411
17905
|
_this._isProjMatSetting = false;
|
|
17412
17906
|
_this._nearClipPlane = 0.1;
|
|
@@ -17418,8 +17912,6 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17418
17912
|
_this._isFrustumProjectDirty = true;
|
|
17419
17913
|
_this._customAspectRatio = undefined;
|
|
17420
17914
|
_this._renderTarget = null;
|
|
17421
|
-
/** @internal */ _this._frustum = new engineMath.BoundingFrustum();
|
|
17422
|
-
/** @internal */ _this._virtualCamera = new VirtualCamera();
|
|
17423
17915
|
_this._viewport = new engineMath.Vector4(0, 0, 1, 1);
|
|
17424
17916
|
_this._inverseProjectionMatrix = new engineMath.Matrix();
|
|
17425
17917
|
_this._lastAspectSize = new engineMath.Vector2(0, 0);
|
|
@@ -17429,7 +17921,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17429
17921
|
_this._isViewMatrixDirty = transform.registerWorldChangeFlag();
|
|
17430
17922
|
_this._isInvViewProjDirty = transform.registerWorldChangeFlag();
|
|
17431
17923
|
_this._frustumViewChangeFlag = transform.registerWorldChangeFlag();
|
|
17432
|
-
_this._renderPipeline = new BasicRenderPipeline(
|
|
17924
|
+
_this._renderPipeline = new BasicRenderPipeline(_assert_this_initialized(_this));
|
|
17433
17925
|
_this.shaderData._addRefCount(1);
|
|
17434
17926
|
return _this;
|
|
17435
17927
|
}
|
|
@@ -17660,7 +18152,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17660
18152
|
}
|
|
17661
18153
|
return this._inverseProjectionMatrix;
|
|
17662
18154
|
};
|
|
17663
|
-
|
|
18155
|
+
_create_class(Camera1, [
|
|
17664
18156
|
{
|
|
17665
18157
|
key: "shaderData",
|
|
17666
18158
|
get: /**
|
|
@@ -17832,41 +18324,45 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17832
18324
|
}
|
|
17833
18325
|
]);
|
|
17834
18326
|
return Camera1;
|
|
17835
|
-
}(Component),
|
|
17836
|
-
|
|
18327
|
+
}(Component), function() {
|
|
18328
|
+
/** @internal */ _Camera._inverseViewMatrixProperty = Shader.getPropertyByName("u_viewInvMat");
|
|
18329
|
+
}(), function() {
|
|
18330
|
+
/** @internal */ _Camera._cameraPositionProperty = Shader.getPropertyByName("u_cameraPos");
|
|
18331
|
+
}(), _Camera);
|
|
18332
|
+
__decorate([
|
|
17837
18333
|
deepClone
|
|
17838
18334
|
], exports.Camera.prototype, "_frustum", void 0);
|
|
17839
|
-
|
|
18335
|
+
__decorate([
|
|
17840
18336
|
ignoreClone
|
|
17841
18337
|
], exports.Camera.prototype, "_renderPipeline", void 0);
|
|
17842
|
-
|
|
18338
|
+
__decorate([
|
|
17843
18339
|
ignoreClone
|
|
17844
18340
|
], exports.Camera.prototype, "_virtualCamera", void 0);
|
|
17845
|
-
|
|
18341
|
+
__decorate([
|
|
17846
18342
|
ignoreClone
|
|
17847
18343
|
], exports.Camera.prototype, "_frustumViewChangeFlag", void 0);
|
|
17848
|
-
|
|
18344
|
+
__decorate([
|
|
17849
18345
|
ignoreClone
|
|
17850
18346
|
], exports.Camera.prototype, "_transform", void 0);
|
|
17851
|
-
|
|
18347
|
+
__decorate([
|
|
17852
18348
|
ignoreClone
|
|
17853
18349
|
], exports.Camera.prototype, "_isViewMatrixDirty", void 0);
|
|
17854
|
-
|
|
18350
|
+
__decorate([
|
|
17855
18351
|
ignoreClone
|
|
17856
18352
|
], exports.Camera.prototype, "_isInvViewProjDirty", void 0);
|
|
17857
|
-
|
|
18353
|
+
__decorate([
|
|
17858
18354
|
deepClone
|
|
17859
18355
|
], exports.Camera.prototype, "_viewport", void 0);
|
|
17860
|
-
|
|
18356
|
+
__decorate([
|
|
17861
18357
|
deepClone
|
|
17862
18358
|
], exports.Camera.prototype, "_inverseProjectionMatrix", void 0);
|
|
17863
|
-
|
|
18359
|
+
__decorate([
|
|
17864
18360
|
deepClone
|
|
17865
18361
|
], exports.Camera.prototype, "_lastAspectSize", void 0);
|
|
17866
|
-
|
|
18362
|
+
__decorate([
|
|
17867
18363
|
deepClone
|
|
17868
18364
|
], exports.Camera.prototype, "_invViewProjMat", void 0);
|
|
17869
|
-
exports.Camera =
|
|
18365
|
+
exports.Camera = __decorate([
|
|
17870
18366
|
dependentComponents(Transform)
|
|
17871
18367
|
], exports.Camera);
|
|
17872
18368
|
|
|
@@ -18045,8 +18541,13 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18045
18541
|
};
|
|
18046
18542
|
return Loader;
|
|
18047
18543
|
}();
|
|
18048
|
-
|
|
18544
|
+
(function() {
|
|
18545
|
+
Loader._engineObjects = {};
|
|
18546
|
+
})();
|
|
18049
18547
|
|
|
18548
|
+
/**
|
|
18549
|
+
* Asset Type.
|
|
18550
|
+
*/ exports.AssetType = void 0;
|
|
18050
18551
|
(function(AssetType) {
|
|
18051
18552
|
AssetType[/**
|
|
18052
18553
|
* Plain text.
|
|
@@ -18078,11 +18579,17 @@ Loader._engineObjects = {};
|
|
|
18078
18579
|
AssetType[/** Source Font, include ttf、 otf and woff. */ "SourceFont"] = "source-font";
|
|
18079
18580
|
})(exports.AssetType || (exports.AssetType = {}));
|
|
18080
18581
|
|
|
18582
|
+
/**
|
|
18583
|
+
* Alpha blend mode.
|
|
18584
|
+
*/ exports.BlendMode = void 0;
|
|
18081
18585
|
(function(BlendMode) {
|
|
18082
18586
|
BlendMode[BlendMode[/** SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */ "Normal"] = 0] = "Normal";
|
|
18083
18587
|
BlendMode[BlendMode[/** SRC ALPHA * SRC + ONE * DEST */ "Additive"] = 1] = "Additive";
|
|
18084
18588
|
})(exports.BlendMode || (exports.BlendMode = {}));
|
|
18085
18589
|
|
|
18590
|
+
/**
|
|
18591
|
+
* Set which face for render.
|
|
18592
|
+
*/ exports.RenderFace = void 0;
|
|
18086
18593
|
(function(RenderFace) {
|
|
18087
18594
|
RenderFace[RenderFace[/** Render front face. */ "Front"] = 0] = "Front";
|
|
18088
18595
|
RenderFace[RenderFace[/** Render back face. */ "Back"] = 1] = "Back";
|
|
@@ -18090,7 +18597,7 @@ Loader._engineObjects = {};
|
|
|
18090
18597
|
})(exports.RenderFace || (exports.RenderFace = {}));
|
|
18091
18598
|
|
|
18092
18599
|
var BaseMaterial = /*#__PURE__*/ function(Material) {
|
|
18093
|
-
|
|
18600
|
+
_inherits(BaseMaterial, Material);
|
|
18094
18601
|
function BaseMaterial(engine, shader) {
|
|
18095
18602
|
var _this;
|
|
18096
18603
|
_this = Material.call(this, engine, shader) || this;
|
|
@@ -18189,7 +18696,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
|
|
|
18189
18696
|
target._isTransparent = this._isTransparent;
|
|
18190
18697
|
target._blendMode = this._blendMode;
|
|
18191
18698
|
};
|
|
18192
|
-
|
|
18699
|
+
_create_class(BaseMaterial, [
|
|
18193
18700
|
{
|
|
18194
18701
|
key: "shader",
|
|
18195
18702
|
get: /**
|
|
@@ -18289,24 +18796,50 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
|
|
|
18289
18796
|
]);
|
|
18290
18797
|
return BaseMaterial;
|
|
18291
18798
|
}(Material);
|
|
18292
|
-
|
|
18293
|
-
BaseMaterial.
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
BaseMaterial.
|
|
18297
|
-
|
|
18298
|
-
|
|
18299
|
-
BaseMaterial.
|
|
18300
|
-
|
|
18301
|
-
|
|
18302
|
-
BaseMaterial.
|
|
18303
|
-
|
|
18304
|
-
|
|
18799
|
+
(function() {
|
|
18800
|
+
BaseMaterial._baseColorProp = Shader.getPropertyByName("u_baseColor");
|
|
18801
|
+
})();
|
|
18802
|
+
(function() {
|
|
18803
|
+
BaseMaterial._baseTextureProp = Shader.getPropertyByName("u_baseTexture");
|
|
18804
|
+
})();
|
|
18805
|
+
(function() {
|
|
18806
|
+
BaseMaterial._baseTextureMacro = Shader.getMacroByName("BASETEXTURE");
|
|
18807
|
+
})();
|
|
18808
|
+
(function() {
|
|
18809
|
+
BaseMaterial._tilingOffsetProp = Shader.getPropertyByName("u_tilingOffset");
|
|
18810
|
+
})();
|
|
18811
|
+
(function() {
|
|
18812
|
+
BaseMaterial._normalTextureProp = Shader.getPropertyByName("u_normalTexture");
|
|
18813
|
+
})();
|
|
18814
|
+
(function() {
|
|
18815
|
+
BaseMaterial._normalIntensityProp = Shader.getPropertyByName("u_normalIntensity");
|
|
18816
|
+
})();
|
|
18817
|
+
(function() {
|
|
18818
|
+
BaseMaterial._normalTextureMacro = Shader.getMacroByName("NORMALTEXTURE");
|
|
18819
|
+
})();
|
|
18820
|
+
(function() {
|
|
18821
|
+
BaseMaterial._emissiveColorProp = Shader.getPropertyByName("u_emissiveColor");
|
|
18822
|
+
})();
|
|
18823
|
+
(function() {
|
|
18824
|
+
BaseMaterial._emissiveTextureProp = Shader.getPropertyByName("u_emissiveTexture");
|
|
18825
|
+
})();
|
|
18826
|
+
(function() {
|
|
18827
|
+
BaseMaterial._emissiveTextureMacro = Shader.getMacroByName("EMISSIVETEXTURE");
|
|
18828
|
+
})();
|
|
18829
|
+
(function() {
|
|
18830
|
+
BaseMaterial._transparentMacro = Shader.getMacroByName("OASIS_TRANSPARENT");
|
|
18831
|
+
})();
|
|
18832
|
+
(function() {
|
|
18833
|
+
BaseMaterial._alphaCutoffProp = Shader.getPropertyByName("u_alphaCutoff");
|
|
18834
|
+
})();
|
|
18835
|
+
(function() {
|
|
18836
|
+
BaseMaterial._alphaCutoffMacro = Shader.getMacroByName("ALPHA_CUTOFF");
|
|
18837
|
+
})();
|
|
18305
18838
|
|
|
18306
18839
|
/**
|
|
18307
18840
|
* Blinn-phong Material.
|
|
18308
18841
|
*/ var BlinnPhongMaterial = /*#__PURE__*/ function(BaseMaterial) {
|
|
18309
|
-
|
|
18842
|
+
_inherits(BlinnPhongMaterial, BaseMaterial);
|
|
18310
18843
|
function BlinnPhongMaterial(engine) {
|
|
18311
18844
|
var _this;
|
|
18312
18845
|
_this = BaseMaterial.call(this, engine, Shader.find("blinn-phong")) || this;
|
|
@@ -18329,7 +18862,7 @@ BaseMaterial._alphaCutoffMacro = Shader.getMacroByName("ALPHA_CUTOFF");
|
|
|
18329
18862
|
this.cloneTo(dest);
|
|
18330
18863
|
return dest;
|
|
18331
18864
|
};
|
|
18332
|
-
|
|
18865
|
+
_create_class(BlinnPhongMaterial, [
|
|
18333
18866
|
{
|
|
18334
18867
|
key: "baseColor",
|
|
18335
18868
|
get: /**
|
|
@@ -18475,10 +19008,19 @@ BaseMaterial._alphaCutoffMacro = Shader.getMacroByName("ALPHA_CUTOFF");
|
|
|
18475
19008
|
]);
|
|
18476
19009
|
return BlinnPhongMaterial;
|
|
18477
19010
|
}(BaseMaterial);
|
|
18478
|
-
|
|
18479
|
-
BlinnPhongMaterial.
|
|
18480
|
-
|
|
19011
|
+
(function() {
|
|
19012
|
+
BlinnPhongMaterial._specularColorProp = Shader.getPropertyByName("u_specularColor");
|
|
19013
|
+
})();
|
|
19014
|
+
(function() {
|
|
19015
|
+
BlinnPhongMaterial._shininessProp = Shader.getPropertyByName("u_shininess");
|
|
19016
|
+
})();
|
|
19017
|
+
(function() {
|
|
19018
|
+
BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTexture");
|
|
19019
|
+
})();
|
|
18481
19020
|
|
|
19021
|
+
/**
|
|
19022
|
+
* Texture UV coordinate.
|
|
19023
|
+
*/ exports.TextureCoordinate = void 0;
|
|
18482
19024
|
(function(TextureCoordinate) {
|
|
18483
19025
|
TextureCoordinate[TextureCoordinate["UV0"] = 0] = "UV0";
|
|
18484
19026
|
TextureCoordinate[TextureCoordinate["UV1"] = 1] = "UV1";
|
|
@@ -18493,7 +19035,7 @@ BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTe
|
|
|
18493
19035
|
/**
|
|
18494
19036
|
* PBR (Physically-Based Rendering) Material.
|
|
18495
19037
|
*/ var PBRBaseMaterial = /*#__PURE__*/ function(BaseMaterial) {
|
|
18496
|
-
|
|
19038
|
+
_inherits(PBRBaseMaterial, BaseMaterial);
|
|
18497
19039
|
function PBRBaseMaterial(engine, shader) {
|
|
18498
19040
|
var _this;
|
|
18499
19041
|
_this = BaseMaterial.call(this, engine, shader) || this;
|
|
@@ -18510,7 +19052,7 @@ BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTe
|
|
|
18510
19052
|
shaderData.setFloat(PBRBaseMaterial._clearCoatRoughnessProp, 0);
|
|
18511
19053
|
return _this;
|
|
18512
19054
|
}
|
|
18513
|
-
|
|
19055
|
+
_create_class(PBRBaseMaterial, [
|
|
18514
19056
|
{
|
|
18515
19057
|
key: "baseColor",
|
|
18516
19058
|
get: /**
|
|
@@ -18734,19 +19276,35 @@ BlinnPhongMaterial._specularTextureProp = Shader.getPropertyByName("u_specularTe
|
|
|
18734
19276
|
]);
|
|
18735
19277
|
return PBRBaseMaterial;
|
|
18736
19278
|
}(BaseMaterial);
|
|
18737
|
-
|
|
18738
|
-
PBRBaseMaterial.
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
PBRBaseMaterial.
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
PBRBaseMaterial.
|
|
19279
|
+
(function() {
|
|
19280
|
+
PBRBaseMaterial._occlusionTextureIntensityProp = Shader.getPropertyByName("u_occlusionIntensity");
|
|
19281
|
+
})();
|
|
19282
|
+
(function() {
|
|
19283
|
+
PBRBaseMaterial._occlusionTextureCoordProp = Shader.getPropertyByName("u_occlusionTextureCoord");
|
|
19284
|
+
})();
|
|
19285
|
+
(function() {
|
|
19286
|
+
PBRBaseMaterial._occlusionTextureProp = Shader.getPropertyByName("u_occlusionTexture");
|
|
19287
|
+
})();
|
|
19288
|
+
(function() {
|
|
19289
|
+
PBRBaseMaterial._clearCoatProp = Shader.getPropertyByName("u_clearCoat");
|
|
19290
|
+
})();
|
|
19291
|
+
(function() {
|
|
19292
|
+
PBRBaseMaterial._clearCoatTextureProp = Shader.getPropertyByName("u_clearCoatTexture");
|
|
19293
|
+
})();
|
|
19294
|
+
(function() {
|
|
19295
|
+
PBRBaseMaterial._clearCoatRoughnessProp = Shader.getPropertyByName("u_clearCoatRoughness");
|
|
19296
|
+
})();
|
|
19297
|
+
(function() {
|
|
19298
|
+
PBRBaseMaterial._clearCoatRoughnessTextureProp = Shader.getPropertyByName("u_clearCoatRoughnessTexture");
|
|
19299
|
+
})();
|
|
19300
|
+
(function() {
|
|
19301
|
+
PBRBaseMaterial._clearCoatNormalTextureProp = Shader.getPropertyByName("u_clearCoatNormalTexture");
|
|
19302
|
+
})();
|
|
18745
19303
|
|
|
18746
19304
|
/**
|
|
18747
19305
|
* PBR (Metallic-Roughness Workflow) Material.
|
|
18748
19306
|
*/ var PBRMaterial = /*#__PURE__*/ function(PBRBaseMaterial) {
|
|
18749
|
-
|
|
19307
|
+
_inherits(PBRMaterial, PBRBaseMaterial);
|
|
18750
19308
|
function PBRMaterial(engine) {
|
|
18751
19309
|
var _this;
|
|
18752
19310
|
_this = PBRBaseMaterial.call(this, engine, Shader.find("pbr")) || this;
|
|
@@ -18763,7 +19321,7 @@ PBRBaseMaterial._clearCoatNormalTextureProp = Shader.getPropertyByName("u_clearC
|
|
|
18763
19321
|
this.cloneTo(dest);
|
|
18764
19322
|
return dest;
|
|
18765
19323
|
};
|
|
18766
|
-
|
|
19324
|
+
_create_class(PBRMaterial, [
|
|
18767
19325
|
{
|
|
18768
19326
|
key: "ior",
|
|
18769
19327
|
get: /**
|
|
@@ -18820,15 +19378,23 @@ PBRBaseMaterial._clearCoatNormalTextureProp = Shader.getPropertyByName("u_clearC
|
|
|
18820
19378
|
]);
|
|
18821
19379
|
return PBRMaterial;
|
|
18822
19380
|
}(PBRBaseMaterial);
|
|
18823
|
-
|
|
18824
|
-
PBRMaterial.
|
|
18825
|
-
|
|
18826
|
-
|
|
19381
|
+
(function() {
|
|
19382
|
+
PBRMaterial._metallicProp = Shader.getPropertyByName("u_metal");
|
|
19383
|
+
})();
|
|
19384
|
+
(function() {
|
|
19385
|
+
PBRMaterial._roughnessProp = Shader.getPropertyByName("u_roughness");
|
|
19386
|
+
})();
|
|
19387
|
+
(function() {
|
|
19388
|
+
PBRMaterial._roughnessMetallicTextureProp = Shader.getPropertyByName("u_roughnessMetallicTexture");
|
|
19389
|
+
})();
|
|
19390
|
+
(function() {
|
|
19391
|
+
PBRMaterial._iorProp = Shader.getPropertyByName("material_IOR");
|
|
19392
|
+
})();
|
|
18827
19393
|
|
|
18828
19394
|
/**
|
|
18829
19395
|
* PBR (Specular-Glossiness Workflow) Material.
|
|
18830
19396
|
*/ var PBRSpecularMaterial = /*#__PURE__*/ function(PBRBaseMaterial) {
|
|
18831
|
-
|
|
19397
|
+
_inherits(PBRSpecularMaterial, PBRBaseMaterial);
|
|
18832
19398
|
function PBRSpecularMaterial(engine) {
|
|
18833
19399
|
var _this;
|
|
18834
19400
|
_this = PBRBaseMaterial.call(this, engine, Shader.find("pbr-specular")) || this;
|
|
@@ -18844,7 +19410,7 @@ PBRMaterial._iorProp = Shader.getPropertyByName("material_IOR");
|
|
|
18844
19410
|
this.cloneTo(dest);
|
|
18845
19411
|
return dest;
|
|
18846
19412
|
};
|
|
18847
|
-
|
|
19413
|
+
_create_class(PBRSpecularMaterial, [
|
|
18848
19414
|
{
|
|
18849
19415
|
key: "specularColor",
|
|
18850
19416
|
get: /**
|
|
@@ -18890,15 +19456,23 @@ PBRMaterial._iorProp = Shader.getPropertyByName("material_IOR");
|
|
|
18890
19456
|
]);
|
|
18891
19457
|
return PBRSpecularMaterial;
|
|
18892
19458
|
}(PBRBaseMaterial);
|
|
18893
|
-
|
|
18894
|
-
PBRSpecularMaterial.
|
|
18895
|
-
|
|
18896
|
-
|
|
19459
|
+
(function() {
|
|
19460
|
+
PBRSpecularMaterial._specularColorProp = Shader.getPropertyByName("u_PBRSpecularColor");
|
|
19461
|
+
})();
|
|
19462
|
+
(function() {
|
|
19463
|
+
PBRSpecularMaterial._glossinessProp = Shader.getPropertyByName("u_glossiness");
|
|
19464
|
+
})();
|
|
19465
|
+
(function() {
|
|
19466
|
+
PBRSpecularMaterial._specularGlossinessTextureProp = Shader.getPropertyByName("u_specularGlossinessTexture");
|
|
19467
|
+
})();
|
|
19468
|
+
(function() {
|
|
19469
|
+
PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPECULARGLOSSINESSTEXTURE");
|
|
19470
|
+
})();
|
|
18897
19471
|
|
|
18898
19472
|
/**
|
|
18899
19473
|
* Unlit Material.
|
|
18900
19474
|
*/ var UnlitMaterial = /*#__PURE__*/ function(BaseMaterial) {
|
|
18901
|
-
|
|
19475
|
+
_inherits(UnlitMaterial, BaseMaterial);
|
|
18902
19476
|
function UnlitMaterial(engine) {
|
|
18903
19477
|
var _this;
|
|
18904
19478
|
_this = BaseMaterial.call(this, engine, Shader.find("unlit")) || this;
|
|
@@ -18917,7 +19491,7 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
|
|
|
18917
19491
|
this.cloneTo(dest);
|
|
18918
19492
|
return dest;
|
|
18919
19493
|
};
|
|
18920
|
-
|
|
19494
|
+
_create_class(UnlitMaterial, [
|
|
18921
19495
|
{
|
|
18922
19496
|
key: "baseColor",
|
|
18923
19497
|
get: /**
|
|
@@ -18966,22 +19540,32 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
|
|
|
18966
19540
|
return UnlitMaterial;
|
|
18967
19541
|
}(BaseMaterial);
|
|
18968
19542
|
|
|
19543
|
+
/**
|
|
19544
|
+
* The horizontal alignment of the text.
|
|
19545
|
+
*/ exports.TextHorizontalAlignment = void 0;
|
|
18969
19546
|
(function(TextHorizontalAlignment) {
|
|
18970
19547
|
TextHorizontalAlignment[TextHorizontalAlignment[/** Align left horizontally */ "Left"] = 0] = "Left";
|
|
18971
19548
|
TextHorizontalAlignment[TextHorizontalAlignment[/** Align center horizontally */ "Center"] = 1] = "Center";
|
|
18972
19549
|
TextHorizontalAlignment[TextHorizontalAlignment[/** Align right horizontally */ "Right"] = 2] = "Right";
|
|
18973
19550
|
})(exports.TextHorizontalAlignment || (exports.TextHorizontalAlignment = {}));
|
|
19551
|
+
exports.TextVerticalAlignment = void 0;
|
|
18974
19552
|
(function(TextVerticalAlignment) {
|
|
18975
19553
|
TextVerticalAlignment[TextVerticalAlignment[/** Align top vertically */ "Top"] = 0] = "Top";
|
|
18976
19554
|
TextVerticalAlignment[TextVerticalAlignment[/** Align center vertically */ "Center"] = 1] = "Center";
|
|
18977
19555
|
TextVerticalAlignment[TextVerticalAlignment[/** Align bottom vertically */ "Bottom"] = 2] = "Bottom";
|
|
18978
19556
|
})(exports.TextVerticalAlignment || (exports.TextVerticalAlignment = {}));
|
|
18979
19557
|
|
|
19558
|
+
/**
|
|
19559
|
+
* The way to handle the situation where wrapped text is too tall to fit in the height.
|
|
19560
|
+
*/ exports.OverflowMode = void 0;
|
|
18980
19561
|
(function(OverflowMode) {
|
|
18981
19562
|
OverflowMode[OverflowMode[/** Overflow when the text is too tall */ "Overflow"] = 0] = "Overflow";
|
|
18982
19563
|
OverflowMode[OverflowMode[/** Truncate with height when the text is too tall */ "Truncate"] = 1] = "Truncate";
|
|
18983
19564
|
})(exports.OverflowMode || (exports.OverflowMode = {}));
|
|
18984
19565
|
|
|
19566
|
+
/**
|
|
19567
|
+
* The style of the font.
|
|
19568
|
+
*/ exports.FontStyle = void 0;
|
|
18985
19569
|
(function(FontStyle) {
|
|
18986
19570
|
FontStyle[FontStyle[/** Set font without style */ "None"] = 0x0] = "None";
|
|
18987
19571
|
FontStyle[FontStyle[/** Set font bold */ "Bold"] = 0x1] = "Bold";
|
|
@@ -18991,7 +19575,7 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
|
|
|
18991
19575
|
/**
|
|
18992
19576
|
* Sprite Atlas.
|
|
18993
19577
|
*/ var SpriteAtlas = /*#__PURE__*/ function(RefObject) {
|
|
18994
|
-
|
|
19578
|
+
_inherits(SpriteAtlas, RefObject);
|
|
18995
19579
|
function SpriteAtlas(engine) {
|
|
18996
19580
|
var _this;
|
|
18997
19581
|
_this = RefObject.call(this, engine) || this;
|
|
@@ -19048,7 +19632,7 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
|
|
|
19048
19632
|
this._sprites = null;
|
|
19049
19633
|
this._spriteNamesToIndex = null;
|
|
19050
19634
|
};
|
|
19051
|
-
|
|
19635
|
+
_create_class(SpriteAtlas, [
|
|
19052
19636
|
{
|
|
19053
19637
|
key: "sprites",
|
|
19054
19638
|
get: /**
|
|
@@ -19061,6 +19645,9 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
|
|
|
19061
19645
|
return SpriteAtlas;
|
|
19062
19646
|
}(RefObject);
|
|
19063
19647
|
|
|
19648
|
+
/**
|
|
19649
|
+
* Sprite's drawing mode enumeration.
|
|
19650
|
+
*/ exports.SpriteDrawMode = void 0;
|
|
19064
19651
|
(function(SpriteDrawMode) {
|
|
19065
19652
|
SpriteDrawMode[SpriteDrawMode[/** Overall scaling when modifying size. */ "Simple"] = 0] = "Simple";
|
|
19066
19653
|
SpriteDrawMode[SpriteDrawMode[/** When modifying the size, it is transformed according to the 9-slice settings (border). */ "Sliced"] = 1] = "Sliced";
|
|
@@ -19069,7 +19656,7 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
|
|
|
19069
19656
|
/**
|
|
19070
19657
|
* 2D sprite.
|
|
19071
19658
|
*/ var Sprite = /*#__PURE__*/ function(RefObject) {
|
|
19072
|
-
|
|
19659
|
+
_inherits(Sprite, RefObject);
|
|
19073
19660
|
function Sprite(engine, texture, region, pivot, border, name) {
|
|
19074
19661
|
if (texture === void 0) texture = null;
|
|
19075
19662
|
if (region === void 0) region = null;
|
|
@@ -19245,7 +19832,7 @@ PBRSpecularMaterial._specularGlossinessTextureMacro = Shader.getMacroByName("SPE
|
|
|
19245
19832
|
}
|
|
19246
19833
|
this._updateFlagManager.dispatch(type);
|
|
19247
19834
|
};
|
|
19248
|
-
|
|
19835
|
+
_create_class(Sprite, [
|
|
19249
19836
|
{
|
|
19250
19837
|
key: "texture",
|
|
19251
19838
|
get: /**
|
|
@@ -19559,15 +20146,17 @@ var SlicedSpriteAssembler = (_SlicedSpriteAssembler = /*#__PURE__*/ function() {
|
|
|
19559
20146
|
};
|
|
19560
20147
|
SlicedSpriteAssembler1.updateUVs = function updateUVs(renderer) {};
|
|
19561
20148
|
return SlicedSpriteAssembler1;
|
|
19562
|
-
}(),
|
|
19563
|
-
|
|
20149
|
+
}(), function() {
|
|
20150
|
+
_SlicedSpriteAssembler._worldMatrix = new engineMath.Matrix();
|
|
20151
|
+
}(), _SlicedSpriteAssembler);
|
|
20152
|
+
SlicedSpriteAssembler = __decorate([
|
|
19564
20153
|
StaticInterfaceImplement()
|
|
19565
20154
|
], SlicedSpriteAssembler);
|
|
19566
20155
|
|
|
19567
20156
|
/**
|
|
19568
20157
|
* Renders a Sprite for 2D graphics.
|
|
19569
20158
|
*/ var SpriteRenderer = /*#__PURE__*/ function(Renderer) {
|
|
19570
|
-
|
|
20159
|
+
_inherits(SpriteRenderer, Renderer);
|
|
19571
20160
|
function SpriteRenderer(entity) {
|
|
19572
20161
|
var _this;
|
|
19573
20162
|
_this = Renderer.call(this, entity) || this;
|
|
@@ -19584,7 +20173,7 @@ SlicedSpriteAssembler = _ts_decorate__default['default']([
|
|
|
19584
20173
|
_this._renderData = new RenderData2D(4, [], [], null, _this._color);
|
|
19585
20174
|
_this.drawMode = exports.SpriteDrawMode.Simple;
|
|
19586
20175
|
_this.setMaterial(_this._engine._spriteDefaultMaterial);
|
|
19587
|
-
_this._onSpriteChange = _this._onSpriteChange.bind(
|
|
20176
|
+
_this._onSpriteChange = _this._onSpriteChange.bind(_assert_this_initialized(_this));
|
|
19588
20177
|
return _this;
|
|
19589
20178
|
}
|
|
19590
20179
|
var _proto = SpriteRenderer.prototype;
|
|
@@ -19705,7 +20294,7 @@ SlicedSpriteAssembler = _ts_decorate__default['default']([
|
|
|
19705
20294
|
break;
|
|
19706
20295
|
}
|
|
19707
20296
|
};
|
|
19708
|
-
|
|
20297
|
+
_create_class(SpriteRenderer, [
|
|
19709
20298
|
{
|
|
19710
20299
|
key: "drawMode",
|
|
19711
20300
|
get: /**
|
|
@@ -19870,47 +20459,49 @@ SlicedSpriteAssembler = _ts_decorate__default['default']([
|
|
|
19870
20459
|
]);
|
|
19871
20460
|
return SpriteRenderer;
|
|
19872
20461
|
}(exports.Renderer);
|
|
19873
|
-
|
|
19874
|
-
|
|
20462
|
+
(function() {
|
|
20463
|
+
/** @internal */ SpriteRenderer._textureProperty = Shader.getPropertyByName("u_spriteTexture");
|
|
20464
|
+
})();
|
|
20465
|
+
__decorate([
|
|
19875
20466
|
ignoreClone
|
|
19876
20467
|
], SpriteRenderer.prototype, "_renderData", void 0);
|
|
19877
|
-
|
|
20468
|
+
__decorate([
|
|
19878
20469
|
ignoreClone
|
|
19879
20470
|
], SpriteRenderer.prototype, "_drawMode", void 0);
|
|
19880
|
-
|
|
20471
|
+
__decorate([
|
|
19881
20472
|
ignoreClone
|
|
19882
20473
|
], SpriteRenderer.prototype, "_assembler", void 0);
|
|
19883
|
-
|
|
20474
|
+
__decorate([
|
|
19884
20475
|
deepClone
|
|
19885
20476
|
], SpriteRenderer.prototype, "_color", void 0);
|
|
19886
|
-
|
|
20477
|
+
__decorate([
|
|
19887
20478
|
ignoreClone
|
|
19888
20479
|
], SpriteRenderer.prototype, "_sprite", void 0);
|
|
19889
|
-
|
|
20480
|
+
__decorate([
|
|
19890
20481
|
ignoreClone
|
|
19891
20482
|
], SpriteRenderer.prototype, "_automaticWidth", void 0);
|
|
19892
|
-
|
|
20483
|
+
__decorate([
|
|
19893
20484
|
ignoreClone
|
|
19894
20485
|
], SpriteRenderer.prototype, "_automaticHeight", void 0);
|
|
19895
|
-
|
|
20486
|
+
__decorate([
|
|
19896
20487
|
assignmentClone
|
|
19897
20488
|
], SpriteRenderer.prototype, "_customWidth", void 0);
|
|
19898
|
-
|
|
20489
|
+
__decorate([
|
|
19899
20490
|
assignmentClone
|
|
19900
20491
|
], SpriteRenderer.prototype, "_customHeight", void 0);
|
|
19901
|
-
|
|
20492
|
+
__decorate([
|
|
19902
20493
|
assignmentClone
|
|
19903
20494
|
], SpriteRenderer.prototype, "_flipX", void 0);
|
|
19904
|
-
|
|
20495
|
+
__decorate([
|
|
19905
20496
|
assignmentClone
|
|
19906
20497
|
], SpriteRenderer.prototype, "_flipY", void 0);
|
|
19907
|
-
|
|
20498
|
+
__decorate([
|
|
19908
20499
|
assignmentClone
|
|
19909
20500
|
], SpriteRenderer.prototype, "_maskLayer", void 0);
|
|
19910
|
-
|
|
20501
|
+
__decorate([
|
|
19911
20502
|
assignmentClone
|
|
19912
20503
|
], SpriteRenderer.prototype, "_maskInteraction", void 0);
|
|
19913
|
-
|
|
20504
|
+
__decorate([
|
|
19914
20505
|
ignoreClone
|
|
19915
20506
|
], SpriteRenderer.prototype, "_onSpriteChange", null);
|
|
19916
20507
|
var /**
|
|
@@ -19935,14 +20526,16 @@ var /**
|
|
|
19935
20526
|
];
|
|
19936
20527
|
this.renderData = new RenderData2D(4, positions, null, CharRenderData.triangles, null);
|
|
19937
20528
|
};
|
|
19938
|
-
|
|
19939
|
-
|
|
19940
|
-
|
|
19941
|
-
|
|
19942
|
-
|
|
19943
|
-
|
|
19944
|
-
|
|
19945
|
-
|
|
20529
|
+
(function() {
|
|
20530
|
+
CharRenderData.triangles = [
|
|
20531
|
+
0,
|
|
20532
|
+
2,
|
|
20533
|
+
1,
|
|
20534
|
+
2,
|
|
20535
|
+
0,
|
|
20536
|
+
3
|
|
20537
|
+
];
|
|
20538
|
+
})();
|
|
19946
20539
|
|
|
19947
20540
|
/**
|
|
19948
20541
|
* @internal
|
|
@@ -20266,28 +20859,42 @@ CharRenderData.triangles = [
|
|
|
20266
20859
|
};
|
|
20267
20860
|
return TextUtils;
|
|
20268
20861
|
}();
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20277
|
-
|
|
20278
|
-
|
|
20279
|
-
|
|
20280
|
-
|
|
20281
|
-
|
|
20282
|
-
|
|
20283
|
-
TextUtils.
|
|
20284
|
-
|
|
20285
|
-
|
|
20862
|
+
(function() {
|
|
20863
|
+
/** @internal */ TextUtils._genericFontFamilies = [
|
|
20864
|
+
"serif",
|
|
20865
|
+
"sans-serif",
|
|
20866
|
+
"monospace",
|
|
20867
|
+
"cursive",
|
|
20868
|
+
"fantasy",
|
|
20869
|
+
"system-ui",
|
|
20870
|
+
"math",
|
|
20871
|
+
"emoji",
|
|
20872
|
+
"fangsong"
|
|
20873
|
+
];
|
|
20874
|
+
})();
|
|
20875
|
+
(function() {
|
|
20876
|
+
/** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
|
|
20877
|
+
})();
|
|
20878
|
+
(function() {
|
|
20879
|
+
TextUtils._measureBaseline = "M";
|
|
20880
|
+
})();
|
|
20881
|
+
(function() {
|
|
20882
|
+
TextUtils._heightMultiplier = 2;
|
|
20883
|
+
})();
|
|
20884
|
+
(function() {
|
|
20885
|
+
TextUtils._baselineMultiplier = 1.4;
|
|
20886
|
+
})();
|
|
20887
|
+
(function() {
|
|
20888
|
+
TextUtils._fontSizeInfoCache = {};
|
|
20889
|
+
})();
|
|
20890
|
+
(function() {
|
|
20891
|
+
TextUtils._textContext = null;
|
|
20892
|
+
})();
|
|
20286
20893
|
|
|
20287
20894
|
/**
|
|
20288
20895
|
* Renders a text for 2D graphics.
|
|
20289
20896
|
*/ var TextRenderer = /*#__PURE__*/ function(Renderer) {
|
|
20290
|
-
|
|
20897
|
+
_inherits(TextRenderer, Renderer);
|
|
20291
20898
|
function TextRenderer(entity) {
|
|
20292
20899
|
var _this;
|
|
20293
20900
|
_this = Renderer.call(this, entity) || this;
|
|
@@ -20309,7 +20916,7 @@ TextUtils._textContext = null;
|
|
|
20309
20916
|
_this._overflowMode = exports.OverflowMode.Overflow;
|
|
20310
20917
|
_this._maskInteraction = exports.SpriteMaskInteraction.None;
|
|
20311
20918
|
_this._maskLayer = exports.SpriteMaskLayer.Layer0;
|
|
20312
|
-
var engine =
|
|
20919
|
+
var engine = _assert_this_initialized(_this).engine;
|
|
20313
20920
|
_this._font = engine._textDefaultFont;
|
|
20314
20921
|
_this._font._addRefCount(1);
|
|
20315
20922
|
_this.setMaterial(engine._spriteDefaultMaterial);
|
|
@@ -20549,7 +21156,7 @@ TextUtils._textContext = null;
|
|
|
20549
21156
|
Renderer.prototype._onTransformChanged.call(this, bit);
|
|
20550
21157
|
this._setDirtyFlagTrue(0x4 | 0x8);
|
|
20551
21158
|
};
|
|
20552
|
-
|
|
21159
|
+
_create_class(TextRenderer, [
|
|
20553
21160
|
{
|
|
20554
21161
|
key: "color",
|
|
20555
21162
|
get: /**
|
|
@@ -20762,61 +21369,67 @@ TextUtils._textContext = null;
|
|
|
20762
21369
|
]);
|
|
20763
21370
|
return TextRenderer;
|
|
20764
21371
|
}(exports.Renderer);
|
|
20765
|
-
|
|
20766
|
-
TextRenderer.
|
|
20767
|
-
|
|
20768
|
-
|
|
21372
|
+
(function() {
|
|
21373
|
+
TextRenderer._charRenderDataPool = new CharRenderDataPool(CharRenderData, 50);
|
|
21374
|
+
})();
|
|
21375
|
+
(function() {
|
|
21376
|
+
TextRenderer._tempVec30 = new engineMath.Vector3();
|
|
21377
|
+
})();
|
|
21378
|
+
(function() {
|
|
21379
|
+
TextRenderer._tempVec31 = new engineMath.Vector3();
|
|
21380
|
+
})();
|
|
21381
|
+
__decorate([
|
|
20769
21382
|
assignmentClone
|
|
20770
21383
|
], TextRenderer.prototype, "_subFont", void 0);
|
|
20771
|
-
|
|
21384
|
+
__decorate([
|
|
20772
21385
|
ignoreClone
|
|
20773
21386
|
], TextRenderer.prototype, "_charRenderDatas", void 0);
|
|
20774
|
-
|
|
21387
|
+
__decorate([
|
|
20775
21388
|
ignoreClone
|
|
20776
21389
|
], TextRenderer.prototype, "_dirtyFlag", void 0);
|
|
20777
|
-
|
|
21390
|
+
__decorate([
|
|
20778
21391
|
deepClone
|
|
20779
21392
|
], TextRenderer.prototype, "_color", void 0);
|
|
20780
|
-
|
|
21393
|
+
__decorate([
|
|
20781
21394
|
assignmentClone
|
|
20782
21395
|
], TextRenderer.prototype, "_text", void 0);
|
|
20783
|
-
|
|
21396
|
+
__decorate([
|
|
20784
21397
|
assignmentClone
|
|
20785
21398
|
], TextRenderer.prototype, "_width", void 0);
|
|
20786
|
-
|
|
21399
|
+
__decorate([
|
|
20787
21400
|
assignmentClone
|
|
20788
21401
|
], TextRenderer.prototype, "_height", void 0);
|
|
20789
|
-
|
|
21402
|
+
__decorate([
|
|
20790
21403
|
ignoreClone
|
|
20791
21404
|
], TextRenderer.prototype, "_localBounds", void 0);
|
|
20792
|
-
|
|
21405
|
+
__decorate([
|
|
20793
21406
|
assignmentClone
|
|
20794
21407
|
], TextRenderer.prototype, "_font", void 0);
|
|
20795
|
-
|
|
21408
|
+
__decorate([
|
|
20796
21409
|
assignmentClone
|
|
20797
21410
|
], TextRenderer.prototype, "_fontSize", void 0);
|
|
20798
|
-
|
|
21411
|
+
__decorate([
|
|
20799
21412
|
assignmentClone
|
|
20800
21413
|
], TextRenderer.prototype, "_fontStyle", void 0);
|
|
20801
|
-
|
|
21414
|
+
__decorate([
|
|
20802
21415
|
assignmentClone
|
|
20803
21416
|
], TextRenderer.prototype, "_lineSpacing", void 0);
|
|
20804
|
-
|
|
21417
|
+
__decorate([
|
|
20805
21418
|
assignmentClone
|
|
20806
21419
|
], TextRenderer.prototype, "_horizontalAlignment", void 0);
|
|
20807
|
-
|
|
21420
|
+
__decorate([
|
|
20808
21421
|
assignmentClone
|
|
20809
21422
|
], TextRenderer.prototype, "_verticalAlignment", void 0);
|
|
20810
|
-
|
|
21423
|
+
__decorate([
|
|
20811
21424
|
assignmentClone
|
|
20812
21425
|
], TextRenderer.prototype, "_enableWrapping", void 0);
|
|
20813
|
-
|
|
21426
|
+
__decorate([
|
|
20814
21427
|
assignmentClone
|
|
20815
21428
|
], TextRenderer.prototype, "_overflowMode", void 0);
|
|
20816
|
-
|
|
21429
|
+
__decorate([
|
|
20817
21430
|
assignmentClone
|
|
20818
21431
|
], TextRenderer.prototype, "_maskInteraction", void 0);
|
|
20819
|
-
|
|
21432
|
+
__decorate([
|
|
20820
21433
|
assignmentClone
|
|
20821
21434
|
], TextRenderer.prototype, "_maskLayer", void 0);
|
|
20822
21435
|
var DirtyFlag;
|
|
@@ -20971,7 +21584,9 @@ var DirtyFlag;
|
|
|
20971
21584
|
};
|
|
20972
21585
|
return AnimationCurveOwner;
|
|
20973
21586
|
}();
|
|
20974
|
-
|
|
21587
|
+
(function() {
|
|
21588
|
+
AnimationCurveOwner._assemblerMap = new Map();
|
|
21589
|
+
})();
|
|
20975
21590
|
|
|
20976
21591
|
/**
|
|
20977
21592
|
* @internal
|
|
@@ -21185,7 +21800,7 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
|
|
|
21185
21800
|
}
|
|
21186
21801
|
}
|
|
21187
21802
|
};
|
|
21188
|
-
|
|
21803
|
+
_create_class(AnimationClip, [
|
|
21189
21804
|
{
|
|
21190
21805
|
key: "events",
|
|
21191
21806
|
get: /**
|
|
@@ -21214,6 +21829,9 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
|
|
|
21214
21829
|
return AnimationClip;
|
|
21215
21830
|
}();
|
|
21216
21831
|
|
|
21832
|
+
/**
|
|
21833
|
+
* Animation interpolation method.
|
|
21834
|
+
*/ exports.InterpolationType = void 0;
|
|
21217
21835
|
(function(InterpolationType) {
|
|
21218
21836
|
InterpolationType[InterpolationType[/** Linear interpolation */ "Linear"] = 0] = "Linear";
|
|
21219
21837
|
InterpolationType[InterpolationType[/** Cubic spline interpolation */ "CubicSpine"] = 1] = "CubicSpine";
|
|
@@ -21331,7 +21949,7 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
|
|
|
21331
21949
|
var result = this._evaluate(time, evaluateData);
|
|
21332
21950
|
return this._type._subtractValue(result, this.keys[0].value, evaluateData.value);
|
|
21333
21951
|
};
|
|
21334
|
-
|
|
21952
|
+
_create_class(AnimationCurve, [
|
|
21335
21953
|
{
|
|
21336
21954
|
key: "interpolation",
|
|
21337
21955
|
get: /**
|
|
@@ -21362,7 +21980,7 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
|
|
|
21362
21980
|
|
|
21363
21981
|
var _AnimationArrayCurve;
|
|
21364
21982
|
exports.AnimationArrayCurve = (_AnimationArrayCurve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21365
|
-
|
|
21983
|
+
_inherits(AnimationArrayCurve, AnimationCurve);
|
|
21366
21984
|
function AnimationArrayCurve() {
|
|
21367
21985
|
var _this;
|
|
21368
21986
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -21446,14 +22064,18 @@ exports.AnimationArrayCurve = (_AnimationArrayCurve = /*#__PURE__*/ function(Ani
|
|
|
21446
22064
|
return out;
|
|
21447
22065
|
};
|
|
21448
22066
|
return AnimationArrayCurve;
|
|
21449
|
-
}(AnimationCurve),
|
|
21450
|
-
|
|
22067
|
+
}(AnimationCurve), function() {
|
|
22068
|
+
/** @internal */ _AnimationArrayCurve._isReferenceType = true;
|
|
22069
|
+
}(), function() {
|
|
22070
|
+
/** @internal */ _AnimationArrayCurve._isInterpolationType = true;
|
|
22071
|
+
}(), _AnimationArrayCurve);
|
|
22072
|
+
exports.AnimationArrayCurve = __decorate([
|
|
21451
22073
|
StaticInterfaceImplement()
|
|
21452
22074
|
], exports.AnimationArrayCurve);
|
|
21453
22075
|
|
|
21454
22076
|
var _AnimationBoolCurve;
|
|
21455
22077
|
exports.AnimationBoolCurve = (_AnimationBoolCurve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21456
|
-
|
|
22078
|
+
_inherits(AnimationBoolCurve, AnimationCurve);
|
|
21457
22079
|
function AnimationBoolCurve() {
|
|
21458
22080
|
var _this;
|
|
21459
22081
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -21504,14 +22126,18 @@ exports.AnimationBoolCurve = (_AnimationBoolCurve = /*#__PURE__*/ function(Anima
|
|
|
21504
22126
|
return frame.value;
|
|
21505
22127
|
};
|
|
21506
22128
|
return AnimationBoolCurve;
|
|
21507
|
-
}(AnimationCurve),
|
|
21508
|
-
|
|
22129
|
+
}(AnimationCurve), function() {
|
|
22130
|
+
/** @internal */ _AnimationBoolCurve._isReferenceType = false;
|
|
22131
|
+
}(), function() {
|
|
22132
|
+
/** @internal */ _AnimationBoolCurve._isInterpolationType = false;
|
|
22133
|
+
}(), _AnimationBoolCurve);
|
|
22134
|
+
exports.AnimationBoolCurve = __decorate([
|
|
21509
22135
|
StaticInterfaceImplement()
|
|
21510
22136
|
], exports.AnimationBoolCurve);
|
|
21511
22137
|
|
|
21512
22138
|
var _AnimationColorCurve;
|
|
21513
22139
|
exports.AnimationColorCurve = (_AnimationColorCurve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21514
|
-
|
|
22140
|
+
_inherits(AnimationColorCurve, AnimationCurve);
|
|
21515
22141
|
function AnimationColorCurve() {
|
|
21516
22142
|
var _this;
|
|
21517
22143
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -21602,14 +22228,18 @@ exports.AnimationColorCurve = (_AnimationColorCurve = /*#__PURE__*/ function(Ani
|
|
|
21602
22228
|
return out;
|
|
21603
22229
|
};
|
|
21604
22230
|
return AnimationColorCurve;
|
|
21605
|
-
}(AnimationCurve),
|
|
21606
|
-
|
|
22231
|
+
}(AnimationCurve), function() {
|
|
22232
|
+
/** @internal */ _AnimationColorCurve._isReferenceType = true;
|
|
22233
|
+
}(), function() {
|
|
22234
|
+
/** @internal */ _AnimationColorCurve._isInterpolationType = true;
|
|
22235
|
+
}(), _AnimationColorCurve);
|
|
22236
|
+
exports.AnimationColorCurve = __decorate([
|
|
21607
22237
|
StaticInterfaceImplement()
|
|
21608
22238
|
], exports.AnimationColorCurve);
|
|
21609
22239
|
|
|
21610
22240
|
var _AnimationFloatArrayCurve;
|
|
21611
22241
|
exports.AnimationFloatArrayCurve = (_AnimationFloatArrayCurve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21612
|
-
|
|
22242
|
+
_inherits(AnimationFloatArrayCurve, AnimationCurve);
|
|
21613
22243
|
function AnimationFloatArrayCurve() {
|
|
21614
22244
|
return AnimationCurve.apply(this, arguments);
|
|
21615
22245
|
}
|
|
@@ -21704,14 +22334,18 @@ exports.AnimationFloatArrayCurve = (_AnimationFloatArrayCurve = /*#__PURE__*/ fu
|
|
|
21704
22334
|
return out;
|
|
21705
22335
|
};
|
|
21706
22336
|
return AnimationFloatArrayCurve;
|
|
21707
|
-
}(AnimationCurve),
|
|
21708
|
-
|
|
22337
|
+
}(AnimationCurve), function() {
|
|
22338
|
+
/** @internal */ _AnimationFloatArrayCurve._isReferenceType = true;
|
|
22339
|
+
}(), function() {
|
|
22340
|
+
/** @internal */ _AnimationFloatArrayCurve._isInterpolationType = true;
|
|
22341
|
+
}(), _AnimationFloatArrayCurve);
|
|
22342
|
+
exports.AnimationFloatArrayCurve = __decorate([
|
|
21709
22343
|
StaticInterfaceImplement()
|
|
21710
22344
|
], exports.AnimationFloatArrayCurve);
|
|
21711
22345
|
|
|
21712
22346
|
var _AnimationFloatCurve;
|
|
21713
22347
|
exports.AnimationFloatCurve = (_AnimationFloatCurve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21714
|
-
|
|
22348
|
+
_inherits(AnimationFloatCurve, AnimationCurve);
|
|
21715
22349
|
function AnimationFloatCurve() {
|
|
21716
22350
|
var _this;
|
|
21717
22351
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -21774,14 +22408,18 @@ exports.AnimationFloatCurve = (_AnimationFloatCurve = /*#__PURE__*/ function(Ani
|
|
|
21774
22408
|
}
|
|
21775
22409
|
};
|
|
21776
22410
|
return AnimationFloatCurve;
|
|
21777
|
-
}(AnimationCurve),
|
|
21778
|
-
|
|
22411
|
+
}(AnimationCurve), function() {
|
|
22412
|
+
/** @internal */ _AnimationFloatCurve._isReferenceType = false;
|
|
22413
|
+
}(), function() {
|
|
22414
|
+
/** @internal */ _AnimationFloatCurve._isInterpolationType = true;
|
|
22415
|
+
}(), _AnimationFloatCurve);
|
|
22416
|
+
exports.AnimationFloatCurve = __decorate([
|
|
21779
22417
|
StaticInterfaceImplement()
|
|
21780
22418
|
], exports.AnimationFloatCurve);
|
|
21781
22419
|
|
|
21782
22420
|
var _AnimationQuaternionCurve;
|
|
21783
22421
|
exports.AnimationQuaternionCurve = (_AnimationQuaternionCurve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21784
|
-
|
|
22422
|
+
_inherits(AnimationQuaternionCurve1, AnimationCurve);
|
|
21785
22423
|
function AnimationQuaternionCurve1() {
|
|
21786
22424
|
var _this;
|
|
21787
22425
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -21877,14 +22515,20 @@ exports.AnimationQuaternionCurve = (_AnimationQuaternionCurve = /*#__PURE__*/ fu
|
|
|
21877
22515
|
return out;
|
|
21878
22516
|
};
|
|
21879
22517
|
return AnimationQuaternionCurve1;
|
|
21880
|
-
}(AnimationCurve),
|
|
21881
|
-
|
|
22518
|
+
}(AnimationCurve), function() {
|
|
22519
|
+
/** @internal */ _AnimationQuaternionCurve._isInterpolationType = true;
|
|
22520
|
+
}(), function() {
|
|
22521
|
+
/** @internal */ _AnimationQuaternionCurve._isReferenceType = true;
|
|
22522
|
+
}(), function() {
|
|
22523
|
+
/** @internal */ _AnimationQuaternionCurve._tempConjugateQuat = new engineMath.Quaternion();
|
|
22524
|
+
}(), _AnimationQuaternionCurve);
|
|
22525
|
+
exports.AnimationQuaternionCurve = __decorate([
|
|
21882
22526
|
StaticInterfaceImplement()
|
|
21883
22527
|
], exports.AnimationQuaternionCurve);
|
|
21884
22528
|
|
|
21885
22529
|
var _AnimationVector2Curve;
|
|
21886
22530
|
exports.AnimationVector2Curve = (_AnimationVector2Curve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21887
|
-
|
|
22531
|
+
_inherits(AnimationVector2Curve, AnimationCurve);
|
|
21888
22532
|
function AnimationVector2Curve() {
|
|
21889
22533
|
var _this;
|
|
21890
22534
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -21963,14 +22607,18 @@ exports.AnimationVector2Curve = (_AnimationVector2Curve = /*#__PURE__*/ function
|
|
|
21963
22607
|
return out;
|
|
21964
22608
|
};
|
|
21965
22609
|
return AnimationVector2Curve;
|
|
21966
|
-
}(AnimationCurve),
|
|
21967
|
-
|
|
22610
|
+
}(AnimationCurve), function() {
|
|
22611
|
+
/** @internal */ _AnimationVector2Curve._isReferenceType = true;
|
|
22612
|
+
}(), function() {
|
|
22613
|
+
/** @internal */ _AnimationVector2Curve._isInterpolationType = true;
|
|
22614
|
+
}(), _AnimationVector2Curve);
|
|
22615
|
+
exports.AnimationVector2Curve = __decorate([
|
|
21968
22616
|
StaticInterfaceImplement()
|
|
21969
22617
|
], exports.AnimationVector2Curve);
|
|
21970
22618
|
|
|
21971
22619
|
var _AnimationVector3Curve;
|
|
21972
22620
|
exports.AnimationVector3Curve = (_AnimationVector3Curve = /*#__PURE__*/ function(AnimationCurve) {
|
|
21973
|
-
|
|
22621
|
+
_inherits(AnimationVector3Curve, AnimationCurve);
|
|
21974
22622
|
function AnimationVector3Curve() {
|
|
21975
22623
|
var _this;
|
|
21976
22624
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -22061,14 +22709,18 @@ exports.AnimationVector3Curve = (_AnimationVector3Curve = /*#__PURE__*/ function
|
|
|
22061
22709
|
return out;
|
|
22062
22710
|
};
|
|
22063
22711
|
return AnimationVector3Curve;
|
|
22064
|
-
}(AnimationCurve),
|
|
22065
|
-
|
|
22712
|
+
}(AnimationCurve), function() {
|
|
22713
|
+
/** @internal */ _AnimationVector3Curve._isReferenceType = true;
|
|
22714
|
+
}(), function() {
|
|
22715
|
+
/** @internal */ _AnimationVector3Curve._isInterpolationType = true;
|
|
22716
|
+
}(), _AnimationVector3Curve);
|
|
22717
|
+
exports.AnimationVector3Curve = __decorate([
|
|
22066
22718
|
StaticInterfaceImplement()
|
|
22067
22719
|
], exports.AnimationVector3Curve);
|
|
22068
22720
|
|
|
22069
22721
|
var _AnimationVector4Curve;
|
|
22070
22722
|
exports.AnimationVector4Curve = (_AnimationVector4Curve = /*#__PURE__*/ function(AnimationCurve) {
|
|
22071
|
-
|
|
22723
|
+
_inherits(AnimationVector4Curve, AnimationCurve);
|
|
22072
22724
|
function AnimationVector4Curve() {
|
|
22073
22725
|
var _this;
|
|
22074
22726
|
_this = AnimationCurve.call(this) || this;
|
|
@@ -22159,16 +22811,24 @@ exports.AnimationVector4Curve = (_AnimationVector4Curve = /*#__PURE__*/ function
|
|
|
22159
22811
|
return out;
|
|
22160
22812
|
};
|
|
22161
22813
|
return AnimationVector4Curve;
|
|
22162
|
-
}(AnimationCurve),
|
|
22163
|
-
|
|
22814
|
+
}(AnimationCurve), function() {
|
|
22815
|
+
/** @internal */ _AnimationVector4Curve._isReferenceType = true;
|
|
22816
|
+
}(), function() {
|
|
22817
|
+
/** @internal */ _AnimationVector4Curve._isInterpolationType = true;
|
|
22818
|
+
}(), _AnimationVector4Curve);
|
|
22819
|
+
exports.AnimationVector4Curve = __decorate([
|
|
22164
22820
|
StaticInterfaceImplement()
|
|
22165
22821
|
], exports.AnimationVector4Curve);
|
|
22166
22822
|
|
|
22823
|
+
/**
|
|
22824
|
+
* Animator culling mode.
|
|
22825
|
+
*/ exports.AnimatorCullingMode = void 0;
|
|
22167
22826
|
(function(AnimatorCullingMode) {
|
|
22168
22827
|
AnimatorCullingMode[AnimatorCullingMode[/** Disable Culling. */ "None"] = 0] = "None";
|
|
22169
22828
|
AnimatorCullingMode[AnimatorCullingMode[/** Completely disabled when renderers are all culled. */ "Complete"] = 1] = "Complete";
|
|
22170
22829
|
})(exports.AnimatorCullingMode || (exports.AnimatorCullingMode = {}));
|
|
22171
22830
|
|
|
22831
|
+
exports.AnimatorLayerBlendingMode = void 0;
|
|
22172
22832
|
(function(AnimatorLayerBlendingMode) {
|
|
22173
22833
|
AnimatorLayerBlendingMode[AnimatorLayerBlendingMode["Override"] = 0] = "Override";
|
|
22174
22834
|
AnimatorLayerBlendingMode[AnimatorLayerBlendingMode["Additive"] = 1] = "Additive";
|
|
@@ -22215,6 +22875,9 @@ exports.AnimationVector4Curve = _ts_decorate__default['default']([
|
|
|
22215
22875
|
/** ExitTime represents the exact time at which the transition can take effect. This is represented in normalized time. */ this.exitTime = 1;
|
|
22216
22876
|
};
|
|
22217
22877
|
|
|
22878
|
+
/**
|
|
22879
|
+
* Animation wrap mode.
|
|
22880
|
+
*/ exports.WrapMode = void 0;
|
|
22218
22881
|
(function(WrapMode) {
|
|
22219
22882
|
WrapMode[WrapMode[/** Play once */ "Once"] = 0] = "Once";
|
|
22220
22883
|
WrapMode[WrapMode[/** Loop play */ "Loop"] = 1] = "Loop";
|
|
@@ -22286,11 +22949,10 @@ exports.AnimationVector4Curve = _ts_decorate__default['default']([
|
|
|
22286
22949
|
this.eventHandlers = [];
|
|
22287
22950
|
};
|
|
22288
22951
|
|
|
22289
|
-
var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
|
|
22290
22952
|
/**
|
|
22291
22953
|
* The controller of the animation system.
|
|
22292
22954
|
*/ var Animator = /*#__PURE__*/ function(Component) {
|
|
22293
|
-
|
|
22955
|
+
_inherits(Animator, Component);
|
|
22294
22956
|
function Animator(entity) {
|
|
22295
22957
|
var _this;
|
|
22296
22958
|
_this = Component.call(this, entity) || this;
|
|
@@ -22479,6 +23141,7 @@ var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPo
|
|
|
22479
23141
|
var curve = curves[i];
|
|
22480
23142
|
var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
|
|
22481
23143
|
if (targetEntity) {
|
|
23144
|
+
var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
|
|
22482
23145
|
var property = curve.property;
|
|
22483
23146
|
var instanceId = targetEntity.instanceId;
|
|
22484
23147
|
// Get owner
|
|
@@ -22912,7 +23575,7 @@ var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPo
|
|
|
22912
23575
|
}
|
|
22913
23576
|
owner.updateMark = this._updateMark;
|
|
22914
23577
|
};
|
|
22915
|
-
|
|
23578
|
+
_create_class(Animator, [
|
|
22916
23579
|
{
|
|
22917
23580
|
key: "animatorController",
|
|
22918
23581
|
get: /**
|
|
@@ -22932,28 +23595,28 @@ var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPo
|
|
|
22932
23595
|
]);
|
|
22933
23596
|
return Animator;
|
|
22934
23597
|
}(Component);
|
|
22935
|
-
|
|
23598
|
+
__decorate([
|
|
22936
23599
|
assignmentClone
|
|
22937
23600
|
], Animator.prototype, "speed", void 0);
|
|
22938
|
-
|
|
23601
|
+
__decorate([
|
|
22939
23602
|
ignoreClone
|
|
22940
23603
|
], Animator.prototype, "_controllerUpdateFlag", void 0);
|
|
22941
|
-
|
|
23604
|
+
__decorate([
|
|
22942
23605
|
ignoreClone
|
|
22943
23606
|
], Animator.prototype, "_updateMark", void 0);
|
|
22944
|
-
|
|
23607
|
+
__decorate([
|
|
22945
23608
|
ignoreClone
|
|
22946
23609
|
], Animator.prototype, "_animatorLayersData", void 0);
|
|
22947
|
-
|
|
23610
|
+
__decorate([
|
|
22948
23611
|
ignoreClone
|
|
22949
23612
|
], Animator.prototype, "_curveOwnerPool", void 0);
|
|
22950
|
-
|
|
23613
|
+
__decorate([
|
|
22951
23614
|
ignoreClone
|
|
22952
23615
|
], Animator.prototype, "_animationEventHandlerPool", void 0);
|
|
22953
|
-
|
|
23616
|
+
__decorate([
|
|
22954
23617
|
ignoreClone
|
|
22955
23618
|
], Animator.prototype, "_tempAnimatorStateInfo", void 0);
|
|
22956
|
-
|
|
23619
|
+
__decorate([
|
|
22957
23620
|
ignoreClone
|
|
22958
23621
|
], Animator.prototype, "_controlledRenderers", void 0);
|
|
22959
23622
|
|
|
@@ -23003,7 +23666,7 @@ _ts_decorate__default['default']([
|
|
|
23003
23666
|
*/ _proto._registerChangeFlag = function _registerChangeFlag() {
|
|
23004
23667
|
return this._updateFlagManager.createFlag(BoolUpdateFlag);
|
|
23005
23668
|
};
|
|
23006
|
-
|
|
23669
|
+
_create_class(AnimatorController, [
|
|
23007
23670
|
{
|
|
23008
23671
|
key: "layers",
|
|
23009
23672
|
get: /**
|
|
@@ -23137,7 +23800,7 @@ _ts_decorate__default['default']([
|
|
|
23137
23800
|
index2 !== -1 && this._onStateExitScripts.splice(index2, 1);
|
|
23138
23801
|
}
|
|
23139
23802
|
};
|
|
23140
|
-
|
|
23803
|
+
_create_class(AnimatorState, [
|
|
23141
23804
|
{
|
|
23142
23805
|
key: "transitions",
|
|
23143
23806
|
get: /**
|
|
@@ -23240,6 +23903,7 @@ _ts_decorate__default['default']([
|
|
|
23240
23903
|
return AnimatorStateMachine;
|
|
23241
23904
|
}();
|
|
23242
23905
|
|
|
23906
|
+
exports.AnimatorConditionMode = void 0;
|
|
23243
23907
|
(function(AnimatorConditionMode) {
|
|
23244
23908
|
AnimatorConditionMode[AnimatorConditionMode["If"] = 0] = "If";
|
|
23245
23909
|
AnimatorConditionMode[AnimatorConditionMode["IfNot"] = 1] = "IfNot";
|
|
@@ -23258,7 +23922,7 @@ _ts_decorate__default['default']([
|
|
|
23258
23922
|
/**
|
|
23259
23923
|
* SkyboxMaterial
|
|
23260
23924
|
*/ var SkyBoxMaterial = /*#__PURE__*/ function(Material) {
|
|
23261
|
-
|
|
23925
|
+
_inherits(SkyBoxMaterial, Material);
|
|
23262
23926
|
function SkyBoxMaterial(engine) {
|
|
23263
23927
|
var _this;
|
|
23264
23928
|
_this = Material.call(this, engine, Shader.find("skybox")) || this;
|
|
@@ -23268,7 +23932,7 @@ _ts_decorate__default['default']([
|
|
|
23268
23932
|
_this.shaderData.setVector4("u_cubeDecodeParam", _this._decodeParam);
|
|
23269
23933
|
return _this;
|
|
23270
23934
|
}
|
|
23271
|
-
|
|
23935
|
+
_create_class(SkyBoxMaterial, [
|
|
23272
23936
|
{
|
|
23273
23937
|
key: "textureDecodeRGBM",
|
|
23274
23938
|
get: /**
|
|
@@ -23321,6 +23985,7 @@ var DirtyFlagType;
|
|
|
23321
23985
|
DirtyFlagType[DirtyFlagType["Scale"] = 0x400] = "Scale";
|
|
23322
23986
|
DirtyFlagType[DirtyFlagType["Everything"] = 0xffffffff] = "Everything";
|
|
23323
23987
|
})(DirtyFlagType || (DirtyFlagType = {}));
|
|
23988
|
+
exports.ParticleRendererBlendMode = void 0;
|
|
23324
23989
|
(function(ParticleRendererBlendMode) {
|
|
23325
23990
|
ParticleRendererBlendMode[ParticleRendererBlendMode["Transparent"] = 0] = "Transparent";
|
|
23326
23991
|
ParticleRendererBlendMode[ParticleRendererBlendMode["Additive"] = 1] = "Additive";
|
|
@@ -23328,7 +23993,7 @@ var DirtyFlagType;
|
|
|
23328
23993
|
/**
|
|
23329
23994
|
* Particle Renderer Component.
|
|
23330
23995
|
*/ var ParticleRenderer = /*#__PURE__*/ function(MeshRenderer) {
|
|
23331
|
-
|
|
23996
|
+
_inherits(ParticleRenderer, MeshRenderer);
|
|
23332
23997
|
function ParticleRenderer(props) {
|
|
23333
23998
|
var _this;
|
|
23334
23999
|
_this = MeshRenderer.call(this, props) || this;
|
|
@@ -23366,7 +24031,7 @@ var DirtyFlagType;
|
|
|
23366
24031
|
_this._isFadeOut = false;
|
|
23367
24032
|
_this._playOnEnable = true;
|
|
23368
24033
|
_this._blendMode = 0;
|
|
23369
|
-
_this._onColorChanged = _this._onColorChanged.bind(
|
|
24034
|
+
_this._onColorChanged = _this._onColorChanged.bind(_assert_this_initialized(_this));
|
|
23370
24035
|
//@ts-ignore
|
|
23371
24036
|
_this._color._onValueChanged = _this._onColorChanged;
|
|
23372
24037
|
_this.setMaterial(_this._createMaterial());
|
|
@@ -23643,7 +24308,7 @@ var DirtyFlagType;
|
|
|
23643
24308
|
ParticleRenderer._getRandom = function _getRandom() {
|
|
23644
24309
|
return Math.random() - 0.5;
|
|
23645
24310
|
};
|
|
23646
|
-
|
|
24311
|
+
_create_class(ParticleRenderer, [
|
|
23647
24312
|
{
|
|
23648
24313
|
key: "texture",
|
|
23649
24314
|
get: /**
|
|
@@ -24074,8 +24739,10 @@ var DirtyFlagType;
|
|
|
24074
24739
|
]);
|
|
24075
24740
|
return ParticleRenderer;
|
|
24076
24741
|
}(MeshRenderer);
|
|
24077
|
-
|
|
24078
|
-
|
|
24742
|
+
(function() {
|
|
24743
|
+
/** The max number of indices that Uint16Array can support. */ ParticleRenderer._uint16VertexLimit = 65535;
|
|
24744
|
+
})();
|
|
24745
|
+
__decorate([
|
|
24079
24746
|
ignoreClone
|
|
24080
24747
|
], ParticleRenderer.prototype, "_onColorChanged", null);
|
|
24081
24748
|
|
|
@@ -24085,7 +24752,7 @@ var VERT_SHADER = "#define GLSLIFY 1\nattribute vec3 POSITION;attribute vec2 TEX
|
|
|
24085
24752
|
|
|
24086
24753
|
Shader.create("trail", VERT_SHADER, FRAG_SHADER);
|
|
24087
24754
|
var TrailMaterial = /*#__PURE__*/ function(Material) {
|
|
24088
|
-
|
|
24755
|
+
_inherits(TrailMaterial, Material);
|
|
24089
24756
|
function TrailMaterial(engine) {
|
|
24090
24757
|
var _this;
|
|
24091
24758
|
_this = Material.call(this, engine, Shader.find("trail")) || this;
|
|
@@ -24103,7 +24770,7 @@ var _tempVector3 = new engineMath.Vector3();
|
|
|
24103
24770
|
/**
|
|
24104
24771
|
* @deprecated
|
|
24105
24772
|
*/ var TrailRenderer = /*#__PURE__*/ function(MeshRenderer) {
|
|
24106
|
-
|
|
24773
|
+
_inherits(TrailRenderer, MeshRenderer);
|
|
24107
24774
|
function TrailRenderer(entity, props) {
|
|
24108
24775
|
var _this;
|
|
24109
24776
|
_this = MeshRenderer.call(this, entity) || this;
|
|
@@ -24291,7 +24958,7 @@ var _tempVector3 = new engineMath.Vector3();
|
|
|
24291
24958
|
* }
|
|
24292
24959
|
* ```
|
|
24293
24960
|
*/ var Probe = /*#__PURE__*/ function(Script) {
|
|
24294
|
-
|
|
24961
|
+
_inherits(Probe, Script);
|
|
24295
24962
|
function Probe() {
|
|
24296
24963
|
var _this;
|
|
24297
24964
|
_this = Script.apply(this, arguments) || this;
|
|
@@ -24344,7 +25011,7 @@ var _tempVector3 = new engineMath.Vector3();
|
|
|
24344
25011
|
this._camera.renderTarget = this._oriCameraRenderTarget;
|
|
24345
25012
|
this._camera.cullingMask = this._oriCameraCullingMask;
|
|
24346
25013
|
};
|
|
24347
|
-
|
|
25014
|
+
_create_class(Probe, [
|
|
24348
25015
|
{
|
|
24349
25016
|
key: "_texture",
|
|
24350
25017
|
get: function get() {
|
|
@@ -24362,7 +25029,7 @@ var cacheDir = new engineMath.Vector3();
|
|
|
24362
25029
|
/**
|
|
24363
25030
|
* Cube probe, generate cubeTexture, used for dynamic environment reflection and other effects.
|
|
24364
25031
|
*/ var CubeProbe = /*#__PURE__*/ function(Probe) {
|
|
24365
|
-
|
|
25032
|
+
_inherits(CubeProbe, Probe);
|
|
24366
25033
|
function CubeProbe() {
|
|
24367
25034
|
var _this;
|
|
24368
25035
|
_this = Probe.apply(this, arguments) || this;
|