@galacean/engine-core 2.0.0-alpha.41 → 2.0.0-alpha.44
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 +106 -60
- package/dist/main.js.map +1 -1
- package/dist/module.js +106 -60
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Entity.d.ts +2 -2
- package/types/Script.d.ts +1 -0
- package/types/asset/LoadItem.d.ts +1 -1
- package/types/asset/ResourceManager.d.ts +5 -3
- package/types/mesh/PrimitiveMesh.d.ts +3 -3
- package/types/particle/modules/CustomDataModule.d.ts +4 -0
- package/types/particle/modules/SubEmittersModule.d.ts +4 -0
- package/types/physics/Collider.d.ts +1 -0
- package/types/physics/DynamicCollider.d.ts +3 -1
- package/types/physics/PhysicsScene.d.ts +1 -0
package/dist/main.js
CHANGED
|
@@ -3065,7 +3065,7 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
3065
3065
|
* @param url - The url to be judged.
|
|
3066
3066
|
* @returns Whether the url is absolute url.
|
|
3067
3067
|
*/ Utils.isAbsoluteUrl = function isAbsoluteUrl(url) {
|
|
3068
|
-
return /^([a-z][a-z\d
|
|
3068
|
+
return /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(url);
|
|
3069
3069
|
};
|
|
3070
3070
|
/**
|
|
3071
3071
|
* Judge whether the url is base64 url.
|
|
@@ -3090,16 +3090,15 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
3090
3090
|
if (Utils.isAbsoluteUrl(relativeUrl)) {
|
|
3091
3091
|
return relativeUrl;
|
|
3092
3092
|
}
|
|
3093
|
-
if (Utils.isBase64Url(relativeUrl)) {
|
|
3094
|
-
return relativeUrl;
|
|
3095
|
-
}
|
|
3096
3093
|
if (Utils.isAbsoluteUrl(baseUrl)) {
|
|
3097
3094
|
return relativeUrl ? new URL(relativeUrl, baseUrl).href : baseUrl;
|
|
3098
3095
|
}
|
|
3099
|
-
|
|
3100
|
-
var
|
|
3096
|
+
// Use an empty file URL host to preserve path casing
|
|
3097
|
+
var hasLeadingSlash = baseUrl.startsWith("/") || relativeUrl.startsWith("/");
|
|
3098
|
+
var encodedBaseUrl = "file:///" + this._encodePathComponents(baseUrl.replace(/^\/+/, ""));
|
|
3101
3099
|
var encodedRelativeUrl = this._encodePathComponents(relativeUrl);
|
|
3102
|
-
|
|
3100
|
+
var resolvedPath = decodeURIComponent(new URL(encodedRelativeUrl, encodedBaseUrl).pathname);
|
|
3101
|
+
return hasLeadingSlash ? resolvedPath : resolvedPath.slice(1);
|
|
3103
3102
|
};
|
|
3104
3103
|
/**
|
|
3105
3104
|
* @internal
|
|
@@ -6324,8 +6323,8 @@ function _construct(Parent, args, Class) {
|
|
|
6324
6323
|
children.length = 0;
|
|
6325
6324
|
};
|
|
6326
6325
|
/**
|
|
6327
|
-
* Clone this
|
|
6328
|
-
* @returns
|
|
6326
|
+
* Clone this Entity, including children and components.
|
|
6327
|
+
* @returns A detached clone that must be added to a parent Entity or Scene to update and render
|
|
6329
6328
|
*/ _proto.clone = function clone() {
|
|
6330
6329
|
var cloneMap = new Map();
|
|
6331
6330
|
var cloneEntity = this._createCloneEntity(cloneMap);
|
|
@@ -7791,6 +7790,7 @@ var RendererUpdateFlags = /*#__PURE__*/ function(RendererUpdateFlags) {
|
|
|
7791
7790
|
this._intView = new Int32Array(this._data);
|
|
7792
7791
|
(_this_buffer = this.buffer) == null ? void 0 : _this_buffer.destroy();
|
|
7793
7792
|
this.buffer = new Buffer(this._engine, BufferBindFlag.ConstantBuffer, totalBytes, BufferUsage.Dynamic);
|
|
7793
|
+
this.buffer.isGCIgnored = true;
|
|
7794
7794
|
}
|
|
7795
7795
|
};
|
|
7796
7796
|
/**
|
|
@@ -15951,10 +15951,10 @@ var BufferUpdateInfo = /*#__PURE__*/ function() {
|
|
|
15951
15951
|
return mesh;
|
|
15952
15952
|
};
|
|
15953
15953
|
/**
|
|
15954
|
-
* Create a plane mesh.
|
|
15954
|
+
* Create a plane mesh with U mapped along local +X and V along local +Z.
|
|
15955
15955
|
* @param engine - Engine
|
|
15956
|
-
* @param width - Plane width
|
|
15957
|
-
* @param height - Plane height
|
|
15956
|
+
* @param width - Plane width along the local X axis
|
|
15957
|
+
* @param height - Plane height along the local Z axis
|
|
15958
15958
|
* @param horizontalSegments - Plane horizontal segments
|
|
15959
15959
|
* @param verticalSegments - Plane vertical segments
|
|
15960
15960
|
* @param noLongerAccessible - No longer access the vertices of the mesh after creation
|
|
@@ -18634,11 +18634,11 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18634
18634
|
};
|
|
18635
18635
|
/**
|
|
18636
18636
|
* Get the resource from cache by asset url, return the resource object if it loaded, otherwise return null.
|
|
18637
|
-
* @param url - Resource
|
|
18637
|
+
* @param url - Resource URL
|
|
18638
18638
|
* @returns Resource object
|
|
18639
18639
|
*/ _proto.getFromCache = function getFromCache(url) {
|
|
18640
|
-
var
|
|
18641
|
-
return (
|
|
18640
|
+
var _this__assetUrlPool_this__getRemoteUrl;
|
|
18641
|
+
return (_this__assetUrlPool_this__getRemoteUrl = this._assetUrlPool[this._getRemoteUrl(url)]) != null ? _this__assetUrlPool_this__getRemoteUrl : null;
|
|
18642
18642
|
};
|
|
18643
18643
|
/**
|
|
18644
18644
|
* Find the resource by type.
|
|
@@ -18663,19 +18663,18 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18663
18663
|
return this._assetPool[instanceId];
|
|
18664
18664
|
};
|
|
18665
18665
|
_proto.cancelNotLoaded = function cancelNotLoaded(url) {
|
|
18666
|
-
var _this = this;
|
|
18667
18666
|
if (!url) {
|
|
18668
18667
|
Utils.objectValues(this._loadingPromises).forEach(function(promise) {
|
|
18669
18668
|
promise.cancel();
|
|
18670
18669
|
});
|
|
18671
18670
|
} else if (typeof url === "string") {
|
|
18672
|
-
var
|
|
18673
|
-
(
|
|
18671
|
+
var _this__loadingPromises_this__getLoadingKey;
|
|
18672
|
+
(_this__loadingPromises_this__getLoadingKey = this._loadingPromises[this._getLoadingKey(url)]) == null ? void 0 : _this__loadingPromises_this__getLoadingKey.cancel();
|
|
18674
18673
|
} else {
|
|
18675
|
-
url.
|
|
18676
|
-
var
|
|
18677
|
-
(
|
|
18678
|
-
}
|
|
18674
|
+
for(var i = 0, n = url.length; i < n; i++){
|
|
18675
|
+
var _this__loadingPromises_this__getLoadingKey1;
|
|
18676
|
+
(_this__loadingPromises_this__getLoadingKey1 = this._loadingPromises[this._getLoadingKey(url[i])]) == null ? void 0 : _this__loadingPromises_this__getLoadingKey1.cancel();
|
|
18677
|
+
}
|
|
18679
18678
|
}
|
|
18680
18679
|
};
|
|
18681
18680
|
/**
|
|
@@ -18697,7 +18696,7 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18697
18696
|
*/ _proto._getRemoteUrl = function _getRemoteUrl(url) {
|
|
18698
18697
|
var _this__virtualPathResourceMap_url;
|
|
18699
18698
|
var _this__virtualPathResourceMap_url_path;
|
|
18700
|
-
return (_this__virtualPathResourceMap_url_path = (_this__virtualPathResourceMap_url = this._virtualPathResourceMap[url]) == null ? void 0 : _this__virtualPathResourceMap_url.path) != null ? _this__virtualPathResourceMap_url_path : url;
|
|
18699
|
+
return (_this__virtualPathResourceMap_url_path = (_this__virtualPathResourceMap_url = this._virtualPathResourceMap[url]) == null ? void 0 : _this__virtualPathResourceMap_url.path) != null ? _this__virtualPathResourceMap_url_path : this.baseUrl ? Utils.resolveAbsoluteUrl(this.baseUrl, url) : url;
|
|
18701
18700
|
};
|
|
18702
18701
|
/**
|
|
18703
18702
|
* @internal
|
|
@@ -18712,17 +18711,14 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18712
18711
|
};
|
|
18713
18712
|
/**
|
|
18714
18713
|
* @internal
|
|
18715
|
-
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(
|
|
18716
|
-
var
|
|
18717
|
-
var
|
|
18718
|
-
var
|
|
18719
|
-
var subPromiseCallback = (_this__subAssetPromiseCallbacks_remoteAssetBaseURL = this._subAssetPromiseCallbacks[remoteAssetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_remoteAssetBaseURL[assetSubPath];
|
|
18714
|
+
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(remoteAssetBaseURL, assetSubPath, value) {
|
|
18715
|
+
var _this__subAssetPromiseCallbacks, _remoteAssetBaseURL;
|
|
18716
|
+
var subAssetPromiseCallbacks = (_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[_remoteAssetBaseURL = remoteAssetBaseURL] || (_this__subAssetPromiseCallbacks[_remoteAssetBaseURL] = {});
|
|
18717
|
+
var subPromiseCallback = subAssetPromiseCallbacks[assetSubPath];
|
|
18720
18718
|
if (subPromiseCallback) {
|
|
18721
18719
|
subPromiseCallback.resolve(value);
|
|
18722
18720
|
} else {
|
|
18723
|
-
|
|
18724
|
-
_this__subAssetPromiseCallbacks, _remoteAssetBaseURL;
|
|
18725
|
-
((_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[_remoteAssetBaseURL = remoteAssetBaseURL] || (_this__subAssetPromiseCallbacks[_remoteAssetBaseURL] = {}))[assetSubPath] = {
|
|
18721
|
+
subAssetPromiseCallbacks[assetSubPath] = {
|
|
18726
18722
|
resolvedValue: value
|
|
18727
18723
|
};
|
|
18728
18724
|
}
|
|
@@ -18834,13 +18830,10 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18834
18830
|
// Parse url
|
|
18835
18831
|
var _this__parseURL = this._parseURL(item.url), assetBaseURL = _this__parseURL.assetBaseURL, queryPath = _this__parseURL.queryPath;
|
|
18836
18832
|
var paths = queryPath ? this._parseQueryPath(queryPath) : [];
|
|
18837
|
-
// Get remote asset base url
|
|
18838
18833
|
var virtualResourceEntry = this._virtualPathResourceMap[assetBaseURL];
|
|
18839
18834
|
this._resolveLoadItemOptions(item, virtualResourceEntry);
|
|
18840
|
-
|
|
18841
|
-
item.url =
|
|
18842
|
-
var _virtualResourceEntry_path;
|
|
18843
|
-
var remoteAssetBaseURL = (_virtualResourceEntry_path = virtualResourceEntry == null ? void 0 : virtualResourceEntry.path) != null ? _virtualResourceEntry_path : item.url;
|
|
18835
|
+
var remoteAssetBaseURL = this._getRemoteUrl(assetBaseURL);
|
|
18836
|
+
item.url = assetBaseURL;
|
|
18844
18837
|
// Check cache
|
|
18845
18838
|
var cacheObject = this._assetUrlPool[remoteAssetBaseURL];
|
|
18846
18839
|
if (cacheObject) {
|
|
@@ -18848,15 +18841,7 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18848
18841
|
resolve(_this._getResolveResource(cacheObject, paths));
|
|
18849
18842
|
});
|
|
18850
18843
|
}
|
|
18851
|
-
|
|
18852
|
-
var remoteAssetURL = remoteAssetBaseURL;
|
|
18853
|
-
if (queryPath) {
|
|
18854
|
-
remoteAssetURL += "?q=" + paths.shift();
|
|
18855
|
-
var index;
|
|
18856
|
-
while(index = paths.shift()){
|
|
18857
|
-
remoteAssetURL += "[" + index + "]";
|
|
18858
|
-
}
|
|
18859
|
-
}
|
|
18844
|
+
var remoteAssetURL = this._getRemoteAssetURL(remoteAssetBaseURL, paths);
|
|
18860
18845
|
// Check is loading
|
|
18861
18846
|
var loadingPromises = this._loadingPromises;
|
|
18862
18847
|
var loadingPromise = loadingPromises[remoteAssetURL];
|
|
@@ -18962,6 +18947,21 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
18962
18947
|
}
|
|
18963
18948
|
return subResource;
|
|
18964
18949
|
};
|
|
18950
|
+
_proto._getLoadingKey = function _getLoadingKey(url) {
|
|
18951
|
+
var _this__parseURL = this._parseURL(url), assetBaseURL = _this__parseURL.assetBaseURL, queryPath = _this__parseURL.queryPath;
|
|
18952
|
+
var remoteAssetBaseURL = this._getRemoteUrl(assetBaseURL);
|
|
18953
|
+
return queryPath ? this._getRemoteAssetURL(remoteAssetBaseURL, this._parseQueryPath(queryPath)) : remoteAssetBaseURL;
|
|
18954
|
+
};
|
|
18955
|
+
_proto._getRemoteAssetURL = function _getRemoteAssetURL(remoteAssetBaseURL, paths) {
|
|
18956
|
+
var remoteAssetURL = remoteAssetBaseURL;
|
|
18957
|
+
if (paths.length > 0) {
|
|
18958
|
+
remoteAssetURL += "?q=" + paths[0];
|
|
18959
|
+
for(var i = 1, n = paths.length; i < n; i++){
|
|
18960
|
+
remoteAssetURL += "[" + paths[i] + "]";
|
|
18961
|
+
}
|
|
18962
|
+
}
|
|
18963
|
+
return remoteAssetURL;
|
|
18964
|
+
};
|
|
18965
18965
|
_proto._parseURL = function _parseURL(path) {
|
|
18966
18966
|
var _path_split = path.split("?"), baseUrl = _path_split[0], searchStr = _path_split[1];
|
|
18967
18967
|
var queryPath = undefined;
|
|
@@ -19603,6 +19603,7 @@ exports.Collider = /*#__PURE__*/ function(Component) {
|
|
|
19603
19603
|
var _proto = Collider.prototype;
|
|
19604
19604
|
/**
|
|
19605
19605
|
* Add collider shape on this collider.
|
|
19606
|
+
* @remarks If the shape belongs to another Collider, it is moved to this Collider.
|
|
19606
19607
|
* @param shape - Collider shape
|
|
19607
19608
|
*/ _proto.addShape = function addShape(shape) {
|
|
19608
19609
|
var oldCollider = shape._collider;
|
|
@@ -20505,7 +20506,7 @@ __decorate([
|
|
|
20505
20506
|
};
|
|
20506
20507
|
_proto._syncNative = function _syncNative() {
|
|
20507
20508
|
// Non-convex triangle meshes require a kinematic native actor before attachment
|
|
20508
|
-
this._nativeCollider.
|
|
20509
|
+
this._nativeCollider.setMotionState(this._isKinematic, this._collisionDetectionMode);
|
|
20509
20510
|
Collider.prototype._syncNative.call(this);
|
|
20510
20511
|
this._nativeCollider.setLinearDamping(this._linearDamping);
|
|
20511
20512
|
this._nativeCollider.setAngularDamping(this._angularDamping);
|
|
@@ -20524,7 +20525,6 @@ __decorate([
|
|
|
20524
20525
|
this._nativeCollider.setSolverIterations(this._solverIterations);
|
|
20525
20526
|
this._nativeCollider.setUseGravity(this._useGravity);
|
|
20526
20527
|
this._nativeCollider.setConstraints(this._constraints);
|
|
20527
|
-
this._nativeCollider.setCollisionDetectionMode(this._collisionDetectionMode);
|
|
20528
20528
|
};
|
|
20529
20529
|
_proto._setMassAndUpdateInertia = function _setMassAndUpdateInertia() {
|
|
20530
20530
|
// Kinematic bodies don't need mass/inertia computation (PhysX doc: mass is not used in kinematic mode)
|
|
@@ -20801,13 +20801,9 @@ __decorate([
|
|
|
20801
20801
|
}
|
|
20802
20802
|
}
|
|
20803
20803
|
this._isKinematic = value;
|
|
20804
|
-
this._nativeCollider.
|
|
20805
|
-
|
|
20806
|
-
|
|
20807
|
-
this._nativeCollider.setCollisionDetectionMode(this._collisionDetectionMode);
|
|
20808
|
-
if (this._automaticCenterOfMass || this._automaticInertiaTensor) {
|
|
20809
|
-
this._setMassAndUpdateInertia();
|
|
20810
|
-
}
|
|
20804
|
+
this._nativeCollider.setMotionState(value, this._collisionDetectionMode);
|
|
20805
|
+
if (!value && (this._automaticCenterOfMass || this._automaticInertiaTensor)) {
|
|
20806
|
+
this._setMassAndUpdateInertia();
|
|
20811
20807
|
}
|
|
20812
20808
|
}
|
|
20813
20809
|
}
|
|
@@ -20829,14 +20825,16 @@ __decorate([
|
|
|
20829
20825
|
{
|
|
20830
20826
|
key: "collisionDetectionMode",
|
|
20831
20827
|
get: /**
|
|
20832
|
-
* The
|
|
20828
|
+
* The collision detection mode.
|
|
20829
|
+
* @remarks With the PhysX backend, Continuous and ContinuousDynamic are mapped to speculative CCD while the collider
|
|
20830
|
+
* is kinematic.
|
|
20833
20831
|
*/ function get() {
|
|
20834
20832
|
return this._collisionDetectionMode;
|
|
20835
20833
|
},
|
|
20836
20834
|
set: function set(value) {
|
|
20837
20835
|
if (this._collisionDetectionMode !== value) {
|
|
20838
20836
|
this._collisionDetectionMode = value;
|
|
20839
|
-
this._nativeCollider.
|
|
20837
|
+
this._nativeCollider.setMotionState(this._isKinematic, value);
|
|
20840
20838
|
}
|
|
20841
20839
|
}
|
|
20842
20840
|
}
|
|
@@ -20923,8 +20921,7 @@ __decorate([
|
|
|
20923
20921
|
* You need to obtain the actual number of contact points from the function's return value.
|
|
20924
20922
|
*/ _proto.getContacts = function getContacts(outContacts) {
|
|
20925
20923
|
var nativeCollision = this._nativeCollision;
|
|
20926
|
-
var
|
|
20927
|
-
var factor = this.shape.id === smallerShapeId ? 1 : -1;
|
|
20924
|
+
var factor = this.shape.id === nativeCollision.shape1Id ? 1 : -1;
|
|
20928
20925
|
var nativeContactPoints = nativeCollision.getContacts();
|
|
20929
20926
|
var length = nativeContactPoints.size();
|
|
20930
20927
|
for(var i = 0; i < length; i++){
|
|
@@ -20959,6 +20956,7 @@ __decorate([
|
|
|
20959
20956
|
this._fixedTimeStep = 1 / 60;
|
|
20960
20957
|
this._colliders = new DisorderedArray();
|
|
20961
20958
|
this._gravity = new engineMath.Vector3(0, -9.81, 0);
|
|
20959
|
+
this._contactEventConsumerCount = 0;
|
|
20962
20960
|
this._scene = scene;
|
|
20963
20961
|
this._setGravity = this._setGravity.bind(this);
|
|
20964
20962
|
//@ts-ignore
|
|
@@ -20966,6 +20964,7 @@ __decorate([
|
|
|
20966
20964
|
var engine = scene.engine;
|
|
20967
20965
|
if (engine._physicsInitialized) {
|
|
20968
20966
|
this._nativePhysicsScene = Engine._nativePhysics.createPhysicsScene(engine._nativePhysicsManager);
|
|
20967
|
+
this._nativePhysicsScene.setContactEventEnabled(false);
|
|
20969
20968
|
}
|
|
20970
20969
|
}
|
|
20971
20970
|
var _proto = PhysicsScene.prototype;
|
|
@@ -21224,6 +21223,17 @@ __decorate([
|
|
|
21224
21223
|
};
|
|
21225
21224
|
/**
|
|
21226
21225
|
* @internal
|
|
21226
|
+
*/ _proto._addContactEventConsumer = function _addContactEventConsumer(delta) {
|
|
21227
|
+
var wasEnabled = this._contactEventConsumerCount > 0;
|
|
21228
|
+
this._contactEventConsumerCount += delta;
|
|
21229
|
+
var enabled = this._contactEventConsumerCount > 0;
|
|
21230
|
+
if (wasEnabled !== enabled) {
|
|
21231
|
+
var _this__nativePhysicsScene;
|
|
21232
|
+
(_this__nativePhysicsScene = this._nativePhysicsScene) == null ? void 0 : _this__nativePhysicsScene.setContactEventEnabled(enabled);
|
|
21233
|
+
}
|
|
21234
|
+
};
|
|
21235
|
+
/**
|
|
21236
|
+
* @internal
|
|
21227
21237
|
*/ _proto._callColliderOnUpdate = function _callColliderOnUpdate() {
|
|
21228
21238
|
var elements = this._colliders._elements;
|
|
21229
21239
|
for(var i = this._colliders.length - 1; i >= 0; --i){
|
|
@@ -29447,6 +29457,9 @@ Scene._prefilterdDFGProperty = ShaderProperty.getByName("scene_PrefilteredDFG");
|
|
|
29447
29457
|
}
|
|
29448
29458
|
}
|
|
29449
29459
|
this._entity._addScript(this);
|
|
29460
|
+
if (this._hasCollisionEventCallbacks()) {
|
|
29461
|
+
this.scene.physics._addContactEventConsumer(1);
|
|
29462
|
+
}
|
|
29450
29463
|
};
|
|
29451
29464
|
/**
|
|
29452
29465
|
* @internal
|
|
@@ -29466,6 +29479,9 @@ Scene._prefilterdDFGProperty = ShaderProperty.getByName("scene_PrefilteredDFG");
|
|
|
29466
29479
|
componentsManager.removeOnPhysicsUpdateScript(this);
|
|
29467
29480
|
}
|
|
29468
29481
|
this._entity._removeScript(this);
|
|
29482
|
+
if (this._hasCollisionEventCallbacks()) {
|
|
29483
|
+
this.scene.physics._addContactEventConsumer(-1);
|
|
29484
|
+
}
|
|
29469
29485
|
};
|
|
29470
29486
|
/**
|
|
29471
29487
|
* @internal
|
|
@@ -29473,6 +29489,10 @@ Scene._prefilterdDFGProperty = ShaderProperty.getByName("scene_PrefilteredDFG");
|
|
|
29473
29489
|
Component.prototype._onDestroy.call(this);
|
|
29474
29490
|
this.onDestroy();
|
|
29475
29491
|
};
|
|
29492
|
+
_proto._hasCollisionEventCallbacks = function _hasCollisionEventCallbacks() {
|
|
29493
|
+
var prototype = Script.prototype;
|
|
29494
|
+
return this.onCollisionEnter !== prototype.onCollisionEnter || this.onCollisionExit !== prototype.onCollisionExit || this.onCollisionStay !== prototype.onCollisionStay;
|
|
29495
|
+
};
|
|
29476
29496
|
return Script;
|
|
29477
29497
|
}(Component);
|
|
29478
29498
|
__decorate([
|
|
@@ -35156,6 +35176,23 @@ __decorate([
|
|
|
35156
35176
|
this._gradients.delete(name);
|
|
35157
35177
|
};
|
|
35158
35178
|
/**
|
|
35179
|
+
* Remove all custom data streams.
|
|
35180
|
+
*/ _proto.clear = function clear() {
|
|
35181
|
+
var shaderData = this._generator._renderer.shaderData;
|
|
35182
|
+
var curveStreams = this._curveStreams;
|
|
35183
|
+
for(var i = 0, n = curveStreams.length; i < n; i++){
|
|
35184
|
+
this._zeroCurveUniforms(shaderData, curveStreams[i]);
|
|
35185
|
+
}
|
|
35186
|
+
var gradientStreams = this._gradientStreams;
|
|
35187
|
+
for(var i1 = 0, n1 = gradientStreams.length; i1 < n1; i1++){
|
|
35188
|
+
this._zeroGradientUniforms(shaderData, gradientStreams[i1]);
|
|
35189
|
+
}
|
|
35190
|
+
this._curves.clear();
|
|
35191
|
+
this._gradients.clear();
|
|
35192
|
+
curveStreams.length = 0;
|
|
35193
|
+
gradientStreams.length = 0;
|
|
35194
|
+
};
|
|
35195
|
+
/**
|
|
35159
35196
|
* @internal
|
|
35160
35197
|
*/ _proto._updateShaderData = function _updateShaderData(shaderData) {
|
|
35161
35198
|
if (!this.enabled) {
|
|
@@ -35281,7 +35318,7 @@ CustomDataModule._zeroVector4 = new engineMath.Vector4(0, 0, 0, 0);
|
|
|
35281
35318
|
_this = DataObject.call(this) || this, _this._updateManager = new UpdateFlagManager(), _this._mode = ParticleCurveMode.Constant, _this._constantMin = 0, _this._constantMax = 0;
|
|
35282
35319
|
_this._updateDispatch = _this._updateManager.dispatch.bind(_this._updateManager);
|
|
35283
35320
|
if (typeof constantOrCurve === "number") {
|
|
35284
|
-
if (constantMaxOrCurveMax) {
|
|
35321
|
+
if (constantMaxOrCurveMax !== undefined) {
|
|
35285
35322
|
_this.constantMin = constantOrCurve;
|
|
35286
35323
|
_this.constantMax = constantMaxOrCurveMax;
|
|
35287
35324
|
_this.mode = ParticleCurveMode.TwoConstants;
|
|
@@ -35290,7 +35327,7 @@ CustomDataModule._zeroVector4 = new engineMath.Vector4(0, 0, 0, 0);
|
|
|
35290
35327
|
_this.mode = ParticleCurveMode.Constant;
|
|
35291
35328
|
}
|
|
35292
35329
|
} else {
|
|
35293
|
-
if (constantMaxOrCurveMax) {
|
|
35330
|
+
if (constantMaxOrCurveMax !== undefined) {
|
|
35294
35331
|
_this.curveMin = constantOrCurve;
|
|
35295
35332
|
_this.curveMax = constantMaxOrCurveMax;
|
|
35296
35333
|
_this.mode = ParticleCurveMode.TwoCurves;
|
|
@@ -37975,6 +38012,15 @@ __decorate([
|
|
|
37975
38012
|
this._generator._setTransformFeedback();
|
|
37976
38013
|
};
|
|
37977
38014
|
/**
|
|
38015
|
+
* Remove all sub-emitter slots.
|
|
38016
|
+
*/ _proto.clear = function clear() {
|
|
38017
|
+
if (this._subEmitters.length === 0) {
|
|
38018
|
+
return;
|
|
38019
|
+
}
|
|
38020
|
+
this._subEmitters.length = 0;
|
|
38021
|
+
this._generator._setTransformFeedback();
|
|
38022
|
+
};
|
|
38023
|
+
/**
|
|
37978
38024
|
* @internal
|
|
37979
38025
|
*/ _proto._dispatchEvent = function _dispatchEvent(type, worldPosition, parentColor, parentSize, parentRotation, worldDirection) {
|
|
37980
38026
|
var subEmitters = this.subEmitters;
|