@galacean/engine-core 1.4.5 → 1.4.7
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 +38 -28
- package/dist/main.js.map +1 -1
- package/dist/module.js +38 -28
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Entity.d.ts +1 -1
package/dist/main.js
CHANGED
|
@@ -17502,21 +17502,14 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
17502
17502
|
};
|
|
17503
17503
|
/**
|
|
17504
17504
|
* Find the entity by path.
|
|
17505
|
-
* @param path - The path
|
|
17505
|
+
* @param path - The path of the entity eg: /entity
|
|
17506
17506
|
* @returns The component which be found
|
|
17507
17507
|
*/ _proto.findByPath = function findByPath(path) {
|
|
17508
|
-
var splits = path.split("/");
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
var split = splits[i];
|
|
17512
|
-
if (split) {
|
|
17513
|
-
entity = Entity._findChildByName(entity, split);
|
|
17514
|
-
if (!entity) {
|
|
17515
|
-
return null;
|
|
17516
|
-
}
|
|
17517
|
-
}
|
|
17508
|
+
var splits = path.split("/").filter(Boolean);
|
|
17509
|
+
if (!splits.length) {
|
|
17510
|
+
return this;
|
|
17518
17511
|
}
|
|
17519
|
-
return
|
|
17512
|
+
return Entity._findChildByName(this, 0, splits, 0);
|
|
17520
17513
|
};
|
|
17521
17514
|
/**
|
|
17522
17515
|
* Create child entity.
|
|
@@ -17848,15 +17841,19 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
17848
17841
|
};
|
|
17849
17842
|
/**
|
|
17850
17843
|
* @internal
|
|
17851
|
-
*/ Entity._findChildByName = function _findChildByName(
|
|
17852
|
-
var
|
|
17853
|
-
|
|
17854
|
-
|
|
17855
|
-
|
|
17856
|
-
|
|
17844
|
+
*/ Entity._findChildByName = function _findChildByName(entity, childIndex, paths, pathIndex) {
|
|
17845
|
+
var searchPath = paths[pathIndex];
|
|
17846
|
+
var isEndPath = pathIndex === paths.length - 1;
|
|
17847
|
+
var children = entity._children;
|
|
17848
|
+
for(var n = children.length; childIndex < n; childIndex++){
|
|
17849
|
+
var child = children[childIndex];
|
|
17850
|
+
if (child.name === searchPath) {
|
|
17851
|
+
// Search success if end path, or downward search
|
|
17852
|
+
return isEndPath ? child : Entity._findChildByName(child, 0, paths, pathIndex + 1);
|
|
17857
17853
|
}
|
|
17858
17854
|
}
|
|
17859
|
-
|
|
17855
|
+
// Search failed if first path, or upward search
|
|
17856
|
+
return pathIndex === 0 ? null : Entity._findChildByName(entity.parent, entity.siblingIndex + 1, paths, pathIndex - 1);
|
|
17860
17857
|
};
|
|
17861
17858
|
/**
|
|
17862
17859
|
* @internal
|
|
@@ -21361,6 +21358,7 @@ __decorate([
|
|
|
21361
21358
|
this._nativeCollider.setMaxDepenetrationVelocity(this._maxDepenetrationVelocity);
|
|
21362
21359
|
this._nativeCollider.setSleepThreshold(this._sleepThreshold);
|
|
21363
21360
|
this._nativeCollider.setSolverIterations(this._solverIterations);
|
|
21361
|
+
this._nativeCollider.setUseGravity(this._useGravity);
|
|
21364
21362
|
this._nativeCollider.setIsKinematic(this._isKinematic);
|
|
21365
21363
|
this._nativeCollider.setConstraints(this._constraints);
|
|
21366
21364
|
this._nativeCollider.setCollisionDetectionMode(this._collisionDetectionMode);
|
|
@@ -27046,12 +27044,20 @@ PostProcessManager._tempVector3 = new engineMath.Vector3();
|
|
|
27046
27044
|
* @returns Entity
|
|
27047
27045
|
*/ _proto.findEntityByPath = function findEntityByPath(path) {
|
|
27048
27046
|
var splits = path.split("/").filter(Boolean);
|
|
27047
|
+
if (!splits.length) {
|
|
27048
|
+
return null;
|
|
27049
|
+
}
|
|
27050
|
+
var searchRootName = splits.shift();
|
|
27049
27051
|
for(var i = 0, n = this.rootEntitiesCount; i < n; i++){
|
|
27050
27052
|
var findEntity = this.getRootEntity(i);
|
|
27051
|
-
if (findEntity.name
|
|
27052
|
-
|
|
27053
|
-
|
|
27054
|
-
|
|
27053
|
+
if (findEntity.name !== searchRootName) {
|
|
27054
|
+
continue;
|
|
27055
|
+
}
|
|
27056
|
+
if (splits.length) {
|
|
27057
|
+
findEntity = Entity._findChildByName(findEntity, 0, splits, 0);
|
|
27058
|
+
if (!findEntity) {
|
|
27059
|
+
continue;
|
|
27060
|
+
}
|
|
27055
27061
|
}
|
|
27056
27062
|
return findEntity;
|
|
27057
27063
|
}
|
|
@@ -34076,13 +34082,17 @@ __decorate([
|
|
|
34076
34082
|
instanceVertices[offset + 14] = size;
|
|
34077
34083
|
}
|
|
34078
34084
|
// Start rotation
|
|
34079
|
-
var startRotationRand = main._startRotationRand;
|
|
34085
|
+
var startRotationRand = main._startRotationRand, flipRotation = main.flipRotation;
|
|
34086
|
+
var isOpposite = flipRotation < startRotationRand.random();
|
|
34087
|
+
var rotationZ = engineMath.MathUtil.degreeToRadian(main.startRotationZ.evaluate(undefined, startRotationRand.random()));
|
|
34080
34088
|
if (main.startRotation3D) {
|
|
34081
|
-
|
|
34082
|
-
|
|
34083
|
-
instanceVertices[offset +
|
|
34089
|
+
var rotationX = engineMath.MathUtil.degreeToRadian(main.startRotationX.evaluate(undefined, startRotationRand.random()));
|
|
34090
|
+
var rotationY = engineMath.MathUtil.degreeToRadian(main.startRotationY.evaluate(undefined, startRotationRand.random()));
|
|
34091
|
+
instanceVertices[offset + 15] = isOpposite ? -rotationX : rotationX;
|
|
34092
|
+
instanceVertices[offset + 16] = isOpposite ? -rotationY : rotationY;
|
|
34093
|
+
instanceVertices[offset + 17] = isOpposite ? -rotationZ : rotationZ;
|
|
34084
34094
|
} else {
|
|
34085
|
-
instanceVertices[offset + 15] =
|
|
34095
|
+
instanceVertices[offset + 15] = isOpposite ? -rotationZ : rotationZ;
|
|
34086
34096
|
}
|
|
34087
34097
|
// Start speed
|
|
34088
34098
|
instanceVertices[offset + 18] = startSpeed;
|