@galacean/engine-core 1.1.0-alpha.1 → 1.1.0-alpha.2
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 +93 -31
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +93 -31
- package/dist/module.js +93 -31
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/RenderPipeline/MeshRenderElement.d.ts +1 -3
- package/types/RenderPipeline/RenderElementX.d.ts +12 -0
- package/types/RenderPipeline/SpriteElement.d.ts +1 -3
- package/types/RenderPipeline/SpriteMaskElement.d.ts +1 -3
- package/types/RenderPipeline/TextRenderElement.d.ts +1 -3
- package/types/SafeLoopArray.d.ts +37 -0
- package/types/Ticker.d.ts +30 -0
- package/types/Transform.d.ts +1 -0
- package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
- package/types/asset/Loader.d.ts +1 -1
- package/types/asset/ResourceManager.d.ts +8 -0
- package/types/graphic/Primitive.d.ts +1 -0
- package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
- package/types/graphic/SubPrimitive.d.ts +9 -0
- package/types/index.d.ts +1 -1
- package/types/particle/ParticleBufferUtils.d.ts +1 -0
- package/types/particle/ParticleData.d.ts +1 -0
- package/types/particle/ParticleGenerator.d.ts +72 -0
- package/types/particle/ParticleMaterial.d.ts +28 -0
- package/types/particle/ParticleMesh.d.ts +289 -0
- package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
- package/types/particle/ParticleShaderMacro.d.ts +1 -0
- package/types/particle/ParticleShaderProperty.d.ts +1 -0
- package/types/particle/ParticleSystem.d.ts +41 -0
- package/types/particle/ParticleVertexElements.d.ts +1 -0
- package/types/particle/ParticleVertexUtils.d.ts +1 -0
- package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
- package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
- package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
- package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
- package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/enum/ParticleShapeType.d.ts +15 -0
- package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enum/index.d.ts +9 -0
- package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
- package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
- package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enums/ParticleStopMode.d.ts +6 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
- package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
- package/types/particle/module/Burst.d.ts +38 -0
- package/types/particle/module/ColorGradient.d.ts +75 -0
- package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/module/EmissionModule.d.ts +63 -0
- package/types/particle/module/FrameOverTime.d.ts +73 -0
- package/types/particle/module/ParticleCurve.d.ts +37 -0
- package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
- package/types/particle/module/SizeGradient.d.ts +151 -0
- package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/StartFrame.d.ts +46 -0
- package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
- package/types/particle/module/VelocityGradient.d.ts +110 -0
- package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
- package/types/particle/module/index.d.ts +15 -0
- package/types/particle/module/shape/BaseShape.d.ts +26 -0
- package/types/particle/module/shape/BoxShape.d.ts +20 -0
- package/types/particle/module/shape/CircleShape.d.ts +27 -0
- package/types/particle/module/shape/ConeShape.d.ts +35 -0
- package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/module/shape/SphereShape.d.ts +23 -0
- package/types/particle/module/shape/index.d.ts +5 -0
- package/types/particle/modules/Burst.d.ts +14 -0
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/modules/EmissionModule.d.ts +45 -0
- package/types/particle/modules/MainModule.d.ts +68 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
- package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
- package/types/particle/modules/ParticleCurve.d.ts +56 -0
- package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
- package/types/particle/modules/ParticleGradient.d.ts +94 -0
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/ShapeModule.d.ts +9 -0
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/shape/BaseShape.d.ts +12 -0
- package/types/particle/modules/shape/BoxShape.d.ts +11 -0
- package/types/particle/modules/shape/CircleShape.d.ts +17 -0
- package/types/particle/modules/shape/ConeShape.d.ts +28 -0
- package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
- package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/modules/shape/SphereShape.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/modules/shape/index.d.ts +6 -0
- package/types/particle/moudules/Burst.d.ts +25 -0
- package/types/particle/moudules/Emission.d.ts +47 -0
- package/types/particle/moudules/EmissionModule.d.ts +49 -0
- package/types/particle/moudules/MainModule.d.ts +59 -0
- package/types/particle/moudules/ParticleCurve.d.ts +27 -0
- package/types/particle/moudules/ParticleGradient.d.ts +28 -0
- package/types/particle/moudules/ShapeModule.d.ts +7 -0
- package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
- package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
- package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
- package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
- package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/moudules/shape/index.d.ts +5 -0
- package/types/physics/PhysicsScene.d.ts +6 -2
- package/types/shaderlib/particle/index.d.ts +14 -0
- package/types/shadow/PipelinePass.d.ts +16 -0
- package/types/utils/BoolUpdateFlag.d.ts +12 -0
- package/types/utils/DisorderedArray.d.ts +18 -0
- package/types/utils/UpdateFlag.d.ts +20 -0
- package/types/utils/UpdateFlagManager.d.ts +1 -0
- package/types/utils/Utils.d.ts +31 -0
- package/types/xr/XRManager.d.ts +31 -0
- package/types/xr/component/XRPoseDriver.d.ts +10 -0
- package/types/xr/data/XRCamera.d.ts +6 -0
- package/types/xr/data/XRDevice.d.ts +9 -0
- package/types/xr/data/XRHandle.d.ts +10 -0
- package/types/xr/enum/EnumXRButton.d.ts +5 -0
- package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
- package/types/xr/enum/EnumXRFeature.d.ts +9 -0
- package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
- package/types/xr/enum/EnumXRMode.d.ts +7 -0
- package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
- package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
- package/types/xr/feature/XRCameraManager.d.ts +21 -0
- package/types/xr/feature/XRFeature.d.ts +29 -0
- package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
- package/types/xr/feature/XRInputManager.d.ts +16 -0
- package/types/xr/index.d.ts +18 -0
- package/types/xr/provider/XRProvider.d.ts +19 -0
- package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
- package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
package/dist/miniprogram.js
CHANGED
|
@@ -3287,6 +3287,23 @@ var rePropName$1 = RegExp(// Match anything that isn't a dot or bracket.
|
|
|
3287
3287
|
scale.z < 0 && (isInvert = !isInvert);
|
|
3288
3288
|
return isInvert;
|
|
3289
3289
|
};
|
|
3290
|
+
_proto._onDestroy = function _onDestroy() {
|
|
3291
|
+
Component.prototype._onDestroy.call(this);
|
|
3292
|
+
//@ts-ignore
|
|
3293
|
+
this._worldPosition._onValueChanged = null;
|
|
3294
|
+
//@ts-ignore
|
|
3295
|
+
this._rotation._onValueChanged = null;
|
|
3296
|
+
//@ts-ignore
|
|
3297
|
+
this._worldRotation._onValueChanged = null;
|
|
3298
|
+
//@ts-ignore
|
|
3299
|
+
this._rotationQuaternion._onValueChanged = null;
|
|
3300
|
+
//@ts-ignore
|
|
3301
|
+
this._worldRotationQuaternion._onValueChanged = null;
|
|
3302
|
+
//@ts-ignore
|
|
3303
|
+
this._position._onValueChanged = null;
|
|
3304
|
+
//@ts-ignore
|
|
3305
|
+
this._scale._onValueChanged = null;
|
|
3306
|
+
};
|
|
3290
3307
|
/**
|
|
3291
3308
|
* Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
|
|
3292
3309
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
@@ -12547,6 +12564,7 @@ var /** @internal */ PromiseState;
|
|
|
12547
12564
|
this._referResourcePool = Object.create(null);
|
|
12548
12565
|
this._graphicResourcePool = Object.create(null);
|
|
12549
12566
|
this._contentRestorerPool = Object.create(null);
|
|
12567
|
+
this._subAssetPromiseCallbacks = {};
|
|
12550
12568
|
this.//-----------------Editor temp solution-----------------
|
|
12551
12569
|
/** @internal */ _objectPool = Object.create(null);
|
|
12552
12570
|
this./** @internal */ _editorResourceConfig = Object.create(null);
|
|
@@ -12574,6 +12592,21 @@ var /** @internal */ PromiseState;
|
|
|
12574
12592
|
return (_this__assetUrlPool_url = this._assetUrlPool[url]) != null ? _this__assetUrlPool_url : null;
|
|
12575
12593
|
};
|
|
12576
12594
|
/**
|
|
12595
|
+
* Find the resource by type.
|
|
12596
|
+
* @param type - Resource type
|
|
12597
|
+
* @returns - Resource collection
|
|
12598
|
+
*/ _proto.findResourcesByType = function findResourcesByType(type) {
|
|
12599
|
+
var resources = new Array();
|
|
12600
|
+
var referResourcePool = this._referResourcePool;
|
|
12601
|
+
for(var k in referResourcePool){
|
|
12602
|
+
var resource = referResourcePool[k];
|
|
12603
|
+
if (_instanceof(resource, type)) {
|
|
12604
|
+
resources.push(resource);
|
|
12605
|
+
}
|
|
12606
|
+
}
|
|
12607
|
+
return resources;
|
|
12608
|
+
};
|
|
12609
|
+
/**
|
|
12577
12610
|
* Get asset url from instanceId.
|
|
12578
12611
|
* @param instanceId - Engine instance id
|
|
12579
12612
|
* @returns Asset url
|
|
@@ -12611,6 +12644,20 @@ var /** @internal */ PromiseState;
|
|
|
12611
12644
|
};
|
|
12612
12645
|
/**
|
|
12613
12646
|
* @internal
|
|
12647
|
+
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(assetURL, value) {
|
|
12648
|
+
var _this__subAssetPromiseCallbacks_assetURL;
|
|
12649
|
+
(_this__subAssetPromiseCallbacks_assetURL = this._subAssetPromiseCallbacks[assetURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_assetURL.resolve(value);
|
|
12650
|
+
delete this._subAssetPromiseCallbacks[assetURL];
|
|
12651
|
+
};
|
|
12652
|
+
/**
|
|
12653
|
+
* @internal
|
|
12654
|
+
*/ _proto._onSubAssetFail = function _onSubAssetFail(assetURL, value) {
|
|
12655
|
+
var _this__subAssetPromiseCallbacks_assetURL;
|
|
12656
|
+
(_this__subAssetPromiseCallbacks_assetURL = this._subAssetPromiseCallbacks[assetURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_assetURL.reject(value);
|
|
12657
|
+
delete this._subAssetPromiseCallbacks[assetURL];
|
|
12658
|
+
};
|
|
12659
|
+
/**
|
|
12660
|
+
* @internal
|
|
12614
12661
|
*/ _proto._addAsset = function _addAsset(path, asset) {
|
|
12615
12662
|
this._assetPool[asset.instanceId] = path;
|
|
12616
12663
|
this._assetUrlPool[path] = asset;
|
|
@@ -12720,6 +12767,10 @@ var /** @internal */ PromiseState;
|
|
|
12720
12767
|
var assetURL = assetBaseURL;
|
|
12721
12768
|
if (queryPath) {
|
|
12722
12769
|
assetURL += "?q=" + paths.shift();
|
|
12770
|
+
var index;
|
|
12771
|
+
while(index = paths.shift()){
|
|
12772
|
+
assetURL += "[" + index + "]";
|
|
12773
|
+
}
|
|
12723
12774
|
}
|
|
12724
12775
|
// Check is loading
|
|
12725
12776
|
var loadingPromises = this._loadingPromises;
|
|
@@ -12727,7 +12778,7 @@ var /** @internal */ PromiseState;
|
|
|
12727
12778
|
if (loadingPromise) {
|
|
12728
12779
|
return new AssetPromise(function(resolve, reject) {
|
|
12729
12780
|
loadingPromise.then(function(resource) {
|
|
12730
|
-
resolve(
|
|
12781
|
+
resolve(resource);
|
|
12731
12782
|
}).catch(function(error) {
|
|
12732
12783
|
reject(error);
|
|
12733
12784
|
});
|
|
@@ -12741,38 +12792,37 @@ var /** @internal */ PromiseState;
|
|
|
12741
12792
|
// Load asset
|
|
12742
12793
|
item.url = assetBaseURL;
|
|
12743
12794
|
var promise = loader.load(item, this);
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12795
|
+
loadingPromises[assetBaseURL] = promise;
|
|
12796
|
+
promise.then(function(resource) {
|
|
12797
|
+
if (loader.useCache) {
|
|
12798
|
+
_this._addAsset(assetBaseURL, resource);
|
|
12799
|
+
}
|
|
12800
|
+
delete loadingPromises[assetBaseURL];
|
|
12801
|
+
}, function() {
|
|
12802
|
+
return delete loadingPromises[assetBaseURL];
|
|
12803
|
+
});
|
|
12804
|
+
if (queryPath) {
|
|
12805
|
+
var subPromise = new AssetPromise(function(resolve, reject) {
|
|
12806
|
+
_this._pushSubAssetPromiseCallback(assetURL, resolve, reject);
|
|
12807
|
+
});
|
|
12808
|
+
loadingPromises[assetURL] = subPromise;
|
|
12809
|
+
subPromise.then(function() {
|
|
12810
|
+
delete loadingPromises[assetURL];
|
|
12751
12811
|
}, function() {
|
|
12752
|
-
return delete loadingPromises[
|
|
12812
|
+
return delete loadingPromises[assetURL];
|
|
12753
12813
|
});
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
var _loop = function(subURL) {
|
|
12757
|
-
var subPromise = promise[subURL];
|
|
12758
|
-
var isMaster = assetBaseURL === subURL;
|
|
12759
|
-
loadingPromises[subURL] = subPromise;
|
|
12760
|
-
subPromise.then(function(resource) {
|
|
12761
|
-
if (isMaster) {
|
|
12762
|
-
if (loader.useCache) {
|
|
12763
|
-
_this._addAsset(subURL, resource);
|
|
12764
|
-
for(var k in promise)delete loadingPromises[k];
|
|
12765
|
-
}
|
|
12766
|
-
}
|
|
12767
|
-
}, function() {
|
|
12768
|
-
for(var k in promise)delete loadingPromises[k];
|
|
12769
|
-
});
|
|
12770
|
-
};
|
|
12771
|
-
for(var subURL in promise)_loop(subURL);
|
|
12772
|
-
return promise[assetURL].then(function(resource) {
|
|
12773
|
-
return _this._getResolveResource(resource, paths);
|
|
12814
|
+
promise.catch(function(e) {
|
|
12815
|
+
_this._onSubAssetFail(assetURL, e);
|
|
12774
12816
|
});
|
|
12817
|
+
return subPromise;
|
|
12775
12818
|
}
|
|
12819
|
+
return promise;
|
|
12820
|
+
};
|
|
12821
|
+
_proto._pushSubAssetPromiseCallback = function _pushSubAssetPromiseCallback(assetURL, resolve, reject) {
|
|
12822
|
+
this._subAssetPromiseCallbacks[assetURL] = {
|
|
12823
|
+
resolve: resolve,
|
|
12824
|
+
reject: reject
|
|
12825
|
+
};
|
|
12776
12826
|
};
|
|
12777
12827
|
_proto._gc = function _gc(forceDestroy) {
|
|
12778
12828
|
var objects = Utils.objectValues(this._referResourcePool);
|
|
@@ -13582,6 +13632,7 @@ var Collision = function Collision() {
|
|
|
13582
13632
|
function PhysicsScene(scene) {
|
|
13583
13633
|
var _this = this;
|
|
13584
13634
|
this._restTime = 0;
|
|
13635
|
+
this._fixedTimeStep = 1 / 60;
|
|
13585
13636
|
this._colliders = new DisorderedArray();
|
|
13586
13637
|
this._gravity = new miniprogram.Vector3(0, -9.81, 0);
|
|
13587
13638
|
this._onContactEnter = function(obj1, obj2) {
|
|
@@ -13698,7 +13749,6 @@ var Collision = function Collision() {
|
|
|
13698
13749
|
script1._waitHandlingInValid || script1.onTriggerStay(shape1);
|
|
13699
13750
|
}
|
|
13700
13751
|
};
|
|
13701
|
-
/** The fixed time step in seconds at which physics are performed. */ this.fixedTimeStep = 1 / 60;
|
|
13702
13752
|
this._scene = scene;
|
|
13703
13753
|
this._setGravity = this._setGravity.bind(this);
|
|
13704
13754
|
//@ts-ignore
|
|
@@ -13755,7 +13805,7 @@ var Collision = function Collision() {
|
|
|
13755
13805
|
* Call on every frame to update pose of objects.
|
|
13756
13806
|
* @internal
|
|
13757
13807
|
*/ _proto._update = function _update(deltaTime) {
|
|
13758
|
-
var _this = this, fixedTimeStep = _this.
|
|
13808
|
+
var _this = this, fixedTimeStep = _this._fixedTimeStep, nativePhysicsManager = _this._nativePhysicsScene;
|
|
13759
13809
|
var componentsManager = this._scene._componentsManager;
|
|
13760
13810
|
var simulateTime = this._restTime + deltaTime;
|
|
13761
13811
|
var step = Math.floor(simulateTime / fixedTimeStep);
|
|
@@ -13863,6 +13913,17 @@ var Collision = function Collision() {
|
|
|
13863
13913
|
gravity.copyFrom(value);
|
|
13864
13914
|
}
|
|
13865
13915
|
}
|
|
13916
|
+
},
|
|
13917
|
+
{
|
|
13918
|
+
key: "fixedTimeStep",
|
|
13919
|
+
get: /**
|
|
13920
|
+
* The fixed time step in seconds at which physics are performed.
|
|
13921
|
+
*/ function get() {
|
|
13922
|
+
return this._fixedTimeStep;
|
|
13923
|
+
},
|
|
13924
|
+
set: function set(value) {
|
|
13925
|
+
this._fixedTimeStep = Math.max(value, miniprogram.MathUtil.zeroTolerance);
|
|
13926
|
+
}
|
|
13866
13927
|
}
|
|
13867
13928
|
]);
|
|
13868
13929
|
return PhysicsScene;
|
|
@@ -15736,6 +15797,7 @@ exports.Joint = __decorate([
|
|
|
15736
15797
|
CloneManager.deepCloneObject(this.renderStates, target.renderStates);
|
|
15737
15798
|
};
|
|
15738
15799
|
_proto._addReferCount = function _addReferCount(value) {
|
|
15800
|
+
if (this._destroyed) return;
|
|
15739
15801
|
ReferResource.prototype._addReferCount.call(this, value);
|
|
15740
15802
|
this.shaderData._addReferCount(value);
|
|
15741
15803
|
};
|
package/dist/module.js
CHANGED
|
@@ -3282,6 +3282,23 @@ var rePropName$1 = RegExp(// Match anything that isn't a dot or bracket.
|
|
|
3282
3282
|
scale.z < 0 && (isInvert = !isInvert);
|
|
3283
3283
|
return isInvert;
|
|
3284
3284
|
};
|
|
3285
|
+
_proto._onDestroy = function _onDestroy() {
|
|
3286
|
+
Component.prototype._onDestroy.call(this);
|
|
3287
|
+
//@ts-ignore
|
|
3288
|
+
this._worldPosition._onValueChanged = null;
|
|
3289
|
+
//@ts-ignore
|
|
3290
|
+
this._rotation._onValueChanged = null;
|
|
3291
|
+
//@ts-ignore
|
|
3292
|
+
this._worldRotation._onValueChanged = null;
|
|
3293
|
+
//@ts-ignore
|
|
3294
|
+
this._rotationQuaternion._onValueChanged = null;
|
|
3295
|
+
//@ts-ignore
|
|
3296
|
+
this._worldRotationQuaternion._onValueChanged = null;
|
|
3297
|
+
//@ts-ignore
|
|
3298
|
+
this._position._onValueChanged = null;
|
|
3299
|
+
//@ts-ignore
|
|
3300
|
+
this._scale._onValueChanged = null;
|
|
3301
|
+
};
|
|
3285
3302
|
/**
|
|
3286
3303
|
* Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
|
|
3287
3304
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
@@ -12542,6 +12559,7 @@ var /** @internal */ PromiseState;
|
|
|
12542
12559
|
this._referResourcePool = Object.create(null);
|
|
12543
12560
|
this._graphicResourcePool = Object.create(null);
|
|
12544
12561
|
this._contentRestorerPool = Object.create(null);
|
|
12562
|
+
this._subAssetPromiseCallbacks = {};
|
|
12545
12563
|
this.//-----------------Editor temp solution-----------------
|
|
12546
12564
|
/** @internal */ _objectPool = Object.create(null);
|
|
12547
12565
|
this./** @internal */ _editorResourceConfig = Object.create(null);
|
|
@@ -12569,6 +12587,21 @@ var /** @internal */ PromiseState;
|
|
|
12569
12587
|
return (_this__assetUrlPool_url = this._assetUrlPool[url]) != null ? _this__assetUrlPool_url : null;
|
|
12570
12588
|
};
|
|
12571
12589
|
/**
|
|
12590
|
+
* Find the resource by type.
|
|
12591
|
+
* @param type - Resource type
|
|
12592
|
+
* @returns - Resource collection
|
|
12593
|
+
*/ _proto.findResourcesByType = function findResourcesByType(type) {
|
|
12594
|
+
var resources = new Array();
|
|
12595
|
+
var referResourcePool = this._referResourcePool;
|
|
12596
|
+
for(var k in referResourcePool){
|
|
12597
|
+
var resource = referResourcePool[k];
|
|
12598
|
+
if (_instanceof(resource, type)) {
|
|
12599
|
+
resources.push(resource);
|
|
12600
|
+
}
|
|
12601
|
+
}
|
|
12602
|
+
return resources;
|
|
12603
|
+
};
|
|
12604
|
+
/**
|
|
12572
12605
|
* Get asset url from instanceId.
|
|
12573
12606
|
* @param instanceId - Engine instance id
|
|
12574
12607
|
* @returns Asset url
|
|
@@ -12606,6 +12639,20 @@ var /** @internal */ PromiseState;
|
|
|
12606
12639
|
};
|
|
12607
12640
|
/**
|
|
12608
12641
|
* @internal
|
|
12642
|
+
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(assetURL, value) {
|
|
12643
|
+
var _this__subAssetPromiseCallbacks_assetURL;
|
|
12644
|
+
(_this__subAssetPromiseCallbacks_assetURL = this._subAssetPromiseCallbacks[assetURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_assetURL.resolve(value);
|
|
12645
|
+
delete this._subAssetPromiseCallbacks[assetURL];
|
|
12646
|
+
};
|
|
12647
|
+
/**
|
|
12648
|
+
* @internal
|
|
12649
|
+
*/ _proto._onSubAssetFail = function _onSubAssetFail(assetURL, value) {
|
|
12650
|
+
var _this__subAssetPromiseCallbacks_assetURL;
|
|
12651
|
+
(_this__subAssetPromiseCallbacks_assetURL = this._subAssetPromiseCallbacks[assetURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_assetURL.reject(value);
|
|
12652
|
+
delete this._subAssetPromiseCallbacks[assetURL];
|
|
12653
|
+
};
|
|
12654
|
+
/**
|
|
12655
|
+
* @internal
|
|
12609
12656
|
*/ _proto._addAsset = function _addAsset(path, asset) {
|
|
12610
12657
|
this._assetPool[asset.instanceId] = path;
|
|
12611
12658
|
this._assetUrlPool[path] = asset;
|
|
@@ -12715,6 +12762,10 @@ var /** @internal */ PromiseState;
|
|
|
12715
12762
|
var assetURL = assetBaseURL;
|
|
12716
12763
|
if (queryPath) {
|
|
12717
12764
|
assetURL += "?q=" + paths.shift();
|
|
12765
|
+
var index;
|
|
12766
|
+
while(index = paths.shift()){
|
|
12767
|
+
assetURL += "[" + index + "]";
|
|
12768
|
+
}
|
|
12718
12769
|
}
|
|
12719
12770
|
// Check is loading
|
|
12720
12771
|
var loadingPromises = this._loadingPromises;
|
|
@@ -12722,7 +12773,7 @@ var /** @internal */ PromiseState;
|
|
|
12722
12773
|
if (loadingPromise) {
|
|
12723
12774
|
return new AssetPromise(function(resolve, reject) {
|
|
12724
12775
|
loadingPromise.then(function(resource) {
|
|
12725
|
-
resolve(
|
|
12776
|
+
resolve(resource);
|
|
12726
12777
|
}).catch(function(error) {
|
|
12727
12778
|
reject(error);
|
|
12728
12779
|
});
|
|
@@ -12736,38 +12787,37 @@ var /** @internal */ PromiseState;
|
|
|
12736
12787
|
// Load asset
|
|
12737
12788
|
item.url = assetBaseURL;
|
|
12738
12789
|
var promise = loader.load(item, this);
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12790
|
+
loadingPromises[assetBaseURL] = promise;
|
|
12791
|
+
promise.then(function(resource) {
|
|
12792
|
+
if (loader.useCache) {
|
|
12793
|
+
_this._addAsset(assetBaseURL, resource);
|
|
12794
|
+
}
|
|
12795
|
+
delete loadingPromises[assetBaseURL];
|
|
12796
|
+
}, function() {
|
|
12797
|
+
return delete loadingPromises[assetBaseURL];
|
|
12798
|
+
});
|
|
12799
|
+
if (queryPath) {
|
|
12800
|
+
var subPromise = new AssetPromise(function(resolve, reject) {
|
|
12801
|
+
_this._pushSubAssetPromiseCallback(assetURL, resolve, reject);
|
|
12802
|
+
});
|
|
12803
|
+
loadingPromises[assetURL] = subPromise;
|
|
12804
|
+
subPromise.then(function() {
|
|
12805
|
+
delete loadingPromises[assetURL];
|
|
12746
12806
|
}, function() {
|
|
12747
|
-
return delete loadingPromises[
|
|
12807
|
+
return delete loadingPromises[assetURL];
|
|
12748
12808
|
});
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
var _loop = function(subURL) {
|
|
12752
|
-
var subPromise = promise[subURL];
|
|
12753
|
-
var isMaster = assetBaseURL === subURL;
|
|
12754
|
-
loadingPromises[subURL] = subPromise;
|
|
12755
|
-
subPromise.then(function(resource) {
|
|
12756
|
-
if (isMaster) {
|
|
12757
|
-
if (loader.useCache) {
|
|
12758
|
-
_this._addAsset(subURL, resource);
|
|
12759
|
-
for(var k in promise)delete loadingPromises[k];
|
|
12760
|
-
}
|
|
12761
|
-
}
|
|
12762
|
-
}, function() {
|
|
12763
|
-
for(var k in promise)delete loadingPromises[k];
|
|
12764
|
-
});
|
|
12765
|
-
};
|
|
12766
|
-
for(var subURL in promise)_loop(subURL);
|
|
12767
|
-
return promise[assetURL].then(function(resource) {
|
|
12768
|
-
return _this._getResolveResource(resource, paths);
|
|
12809
|
+
promise.catch(function(e) {
|
|
12810
|
+
_this._onSubAssetFail(assetURL, e);
|
|
12769
12811
|
});
|
|
12812
|
+
return subPromise;
|
|
12770
12813
|
}
|
|
12814
|
+
return promise;
|
|
12815
|
+
};
|
|
12816
|
+
_proto._pushSubAssetPromiseCallback = function _pushSubAssetPromiseCallback(assetURL, resolve, reject) {
|
|
12817
|
+
this._subAssetPromiseCallbacks[assetURL] = {
|
|
12818
|
+
resolve: resolve,
|
|
12819
|
+
reject: reject
|
|
12820
|
+
};
|
|
12771
12821
|
};
|
|
12772
12822
|
_proto._gc = function _gc(forceDestroy) {
|
|
12773
12823
|
var objects = Utils.objectValues(this._referResourcePool);
|
|
@@ -13577,6 +13627,7 @@ var Collision = function Collision() {
|
|
|
13577
13627
|
function PhysicsScene(scene) {
|
|
13578
13628
|
var _this = this;
|
|
13579
13629
|
this._restTime = 0;
|
|
13630
|
+
this._fixedTimeStep = 1 / 60;
|
|
13580
13631
|
this._colliders = new DisorderedArray();
|
|
13581
13632
|
this._gravity = new Vector3(0, -9.81, 0);
|
|
13582
13633
|
this._onContactEnter = function(obj1, obj2) {
|
|
@@ -13693,7 +13744,6 @@ var Collision = function Collision() {
|
|
|
13693
13744
|
script1._waitHandlingInValid || script1.onTriggerStay(shape1);
|
|
13694
13745
|
}
|
|
13695
13746
|
};
|
|
13696
|
-
/** The fixed time step in seconds at which physics are performed. */ this.fixedTimeStep = 1 / 60;
|
|
13697
13747
|
this._scene = scene;
|
|
13698
13748
|
this._setGravity = this._setGravity.bind(this);
|
|
13699
13749
|
//@ts-ignore
|
|
@@ -13750,7 +13800,7 @@ var Collision = function Collision() {
|
|
|
13750
13800
|
* Call on every frame to update pose of objects.
|
|
13751
13801
|
* @internal
|
|
13752
13802
|
*/ _proto._update = function _update(deltaTime) {
|
|
13753
|
-
var _this = this, fixedTimeStep = _this.
|
|
13803
|
+
var _this = this, fixedTimeStep = _this._fixedTimeStep, nativePhysicsManager = _this._nativePhysicsScene;
|
|
13754
13804
|
var componentsManager = this._scene._componentsManager;
|
|
13755
13805
|
var simulateTime = this._restTime + deltaTime;
|
|
13756
13806
|
var step = Math.floor(simulateTime / fixedTimeStep);
|
|
@@ -13858,6 +13908,17 @@ var Collision = function Collision() {
|
|
|
13858
13908
|
gravity.copyFrom(value);
|
|
13859
13909
|
}
|
|
13860
13910
|
}
|
|
13911
|
+
},
|
|
13912
|
+
{
|
|
13913
|
+
key: "fixedTimeStep",
|
|
13914
|
+
get: /**
|
|
13915
|
+
* The fixed time step in seconds at which physics are performed.
|
|
13916
|
+
*/ function get() {
|
|
13917
|
+
return this._fixedTimeStep;
|
|
13918
|
+
},
|
|
13919
|
+
set: function set(value) {
|
|
13920
|
+
this._fixedTimeStep = Math.max(value, MathUtil$1.zeroTolerance);
|
|
13921
|
+
}
|
|
13861
13922
|
}
|
|
13862
13923
|
]);
|
|
13863
13924
|
return PhysicsScene;
|
|
@@ -15731,6 +15792,7 @@ Joint = __decorate([
|
|
|
15731
15792
|
CloneManager.deepCloneObject(this.renderStates, target.renderStates);
|
|
15732
15793
|
};
|
|
15733
15794
|
_proto._addReferCount = function _addReferCount(value) {
|
|
15795
|
+
if (this._destroyed) return;
|
|
15734
15796
|
ReferResource.prototype._addReferCount.call(this, value);
|
|
15735
15797
|
this.shaderData._addReferCount(value);
|
|
15736
15798
|
};
|