@galacean/engine-core 2.0.0-alpha.49 → 2.0.0-alpha.50
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 +89 -74
- package/dist/main.js.map +1 -1
- package/dist/module.js +89 -74
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/assembler/ISpriteRenderer.d.ts +2 -2
- package/types/2d/sprite/Sprite.d.ts +3 -3
- package/types/2d/sprite/SpriteMask.d.ts +1 -1
- package/types/2d/sprite/SpriteRenderer.d.ts +1 -1
- package/types/2d/text/CharInfo.d.ts +1 -1
- package/types/2d/text/Font.d.ts +1 -1
- package/types/2d/text/SubFont.d.ts +2 -2
- package/types/2d/text/TextRenderer.d.ts +2 -2
- package/types/Background.d.ts +2 -2
- package/types/Camera.d.ts +3 -3
- package/types/Component.d.ts +2 -2
- package/types/Engine.d.ts +1 -1
- package/types/Entity.d.ts +19 -19
- package/types/RenderPipeline/Blitter.d.ts +1 -1
- package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -1
- package/types/RenderPipeline/PipelineUtils.d.ts +1 -1
- package/types/RenderPipeline/PrimitiveChunkManager.d.ts +1 -1
- package/types/RenderPipeline/RenderContext.d.ts +5 -5
- package/types/RenderPipeline/VertexArea.d.ts +2 -2
- package/types/Renderer.d.ts +8 -8
- package/types/Scene.d.ts +7 -8
- package/types/SceneManager.d.ts +5 -6
- package/types/Utils.d.ts +1 -1
- package/types/animation/AnimationClipCurveBinding.d.ts +1 -1
- package/types/animation/AnimationEvent.d.ts +2 -2
- package/types/animation/Animator.d.ts +1 -1
- package/types/animation/AnimatorController.d.ts +2 -2
- package/types/animation/AnimatorControllerParameter.d.ts +1 -1
- package/types/animation/AnimatorState.d.ts +3 -3
- package/types/animation/AnimatorStateInstance.d.ts +1 -1
- package/types/animation/AnimatorStateTransition.d.ts +1 -1
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/animationCurve/AnimationCurve.d.ts +2 -2
- package/types/animation/animationCurve/AnimationRefCurve.d.ts +4 -4
- package/types/animation/internal/AnimatorLayerData.d.ts +1 -1
- package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +4 -4
- package/types/asset/AssetPromise.d.ts +4 -4
- package/types/asset/JSONAsset.d.ts +1 -1
- package/types/asset/Loader.d.ts +2 -2
- package/types/asset/ResourceManager.d.ts +1 -1
- package/types/audio/AudioClip.d.ts +1 -1
- package/types/audio/AudioSource.d.ts +2 -2
- package/types/env-probe/Probe.d.ts +1 -1
- package/types/graphic/Buffer.d.ts +2 -2
- package/types/graphic/Mesh.d.ts +2 -2
- package/types/graphic/Primitive.d.ts +5 -5
- package/types/input/keyboard/KeyboardManager.d.ts +1 -1
- package/types/input/pointer/emitter/IHitResult.d.ts +1 -1
- package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +3 -3
- package/types/lighting/KHR_lights.d.ts +13 -1
- package/types/mesh/BlendShape.d.ts +1 -1
- package/types/mesh/BlendShapeFrame.d.ts +4 -4
- package/types/mesh/BlendShapeManager.d.ts +1 -1
- package/types/mesh/BufferMesh.d.ts +2 -2
- package/types/mesh/ModelMesh.d.ts +4 -4
- package/types/mesh/PrimitiveMesh.d.ts +1 -1
- package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
- package/types/particle/ParticleGenerator.d.ts +1 -1
- package/types/particle/modules/ParticleCompositeCurve.d.ts +2 -2
- package/types/particle/modules/ParticleCompositeGradient.d.ts +1 -1
- package/types/particle/modules/ParticleGeneratorModule.d.ts +1 -1
- package/types/particle/modules/ParticleGradient.d.ts +4 -4
- package/types/particle/modules/SubEmitter.d.ts +2 -2
- package/types/particle/modules/shape/MeshShape.d.ts +2 -2
- package/types/particle/modules/shape/ShapeUtils.d.ts +1 -1
- package/types/physics/HitResult.d.ts +2 -2
- package/types/physics/joint/Joint.d.ts +3 -3
- package/types/physics/shape/ColliderShape.d.ts +3 -3
- package/types/physics/shape/MeshColliderShape.d.ts +2 -2
- package/types/postProcess/PostProcess.d.ts +6 -6
- package/types/postProcess/PostProcessEffectParameter.d.ts +2 -2
- package/types/postProcess/PostProcessManager.d.ts +1 -1
- package/types/postProcess/PostProcessPass.d.ts +2 -2
- package/types/shader/Shader.d.ts +8 -8
- package/types/shader/ShaderData.d.ts +3 -3
- package/types/shader/ShaderMacro.d.ts +2 -2
- package/types/shader/state/BlendState.d.ts +1 -1
- package/types/shader/state/DepthState.d.ts +1 -1
- package/types/shader/state/RasterState.d.ts +1 -1
- package/types/shader/state/RenderState.d.ts +1 -1
- package/types/shader/state/StencilState.d.ts +1 -1
- package/types/sky/Sky.d.ts +4 -4
- package/types/texture/RenderTarget.d.ts +3 -3
- package/types/utils/DisorderedArray.d.ts +1 -1
- package/types/xr/XRManager.d.ts +2 -2
package/dist/module.js
CHANGED
|
@@ -597,12 +597,12 @@ var AssetPromise = /*#__PURE__*/ function() {
|
|
|
597
597
|
var completeProgress = this._taskCompleteProgress;
|
|
598
598
|
var detailProgress = this._taskDetailProgress;
|
|
599
599
|
if (completeProgress) {
|
|
600
|
-
onTaskComplete(completeProgress.loaded, completeProgress.total);
|
|
600
|
+
onTaskComplete == null ? void 0 : onTaskComplete(completeProgress.loaded, completeProgress.total);
|
|
601
601
|
}
|
|
602
602
|
if (detailProgress) {
|
|
603
603
|
for(var url in detailProgress){
|
|
604
604
|
var _detailProgress_url = detailProgress[url], loaded = _detailProgress_url.loaded, total = _detailProgress_url.total;
|
|
605
|
-
onTaskDetail(url, loaded, total);
|
|
605
|
+
onTaskDetail == null ? void 0 : onTaskDetail(url, loaded, total);
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
if (this._state === "pending") {
|
|
@@ -3584,7 +3584,8 @@ var TiledSpriteAssembler = /*#__PURE__*/ function() {
|
|
|
3584
3584
|
}
|
|
3585
3585
|
};
|
|
3586
3586
|
TiledSpriteAssembler._calculateDividing = function _calculateDividing(renderer, width, height, rPos, cPos, rUV, cUV, referenceResolutionPerUnit) {
|
|
3587
|
-
var sprite = renderer.sprite
|
|
3587
|
+
var sprite = renderer.sprite;
|
|
3588
|
+
var threshold = renderer.tiledAdaptiveThreshold;
|
|
3588
3589
|
var border = sprite.border;
|
|
3589
3590
|
var spritePositions = sprite._getPositions();
|
|
3590
3591
|
var _spritePositions_ = spritePositions[0], left = _spritePositions_.x, bottom = _spritePositions_.y;
|
|
@@ -3760,7 +3761,7 @@ TiledSpriteAssembler = __decorate([
|
|
|
3760
3761
|
/**
|
|
3761
3762
|
* @internal
|
|
3762
3763
|
*/ _proto._addSprite = function _addSprite(sprite) {
|
|
3763
|
-
this._spriteNamesToIndex[sprite.name] = this._sprites.push(sprite) - 1;
|
|
3764
|
+
this._spriteNamesToIndex[String(sprite.name)] = this._sprites.push(sprite) - 1;
|
|
3764
3765
|
sprite._atlas = this;
|
|
3765
3766
|
sprite.isGCIgnored = true;
|
|
3766
3767
|
};
|
|
@@ -4975,7 +4976,7 @@ var ActiveChangeFlag = /*#__PURE__*/ function(ActiveChangeFlag) {
|
|
|
4975
4976
|
{
|
|
4976
4977
|
key: "scene",
|
|
4977
4978
|
get: /**
|
|
4978
|
-
* The scene
|
|
4979
|
+
* The owning entity's scene, or null/undefined if it is not in a scene.
|
|
4979
4980
|
*/ function get() {
|
|
4980
4981
|
return this._entity.scene;
|
|
4981
4982
|
}
|
|
@@ -6323,17 +6324,17 @@ function _construct(Parent, args, Class) {
|
|
|
6323
6324
|
child._setParent(null);
|
|
6324
6325
|
};
|
|
6325
6326
|
/**
|
|
6327
|
+
* Get a child entity by index.
|
|
6328
|
+
* @param index - The zero-based child index
|
|
6329
|
+
* @returns The child at the index, or undefined if none exists
|
|
6326
6330
|
* @deprecated Please use `children` property instead.
|
|
6327
|
-
* Find child entity by index.
|
|
6328
|
-
* @param index - The index of the child entity
|
|
6329
|
-
* @returns The entity that was found
|
|
6330
6331
|
*/ _proto.getChild = function getChild(index) {
|
|
6331
6332
|
return this._children[index];
|
|
6332
6333
|
};
|
|
6333
6334
|
/**
|
|
6334
|
-
* Find entity
|
|
6335
|
+
* Find the first entity with the given name in this entity and its descendants.
|
|
6335
6336
|
* @param name - The name of the entity to find
|
|
6336
|
-
* @returns The entity
|
|
6337
|
+
* @returns The first matching entity, or null if none is found
|
|
6337
6338
|
*/ _proto.findByName = function findByName(name) {
|
|
6338
6339
|
if (name === this.name) {
|
|
6339
6340
|
return this;
|
|
@@ -6348,9 +6349,9 @@ function _construct(Parent, args, Class) {
|
|
|
6348
6349
|
return null;
|
|
6349
6350
|
};
|
|
6350
6351
|
/**
|
|
6351
|
-
* Find
|
|
6352
|
-
* @param path - The path
|
|
6353
|
-
* @returns The entity
|
|
6352
|
+
* Find a descendant by its path relative to this entity.
|
|
6353
|
+
* @param path - The entity path, with names separated by "/"
|
|
6354
|
+
* @returns The matching entity, this entity for an empty path, or null if none is found
|
|
6354
6355
|
*/ _proto.findByPath = function findByPath(path) {
|
|
6355
6356
|
var splits = path.split("/").filter(Boolean);
|
|
6356
6357
|
if (!splits.length) {
|
|
@@ -6819,7 +6820,7 @@ function _construct(Parent, args, Class) {
|
|
|
6819
6820
|
{
|
|
6820
6821
|
key: "parent",
|
|
6821
6822
|
get: /**
|
|
6822
|
-
* The parent entity.
|
|
6823
|
+
* The parent entity, or null if this entity has no parent.
|
|
6823
6824
|
*/ function get() {
|
|
6824
6825
|
return this._parent;
|
|
6825
6826
|
},
|
|
@@ -6847,7 +6848,7 @@ function _construct(Parent, args, Class) {
|
|
|
6847
6848
|
{
|
|
6848
6849
|
key: "scene",
|
|
6849
6850
|
get: /**
|
|
6850
|
-
* The scene
|
|
6851
|
+
* The owning scene, or null/undefined if this entity is not in a scene.
|
|
6851
6852
|
*/ function get() {
|
|
6852
6853
|
return this._scene;
|
|
6853
6854
|
}
|
|
@@ -7511,8 +7512,9 @@ var Renderer = /*#__PURE__*/ function(Component) {
|
|
|
7511
7512
|
var materials = this._materials;
|
|
7512
7513
|
var materialsInstance = this._materialsInstanced;
|
|
7513
7514
|
for(var i = 0, n = materials.length; i < n; i++){
|
|
7514
|
-
|
|
7515
|
-
|
|
7515
|
+
var material = materials[i];
|
|
7516
|
+
if (material && !materialsInstance[i]) {
|
|
7517
|
+
this._createInstanceMaterial(material, i);
|
|
7516
7518
|
}
|
|
7517
7519
|
}
|
|
7518
7520
|
return materials;
|
|
@@ -14622,7 +14624,8 @@ __decorate([
|
|
|
14622
14624
|
* @internal
|
|
14623
14625
|
*/ _proto._updateVertexBuffers = function _updateVertexBuffers(vertexCount, force) {
|
|
14624
14626
|
var _this = this, blendShapes = _this._blendShapes, maxCountSingleBuffer = _this._maxCountSingleVertexBuffer;
|
|
14625
|
-
var _this1 = this,
|
|
14627
|
+
var _this1 = this, vertexBuffers = _this1._vertexBuffers, storeInfos = _this1._storeInVertexBufferInfo;
|
|
14628
|
+
var vertices = this._vertices;
|
|
14626
14629
|
var subDataDirtyFlags = this._subDataDirtyFlags;
|
|
14627
14630
|
var blendShapeFloatStride = this._vertexElementCount * 3;
|
|
14628
14631
|
var blendShapeByteStride = blendShapeFloatStride * 4;
|
|
@@ -14695,7 +14698,8 @@ __decorate([
|
|
|
14695
14698
|
}
|
|
14696
14699
|
};
|
|
14697
14700
|
_proto._updateTextureArray = function _updateTextureArray(vertexCount, force) {
|
|
14698
|
-
var _this = this, blendShapes = _this._blendShapes, vertexTexture = _this._vertexTexture,
|
|
14701
|
+
var _this = this, blendShapes = _this._blendShapes, vertexTexture = _this._vertexTexture, subDataDirtyFlags = _this._subDataDirtyFlags;
|
|
14702
|
+
var vertices = this._vertices;
|
|
14699
14703
|
for(var i = 0, n = blendShapes.length; i < n; i++){
|
|
14700
14704
|
var subDirtyFlag = subDataDirtyFlags[i];
|
|
14701
14705
|
var subBlendShapeDataStride = vertexTexture.width * vertexTexture.height * 4;
|
|
@@ -14706,7 +14710,8 @@ __decorate([
|
|
|
14706
14710
|
if (frameCount > 0 && endFrame.deltaPositions.length !== vertexCount) {
|
|
14707
14711
|
throw "BlendShape frame deltaPositions length must same with mesh vertexCount.";
|
|
14708
14712
|
}
|
|
14709
|
-
var
|
|
14713
|
+
var deltaNormals = endFrame.deltaNormals, deltaTangents = endFrame.deltaTangents;
|
|
14714
|
+
var deltaPositions = endFrame.deltaPositions;
|
|
14710
14715
|
var offset = i * subBlendShapeDataStride;
|
|
14711
14716
|
for(var j = 0; j < vertexCount; j++){
|
|
14712
14717
|
var position = deltaPositions[j];
|
|
@@ -17255,7 +17260,7 @@ var SkinUpdateFlag = /*#__PURE__*/ function(SkinUpdateFlag) {
|
|
|
17255
17260
|
};
|
|
17256
17261
|
_proto._update = function _update(context) {
|
|
17257
17262
|
var skin = this.skin;
|
|
17258
|
-
if (
|
|
17263
|
+
if (skin && skin.bones.length > 0) {
|
|
17259
17264
|
skin._updateSkinMatrices(this);
|
|
17260
17265
|
}
|
|
17261
17266
|
var shaderData = this.shaderData;
|
|
@@ -18398,19 +18403,20 @@ registerDefaultCloneMode(SafeLoopArray, CloneMode.Ignore);
|
|
|
18398
18403
|
index = scenes.length;
|
|
18399
18404
|
scene = indexOrScene;
|
|
18400
18405
|
}
|
|
18401
|
-
|
|
18406
|
+
var targetScene = scene;
|
|
18407
|
+
if (targetScene.engine !== this.engine) {
|
|
18402
18408
|
throw "The scene is not belong to this engine.";
|
|
18403
18409
|
}
|
|
18404
|
-
if (
|
|
18405
|
-
var currentIndex = scenes.indexOf(
|
|
18410
|
+
if (targetScene._sceneManager) {
|
|
18411
|
+
var currentIndex = scenes.indexOf(targetScene);
|
|
18406
18412
|
if (currentIndex !== index) {
|
|
18407
18413
|
scenes.removeByIndex(currentIndex);
|
|
18408
|
-
scenes.add(index,
|
|
18414
|
+
scenes.add(index, targetScene);
|
|
18409
18415
|
}
|
|
18410
18416
|
} else {
|
|
18411
|
-
|
|
18412
|
-
scenes.add(index,
|
|
18413
|
-
|
|
18417
|
+
targetScene._sceneManager = this;
|
|
18418
|
+
scenes.add(index, targetScene);
|
|
18419
|
+
targetScene.isActive && targetScene._processActive(true);
|
|
18414
18420
|
}
|
|
18415
18421
|
};
|
|
18416
18422
|
/**
|
|
@@ -18480,10 +18486,9 @@ registerDefaultCloneMode(SafeLoopArray, CloneMode.Ignore);
|
|
|
18480
18486
|
{
|
|
18481
18487
|
key: "activeScene",
|
|
18482
18488
|
get: /**
|
|
18483
|
-
*
|
|
18484
|
-
*
|
|
18485
|
-
*
|
|
18486
|
-
* Get the first scene.
|
|
18489
|
+
* Get the first scene, or undefined if no scene is registered.
|
|
18490
|
+
* @remarks Assigning null or undefined removes the first scene.
|
|
18491
|
+
* @deprecated Please use `scenes` instead.
|
|
18487
18492
|
*/ function get() {
|
|
18488
18493
|
return this._scenes.getArray()[0];
|
|
18489
18494
|
},
|
|
@@ -19055,7 +19060,7 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
19055
19060
|
};
|
|
19056
19061
|
_proto._parseURL = function _parseURL(path) {
|
|
19057
19062
|
var _path_split = path.split("?"), baseUrl = _path_split[0], searchStr = _path_split[1];
|
|
19058
|
-
var queryPath
|
|
19063
|
+
var queryPath;
|
|
19059
19064
|
var assetBaseURL = baseUrl;
|
|
19060
19065
|
if (searchStr) {
|
|
19061
19066
|
var params = searchStr.split("&");
|
|
@@ -21467,7 +21472,7 @@ __decorate([
|
|
|
21467
21472
|
if (!shape) {
|
|
21468
21473
|
return false;
|
|
21469
21474
|
}
|
|
21470
|
-
return shape.collider.collisionLayer & mask && shape.isSceneQuery;
|
|
21475
|
+
return (shape.collider.collisionLayer & mask) !== 0 && shape.isSceneQuery;
|
|
21471
21476
|
};
|
|
21472
21477
|
};
|
|
21473
21478
|
_proto._createHitCallback = function _createHitCallback(outHitResult) {
|
|
@@ -24253,7 +24258,7 @@ Sky._projectionMatrix = new Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, Sky._epsilon -
|
|
|
24253
24258
|
* @internal
|
|
24254
24259
|
*/ _proto._resizeBackgroundTexture = function _resizeBackgroundTexture() {
|
|
24255
24260
|
var _this = this, texture = _this._texture, mesh = _this._mesh;
|
|
24256
|
-
if (!
|
|
24261
|
+
if (!texture) {
|
|
24257
24262
|
return;
|
|
24258
24263
|
}
|
|
24259
24264
|
var _this__engine_canvas = this._engine.canvas, width = _this__engine_canvas.width, height = _this__engine_canvas.height;
|
|
@@ -25249,7 +25254,8 @@ Camera = __decorate([
|
|
|
25249
25254
|
_proto.onRender = function onRender(context) {
|
|
25250
25255
|
var engine = this.engine;
|
|
25251
25256
|
var camera = context.camera;
|
|
25252
|
-
camera.viewport; var
|
|
25257
|
+
camera.viewport; var pixelViewport = camera.pixelViewport;
|
|
25258
|
+
var scene = camera.scene;
|
|
25253
25259
|
var ambientOcclusion = scene.ambientOcclusion;
|
|
25254
25260
|
var shaderData = this._material.shaderData;
|
|
25255
25261
|
var projectionMatrix = context.projectionMatrix;
|
|
@@ -25278,7 +25284,8 @@ Camera = __decorate([
|
|
|
25278
25284
|
var farPlaneOverEdgeDistance = -camera.farClipPlane / ambientOcclusion.bilateralThreshold;
|
|
25279
25285
|
shaderData.setFloat(ScalableAmbientObscurancePass._projectionScaleRadiusProp, radius * projectionScale);
|
|
25280
25286
|
shaderData.setFloat(ScalableAmbientObscurancePass._farPlaneOverEdgeDistanceProp, farPlaneOverEdgeDistance);
|
|
25281
|
-
var _this = this,
|
|
25287
|
+
var _this = this, material = _this._material;
|
|
25288
|
+
var saoTarget = this._saoRenderTarget;
|
|
25282
25289
|
// Draw ambient occlusion texture
|
|
25283
25290
|
var sourceTexture = this._depthRenderTarget.depthTexture;
|
|
25284
25291
|
Blitter.blitTexture(engine, sourceTexture, saoTarget, 0, undefined, material, 0);
|
|
@@ -25382,7 +25389,7 @@ ScalableAmbientObscurancePass._kernelProp = ShaderProperty.getByName("material_k
|
|
|
25382
25389
|
/**
|
|
25383
25390
|
* Get the PostProcessEffect by type.
|
|
25384
25391
|
* @param type - The type of PostProcessEffect
|
|
25385
|
-
* @returns The
|
|
25392
|
+
* @returns The effect, or `undefined` if none matches.
|
|
25386
25393
|
*/ _proto.getEffect = function getEffect(type) {
|
|
25387
25394
|
var effects = this._effects;
|
|
25388
25395
|
var length = effects.length;
|
|
@@ -25397,7 +25404,7 @@ ScalableAmbientObscurancePass._kernelProp = ShaderProperty.getByName("material_k
|
|
|
25397
25404
|
* Add a PostProcessEffect to the PostProcess.
|
|
25398
25405
|
* @remarks Only one effect of the same type can be added to the PostProcess.
|
|
25399
25406
|
* @param type - The type of PostProcessEffect
|
|
25400
|
-
* @returns The
|
|
25407
|
+
* @returns The added effect, or `undefined` if the type already exists.
|
|
25401
25408
|
*/ _proto.addEffect = function addEffect(type) {
|
|
25402
25409
|
if (this.getEffect(type)) {
|
|
25403
25410
|
Logger.error('effect "' + type.name + '" already exists in the PostProcess.');
|
|
@@ -25410,7 +25417,7 @@ ScalableAmbientObscurancePass._kernelProp = ShaderProperty.getByName("material_k
|
|
|
25410
25417
|
/**
|
|
25411
25418
|
* Remove a PostProcessEffect from the PostProcess.
|
|
25412
25419
|
* @param type - The type of PostProcessEffect
|
|
25413
|
-
* @returns The
|
|
25420
|
+
* @returns The removed effect, or `undefined` if none matches.
|
|
25414
25421
|
*/ _proto.removeEffect = function removeEffect(type) {
|
|
25415
25422
|
var effects = this._effects;
|
|
25416
25423
|
var length = effects.length;
|
|
@@ -25772,7 +25779,8 @@ PostProcessManager._tempVector3 = new Vector3();
|
|
|
25772
25779
|
if (length === 0) {
|
|
25773
25780
|
return;
|
|
25774
25781
|
}
|
|
25775
|
-
var _context_camera = context.camera, engine = _context_camera.engine,
|
|
25782
|
+
var _context_camera = context.camera, engine = _context_camera.engine, cameraId = _context_camera.instanceId, cameraData = _context_camera.shaderData;
|
|
25783
|
+
var scene = context.camera.scene;
|
|
25776
25784
|
var sceneId = scene.instanceId, sceneData = scene.shaderData, maskManager = scene._maskManager;
|
|
25777
25785
|
var renderCount = engine._renderCount;
|
|
25778
25786
|
var rhi = engine._hardwareRenderer;
|
|
@@ -26818,7 +26826,8 @@ CascadedShadowCasterPass._tempMatrix0 = new Matrix();
|
|
|
26818
26826
|
*/ _proto.render = function render(context, cubeFace, mipLevel, ignoreClear) {
|
|
26819
26827
|
this._cullingResults.setRenderUpdateFlagTrue(ContextRendererUpdateFlag.All);
|
|
26820
26828
|
var camera = this._camera;
|
|
26821
|
-
var
|
|
26829
|
+
var engine = camera.engine, renderTarget = camera.renderTarget;
|
|
26830
|
+
var scene = camera.scene;
|
|
26822
26831
|
var independentCanvasEnabled = camera._isIndependentCanvasEnabled();
|
|
26823
26832
|
var rhi = engine._hardwareRenderer;
|
|
26824
26833
|
var cullingResults = this._cullingResults;
|
|
@@ -26904,7 +26913,8 @@ CascadedShadowCasterPass._tempMatrix0 = new Matrix();
|
|
|
26904
26913
|
_proto._drawRenderPass = function _drawRenderPass(context, camera, finalClearFlags, cubeFace, mipLevel) {
|
|
26905
26914
|
var cullingResults = this._cullingResults;
|
|
26906
26915
|
var opaqueQueue = cullingResults.opaqueQueue, alphaTestQueue = cullingResults.alphaTestQueue, transparentQueue = cullingResults.transparentQueue;
|
|
26907
|
-
var engine = camera.engine,
|
|
26916
|
+
var engine = camera.engine, cameraRenderTarget = camera.renderTarget;
|
|
26917
|
+
var scene = camera.scene;
|
|
26908
26918
|
var background = scene.background;
|
|
26909
26919
|
var rhi = engine._hardwareRenderer;
|
|
26910
26920
|
var internalColorTarget = this._internalColorTarget;
|
|
@@ -27578,7 +27588,7 @@ var OverlayCamera = function OverlayCamera() {
|
|
|
27578
27588
|
shaderCompiler._setIncludeMap(ShaderFactory.includeMap);
|
|
27579
27589
|
Shader._shaderCompiler = shaderCompiler;
|
|
27580
27590
|
}
|
|
27581
|
-
var initializePromises =
|
|
27591
|
+
var initializePromises = [];
|
|
27582
27592
|
if (physics) {
|
|
27583
27593
|
initializePromises.push(physics.initialize().then(function() {
|
|
27584
27594
|
if (Engine._nativePhysics) {
|
|
@@ -29073,42 +29083,43 @@ AmbientOcclusion._enableMacro = ShaderMacro.getByName("SCENE_ENABLE_AMBIENT_OCCL
|
|
|
29073
29083
|
index = undefined;
|
|
29074
29084
|
entity = indexOrChild;
|
|
29075
29085
|
}
|
|
29076
|
-
var
|
|
29077
|
-
|
|
29086
|
+
var rootEntity = entity;
|
|
29087
|
+
var isRoot = rootEntity._isRoot;
|
|
29088
|
+
// Let rootEntity become root
|
|
29078
29089
|
if (!isRoot) {
|
|
29079
|
-
|
|
29080
|
-
|
|
29081
|
-
|
|
29090
|
+
rootEntity._isRoot = true;
|
|
29091
|
+
rootEntity._removeFromParent();
|
|
29092
|
+
rootEntity._setParentChange();
|
|
29082
29093
|
}
|
|
29083
29094
|
// Add or remove from scene's rootEntities
|
|
29084
|
-
var oldScene =
|
|
29095
|
+
var oldScene = rootEntity._scene;
|
|
29085
29096
|
if (oldScene !== this) {
|
|
29086
29097
|
if (oldScene && isRoot) {
|
|
29087
|
-
Entity._removeFromChildren(oldScene._rootEntities,
|
|
29098
|
+
Entity._removeFromChildren(oldScene._rootEntities, rootEntity);
|
|
29088
29099
|
}
|
|
29089
|
-
Entity._addToChildren(this._rootEntities,
|
|
29100
|
+
Entity._addToChildren(this._rootEntities, rootEntity, index);
|
|
29090
29101
|
} else if (!isRoot) {
|
|
29091
|
-
Entity._addToChildren(this._rootEntities,
|
|
29102
|
+
Entity._addToChildren(this._rootEntities, rootEntity, index);
|
|
29092
29103
|
}
|
|
29093
|
-
// Process
|
|
29104
|
+
// Process rootEntity active/inActive
|
|
29094
29105
|
var inActiveChangeFlag = ActiveChangeFlag.None;
|
|
29095
|
-
if (
|
|
29106
|
+
if (rootEntity._isActiveInHierarchy) {
|
|
29096
29107
|
this._isActiveInEngine || (inActiveChangeFlag |= ActiveChangeFlag.Hierarchy);
|
|
29097
29108
|
}
|
|
29098
29109
|
// Cross scene should inActive first and then active
|
|
29099
|
-
|
|
29100
|
-
inActiveChangeFlag &&
|
|
29110
|
+
rootEntity._isActiveInScene && oldScene !== this && (inActiveChangeFlag |= ActiveChangeFlag.Scene);
|
|
29111
|
+
inActiveChangeFlag && rootEntity._processInActive(inActiveChangeFlag);
|
|
29101
29112
|
if (oldScene !== this) {
|
|
29102
|
-
Entity._traverseSetOwnerScene(
|
|
29113
|
+
Entity._traverseSetOwnerScene(rootEntity, this);
|
|
29103
29114
|
}
|
|
29104
29115
|
var activeChangeFlag = ActiveChangeFlag.None;
|
|
29105
|
-
if (
|
|
29116
|
+
if (rootEntity._isActive) {
|
|
29106
29117
|
if (this._isActiveInEngine) {
|
|
29107
|
-
!
|
|
29118
|
+
!rootEntity._isActiveInHierarchy && (activeChangeFlag |= ActiveChangeFlag.Hierarchy);
|
|
29108
29119
|
}
|
|
29109
|
-
(!
|
|
29120
|
+
(!rootEntity._isActiveInScene || oldScene !== this) && (activeChangeFlag |= ActiveChangeFlag.Scene);
|
|
29110
29121
|
}
|
|
29111
|
-
activeChangeFlag &&
|
|
29122
|
+
activeChangeFlag && rootEntity._processActive(activeChangeFlag);
|
|
29112
29123
|
};
|
|
29113
29124
|
/**
|
|
29114
29125
|
* Remove an entity.
|
|
@@ -29125,9 +29136,9 @@ AmbientOcclusion._enableMacro = ShaderMacro.getByName("SCENE_ENABLE_AMBIENT_OCCL
|
|
|
29125
29136
|
}
|
|
29126
29137
|
};
|
|
29127
29138
|
/**
|
|
29128
|
-
* Get root entity
|
|
29129
|
-
* @param index -
|
|
29130
|
-
* @returns
|
|
29139
|
+
* Get a root entity by index.
|
|
29140
|
+
* @param index - The zero-based root entity index
|
|
29141
|
+
* @returns The root entity at the index, or undefined if none exists
|
|
29131
29142
|
*/ _proto.getRootEntity = function getRootEntity(index) {
|
|
29132
29143
|
if (index === void 0) index = 0;
|
|
29133
29144
|
return this._rootEntities[index];
|
|
@@ -29409,8 +29420,7 @@ AmbientOcclusion._enableMacro = ShaderMacro.getByName("SCENE_ENABLE_AMBIENT_OCCL
|
|
|
29409
29420
|
{
|
|
29410
29421
|
key: "sun",
|
|
29411
29422
|
get: /**
|
|
29412
|
-
*
|
|
29413
|
-
* @remarks If set this to null, scene will use the brightest directional light.
|
|
29423
|
+
* The explicit sun light; null or undefined enables automatic selection.
|
|
29414
29424
|
*/ function get() {
|
|
29415
29425
|
return this._sun;
|
|
29416
29426
|
},
|
|
@@ -32386,7 +32396,9 @@ var AnimatorLayerBlendingMode = /*#__PURE__*/ function(AnimatorLayerBlendingMode
|
|
|
32386
32396
|
}
|
|
32387
32397
|
};
|
|
32388
32398
|
_proto._updateCrossFadeState = function _updateCrossFadeState(layerData, weight, additive, deltaTime, aniUpdate) {
|
|
32389
|
-
var
|
|
32399
|
+
var layerIndex = layerData.layerIndex;
|
|
32400
|
+
var srcPlayData = layerData.srcPlayData;
|
|
32401
|
+
var destPlayData = layerData.destPlayData;
|
|
32390
32402
|
var speed = this.speed;
|
|
32391
32403
|
var srcState = srcPlayData.state;
|
|
32392
32404
|
var destState = destPlayData.state;
|
|
@@ -32841,7 +32853,8 @@ var AnimatorLayerBlendingMode = /*#__PURE__*/ function(AnimatorLayerBlendingMode
|
|
|
32841
32853
|
var eventIndex = playState.currentEventIndex;
|
|
32842
32854
|
for(var n = eventHandlers.length; eventIndex < n; eventIndex++){
|
|
32843
32855
|
var eventHandler = eventHandlers[eventIndex];
|
|
32844
|
-
var
|
|
32856
|
+
var parameter = eventHandler.event.parameter;
|
|
32857
|
+
var time = eventHandler.event.time;
|
|
32845
32858
|
if (time > curClipTime) {
|
|
32846
32859
|
break;
|
|
32847
32860
|
}
|
|
@@ -32860,7 +32873,8 @@ var AnimatorLayerBlendingMode = /*#__PURE__*/ function(AnimatorLayerBlendingMode
|
|
|
32860
32873
|
var eventIndex = playState.currentEventIndex;
|
|
32861
32874
|
for(; eventIndex >= 0; eventIndex--){
|
|
32862
32875
|
var eventHandler = eventHandlers[eventIndex];
|
|
32863
|
-
var
|
|
32876
|
+
var parameter = eventHandler.event.parameter;
|
|
32877
|
+
var time = eventHandler.event.time;
|
|
32864
32878
|
if (time < curClipTime) {
|
|
32865
32879
|
break;
|
|
32866
32880
|
}
|
|
@@ -35600,8 +35614,8 @@ CustomDataModule._zeroVector4 = new Vector4(0, 0, 0, 0);
|
|
|
35600
35614
|
this._updateManager.removeListener(listener);
|
|
35601
35615
|
};
|
|
35602
35616
|
_proto._getKeyMinMax = function _getKeyMinMax(keys, out) {
|
|
35603
|
-
var min
|
|
35604
|
-
var max
|
|
35617
|
+
var min;
|
|
35618
|
+
var max;
|
|
35605
35619
|
var _keys_length;
|
|
35606
35620
|
var count = (_keys_length = keys == null ? void 0 : keys.length) != null ? _keys_length : 0;
|
|
35607
35621
|
if (count > 0) {
|
|
@@ -39931,7 +39945,6 @@ __decorate([
|
|
|
39931
39945
|
out.z = out.z * range;
|
|
39932
39946
|
};
|
|
39933
39947
|
ShapeUtils._randomPointInsideHalfUnitBox = function _randomPointInsideHalfUnitBox(out, rand) {
|
|
39934
|
-
if (rand === void 0) rand = null;
|
|
39935
39948
|
out.x = rand.random() - 0.5;
|
|
39936
39949
|
out.y = rand.random() - 0.5;
|
|
39937
39950
|
out.z = rand.random() - 0.5;
|
|
@@ -40359,7 +40372,9 @@ __decorate([
|
|
|
40359
40372
|
/**
|
|
40360
40373
|
* @internal
|
|
40361
40374
|
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
40362
|
-
var _this = this,
|
|
40375
|
+
var _this = this, optionalPositions = _this._positionBuffer, positionInfo = _this._positionElementInfo, optionalNormals = _this._normalBuffer, normalInfo = _this._normalElementInfo;
|
|
40376
|
+
var positions = optionalPositions;
|
|
40377
|
+
var normals = optionalNormals;
|
|
40363
40378
|
var randomIndex = Math.floor(rand.random() * this._mesh.vertexCount);
|
|
40364
40379
|
// index = randomIndex * stride + offset
|
|
40365
40380
|
var positionIndex = randomIndex * positionInfo.y + positionInfo.x;
|