@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/module.js
CHANGED
|
@@ -13923,7 +13923,7 @@ __decorate([
|
|
|
13923
13923
|
if (!shape) {
|
|
13924
13924
|
return false;
|
|
13925
13925
|
}
|
|
13926
|
-
return shape.collider.
|
|
13926
|
+
return shape.collider.collisionLayer & mask && shape.isSceneQuery;
|
|
13927
13927
|
};
|
|
13928
13928
|
};
|
|
13929
13929
|
_proto._createHitCallback = function _createHitCallback(outHitResult) {
|
|
@@ -37933,7 +37933,7 @@ __decorate([
|
|
|
37933
37933
|
// StartSpeed's impact
|
|
37934
37934
|
var shape = this.emission.shape;
|
|
37935
37935
|
if (shape == null ? void 0 : shape.enabled) {
|
|
37936
|
-
shape._getPositionRange(
|
|
37936
|
+
shape._getPositionRange(bounds);
|
|
37937
37937
|
shape._getDirectionRange(directionMin, directionMax);
|
|
37938
37938
|
} else {
|
|
37939
37939
|
min.set(0, 0, 0);
|
|
@@ -38317,9 +38317,28 @@ __decorate([
|
|
|
38317
38317
|
* Base class for all particle shapes.
|
|
38318
38318
|
*/ var BaseShape = /*#__PURE__*/ function() {
|
|
38319
38319
|
function BaseShape() {
|
|
38320
|
+
var _this = this;
|
|
38320
38321
|
this._updateManager = new UpdateFlagManager();
|
|
38321
38322
|
this._enabled = true;
|
|
38322
38323
|
this._randomDirectionAmount = 0;
|
|
38324
|
+
this._position = new Vector3(0, 0, 0);
|
|
38325
|
+
this._rotation = new Vector3(0, 0, 0);
|
|
38326
|
+
this._scale = new Vector3(1, 1, 1);
|
|
38327
|
+
this._matrix = new Matrix();
|
|
38328
|
+
this._transformDirty = false;
|
|
38329
|
+
this._hasShapeTransform = false;
|
|
38330
|
+
this._onTransformChanged = function() {
|
|
38331
|
+
_this._transformDirty = true;
|
|
38332
|
+
var p = _this._position, r = _this._rotation, s = _this._scale;
|
|
38333
|
+
_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;
|
|
38334
|
+
_this._updateManager.dispatch();
|
|
38335
|
+
};
|
|
38336
|
+
// @ts-ignore
|
|
38337
|
+
this._position._onValueChanged = this._onTransformChanged;
|
|
38338
|
+
// @ts-ignore
|
|
38339
|
+
this._rotation._onValueChanged = this._onTransformChanged;
|
|
38340
|
+
// @ts-ignore
|
|
38341
|
+
this._scale._onValueChanged = this._onTransformChanged;
|
|
38323
38342
|
}
|
|
38324
38343
|
var _proto = BaseShape.prototype;
|
|
38325
38344
|
/**
|
|
@@ -38332,6 +38351,53 @@ __decorate([
|
|
|
38332
38351
|
*/ _proto._unRegisterOnValueChanged = function _unRegisterOnValueChanged(listener) {
|
|
38333
38352
|
this._updateManager.removeListener(listener);
|
|
38334
38353
|
};
|
|
38354
|
+
/**
|
|
38355
|
+
* @internal
|
|
38356
|
+
*/ _proto._generatePositionAndDirection = function _generatePositionAndDirection(rand, emitTime, position, direction) {
|
|
38357
|
+
this._generateLocalPositionAndDirection(rand, emitTime, position, direction);
|
|
38358
|
+
if (this._hasShapeTransform) {
|
|
38359
|
+
var matrix = this._getMatrix();
|
|
38360
|
+
Vector3.transformToVec3(position, matrix, position);
|
|
38361
|
+
Vector3.transformNormal(direction, matrix, direction);
|
|
38362
|
+
direction.normalize();
|
|
38363
|
+
}
|
|
38364
|
+
};
|
|
38365
|
+
/**
|
|
38366
|
+
* @internal
|
|
38367
|
+
*/ _proto._getPositionRange = function _getPositionRange(bounds) {
|
|
38368
|
+
this._getLocalPositionRange(bounds.min, bounds.max);
|
|
38369
|
+
if (this._hasShapeTransform) {
|
|
38370
|
+
BoundingBox.transform(bounds, this._getMatrix(), bounds);
|
|
38371
|
+
}
|
|
38372
|
+
};
|
|
38373
|
+
/**
|
|
38374
|
+
* @internal
|
|
38375
|
+
*/ _proto._getDirectionRange = function _getDirectionRange(outMin, outMax) {
|
|
38376
|
+
this._getLocalDirectionRange(outMin, outMax);
|
|
38377
|
+
if (this._hasShapeTransform) {
|
|
38378
|
+
this._transformDirectionRange(outMin, outMax);
|
|
38379
|
+
}
|
|
38380
|
+
};
|
|
38381
|
+
_proto._getMatrix = function _getMatrix() {
|
|
38382
|
+
if (this._transformDirty) {
|
|
38383
|
+
var _this = this, r = _this._rotation;
|
|
38384
|
+
var q = BaseShape._tempQuaternion;
|
|
38385
|
+
Quaternion.rotationEuler(MathUtil.degreeToRadian(r.x), MathUtil.degreeToRadian(r.y), MathUtil.degreeToRadian(r.z), q);
|
|
38386
|
+
Matrix.affineTransformation(this._scale, q, this._position, this._matrix);
|
|
38387
|
+
this._transformDirty = false;
|
|
38388
|
+
}
|
|
38389
|
+
return this._matrix;
|
|
38390
|
+
};
|
|
38391
|
+
// Arvo min/max method without translation, only apply RS part of the matrix
|
|
38392
|
+
_proto._transformDirectionRange = function _transformDirectionRange(outMin, outMax) {
|
|
38393
|
+
var e = this._getMatrix().elements;
|
|
38394
|
+
var minX = outMin.x, minY = outMin.y, minZ = outMin.z;
|
|
38395
|
+
var maxX = outMax.x, maxY = outMax.y, maxZ = outMax.z;
|
|
38396
|
+
// prettier-ignore
|
|
38397
|
+
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];
|
|
38398
|
+
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));
|
|
38399
|
+
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));
|
|
38400
|
+
};
|
|
38335
38401
|
_create_class(BaseShape, [
|
|
38336
38402
|
{
|
|
38337
38403
|
key: "enabled",
|
|
@@ -38360,13 +38426,78 @@ __decorate([
|
|
|
38360
38426
|
this._updateManager.dispatch();
|
|
38361
38427
|
}
|
|
38362
38428
|
}
|
|
38429
|
+
},
|
|
38430
|
+
{
|
|
38431
|
+
key: "position",
|
|
38432
|
+
get: /**
|
|
38433
|
+
* Apply a local position offset to the shape.
|
|
38434
|
+
*/ function get() {
|
|
38435
|
+
return this._position;
|
|
38436
|
+
},
|
|
38437
|
+
set: function set(value) {
|
|
38438
|
+
if (value !== this._position) {
|
|
38439
|
+
this._position.copyFrom(value);
|
|
38440
|
+
}
|
|
38441
|
+
}
|
|
38442
|
+
},
|
|
38443
|
+
{
|
|
38444
|
+
key: "rotation",
|
|
38445
|
+
get: /**
|
|
38446
|
+
* Apply a local rotation to the shape, specified as euler angles in degrees.
|
|
38447
|
+
*/ function get() {
|
|
38448
|
+
return this._rotation;
|
|
38449
|
+
},
|
|
38450
|
+
set: function set(value) {
|
|
38451
|
+
if (value !== this._rotation) {
|
|
38452
|
+
this._rotation.copyFrom(value);
|
|
38453
|
+
}
|
|
38454
|
+
}
|
|
38455
|
+
},
|
|
38456
|
+
{
|
|
38457
|
+
key: "scale",
|
|
38458
|
+
get: /**
|
|
38459
|
+
* Apply a local scale to the shape.
|
|
38460
|
+
*/ function get() {
|
|
38461
|
+
return this._scale;
|
|
38462
|
+
},
|
|
38463
|
+
set: function set(value) {
|
|
38464
|
+
if (value !== this._scale) {
|
|
38465
|
+
this._scale.copyFrom(value);
|
|
38466
|
+
}
|
|
38467
|
+
}
|
|
38363
38468
|
}
|
|
38364
38469
|
]);
|
|
38365
38470
|
return BaseShape;
|
|
38366
38471
|
}();
|
|
38472
|
+
/** @internal */ BaseShape._tempVector20 = new Vector2();
|
|
38473
|
+
/** @internal */ BaseShape._tempVector21 = new Vector2();
|
|
38474
|
+
/** @internal */ BaseShape._tempVector30 = new Vector3();
|
|
38475
|
+
/** @internal */ BaseShape._tempVector31 = new Vector3();
|
|
38476
|
+
BaseShape._tempQuaternion = new Quaternion();
|
|
38367
38477
|
__decorate([
|
|
38368
38478
|
ignoreClone
|
|
38369
38479
|
], BaseShape.prototype, "_updateManager", void 0);
|
|
38480
|
+
__decorate([
|
|
38481
|
+
deepClone
|
|
38482
|
+
], BaseShape.prototype, "_position", void 0);
|
|
38483
|
+
__decorate([
|
|
38484
|
+
deepClone
|
|
38485
|
+
], BaseShape.prototype, "_rotation", void 0);
|
|
38486
|
+
__decorate([
|
|
38487
|
+
deepClone
|
|
38488
|
+
], BaseShape.prototype, "_scale", void 0);
|
|
38489
|
+
__decorate([
|
|
38490
|
+
ignoreClone
|
|
38491
|
+
], BaseShape.prototype, "_matrix", void 0);
|
|
38492
|
+
__decorate([
|
|
38493
|
+
ignoreClone
|
|
38494
|
+
], BaseShape.prototype, "_transformDirty", void 0);
|
|
38495
|
+
__decorate([
|
|
38496
|
+
ignoreClone
|
|
38497
|
+
], BaseShape.prototype, "_hasShapeTransform", void 0);
|
|
38498
|
+
__decorate([
|
|
38499
|
+
ignoreClone
|
|
38500
|
+
], BaseShape.prototype, "_onTransformChanged", void 0);
|
|
38370
38501
|
|
|
38371
38502
|
/**
|
|
38372
38503
|
* @internal
|
|
@@ -38432,11 +38563,11 @@ __decorate([
|
|
|
38432
38563
|
|
|
38433
38564
|
/**
|
|
38434
38565
|
* Particle shape that emits particles from a box.
|
|
38435
|
-
*/ var BoxShape = /*#__PURE__*/ function(
|
|
38436
|
-
_inherits(BoxShape,
|
|
38566
|
+
*/ var BoxShape = /*#__PURE__*/ function(BaseShape1) {
|
|
38567
|
+
_inherits(BoxShape, BaseShape1);
|
|
38437
38568
|
function BoxShape() {
|
|
38438
38569
|
var _this;
|
|
38439
|
-
_this =
|
|
38570
|
+
_this = BaseShape1.call(this) || this, _this.shapeType = ParticleShapeType.Box, _this._size = new Vector3(1, 1, 1);
|
|
38440
38571
|
// @ts-ignore
|
|
38441
38572
|
_this._size._onValueChanged = _this._updateManager.dispatch.bind(_this._updateManager);
|
|
38442
38573
|
return _this;
|
|
@@ -38444,17 +38575,17 @@ __decorate([
|
|
|
38444
38575
|
var _proto = BoxShape.prototype;
|
|
38445
38576
|
/**
|
|
38446
38577
|
* @internal
|
|
38447
|
-
*/ _proto.
|
|
38578
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38448
38579
|
ShapeUtils._randomPointInsideHalfUnitBox(position, rand);
|
|
38449
38580
|
position.multiply(this.size);
|
|
38450
|
-
var defaultDirection =
|
|
38581
|
+
var defaultDirection = BaseShape._tempVector30;
|
|
38451
38582
|
defaultDirection.set(0.0, 0.0, -1.0);
|
|
38452
38583
|
ShapeUtils._randomPointUnitSphere(direction, rand);
|
|
38453
38584
|
Vector3.lerp(defaultDirection, direction, this.randomDirectionAmount, direction);
|
|
38454
38585
|
};
|
|
38455
38586
|
/**
|
|
38456
38587
|
* @internal
|
|
38457
|
-
*/ _proto.
|
|
38588
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38458
38589
|
var radian = Math.PI * this.randomDirectionAmount;
|
|
38459
38590
|
if (this.randomDirectionAmount < 0.5) {
|
|
38460
38591
|
var dirSin = Math.sin(radian);
|
|
@@ -38468,7 +38599,7 @@ __decorate([
|
|
|
38468
38599
|
};
|
|
38469
38600
|
/**
|
|
38470
38601
|
* @internal
|
|
38471
|
-
*/ _proto.
|
|
38602
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38472
38603
|
var _this__size = this._size, x = _this__size.x, y = _this__size.y, z = _this__size.z;
|
|
38473
38604
|
outMin.set(-x * 0.5, -y * 0.5, -z * 0.5);
|
|
38474
38605
|
outMax.set(x * 0.5, y * 0.5, z * 0.5);
|
|
@@ -38490,7 +38621,6 @@ __decorate([
|
|
|
38490
38621
|
]);
|
|
38491
38622
|
return BoxShape;
|
|
38492
38623
|
}(BaseShape);
|
|
38493
|
-
BoxShape._tempVector30 = new Vector3();
|
|
38494
38624
|
__decorate([
|
|
38495
38625
|
deepClone
|
|
38496
38626
|
], BoxShape.prototype, "_size", void 0);
|
|
@@ -38505,18 +38635,18 @@ __decorate([
|
|
|
38505
38635
|
|
|
38506
38636
|
/**
|
|
38507
38637
|
* Particle shape that emits particles from a circle.
|
|
38508
|
-
*/ var CircleShape = /*#__PURE__*/ function(
|
|
38509
|
-
_inherits(CircleShape,
|
|
38638
|
+
*/ var CircleShape = /*#__PURE__*/ function(BaseShape1) {
|
|
38639
|
+
_inherits(CircleShape, BaseShape1);
|
|
38510
38640
|
function CircleShape() {
|
|
38511
38641
|
var _this;
|
|
38512
|
-
_this =
|
|
38642
|
+
_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;
|
|
38513
38643
|
return _this;
|
|
38514
38644
|
}
|
|
38515
38645
|
var _proto = CircleShape.prototype;
|
|
38516
38646
|
/**
|
|
38517
38647
|
* @internal
|
|
38518
|
-
*/ _proto.
|
|
38519
|
-
var positionPoint =
|
|
38648
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38649
|
+
var positionPoint = BaseShape._tempVector20;
|
|
38520
38650
|
switch(this.arcMode){
|
|
38521
38651
|
case ParticleShapeArcMode.Loop:
|
|
38522
38652
|
var normalizedEmitTime = emitTime * this.arcSpeed * (360 / this.arc) % 1;
|
|
@@ -38535,7 +38665,7 @@ __decorate([
|
|
|
38535
38665
|
};
|
|
38536
38666
|
/**
|
|
38537
38667
|
* @internal
|
|
38538
|
-
*/ _proto.
|
|
38668
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38539
38669
|
var randomDirZ = this.randomDirectionAmount > 0.5 ? 1 : Math.sin(this.randomDirectionAmount * Math.PI);
|
|
38540
38670
|
var randomDegreeOnXY = 0.5 * (360 - this._arc) * this.randomDirectionAmount;
|
|
38541
38671
|
var randomDirY = randomDegreeOnXY > 90 ? -1 : -Math.sin(randomDegreeOnXY);
|
|
@@ -38543,7 +38673,7 @@ __decorate([
|
|
|
38543
38673
|
};
|
|
38544
38674
|
/**
|
|
38545
38675
|
* @internal
|
|
38546
|
-
*/ _proto.
|
|
38676
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38547
38677
|
this._getUnitArcRange(this._arc, outMin, outMax, 0, 0);
|
|
38548
38678
|
outMin.scale(this._radius);
|
|
38549
38679
|
outMax.scale(this._radius);
|
|
@@ -38626,22 +38756,21 @@ __decorate([
|
|
|
38626
38756
|
]);
|
|
38627
38757
|
return CircleShape;
|
|
38628
38758
|
}(BaseShape);
|
|
38629
|
-
CircleShape._tempPositionPoint = new Vector2();
|
|
38630
38759
|
|
|
38631
38760
|
/**
|
|
38632
38761
|
* Cone shape.
|
|
38633
|
-
*/ var ConeShape = /*#__PURE__*/ function(
|
|
38634
|
-
_inherits(ConeShape,
|
|
38762
|
+
*/ var ConeShape = /*#__PURE__*/ function(BaseShape1) {
|
|
38763
|
+
_inherits(ConeShape, BaseShape1);
|
|
38635
38764
|
function ConeShape() {
|
|
38636
38765
|
var _this;
|
|
38637
|
-
_this =
|
|
38766
|
+
_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;
|
|
38638
38767
|
return _this;
|
|
38639
38768
|
}
|
|
38640
38769
|
var _proto = ConeShape.prototype;
|
|
38641
38770
|
/**
|
|
38642
38771
|
* @internal
|
|
38643
|
-
*/ _proto.
|
|
38644
|
-
var unitPosition =
|
|
38772
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38773
|
+
var unitPosition = BaseShape._tempVector20;
|
|
38645
38774
|
var radian = MathUtil.degreeToRadian(this.angle);
|
|
38646
38775
|
var dirSinA = Math.sin(radian);
|
|
38647
38776
|
var dirCosA = Math.cos(radian);
|
|
@@ -38649,7 +38778,7 @@ CircleShape._tempPositionPoint = new Vector2();
|
|
|
38649
38778
|
case 0:
|
|
38650
38779
|
ShapeUtils.randomPointInsideUnitCircle(unitPosition, rand);
|
|
38651
38780
|
position.set(unitPosition.x * this.radius, unitPosition.y * this.radius, 0);
|
|
38652
|
-
var unitDirection =
|
|
38781
|
+
var unitDirection = BaseShape._tempVector21;
|
|
38653
38782
|
ShapeUtils.randomPointInsideUnitCircle(unitDirection, rand);
|
|
38654
38783
|
Vector2.lerp(unitPosition, unitDirection, this.randomDirectionAmount, unitDirection);
|
|
38655
38784
|
direction.set(unitDirection.x * dirSinA, unitDirection.y * dirSinA, -dirCosA);
|
|
@@ -38659,10 +38788,10 @@ CircleShape._tempPositionPoint = new Vector2();
|
|
|
38659
38788
|
position.set(unitPosition.x * this.radius, unitPosition.y * this.radius, 0);
|
|
38660
38789
|
direction.set(unitPosition.x * dirSinA, unitPosition.y * dirSinA, -dirCosA);
|
|
38661
38790
|
direction.normalize();
|
|
38662
|
-
var distance =
|
|
38791
|
+
var distance = BaseShape._tempVector30;
|
|
38663
38792
|
Vector3.scale(direction, this.length * rand.random(), distance);
|
|
38664
38793
|
position.add(distance);
|
|
38665
|
-
var randomDirection =
|
|
38794
|
+
var randomDirection = BaseShape._tempVector31;
|
|
38666
38795
|
ShapeUtils._randomPointUnitSphere(randomDirection, rand);
|
|
38667
38796
|
Vector3.lerp(direction, randomDirection, this.randomDirectionAmount, direction);
|
|
38668
38797
|
break;
|
|
@@ -38670,7 +38799,7 @@ CircleShape._tempPositionPoint = new Vector2();
|
|
|
38670
38799
|
};
|
|
38671
38800
|
/**
|
|
38672
38801
|
* @internal
|
|
38673
|
-
*/ _proto.
|
|
38802
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38674
38803
|
var radian = 0;
|
|
38675
38804
|
switch(this.emitType){
|
|
38676
38805
|
case 0:
|
|
@@ -38687,7 +38816,7 @@ CircleShape._tempPositionPoint = new Vector2();
|
|
|
38687
38816
|
};
|
|
38688
38817
|
/**
|
|
38689
38818
|
* @internal
|
|
38690
|
-
*/ _proto.
|
|
38819
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38691
38820
|
var radius = this.radius;
|
|
38692
38821
|
switch(this.emitType){
|
|
38693
38822
|
case 0:
|
|
@@ -38762,10 +38891,6 @@ CircleShape._tempPositionPoint = new Vector2();
|
|
|
38762
38891
|
]);
|
|
38763
38892
|
return ConeShape;
|
|
38764
38893
|
}(BaseShape);
|
|
38765
|
-
ConeShape._tempVector20 = new Vector2();
|
|
38766
|
-
ConeShape._tempVector21 = new Vector2();
|
|
38767
|
-
ConeShape._tempVector30 = new Vector3();
|
|
38768
|
-
ConeShape._tempVector31 = new Vector3();
|
|
38769
38894
|
/**
|
|
38770
38895
|
* Cone emitter type.
|
|
38771
38896
|
*/ var ConeEmitType = /*#__PURE__*/ function(ConeEmitType) {
|
|
@@ -38786,7 +38911,7 @@ ConeShape._tempVector31 = new Vector3();
|
|
|
38786
38911
|
var _proto = HemisphereShape.prototype;
|
|
38787
38912
|
/**
|
|
38788
38913
|
* @internal
|
|
38789
|
-
*/ _proto.
|
|
38914
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38790
38915
|
ShapeUtils._randomPointInsideUnitSphere(position, rand);
|
|
38791
38916
|
position.scale(this.radius);
|
|
38792
38917
|
var z = position.z;
|
|
@@ -38796,14 +38921,14 @@ ConeShape._tempVector31 = new Vector3();
|
|
|
38796
38921
|
};
|
|
38797
38922
|
/**
|
|
38798
38923
|
* @internal
|
|
38799
|
-
*/ _proto.
|
|
38924
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38800
38925
|
var randomDir = Math.sin(0.5 * this.randomDirectionAmount * Math.PI);
|
|
38801
38926
|
outMin.set(-1, -1, -1);
|
|
38802
38927
|
outMax.set(1, 1, randomDir);
|
|
38803
38928
|
};
|
|
38804
38929
|
/**
|
|
38805
38930
|
* @internal
|
|
38806
|
-
*/ _proto.
|
|
38931
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38807
38932
|
var radius = this._radius;
|
|
38808
38933
|
outMin.set(-radius, -radius, -radius);
|
|
38809
38934
|
outMax.set(radius, radius, 0);
|
|
@@ -38841,7 +38966,7 @@ ConeShape._tempVector31 = new Vector3();
|
|
|
38841
38966
|
var _proto = MeshShape.prototype;
|
|
38842
38967
|
/**
|
|
38843
38968
|
* @internal
|
|
38844
|
-
*/ _proto.
|
|
38969
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38845
38970
|
var _this = this, positions = _this._positionBuffer, positionInfo = _this._positionElementInfo, normals = _this._normalBuffer, normalInfo = _this._normalElementInfo;
|
|
38846
38971
|
var randomIndex = Math.floor(rand.random() * this._mesh.vertexCount);
|
|
38847
38972
|
// index = randomIndex * stride + offset
|
|
@@ -38854,14 +38979,14 @@ ConeShape._tempVector31 = new Vector3();
|
|
|
38854
38979
|
};
|
|
38855
38980
|
/**
|
|
38856
38981
|
* @internal
|
|
38857
|
-
*/ _proto.
|
|
38982
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38858
38983
|
var bounds = this._mesh.bounds;
|
|
38859
38984
|
bounds.min.copyTo(outMin);
|
|
38860
38985
|
bounds.max.copyTo(outMax);
|
|
38861
38986
|
};
|
|
38862
38987
|
/**
|
|
38863
38988
|
* @internal
|
|
38864
|
-
*/ _proto.
|
|
38989
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38865
38990
|
// @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.
|
|
38866
38991
|
var bounds = this._mesh.bounds;
|
|
38867
38992
|
bounds.min.copyTo(outMin);
|
|
@@ -38976,7 +39101,7 @@ __decorate([
|
|
|
38976
39101
|
var _proto = SphereShape.prototype;
|
|
38977
39102
|
/**
|
|
38978
39103
|
* @internal
|
|
38979
|
-
*/ _proto.
|
|
39104
|
+
*/ _proto._generateLocalPositionAndDirection = function _generateLocalPositionAndDirection(rand, emitTime, position, direction) {
|
|
38980
39105
|
ShapeUtils._randomPointInsideUnitSphere(position, rand);
|
|
38981
39106
|
position.scale(this.radius);
|
|
38982
39107
|
ShapeUtils._randomPointUnitSphere(direction, rand);
|
|
@@ -38984,13 +39109,13 @@ __decorate([
|
|
|
38984
39109
|
};
|
|
38985
39110
|
/**
|
|
38986
39111
|
* @internal
|
|
38987
|
-
*/ _proto.
|
|
39112
|
+
*/ _proto._getLocalDirectionRange = function _getLocalDirectionRange(outMin, outMax) {
|
|
38988
39113
|
outMin.set(-1, -1, -1);
|
|
38989
39114
|
outMax.set(1, 1, 1);
|
|
38990
39115
|
};
|
|
38991
39116
|
/**
|
|
38992
39117
|
* @internal
|
|
38993
|
-
*/ _proto.
|
|
39118
|
+
*/ _proto._getLocalPositionRange = function _getLocalPositionRange(outMin, outMax) {
|
|
38994
39119
|
var radius = this._radius;
|
|
38995
39120
|
outMin.set(-radius, -radius, -radius);
|
|
38996
39121
|
outMax.set(radius, radius, radius);
|
|
@@ -39753,7 +39878,7 @@ var cacheDir = new Vector3();
|
|
|
39753
39878
|
* Suspend the audio context.
|
|
39754
39879
|
* @returns A promise that resolves when the audio context is suspended
|
|
39755
39880
|
*/ AudioManager.suspend = function suspend() {
|
|
39756
|
-
return AudioManager.
|
|
39881
|
+
return AudioManager.getContext().suspend();
|
|
39757
39882
|
};
|
|
39758
39883
|
/**
|
|
39759
39884
|
* Resume the audio context.
|
|
@@ -39762,7 +39887,7 @@ var cacheDir = new Vector3();
|
|
|
39762
39887
|
*/ AudioManager.resume = function resume() {
|
|
39763
39888
|
var _AudioManager;
|
|
39764
39889
|
var __resumePromise;
|
|
39765
|
-
return (__resumePromise = (_AudioManager = AudioManager)._resumePromise) != null ? __resumePromise : _AudioManager._resumePromise = AudioManager.
|
|
39890
|
+
return (__resumePromise = (_AudioManager = AudioManager)._resumePromise) != null ? __resumePromise : _AudioManager._resumePromise = AudioManager.getContext().resume().then(function() {
|
|
39766
39891
|
AudioManager._needsUserGestureResume = false;
|
|
39767
39892
|
}).finally(function() {
|
|
39768
39893
|
AudioManager._resumePromise = null;
|