@galacean/engine-core 2.0.0-alpha.27 → 2.0.0-alpha.28
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 +168 -43
- package/dist/main.js.map +1 -1
- package/dist/module.js +168 -43
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/particle/modules/shape/BaseShape.d.ts +30 -0
- package/types/particle/modules/shape/BoxShape.d.ts +0 -1
- package/types/particle/modules/shape/CircleShape.d.ts +0 -1
- package/types/particle/modules/shape/ConeShape.d.ts +0 -4
package/dist/main.js
CHANGED
|
@@ -13927,7 +13927,7 @@ __decorate([
|
|
|
13927
13927
|
if (!shape) {
|
|
13928
13928
|
return false;
|
|
13929
13929
|
}
|
|
13930
|
-
return shape.collider.
|
|
13930
|
+
return shape.collider.collisionLayer & mask && shape.isSceneQuery;
|
|
13931
13931
|
};
|
|
13932
13932
|
};
|
|
13933
13933
|
_proto._createHitCallback = function _createHitCallback(outHitResult) {
|
|
@@ -37937,7 +37937,7 @@ __decorate([
|
|
|
37937
37937
|
// StartSpeed's impact
|
|
37938
37938
|
var shape = this.emission.shape;
|
|
37939
37939
|
if (shape == null ? void 0 : shape.enabled) {
|
|
37940
|
-
shape._getPositionRange(
|
|
37940
|
+
shape._getPositionRange(bounds);
|
|
37941
37941
|
shape._getDirectionRange(directionMin, directionMax);
|
|
37942
37942
|
} else {
|
|
37943
37943
|
min.set(0, 0, 0);
|
|
@@ -38321,9 +38321,28 @@ __decorate([
|
|
|
38321
38321
|
* Base class for all particle shapes.
|
|
38322
38322
|
*/ var BaseShape = /*#__PURE__*/ function() {
|
|
38323
38323
|
function BaseShape() {
|
|
38324
|
+
var _this = this;
|
|
38324
38325
|
this._updateManager = new UpdateFlagManager();
|
|
38325
38326
|
this._enabled = true;
|
|
38326
38327
|
this._randomDirectionAmount = 0;
|
|
38328
|
+
this._position = new engineMath.Vector3(0, 0, 0);
|
|
38329
|
+
this._rotation = new engineMath.Vector3(0, 0, 0);
|
|
38330
|
+
this._scale = new engineMath.Vector3(1, 1, 1);
|
|
38331
|
+
this._matrix = new engineMath.Matrix();
|
|
38332
|
+
this._transformDirty = false;
|
|
38333
|
+
this._hasShapeTransform = false;
|
|
38334
|
+
this._onTransformChanged = function() {
|
|
38335
|
+
_this._transformDirty = true;
|
|
38336
|
+
var p = _this._position, r = _this._rotation, s = _this._scale;
|
|
38337
|
+
_this._hasShapeTransform = p.x !== 0 || p.y !== 0 || p.z !== 0 || r.x !== 0 || r.y !== 0 || r.z !== 0 || s.x !== 1 || s.y !== 1 || s.z !== 1;
|
|
38338
|
+
_this._updateManager.dispatch();
|
|
38339
|
+
};
|
|
38340
|
+
// @ts-ignore
|
|
38341
|
+
this._position._onValueChanged = this._onTransformChanged;
|
|
38342
|
+
// @ts-ignore
|
|
38343
|
+
this._rotation._onValueChanged = this._onTransformChanged;
|
|
38344
|
+
// @ts-ignore
|
|
38345
|
+
this._scale._onValueChanged = this._onTransformChanged;
|
|
38327
38346
|
}
|
|
38328
38347
|
var _proto = BaseShape.prototype;
|
|
38329
38348
|
/**
|
|
@@ -38336,6 +38355,53 @@ __decorate([
|
|
|
38336
38355
|
*/ _proto._unRegisterOnValueChanged = function _unRegisterOnValueChanged(listener) {
|
|
38337
38356
|
this._updateManager.removeListener(listener);
|
|
38338
38357
|
};
|
|
38358
|
+
/**
|
|
38359
|
+
* @internal
|
|
38360
|
+
*/ _proto._generatePositionAndDirection = function _generatePositionAndDirection(rand, emitTime, position, direction) {
|
|
38361
|
+
this._generateLocalPositionAndDirection(rand, emitTime, position, direction);
|
|
38362
|
+
if (this._hasShapeTransform) {
|
|
38363
|
+
var matrix = this._getMatrix();
|
|
38364
|
+
engineMath.Vector3.transformToVec3(position, matrix, position);
|
|
38365
|
+
engineMath.Vector3.transformNormal(direction, matrix, direction);
|
|
38366
|
+
direction.normalize();
|
|
38367
|
+
}
|
|
38368
|
+
};
|
|
38369
|
+
/**
|
|
38370
|
+
* @internal
|
|
38371
|
+
*/ _proto._getPositionRange = function _getPositionRange(bounds) {
|
|
38372
|
+
this._getLocalPositionRange(bounds.min, bounds.max);
|
|
38373
|
+
if (this._hasShapeTransform) {
|
|
38374
|
+
engineMath.BoundingBox.transform(bounds, this._getMatrix(), bounds);
|
|
38375
|
+
}
|
|
38376
|
+
};
|
|
38377
|
+
/**
|
|
38378
|
+
* @internal
|
|
38379
|
+
*/ _proto._getDirectionRange = function _getDirectionRange(outMin, outMax) {
|
|
38380
|
+
this._getLocalDirectionRange(outMin, outMax);
|
|
38381
|
+
if (this._hasShapeTransform) {
|
|
38382
|
+
this._transformDirectionRange(outMin, outMax);
|
|
38383
|
+
}
|
|
38384
|
+
};
|
|
38385
|
+
_proto._getMatrix = function _getMatrix() {
|
|
38386
|
+
if (this._transformDirty) {
|
|
38387
|
+
var _this = this, r = _this._rotation;
|
|
38388
|
+
var q = BaseShape._tempQuaternion;
|
|
38389
|
+
engineMath.Quaternion.rotationEuler(engineMath.MathUtil.degreeToRadian(r.x), engineMath.MathUtil.degreeToRadian(r.y), engineMath.MathUtil.degreeToRadian(r.z), q);
|
|
38390
|
+
engineMath.Matrix.affineTransformation(this._scale, q, this._position, this._matrix);
|
|
38391
|
+
this._transformDirty = false;
|
|
38392
|
+
}
|
|
38393
|
+
return this._matrix;
|
|
38394
|
+
};
|
|
38395
|
+
// Arvo min/max method without translation, only apply RS part of the matrix
|
|
38396
|
+
_proto._transformDirectionRange = function _transformDirectionRange(outMin, outMax) {
|
|
38397
|
+
var e = this._getMatrix().elements;
|
|
38398
|
+
var minX = outMin.x, minY = outMin.y, minZ = outMin.z;
|
|
38399
|
+
var maxX = outMax.x, maxY = outMax.y, maxZ = outMax.z;
|
|
38400
|
+
// prettier-ignore
|
|
38401
|
+
var e0 = e[0], e1 = e[1], e2 = e[2], e4 = e[4], e5 = e[5], e6 = e[6], e8 = e[8], e9 = e[9], e10 = e[10];
|
|
38402
|
+
outMin.set((e0 > 0 ? e0 * minX : e0 * maxX) + (e4 > 0 ? e4 * minY : e4 * maxY) + (e8 > 0 ? e8 * minZ : e8 * maxZ), (e1 > 0 ? e1 * minX : e1 * maxX) + (e5 > 0 ? e5 * minY : e5 * maxY) + (e9 > 0 ? e9 * minZ : e9 * maxZ), (e2 > 0 ? e2 * minX : e2 * maxX) + (e6 > 0 ? e6 * minY : e6 * maxY) + (e10 > 0 ? e10 * minZ : e10 * maxZ));
|
|
38403
|
+
outMax.set((e0 > 0 ? e0 * maxX : e0 * minX) + (e4 > 0 ? e4 * maxY : e4 * minY) + (e8 > 0 ? e8 * maxZ : e8 * minZ), (e1 > 0 ? e1 * maxX : e1 * minX) + (e5 > 0 ? e5 * maxY : e5 * minY) + (e9 > 0 ? e9 * maxZ : e9 * minZ), (e2 > 0 ? e2 * maxX : e2 * minX) + (e6 > 0 ? e6 * maxY : e6 * minY) + (e10 > 0 ? e10 * maxZ : e10 * minZ));
|
|
38404
|
+
};
|
|
38339
38405
|
_create_class(BaseShape, [
|
|
38340
38406
|
{
|
|
38341
38407
|
key: "enabled",
|
|
@@ -38364,13 +38430,78 @@ __decorate([
|
|
|
38364
38430
|
this._updateManager.dispatch();
|
|
38365
38431
|
}
|
|
38366
38432
|
}
|
|
38433
|
+
},
|
|
38434
|
+
{
|
|
38435
|
+
key: "position",
|
|
38436
|
+
get: /**
|
|
38437
|
+
* Apply a local position offset to the shape.
|
|
38438
|
+
*/ function get() {
|
|
38439
|
+
return this._position;
|
|
38440
|
+
},
|
|
38441
|
+
set: function set(value) {
|
|
38442
|
+
if (value !== this._position) {
|
|
38443
|
+
this._position.copyFrom(value);
|
|
38444
|
+
}
|
|
38445
|
+
}
|
|
38446
|
+
},
|
|
38447
|
+
{
|
|
38448
|
+
key: "rotation",
|
|
38449
|
+
get: /**
|
|
38450
|
+
* Apply a local rotation to the shape, specified as euler angles in degrees.
|
|
38451
|
+
*/ function get() {
|
|
38452
|
+
return this._rotation;
|
|
38453
|
+
},
|
|
38454
|
+
set: function set(value) {
|
|
38455
|
+
if (value !== this._rotation) {
|
|
38456
|
+
this._rotation.copyFrom(value);
|
|
38457
|
+
}
|
|
38458
|
+
}
|
|
38459
|
+
},
|
|
38460
|
+
{
|
|
38461
|
+
key: "scale",
|
|
38462
|
+
get: /**
|
|
38463
|
+
* Apply a local scale to the shape.
|
|
38464
|
+
*/ function get() {
|
|
38465
|
+
return this._scale;
|
|
38466
|
+
},
|
|
38467
|
+
set: function set(value) {
|
|
38468
|
+
if (value !== this._scale) {
|
|
38469
|
+
this._scale.copyFrom(value);
|
|
38470
|
+
}
|
|
38471
|
+
}
|
|
38367
38472
|
}
|
|
38368
38473
|
]);
|
|
38369
38474
|
return BaseShape;
|
|
38370
38475
|
}();
|
|
38476
|
+
/** @internal */ BaseShape._tempVector20 = new engineMath.Vector2();
|
|
38477
|
+
/** @internal */ BaseShape._tempVector21 = new engineMath.Vector2();
|
|
38478
|
+
/** @internal */ BaseShape._tempVector30 = new engineMath.Vector3();
|
|
38479
|
+
/** @internal */ BaseShape._tempVector31 = new engineMath.Vector3();
|
|
38480
|
+
BaseShape._tempQuaternion = new engineMath.Quaternion();
|
|
38371
38481
|
__decorate([
|
|
38372
38482
|
ignoreClone
|
|
38373
38483
|
], BaseShape.prototype, "_updateManager", void 0);
|
|
38484
|
+
__decorate([
|
|
38485
|
+
deepClone
|
|
38486
|
+
], BaseShape.prototype, "_position", void 0);
|
|
38487
|
+
__decorate([
|
|
38488
|
+
deepClone
|
|
38489
|
+
], BaseShape.prototype, "_rotation", void 0);
|
|
38490
|
+
__decorate([
|
|
38491
|
+
deepClone
|
|
38492
|
+
], BaseShape.prototype, "_scale", void 0);
|
|
38493
|
+
__decorate([
|
|
38494
|
+
ignoreClone
|
|
38495
|
+
], BaseShape.prototype, "_matrix", void 0);
|
|
38496
|
+
__decorate([
|
|
38497
|
+
ignoreClone
|
|
38498
|
+
], BaseShape.prototype, "_transformDirty", void 0);
|
|
38499
|
+
__decorate([
|
|
38500
|
+
ignoreClone
|
|
38501
|
+
], BaseShape.prototype, "_hasShapeTransform", void 0);
|
|
38502
|
+
__decorate([
|
|
38503
|
+
ignoreClone
|
|
38504
|
+
], BaseShape.prototype, "_onTransformChanged", void 0);
|
|
38374
38505
|
|
|
38375
38506
|
/**
|
|
38376
38507
|
* @internal
|
|
@@ -38436,11 +38567,11 @@ __decorate([
|
|
|
38436
38567
|
|
|
38437
38568
|
/**
|
|
38438
38569
|
* Particle shape that emits particles from a box.
|
|
38439
|
-
*/ var BoxShape = /*#__PURE__*/ function(
|
|
38440
|
-
_inherits(BoxShape,
|
|
38570
|
+
*/ var BoxShape = /*#__PURE__*/ function(BaseShape1) {
|
|
38571
|
+
_inherits(BoxShape, BaseShape1);
|
|
38441
38572
|
function BoxShape() {
|
|
38442
38573
|
var _this;
|
|
38443
|
-
_this =
|
|
38574
|
+
_this = BaseShape1.call(this) || this, _this.shapeType = ParticleShapeType.Box, _this._size = new engineMath.Vector3(1, 1, 1);
|
|
38444
38575
|
// @ts-ignore
|
|
38445
38576
|
_this._size._onValueChanged = _this._updateManager.dispatch.bind(_this._updateManager);
|
|
38446
38577
|
return _this;
|
|
@@ -38448,17 +38579,17 @@ __decorate([
|
|
|
38448
38579
|
var _proto = BoxShape.prototype;
|
|
38449
38580
|
/**
|
|
38450
38581
|
* @internal
|
|
38451
|
-
*/ _proto.
|
|
38582
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38452
38583
|
ShapeUtils._randomPointInsideHalfUnitBox(position, rand);
|
|
38453
38584
|
position.multiply(this.size);
|
|
38454
|
-
var defaultDirection =
|
|
38585
|
+
var defaultDirection = BaseShape._tempVector30;
|
|
38455
38586
|
defaultDirection.set(0.0, 0.0, -1.0);
|
|
38456
38587
|
ShapeUtils._randomPointUnitSphere(direction, rand);
|
|
38457
38588
|
engineMath.Vector3.lerp(defaultDirection, direction, this.randomDirectionAmount, direction);
|
|
38458
38589
|
};
|
|
38459
38590
|
/**
|
|
38460
38591
|
* @internal
|
|
38461
|
-
*/ _proto.
|
|
38592
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38462
38593
|
var radian = Math.PI * this.randomDirectionAmount;
|
|
38463
38594
|
if (this.randomDirectionAmount < 0.5) {
|
|
38464
38595
|
var dirSin = Math.sin(radian);
|
|
@@ -38472,7 +38603,7 @@ __decorate([
|
|
|
38472
38603
|
};
|
|
38473
38604
|
/**
|
|
38474
38605
|
* @internal
|
|
38475
|
-
*/ _proto.
|
|
38606
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38476
38607
|
var _this__size = this._size, x = _this__size.x, y = _this__size.y, z = _this__size.z;
|
|
38477
38608
|
outMin.set(-x * 0.5, -y * 0.5, -z * 0.5);
|
|
38478
38609
|
outMax.set(x * 0.5, y * 0.5, z * 0.5);
|
|
@@ -38494,7 +38625,6 @@ __decorate([
|
|
|
38494
38625
|
]);
|
|
38495
38626
|
return BoxShape;
|
|
38496
38627
|
}(BaseShape);
|
|
38497
|
-
BoxShape._tempVector30 = new engineMath.Vector3();
|
|
38498
38628
|
__decorate([
|
|
38499
38629
|
deepClone
|
|
38500
38630
|
], BoxShape.prototype, "_size", void 0);
|
|
@@ -38509,18 +38639,18 @@ __decorate([
|
|
|
38509
38639
|
|
|
38510
38640
|
/**
|
|
38511
38641
|
* Particle shape that emits particles from a circle.
|
|
38512
|
-
*/ var CircleShape = /*#__PURE__*/ function(
|
|
38513
|
-
_inherits(CircleShape,
|
|
38642
|
+
*/ var CircleShape = /*#__PURE__*/ function(BaseShape1) {
|
|
38643
|
+
_inherits(CircleShape, BaseShape1);
|
|
38514
38644
|
function CircleShape() {
|
|
38515
38645
|
var _this;
|
|
38516
|
-
_this =
|
|
38646
|
+
_this = BaseShape1.apply(this, arguments) || this, _this.shapeType = ParticleShapeType.Circle, _this._radius = 1.0, _this._arc = 360.0, _this._arcMode = ParticleShapeArcMode.Random, _this._arcSpeed = 1.0;
|
|
38517
38647
|
return _this;
|
|
38518
38648
|
}
|
|
38519
38649
|
var _proto = CircleShape.prototype;
|
|
38520
38650
|
/**
|
|
38521
38651
|
* @internal
|
|
38522
|
-
*/ _proto.
|
|
38523
|
-
var positionPoint =
|
|
38652
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38653
|
+
var positionPoint = BaseShape._tempVector20;
|
|
38524
38654
|
switch(this.arcMode){
|
|
38525
38655
|
case ParticleShapeArcMode.Loop:
|
|
38526
38656
|
var normalizedEmitTime = emitTime * this.arcSpeed * (360 / this.arc) % 1;
|
|
@@ -38539,7 +38669,7 @@ __decorate([
|
|
|
38539
38669
|
};
|
|
38540
38670
|
/**
|
|
38541
38671
|
* @internal
|
|
38542
|
-
*/ _proto.
|
|
38672
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38543
38673
|
var randomDirZ = this.randomDirectionAmount > 0.5 ? 1 : Math.sin(this.randomDirectionAmount * Math.PI);
|
|
38544
38674
|
var randomDegreeOnXY = 0.5 * (360 - this._arc) * this.randomDirectionAmount;
|
|
38545
38675
|
var randomDirY = randomDegreeOnXY > 90 ? -1 : -Math.sin(randomDegreeOnXY);
|
|
@@ -38547,7 +38677,7 @@ __decorate([
|
|
|
38547
38677
|
};
|
|
38548
38678
|
/**
|
|
38549
38679
|
* @internal
|
|
38550
|
-
*/ _proto.
|
|
38680
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38551
38681
|
this._getUnitArcRange(this._arc, outMin, outMax, 0, 0);
|
|
38552
38682
|
outMin.scale(this._radius);
|
|
38553
38683
|
outMax.scale(this._radius);
|
|
@@ -38630,22 +38760,21 @@ __decorate([
|
|
|
38630
38760
|
]);
|
|
38631
38761
|
return CircleShape;
|
|
38632
38762
|
}(BaseShape);
|
|
38633
|
-
CircleShape._tempPositionPoint = new engineMath.Vector2();
|
|
38634
38763
|
|
|
38635
38764
|
/**
|
|
38636
38765
|
* Cone shape.
|
|
38637
|
-
*/ var ConeShape = /*#__PURE__*/ function(
|
|
38638
|
-
_inherits(ConeShape,
|
|
38766
|
+
*/ var ConeShape = /*#__PURE__*/ function(BaseShape1) {
|
|
38767
|
+
_inherits(ConeShape, BaseShape1);
|
|
38639
38768
|
function ConeShape() {
|
|
38640
38769
|
var _this;
|
|
38641
|
-
_this =
|
|
38770
|
+
_this = BaseShape1.apply(this, arguments) || this, _this.shapeType = ParticleShapeType.Cone, _this._angle = 25.0, _this._radius = 1.0, _this._length = 5.0, _this._emitType = 0;
|
|
38642
38771
|
return _this;
|
|
38643
38772
|
}
|
|
38644
38773
|
var _proto = ConeShape.prototype;
|
|
38645
38774
|
/**
|
|
38646
38775
|
* @internal
|
|
38647
|
-
*/ _proto.
|
|
38648
|
-
var unitPosition =
|
|
38776
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38777
|
+
var unitPosition = BaseShape._tempVector20;
|
|
38649
38778
|
var radian = engineMath.MathUtil.degreeToRadian(this.angle);
|
|
38650
38779
|
var dirSinA = Math.sin(radian);
|
|
38651
38780
|
var dirCosA = Math.cos(radian);
|
|
@@ -38653,7 +38782,7 @@ CircleShape._tempPositionPoint = new engineMath.Vector2();
|
|
|
38653
38782
|
case 0:
|
|
38654
38783
|
ShapeUtils.randomPointInsideUnitCircle(unitPosition, rand);
|
|
38655
38784
|
position.set(unitPosition.x * this.radius, unitPosition.y * this.radius, 0);
|
|
38656
|
-
var unitDirection =
|
|
38785
|
+
var unitDirection = BaseShape._tempVector21;
|
|
38657
38786
|
ShapeUtils.randomPointInsideUnitCircle(unitDirection, rand);
|
|
38658
38787
|
engineMath.Vector2.lerp(unitPosition, unitDirection, this.randomDirectionAmount, unitDirection);
|
|
38659
38788
|
direction.set(unitDirection.x * dirSinA, unitDirection.y * dirSinA, -dirCosA);
|
|
@@ -38663,10 +38792,10 @@ CircleShape._tempPositionPoint = new engineMath.Vector2();
|
|
|
38663
38792
|
position.set(unitPosition.x * this.radius, unitPosition.y * this.radius, 0);
|
|
38664
38793
|
direction.set(unitPosition.x * dirSinA, unitPosition.y * dirSinA, -dirCosA);
|
|
38665
38794
|
direction.normalize();
|
|
38666
|
-
var distance =
|
|
38795
|
+
var distance = BaseShape._tempVector30;
|
|
38667
38796
|
engineMath.Vector3.scale(direction, this.length * rand.random(), distance);
|
|
38668
38797
|
position.add(distance);
|
|
38669
|
-
var randomDirection =
|
|
38798
|
+
var randomDirection = BaseShape._tempVector31;
|
|
38670
38799
|
ShapeUtils._randomPointUnitSphere(randomDirection, rand);
|
|
38671
38800
|
engineMath.Vector3.lerp(direction, randomDirection, this.randomDirectionAmount, direction);
|
|
38672
38801
|
break;
|
|
@@ -38674,7 +38803,7 @@ CircleShape._tempPositionPoint = new engineMath.Vector2();
|
|
|
38674
38803
|
};
|
|
38675
38804
|
/**
|
|
38676
38805
|
* @internal
|
|
38677
|
-
*/ _proto.
|
|
38806
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38678
38807
|
var radian = 0;
|
|
38679
38808
|
switch(this.emitType){
|
|
38680
38809
|
case 0:
|
|
@@ -38691,7 +38820,7 @@ CircleShape._tempPositionPoint = new engineMath.Vector2();
|
|
|
38691
38820
|
};
|
|
38692
38821
|
/**
|
|
38693
38822
|
* @internal
|
|
38694
|
-
*/ _proto.
|
|
38823
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38695
38824
|
var radius = this.radius;
|
|
38696
38825
|
switch(this.emitType){
|
|
38697
38826
|
case 0:
|
|
@@ -38766,10 +38895,6 @@ CircleShape._tempPositionPoint = new engineMath.Vector2();
|
|
|
38766
38895
|
]);
|
|
38767
38896
|
return ConeShape;
|
|
38768
38897
|
}(BaseShape);
|
|
38769
|
-
ConeShape._tempVector20 = new engineMath.Vector2();
|
|
38770
|
-
ConeShape._tempVector21 = new engineMath.Vector2();
|
|
38771
|
-
ConeShape._tempVector30 = new engineMath.Vector3();
|
|
38772
|
-
ConeShape._tempVector31 = new engineMath.Vector3();
|
|
38773
38898
|
/**
|
|
38774
38899
|
* Cone emitter type.
|
|
38775
38900
|
*/ var ConeEmitType = /*#__PURE__*/ function(ConeEmitType) {
|
|
@@ -38790,7 +38915,7 @@ ConeShape._tempVector31 = new engineMath.Vector3();
|
|
|
38790
38915
|
var _proto = HemisphereShape.prototype;
|
|
38791
38916
|
/**
|
|
38792
38917
|
* @internal
|
|
38793
|
-
*/ _proto.
|
|
38918
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38794
38919
|
ShapeUtils._randomPointInsideUnitSphere(position, rand);
|
|
38795
38920
|
position.scale(this.radius);
|
|
38796
38921
|
var z = position.z;
|
|
@@ -38800,14 +38925,14 @@ ConeShape._tempVector31 = new engineMath.Vector3();
|
|
|
38800
38925
|
};
|
|
38801
38926
|
/**
|
|
38802
38927
|
* @internal
|
|
38803
|
-
*/ _proto.
|
|
38928
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38804
38929
|
var randomDir = Math.sin(0.5 * this.randomDirectionAmount * Math.PI);
|
|
38805
38930
|
outMin.set(-1, -1, -1);
|
|
38806
38931
|
outMax.set(1, 1, randomDir);
|
|
38807
38932
|
};
|
|
38808
38933
|
/**
|
|
38809
38934
|
* @internal
|
|
38810
|
-
*/ _proto.
|
|
38935
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38811
38936
|
var radius = this._radius;
|
|
38812
38937
|
outMin.set(-radius, -radius, -radius);
|
|
38813
38938
|
outMax.set(radius, radius, 0);
|
|
@@ -38845,7 +38970,7 @@ ConeShape._tempVector31 = new engineMath.Vector3();
|
|
|
38845
38970
|
var _proto = MeshShape.prototype;
|
|
38846
38971
|
/**
|
|
38847
38972
|
* @internal
|
|
38848
|
-
*/ _proto.
|
|
38973
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38849
38974
|
var _this = this, positions = _this._positionBuffer, positionInfo = _this._positionElementInfo, normals = _this._normalBuffer, normalInfo = _this._normalElementInfo;
|
|
38850
38975
|
var randomIndex = Math.floor(rand.random() * this._mesh.vertexCount);
|
|
38851
38976
|
// index = randomIndex * stride + offset
|
|
@@ -38858,14 +38983,14 @@ ConeShape._tempVector31 = new engineMath.Vector3();
|
|
|
38858
38983
|
};
|
|
38859
38984
|
/**
|
|
38860
38985
|
* @internal
|
|
38861
|
-
*/ _proto.
|
|
38986
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38862
38987
|
var bounds = this._mesh.bounds;
|
|
38863
38988
|
bounds.min.copyTo(outMin);
|
|
38864
38989
|
bounds.max.copyTo(outMax);
|
|
38865
38990
|
};
|
|
38866
38991
|
/**
|
|
38867
38992
|
* @internal
|
|
38868
|
-
*/ _proto.
|
|
38993
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38869
38994
|
// @todo: Should use min and max of normal, use bounds is worst, but we can't get the min and max of normal by fast way.
|
|
38870
38995
|
var bounds = this._mesh.bounds;
|
|
38871
38996
|
bounds.min.copyTo(outMin);
|
|
@@ -38980,7 +39105,7 @@ __decorate([
|
|
|
38980
39105
|
var _proto = SphereShape.prototype;
|
|
38981
39106
|
/**
|
|
38982
39107
|
* @internal
|
|
38983
|
-
*/ _proto.
|
|
39108
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38984
39109
|
ShapeUtils._randomPointInsideUnitSphere(position, rand);
|
|
38985
39110
|
position.scale(this.radius);
|
|
38986
39111
|
ShapeUtils._randomPointUnitSphere(direction, rand);
|
|
@@ -38988,13 +39113,13 @@ __decorate([
|
|
|
38988
39113
|
};
|
|
38989
39114
|
/**
|
|
38990
39115
|
* @internal
|
|
38991
|
-
*/ _proto.
|
|
39116
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38992
39117
|
outMin.set(-1, -1, -1);
|
|
38993
39118
|
outMax.set(1, 1, 1);
|
|
38994
39119
|
};
|
|
38995
39120
|
/**
|
|
38996
39121
|
* @internal
|
|
38997
|
-
*/ _proto.
|
|
39122
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38998
39123
|
var radius = this._radius;
|
|
38999
39124
|
outMin.set(-radius, -radius, -radius);
|
|
39000
39125
|
outMax.set(radius, radius, radius);
|
|
@@ -39757,7 +39882,7 @@ var cacheDir = new engineMath.Vector3();
|
|
|
39757
39882
|
* Suspend the audio context.
|
|
39758
39883
|
* @returns A promise that resolves when the audio context is suspended
|
|
39759
39884
|
*/ AudioManager.suspend = function suspend() {
|
|
39760
|
-
return AudioManager.
|
|
39885
|
+
return AudioManager.getContext().suspend();
|
|
39761
39886
|
};
|
|
39762
39887
|
/**
|
|
39763
39888
|
* Resume the audio context.
|
|
@@ -39766,7 +39891,7 @@ var cacheDir = new engineMath.Vector3();
|
|
|
39766
39891
|
*/ AudioManager.resume = function resume() {
|
|
39767
39892
|
var _AudioManager;
|
|
39768
39893
|
var __resumePromise;
|
|
39769
|
-
return (__resumePromise = (_AudioManager = AudioManager)._resumePromise) != null ? __resumePromise : _AudioManager._resumePromise = AudioManager.
|
|
39894
|
+
return (__resumePromise = (_AudioManager = AudioManager)._resumePromise) != null ? __resumePromise : _AudioManager._resumePromise = AudioManager.getContext().resume().then(function() {
|
|
39770
39895
|
AudioManager._needsUserGestureResume = false;
|
|
39771
39896
|
}).finally(function() {
|
|
39772
39897
|
AudioManager._resumePromise = null;
|