@galacean/engine-core 0.0.0-experimental-2.0-game.13 → 0.0.0-experimental-2.0-game.14
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 +193 -74
- package/dist/main.js.map +1 -1
- package/dist/module.js +193 -75
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/animation/Animator.d.ts +1 -1
- package/types/animation/internal/AnimatorStatePlayData.d.ts +3 -3
- package/types/particle/modules/EmissionModule.d.ts +5 -0
- package/types/physics/Collider.d.ts +8 -0
- package/types/physics/DynamicCollider.d.ts +20 -0
- package/types/physics/index.d.ts +1 -1
package/dist/main.js
CHANGED
|
@@ -7360,7 +7360,7 @@ var particle_common = "vec3 rotationByQuaternions(in vec3 v, in vec4 q) {\n r
|
|
|
7360
7360
|
|
|
7361
7361
|
var velocity_over_lifetime_module = "#if defined(RENDERER_VOL_CONSTANT_MODE) || defined(RENDERER_VOL_CURVE_MODE)\n #define _VOL_MODULE_ENABLED\n#endif\n\n#ifdef _VOL_MODULE_ENABLED\n uniform int renderer_VOLSpace;\n\n #ifdef RENDERER_VOL_CONSTANT_MODE\n uniform vec3 renderer_VOLMaxConst;\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n uniform vec3 renderer_VOLMinConst;\n #endif\n #endif\n\n #ifdef RENDERER_VOL_CURVE_MODE\n uniform vec2 renderer_VOLMaxGradientX[4]; // x:time y:value\n uniform vec2 renderer_VOLMaxGradientY[4]; // x:time y:value\n uniform vec2 renderer_VOLMaxGradientZ[4]; // x:time y:value\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n uniform vec2 renderer_VOLMinGradientX[4]; // x:time y:value\n uniform vec2 renderer_VOLMinGradientY[4]; // x:time y:value\n uniform vec2 renderer_VOLMinGradientZ[4]; // x:time y:value\n #endif\n #endif\n\n\n vec3 computeVelocityPositionOffset(in float normalizedAge, in float age, out vec3 currentVelocity) {\n vec3 velocityPosition;\n\n #ifdef RENDERER_VOL_CONSTANT_MODE\n currentVelocity = renderer_VOLMaxConst;\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n currentVelocity = mix(renderer_VOLMinConst, currentVelocity, a_Random1.yzw);\n #endif\n\n velocityPosition = currentVelocity * age;\n #endif\n\n #ifdef RENDERER_VOL_CURVE_MODE\n velocityPosition = vec3(\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientX, normalizedAge, currentVelocity.x),\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientY, normalizedAge, currentVelocity.y),\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientZ, normalizedAge, currentVelocity.z));\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n vec3 minCurrentVelocity;\n vec3 minVelocityPosition = vec3(\n evaluateParticleCurveCumulative(renderer_VOLMinGradientX, normalizedAge, minCurrentVelocity.x),\n evaluateParticleCurveCumulative(renderer_VOLMinGradientY, normalizedAge, minCurrentVelocity.y),\n evaluateParticleCurveCumulative(renderer_VOLMinGradientZ, normalizedAge, minCurrentVelocity.z));\n\n currentVelocity = mix(minCurrentVelocity, currentVelocity, a_Random1.yzw);\n velocityPosition = mix(minVelocityPosition, velocityPosition, a_Random1.yzw);\n #endif\n\n velocityPosition *= vec3(a_ShapePositionStartLifeTime.w);\n #endif\n return velocityPosition;\n }\n#endif\n"; // eslint-disable-line
|
|
7362
7362
|
|
|
7363
|
-
var rotation_over_lifetime_module = "#if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n uniform vec2 renderer_ROLMaxCurveZ[4];\n #ifdef RENDERER_ROL_IS_SEPARATE\n uniform vec2 renderer_ROLMaxCurveX[4];\n uniform vec2 renderer_ROLMaxCurveY[4];\n #endif\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec2 renderer_ROLMinCurveZ[4];\n #ifdef RENDERER_ROL_IS_SEPARATE\n uniform vec2 renderer_ROLMinCurveX[4];\n uniform vec2 renderer_ROLMinCurveY[4];\n #endif\n #endif\n #else\n uniform vec3 renderer_ROLMaxConst;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec3 renderer_ROLMinConst;\n #endif\n #endif\n#endif\n\nfloat computeParticleRotationFloat(in float rotation, in float age, in float normalizedAge) {\n #if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue), lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * a_ShapePositionStartLifeTime.w;\n #else\n float lifeRotation = renderer_ROLMaxConst.z;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(renderer_ROLMinConst.z, lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * age;\n #endif\n #endif\n return rotation;\n}\n\n\n#if defined(RENDERER_MODE_MESH) && (defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE))\nvec3 computeParticleRotationVec3(in vec3 rotation, in float age, in float normalizedAge) {\n #ifdef RENDERER_ROL_IS_SEPARATE\n #ifdef RENDERER_ROL_CONSTANT_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n vec3 ageRot = mix(renderer_ROLMinConst, renderer_ROLMaxConst, a_Random0.w) * age;\n #else\n vec3 ageRot = renderer_ROLMaxConst * age;\n #endif\n rotation += ageRot;\n #endif\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifetime = a_ShapePositionStartLifeTime.w;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n rotation += vec3(\n mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveX, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveX, normalizedAge, currentValue), a_Random0.w),\n mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveY, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveY, normalizedAge, currentValue), a_Random0.w),\n mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue), a_Random0.w)) * lifetime;\n #else\n rotation += vec3(\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveX, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveY, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue)) * lifetime;\n #endif\n #endif\n #else\n #ifdef RENDERER_ROL_CONSTANT_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n float ageRot = mix(renderer_ROLMinConst.z, renderer_ROLMaxConst.z, a_Random0.w) * age;\n #else\n float ageRot = renderer_ROLMaxConst.z * age;\n #endif\n rotation += ageRot;\n #endif\n\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue), lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * a_ShapePositionStartLifeTime.w;\n #endif\n #endif\n return rotation;\n}\n#endif\n"; // eslint-disable-line
|
|
7363
|
+
var rotation_over_lifetime_module = "#if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n uniform vec2 renderer_ROLMaxCurveZ[4];\n #ifdef RENDERER_ROL_IS_SEPARATE\n uniform vec2 renderer_ROLMaxCurveX[4];\n uniform vec2 renderer_ROLMaxCurveY[4];\n #endif\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec2 renderer_ROLMinCurveZ[4];\n #ifdef RENDERER_ROL_IS_SEPARATE\n uniform vec2 renderer_ROLMinCurveX[4];\n uniform vec2 renderer_ROLMinCurveY[4];\n #endif\n #endif\n #else\n uniform vec3 renderer_ROLMaxConst;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec3 renderer_ROLMinConst;\n #endif\n #endif\n#endif\n\nfloat computeParticleRotationFloat(in float rotation, in float age, in float normalizedAge) {\n #if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue), lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * a_ShapePositionStartLifeTime.w;\n #else\n float lifeRotation = renderer_ROLMaxConst.z;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(renderer_ROLMinConst.z, lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * age;\n #endif\n #endif\n return rotation;\n}\n\n\n#if defined(RENDERER_MODE_MESH) && (defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE))\nvec3 computeParticleRotationVec3(in vec3 rotation, in float age, in float normalizedAge) {\n #ifdef RENDERER_ROL_IS_SEPARATE\n #ifdef RENDERER_ROL_CONSTANT_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n vec3 ageRot = mix(renderer_ROLMinConst, renderer_ROLMaxConst, a_Random0.w) * age;\n #else\n vec3 ageRot = renderer_ROLMaxConst * age;\n #endif\n rotation += ageRot;\n #endif\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifetime = a_ShapePositionStartLifeTime.w;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n rotation += vec3(\n mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveX, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveX, normalizedAge, currentValue), a_Random0.w),\n mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveY, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveY, normalizedAge, currentValue), a_Random0.w),\n mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue), a_Random0.w)) * lifetime;\n #else\n rotation += vec3(\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveX, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveY, normalizedAge, currentValue),\n evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue)) * lifetime;\n #endif\n #endif\n #else\n #ifdef RENDERER_ROL_CONSTANT_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n float ageRot = mix(renderer_ROLMinConst.z, renderer_ROLMaxConst.z, a_Random0.w) * age;\n #else\n float ageRot = renderer_ROLMaxConst.z * age;\n #endif\n rotation.z += ageRot;\n #endif\n\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue), lifeRotation, a_Random0.w);\n #endif\n rotation.z += lifeRotation * a_ShapePositionStartLifeTime.w;\n #endif\n #endif\n return rotation;\n}\n#endif\n"; // eslint-disable-line
|
|
7364
7364
|
|
|
7365
7365
|
var size_over_lifetime_module = "#ifdef RENDERER_SOL_CURVE_MODE\n uniform vec2 renderer_SOLMaxCurveX[4]; // x:time y:value\n #ifdef RENDERER_SOL_IS_SEPARATE\n uniform vec2 renderer_SOLMaxCurveY[4]; // x:time y:value\n uniform vec2 renderer_SOLMaxCurveZ[4]; // x:time y:value\n #endif\n\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n uniform vec2 renderer_SOLMinCurveX[4]; // x:time y:value\n #ifdef RENDERER_SOL_IS_SEPARATE\n uniform vec2 renderer_SOLMinCurveY[4]; // x:time y:value\n uniform vec2 renderer_SOLMinCurveZ[4]; // x:time y:value\n #endif\n #endif\n#endif\n\nvec2 computeParticleSizeBillboard(in vec2 size, in float normalizedAge) {\n #ifdef RENDERER_SOL_CURVE_MODE\n float lifeSizeX = evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge);\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n lifeSizeX = mix(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge), lifeSizeX, a_Random0.z);\n #endif\n\n #ifdef RENDERER_SOL_IS_SEPARATE\n float lifeSizeY = evaluateParticleCurve(renderer_SOLMaxCurveY, normalizedAge);\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n lifeSizeY = mix(evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge), lifeSizeY, a_Random0.z);\n #endif\n size *= vec2(lifeSizeX, lifeSizeY);\n #else\n size *= lifeSizeX;\n #endif\n #endif\n return size;\n}\n\n#ifdef RENDERER_MODE_MESH\n vec3 computeParticleSizeMesh(in vec3 size, in float normalizedAge) {\n #ifdef RENDERER_SOL_CURVE\n size *= evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge);\n #endif\n #ifdef RENDERER_SOL_RANDOM_CURVES\n size *= mix(evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge),\n evaluateParticleCurve(u_SOLSizeGradientMax, normalizedAge),\n a_Random0.z);\n #endif\n #ifdef RENDERER_SOL_CURVE_SEPARATE\n size *= vec3(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge),\n evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge),\n evaluateParticleCurve(renderer_SOLMinCurveZ, normalizedAge));\n #endif\n #ifdef RENDERER_SOL_RANDOM_CURVES_SEPARATE\n size *= vec3(mix(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge),\n a_Random0.z),\n mix(evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveY, normalizedAge),\n a_Random0.z),\n mix(evaluateParticleCurve(renderer_SOLMinCurveZ, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveZ, normalizedAge),\n a_Random0.z));\n #endif\n return size;\n }\n#endif"; // eslint-disable-line
|
|
7366
7366
|
|
|
@@ -20559,7 +20559,13 @@ exports.Collider = /*#__PURE__*/ function(Component) {
|
|
|
20559
20559
|
_inherits(Collider, Component);
|
|
20560
20560
|
function Collider(entity) {
|
|
20561
20561
|
var _this;
|
|
20562
|
-
_this = Component.call(this, entity) || this, /** @internal */ _this._index = -1, _this._shapes = [], _this._collisionLayerIndex = 0
|
|
20562
|
+
_this = Component.call(this, entity) || this, /** @internal */ _this._index = -1, _this._shapes = [], _this._collisionLayerIndex = 0, /**
|
|
20563
|
+
* Disabling a collider only detaches its native actor from the simulation
|
|
20564
|
+
* scene; the actor is not destroyed, so on re-enable it still holds its
|
|
20565
|
+
* pre-disable pose. The first transform sync after (re-)enable must teleport,
|
|
20566
|
+
* never sweep — otherwise a kinematic actor drags across the scene from that
|
|
20567
|
+
* stale pose and fires spurious contacts along the path.
|
|
20568
|
+
*/ _this._pendingReenterTeleport = false;
|
|
20563
20569
|
_this._updateFlag = entity.registerWorldChangeFlag();
|
|
20564
20570
|
return _this;
|
|
20565
20571
|
}
|
|
@@ -20603,9 +20609,14 @@ exports.Collider = /*#__PURE__*/ function(Component) {
|
|
|
20603
20609
|
* @internal
|
|
20604
20610
|
*/ _proto._onUpdate = function _onUpdate() {
|
|
20605
20611
|
var shapes = this._shapes;
|
|
20606
|
-
if (this._updateFlag.flag) {
|
|
20612
|
+
if (this._pendingReenterTeleport || this._updateFlag.flag) {
|
|
20607
20613
|
var transform = this.entity.transform;
|
|
20608
|
-
this.
|
|
20614
|
+
if (this._pendingReenterTeleport) {
|
|
20615
|
+
this._teleportToEntityTransform(transform.worldPosition, transform.worldRotationQuaternion);
|
|
20616
|
+
this._pendingReenterTeleport = false;
|
|
20617
|
+
} else {
|
|
20618
|
+
this._syncEntityTransformToNative(transform.worldPosition, transform.worldRotationQuaternion);
|
|
20619
|
+
}
|
|
20609
20620
|
var worldScale = transform.lossyWorldScale;
|
|
20610
20621
|
for(var i = 0, n = shapes.length; i < n; i++){
|
|
20611
20622
|
var _shapes_i__nativeShape;
|
|
@@ -20627,6 +20638,7 @@ exports.Collider = /*#__PURE__*/ function(Component) {
|
|
|
20627
20638
|
* @internal
|
|
20628
20639
|
*/ _proto._onEnableInScene = function _onEnableInScene() {
|
|
20629
20640
|
this.scene.physics._addCollider(this);
|
|
20641
|
+
this._pendingReenterTeleport = true;
|
|
20630
20642
|
};
|
|
20631
20643
|
/**
|
|
20632
20644
|
* @internal
|
|
@@ -20745,6 +20757,9 @@ __decorate([
|
|
|
20745
20757
|
__decorate([
|
|
20746
20758
|
deepClone
|
|
20747
20759
|
], exports.Collider.prototype, "_shapes", void 0);
|
|
20760
|
+
__decorate([
|
|
20761
|
+
ignoreClone
|
|
20762
|
+
], exports.Collider.prototype, "_pendingReenterTeleport", void 0);
|
|
20748
20763
|
exports.Collider = __decorate([
|
|
20749
20764
|
dependentComponents(Transform, DependentMode.CheckOnly)
|
|
20750
20765
|
], exports.Collider);
|
|
@@ -21045,7 +21060,6 @@ __decorate([
|
|
|
21045
21060
|
this._isTrigger = false;
|
|
21046
21061
|
this._rotation = new engineMath.Vector3();
|
|
21047
21062
|
this._position = new engineMath.Vector3();
|
|
21048
|
-
this._contactOffset = 0.02;
|
|
21049
21063
|
/**
|
|
21050
21064
|
* @internal
|
|
21051
21065
|
* @beta
|
|
@@ -21111,7 +21125,9 @@ __decorate([
|
|
|
21111
21125
|
if (!this._nativeShape) return;
|
|
21112
21126
|
this._nativeShape.setPosition(this._position);
|
|
21113
21127
|
this._nativeShape.setRotation(this._rotation);
|
|
21114
|
-
|
|
21128
|
+
if (this._contactOffset !== undefined) {
|
|
21129
|
+
this._nativeShape.setContactOffset(this._contactOffset);
|
|
21130
|
+
}
|
|
21115
21131
|
this._nativeShape.setIsTrigger(this._isTrigger);
|
|
21116
21132
|
this._nativeShape.setMaterial(this._material._nativeMaterial);
|
|
21117
21133
|
(_this__collider = this._collider) == null ? void 0 : _this__collider._handleShapesChanged(ColliderShapeChangeFlag.Property);
|
|
@@ -21149,7 +21165,9 @@ __decorate([
|
|
|
21149
21165
|
* Contact offset for this shape, the value must be greater than or equal to 0.
|
|
21150
21166
|
* @defaultValue 0.02
|
|
21151
21167
|
*/ function get() {
|
|
21152
|
-
|
|
21168
|
+
var _Engine__nativePhysics_getDefaultContactOffset, _Engine__nativePhysics;
|
|
21169
|
+
var _this__contactOffset, _ref;
|
|
21170
|
+
return (_ref = (_this__contactOffset = this._contactOffset) != null ? _this__contactOffset : (_Engine__nativePhysics = Engine._nativePhysics) == null ? void 0 : (_Engine__nativePhysics_getDefaultContactOffset = _Engine__nativePhysics.getDefaultContactOffset) == null ? void 0 : _Engine__nativePhysics_getDefaultContactOffset.call(_Engine__nativePhysics)) != null ? _ref : 0.02;
|
|
21153
21171
|
},
|
|
21154
21172
|
set: function set(value) {
|
|
21155
21173
|
value = Math.max(0, value);
|
|
@@ -21472,7 +21490,7 @@ __decorate([
|
|
|
21472
21490
|
_inherits(DynamicCollider, Collider);
|
|
21473
21491
|
function DynamicCollider(entity) {
|
|
21474
21492
|
var _this;
|
|
21475
|
-
_this = Collider.call(this, entity) || this, _this._linearDamping = 0, _this._angularDamping = 0.05, _this._linearVelocity = new engineMath.Vector3(), _this._angularVelocity = new engineMath.Vector3(), _this._mass = 1.0, _this._centerOfMass = new engineMath.Vector3(), _this._inertiaTensor = new engineMath.Vector3(1, 1, 1), _this._maxAngularVelocity = 18000 / Math.PI, _this._maxDepenetrationVelocity = 1.0000000331813535e32, _this._solverIterations = 4, _this._useGravity = true, _this._isKinematic = false, _this._constraints = 0, _this._collisionDetectionMode = 0, _this.
|
|
21493
|
+
_this = Collider.call(this, entity) || this, _this._linearDamping = 0, _this._angularDamping = 0.05, _this._linearVelocity = new engineMath.Vector3(), _this._angularVelocity = new engineMath.Vector3(), _this._mass = 1.0, _this._centerOfMass = new engineMath.Vector3(), _this._inertiaTensor = new engineMath.Vector3(1, 1, 1), _this._maxAngularVelocity = 18000 / Math.PI, _this._maxDepenetrationVelocity = 1.0000000331813535e32, _this._solverIterations = 4, _this._useGravity = true, _this._isKinematic = false, _this._constraints = 0, _this._collisionDetectionMode = 0, _this._kinematicTransformSyncMode = 0, _this._automaticCenterOfMass = true, _this._automaticInertiaTensor = true;
|
|
21476
21494
|
var transform = _this.entity.transform;
|
|
21477
21495
|
_this._nativeCollider = Engine._nativePhysics.createDynamicCollider(transform.worldPosition, transform.worldRotationQuaternion);
|
|
21478
21496
|
_this._setLinearVelocity = _this._setLinearVelocity.bind(_this);
|
|
@@ -21564,17 +21582,14 @@ __decorate([
|
|
|
21564
21582
|
* collision detection, use setKinematicTarget() instead."
|
|
21565
21583
|
*
|
|
21566
21584
|
* setGlobalPose is a teleport: PhysX skips contact detection between the old
|
|
21567
|
-
* and new pose
|
|
21568
|
-
*
|
|
21569
|
-
*
|
|
21570
|
-
*
|
|
21571
|
-
* setKinematicTarget) tells PhysX the actor is animating to the target during the
|
|
21572
|
-
* next simulate(), enabling sweep contact detection for kine-kine and kine-dynamic
|
|
21573
|
-
* pairs alike.
|
|
21585
|
+
* and new pose. setKinematicTarget tells PhysX the actor is animating to the
|
|
21586
|
+
* target during the next simulate(), enabling swept contacts. Some compatibility
|
|
21587
|
+
* layers need transform writes to stay teleport-like, so the sync mode is
|
|
21588
|
+
* explicit while {@link move} always keeps target semantics.
|
|
21574
21589
|
*
|
|
21575
21590
|
* @internal
|
|
21576
21591
|
*/ _proto._syncEntityTransformToNative = function _syncEntityTransformToNative(worldPosition, worldRotation) {
|
|
21577
|
-
if (this._isKinematic) {
|
|
21592
|
+
if (this._isKinematic && this._kinematicTransformSyncMode === 0) {
|
|
21578
21593
|
this._nativeCollider.move(worldPosition, worldRotation);
|
|
21579
21594
|
} else {
|
|
21580
21595
|
Collider.prototype._syncEntityTransformToNative.call(this, worldPosition, worldRotation);
|
|
@@ -21604,6 +21619,7 @@ __decorate([
|
|
|
21604
21619
|
target._angularVelocity.copyFrom(this.angularVelocity);
|
|
21605
21620
|
target._centerOfMass.copyFrom(this.centerOfMass);
|
|
21606
21621
|
target._inertiaTensor.copyFrom(this.inertiaTensor);
|
|
21622
|
+
target._kinematicTransformSyncMode = this._kinematicTransformSyncMode;
|
|
21607
21623
|
Collider.prototype._cloneTo.call(this, target);
|
|
21608
21624
|
};
|
|
21609
21625
|
/**
|
|
@@ -21629,7 +21645,9 @@ __decorate([
|
|
|
21629
21645
|
}
|
|
21630
21646
|
this._nativeCollider.setMaxAngularVelocity(this._maxAngularVelocity);
|
|
21631
21647
|
this._nativeCollider.setMaxDepenetrationVelocity(this._maxDepenetrationVelocity);
|
|
21632
|
-
|
|
21648
|
+
if (this._sleepThreshold !== undefined) {
|
|
21649
|
+
this._nativeCollider.setSleepThreshold(this._sleepThreshold);
|
|
21650
|
+
}
|
|
21633
21651
|
this._nativeCollider.setSolverIterations(this._solverIterations);
|
|
21634
21652
|
this._nativeCollider.setUseGravity(this._useGravity);
|
|
21635
21653
|
this._nativeCollider.setIsKinematic(this._isKinematic);
|
|
@@ -21853,7 +21871,9 @@ __decorate([
|
|
|
21853
21871
|
get: /**
|
|
21854
21872
|
* The mass-normalized energy threshold, below which objects start going to sleep.
|
|
21855
21873
|
*/ function get() {
|
|
21856
|
-
|
|
21874
|
+
var _Engine__nativePhysics_getDefaultSleepThreshold, _Engine__nativePhysics;
|
|
21875
|
+
var _this__sleepThreshold, _ref;
|
|
21876
|
+
return (_ref = (_this__sleepThreshold = this._sleepThreshold) != null ? _this__sleepThreshold : (_Engine__nativePhysics = Engine._nativePhysics) == null ? void 0 : (_Engine__nativePhysics_getDefaultSleepThreshold = _Engine__nativePhysics.getDefaultSleepThreshold) == null ? void 0 : _Engine__nativePhysics_getDefaultSleepThreshold.call(_Engine__nativePhysics)) != null ? _ref : 5e-3;
|
|
21857
21877
|
},
|
|
21858
21878
|
set: function set(value) {
|
|
21859
21879
|
if (value !== this._sleepThreshold) {
|
|
@@ -21949,6 +21969,22 @@ __decorate([
|
|
|
21949
21969
|
this._nativeCollider.setCollisionDetectionMode(value);
|
|
21950
21970
|
}
|
|
21951
21971
|
}
|
|
21972
|
+
},
|
|
21973
|
+
{
|
|
21974
|
+
key: "kinematicTransformSyncMode",
|
|
21975
|
+
get: /**
|
|
21976
|
+
* Controls how entity transform changes are synchronized to a kinematic native actor.
|
|
21977
|
+
*
|
|
21978
|
+
* @remarks
|
|
21979
|
+
* `Target` routes transform changes through {@link move}, so PhysX treats the
|
|
21980
|
+
* actor as moving between frames and can generate swept contacts. `Teleport`
|
|
21981
|
+
* writes the native pose directly and does not imply velocity.
|
|
21982
|
+
*/ function get() {
|
|
21983
|
+
return this._kinematicTransformSyncMode;
|
|
21984
|
+
},
|
|
21985
|
+
set: function set(value) {
|
|
21986
|
+
this._kinematicTransformSyncMode = value;
|
|
21987
|
+
}
|
|
21952
21988
|
}
|
|
21953
21989
|
]);
|
|
21954
21990
|
return DynamicCollider;
|
|
@@ -21990,6 +22026,13 @@ __decorate([
|
|
|
21990
22026
|
/** Speculative continuous collision detection is on for static and dynamic geometries */ CollisionDetectionMode[CollisionDetectionMode["ContinuousSpeculative"] = 3] = "ContinuousSpeculative";
|
|
21991
22027
|
return CollisionDetectionMode;
|
|
21992
22028
|
}({});
|
|
22029
|
+
/**
|
|
22030
|
+
* Kinematic transform synchronization mode.
|
|
22031
|
+
*/ var DynamicColliderKinematicTransformSyncMode = /*#__PURE__*/ function(DynamicColliderKinematicTransformSyncMode) {
|
|
22032
|
+
/** Synchronize transform changes through PhysX setKinematicTarget. */ DynamicColliderKinematicTransformSyncMode[DynamicColliderKinematicTransformSyncMode["Target"] = 0] = "Target";
|
|
22033
|
+
/** Synchronize transform changes by directly teleporting the native actor. */ DynamicColliderKinematicTransformSyncMode[DynamicColliderKinematicTransformSyncMode["Teleport"] = 1] = "Teleport";
|
|
22034
|
+
return DynamicColliderKinematicTransformSyncMode;
|
|
22035
|
+
}({});
|
|
21993
22036
|
/**
|
|
21994
22037
|
* Use these flags to constrain motion of dynamic collider.
|
|
21995
22038
|
*/ var DynamicColliderConstraints = /*#__PURE__*/ function(DynamicColliderConstraints) {
|
|
@@ -32929,6 +32972,14 @@ var AnimatorLayerBlendingMode = /*#__PURE__*/ function(AnimatorLayerBlendingMode
|
|
|
32929
32972
|
return LayerState;
|
|
32930
32973
|
}({});
|
|
32931
32974
|
|
|
32975
|
+
/**
|
|
32976
|
+
* Animation wrap mode.
|
|
32977
|
+
*/ var WrapMode = /*#__PURE__*/ function(WrapMode) {
|
|
32978
|
+
/** Play once */ WrapMode[WrapMode["Once"] = 0] = "Once";
|
|
32979
|
+
/** Loop play */ WrapMode[WrapMode["Loop"] = 1] = "Loop";
|
|
32980
|
+
return WrapMode;
|
|
32981
|
+
}({});
|
|
32982
|
+
|
|
32932
32983
|
/**
|
|
32933
32984
|
* @internal
|
|
32934
32985
|
*/ var AnimationEventHandler = /*#__PURE__*/ function() {
|
|
@@ -33040,22 +33091,15 @@ function _type_of(obj) {
|
|
|
33040
33091
|
return AnimatorStateTransition;
|
|
33041
33092
|
}();
|
|
33042
33093
|
|
|
33043
|
-
/**
|
|
33044
|
-
* Animation wrap mode.
|
|
33045
|
-
*/ var WrapMode = /*#__PURE__*/ function(WrapMode) {
|
|
33046
|
-
/** Play once */ WrapMode[WrapMode["Once"] = 0] = "Once";
|
|
33047
|
-
/** Loop play */ WrapMode[WrapMode["Loop"] = 1] = "Loop";
|
|
33048
|
-
return WrapMode;
|
|
33049
|
-
}({});
|
|
33050
|
-
|
|
33051
33094
|
/**
|
|
33052
33095
|
* Per-instance runtime data for an AnimatorState.
|
|
33053
33096
|
* Proxies read-only properties from the shared AnimatorState asset,
|
|
33054
|
-
* while providing per-instance mutable properties (e.g. speed).
|
|
33097
|
+
* while providing per-instance mutable properties (e.g. speed, wrapMode).
|
|
33055
33098
|
*/ var AnimatorStatePlayData = /*#__PURE__*/ function() {
|
|
33056
33099
|
function AnimatorStatePlayData() {
|
|
33057
33100
|
/** @internal */ this.isForward = true;
|
|
33058
33101
|
/** Per-instance speed. Initialized from AnimatorState.speed, safe to modify without affecting other instances. */ this.speed = 1.0;
|
|
33102
|
+
/** Per-instance wrap mode. Initialized from AnimatorState.wrapMode, safe to modify without affecting other instances. */ this.wrapMode = WrapMode.Loop;
|
|
33059
33103
|
this._changedOrientation = false;
|
|
33060
33104
|
}
|
|
33061
33105
|
var _proto = AnimatorStatePlayData.prototype;
|
|
@@ -33074,6 +33118,7 @@ function _type_of(obj) {
|
|
|
33074
33118
|
this.currentEventIndex = 0;
|
|
33075
33119
|
this.isForward = true;
|
|
33076
33120
|
this.speed = state.speed;
|
|
33121
|
+
this.wrapMode = state.wrapMode;
|
|
33077
33122
|
this.state._transitionCollection.needResetCurrentCheckIndex = true;
|
|
33078
33123
|
};
|
|
33079
33124
|
_proto.updateOrientation = function updateOrientation(deltaTime) {
|
|
@@ -33092,7 +33137,7 @@ function _type_of(obj) {
|
|
|
33092
33137
|
var time = this.playedTime + this.offsetFrameTime;
|
|
33093
33138
|
var duration = state._getDuration();
|
|
33094
33139
|
this.playState = AnimatorStatePlayState.Playing;
|
|
33095
|
-
if (
|
|
33140
|
+
if (this.wrapMode === WrapMode.Loop) {
|
|
33096
33141
|
time = duration ? time % duration : 0;
|
|
33097
33142
|
} else {
|
|
33098
33143
|
if (Math.abs(time) >= duration) {
|
|
@@ -33127,12 +33172,6 @@ function _type_of(obj) {
|
|
|
33127
33172
|
return this.state.clip;
|
|
33128
33173
|
}
|
|
33129
33174
|
},
|
|
33130
|
-
{
|
|
33131
|
-
key: "wrapMode",
|
|
33132
|
-
get: /** The wrap mode. */ function get() {
|
|
33133
|
-
return this.state.wrapMode;
|
|
33134
|
-
}
|
|
33135
|
-
},
|
|
33136
33175
|
{
|
|
33137
33176
|
key: "transitions",
|
|
33138
33177
|
get: /** The transitions going out of this state. */ function get() {
|
|
@@ -33282,7 +33321,7 @@ function _type_of(obj) {
|
|
|
33282
33321
|
* @param layerIndex - The layer index(default -1). If layer is -1, find the first state with the given state name
|
|
33283
33322
|
*/ /**
|
|
33284
33323
|
* Find the per-instance play data for a state by name.
|
|
33285
|
-
* The returned object's `speed`
|
|
33324
|
+
* The returned object's `speed` and `wrapMode` are per-instance and safe to modify without affecting other Animator instances.
|
|
33286
33325
|
* @param stateName - The state name
|
|
33287
33326
|
* @param layerIndex - The layer index (default -1, searches all layers)
|
|
33288
33327
|
* @returns Per-instance AnimatorStatePlayData, or null if not found
|
|
@@ -34108,22 +34147,27 @@ function _type_of(obj) {
|
|
|
34108
34147
|
return true;
|
|
34109
34148
|
};
|
|
34110
34149
|
_proto._fireAnimationEvents = function _fireAnimationEvents(playData, eventHandlers, lastClipTime, deltaTime) {
|
|
34111
|
-
var state = playData.state, isForward = playData.isForward, clipTime = playData.clipTime;
|
|
34150
|
+
var state = playData.state, isForward = playData.isForward, clipTime = playData.clipTime, wrapMode = playData.wrapMode;
|
|
34112
34151
|
var startTime = state._getClipActualStartTime();
|
|
34113
34152
|
var endTime = state._getClipActualEndTime();
|
|
34153
|
+
var canWrap = wrapMode === WrapMode.Loop;
|
|
34114
34154
|
if (isForward) {
|
|
34115
34155
|
if (lastClipTime + deltaTime >= endTime) {
|
|
34116
34156
|
this._fireSubAnimationEvents(playData, eventHandlers, lastClipTime, endTime);
|
|
34117
|
-
|
|
34118
|
-
|
|
34157
|
+
if (canWrap) {
|
|
34158
|
+
playData.currentEventIndex = 0;
|
|
34159
|
+
this._fireSubAnimationEvents(playData, eventHandlers, startTime, clipTime);
|
|
34160
|
+
}
|
|
34119
34161
|
} else {
|
|
34120
34162
|
this._fireSubAnimationEvents(playData, eventHandlers, lastClipTime, clipTime);
|
|
34121
34163
|
}
|
|
34122
34164
|
} else {
|
|
34123
34165
|
if (lastClipTime + deltaTime <= startTime) {
|
|
34124
34166
|
this._fireBackwardSubAnimationEvents(playData, eventHandlers, lastClipTime, startTime);
|
|
34125
|
-
|
|
34126
|
-
|
|
34167
|
+
if (canWrap) {
|
|
34168
|
+
playData.currentEventIndex = eventHandlers.length - 1;
|
|
34169
|
+
this._fireBackwardSubAnimationEvents(playData, eventHandlers, endTime, clipTime);
|
|
34170
|
+
}
|
|
34127
34171
|
} else {
|
|
34128
34172
|
this._fireBackwardSubAnimationEvents(playData, eventHandlers, lastClipTime, clipTime);
|
|
34129
34173
|
}
|
|
@@ -36615,7 +36659,7 @@ __decorate([
|
|
|
36615
36659
|
_inherits(EmissionModule, ParticleGeneratorModule);
|
|
36616
36660
|
function EmissionModule() {
|
|
36617
36661
|
var _this;
|
|
36618
|
-
_this = ParticleGeneratorModule.apply(this, arguments) || this, /** The rate of particle emission. */ _this.rateOverTime = new ParticleCompositeCurve(10), /** The rate at which the emitter spawns new particles over distance. */ _this.rateOverDistance = new ParticleCompositeCurve(0), /** @internal */ _this._shapeRand = new engineMath.Rand(0, ParticleRandomSubSeeds.Shape), /** @internal */ _this._frameRateTime = 0, _this._bursts = [], _this._currentBurstIndex = 0, _this._burstRand = new engineMath.Rand(0, ParticleRandomSubSeeds.Burst);
|
|
36662
|
+
_this = ParticleGeneratorModule.apply(this, arguments) || this, /** The rate of particle emission. */ _this.rateOverTime = new ParticleCompositeCurve(10), /** The rate at which the emitter spawns new particles over distance. */ _this.rateOverDistance = new ParticleCompositeCurve(0), /** @internal */ _this._shapeRand = new engineMath.Rand(0, ParticleRandomSubSeeds.Shape), /** @internal */ _this._frameRateTime = 0, _this._distanceAccumulator = 0, _this._lastEmitPosition = new engineMath.Vector3(), _this._hasLastEmitPosition = false, _this._bursts = [], _this._currentBurstIndex = 0, _this._burstRand = new engineMath.Rand(0, ParticleRandomSubSeeds.Burst);
|
|
36619
36663
|
return _this;
|
|
36620
36664
|
}
|
|
36621
36665
|
var _proto = EmissionModule.prototype;
|
|
@@ -36652,6 +36696,7 @@ __decorate([
|
|
|
36652
36696
|
* @internal
|
|
36653
36697
|
*/ _proto._emit = function _emit(lastPlayTime, playTime) {
|
|
36654
36698
|
this._emitByRateOverTime(playTime);
|
|
36699
|
+
this._emitByRateOverDistance(lastPlayTime, playTime);
|
|
36655
36700
|
this._emitByBurst(lastPlayTime, playTime);
|
|
36656
36701
|
};
|
|
36657
36702
|
/**
|
|
@@ -36665,6 +36710,13 @@ __decorate([
|
|
|
36665
36710
|
*/ _proto._reset = function _reset() {
|
|
36666
36711
|
this._frameRateTime = 0;
|
|
36667
36712
|
this._currentBurstIndex = 0;
|
|
36713
|
+
this._invalidateDistanceBaseline();
|
|
36714
|
+
};
|
|
36715
|
+
/**
|
|
36716
|
+
* @internal
|
|
36717
|
+
*/ _proto._invalidateDistanceBaseline = function _invalidateDistanceBaseline() {
|
|
36718
|
+
this._hasLastEmitPosition = false;
|
|
36719
|
+
this._distanceAccumulator = 0;
|
|
36668
36720
|
};
|
|
36669
36721
|
/**
|
|
36670
36722
|
* @internal
|
|
@@ -36685,6 +36737,55 @@ __decorate([
|
|
|
36685
36737
|
}
|
|
36686
36738
|
}
|
|
36687
36739
|
};
|
|
36740
|
+
_proto._emitByRateOverDistance = function _emitByRateOverDistance(lastPlayTime, playTime) {
|
|
36741
|
+
var ratePerUnit = this.rateOverDistance.evaluate(undefined, undefined);
|
|
36742
|
+
var generator = this._generator;
|
|
36743
|
+
if (ratePerUnit <= 0) {
|
|
36744
|
+
this._invalidateDistanceBaseline();
|
|
36745
|
+
return;
|
|
36746
|
+
}
|
|
36747
|
+
if (!this._hasLastEmitPosition) {
|
|
36748
|
+
this._lastEmitPosition.copyFrom(generator._renderer.entity.transform.worldPosition);
|
|
36749
|
+
this._hasLastEmitPosition = true;
|
|
36750
|
+
return;
|
|
36751
|
+
}
|
|
36752
|
+
var lastPos = this._lastEmitPosition;
|
|
36753
|
+
var currentPos = generator._renderer.entity.transform.worldPosition;
|
|
36754
|
+
var dx = currentPos.x - lastPos.x;
|
|
36755
|
+
var dy = currentPos.y - lastPos.y;
|
|
36756
|
+
var dz = currentPos.z - lastPos.z;
|
|
36757
|
+
var moveLength = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
36758
|
+
this._distanceAccumulator += moveLength;
|
|
36759
|
+
var emitInterval = 1.0 / ratePerUnit;
|
|
36760
|
+
// `+ zeroTolerance` absorbs float divide error so an exact `N*interval` accumulator doesn't drop 1
|
|
36761
|
+
var count = Math.floor(this._distanceAccumulator / emitInterval + engineMath.MathUtil.zeroTolerance);
|
|
36762
|
+
if (count > 0) {
|
|
36763
|
+
this._distanceAccumulator -= count * emitInterval;
|
|
36764
|
+
// `subFrameAge ∈ [0, 1]`: how far back into the frame a particle was born
|
|
36765
|
+
// (0 = newest at currentPos/playTime, 1 = oldest at lastPos/lastPlayTime).
|
|
36766
|
+
// The initial clamp protects two edges — moveLength ≈ 0 (collapse to frame-end
|
|
36767
|
+
// emit) and a tiny moveLength near the emitInterval edge (would put age > 1).
|
|
36768
|
+
// Local simulation space ignores the position override but still uses emitTime.
|
|
36769
|
+
var isWorld = generator.main.simulationSpace === ParticleSimulationSpace.World;
|
|
36770
|
+
var invMoveLength = moveLength > engineMath.MathUtil.zeroTolerance ? 1.0 / moveLength : 0;
|
|
36771
|
+
var ageStep = emitInterval * invMoveLength;
|
|
36772
|
+
var dt = playTime - lastPlayTime;
|
|
36773
|
+
var subFrameAge = Math.min(this._distanceAccumulator * invMoveLength, 1.0);
|
|
36774
|
+
var emitPos = EmissionModule._tempEmitPosition;
|
|
36775
|
+
for(var i = 0; i < count; i++){
|
|
36776
|
+
if (isWorld) {
|
|
36777
|
+
emitPos.set(currentPos.x - dx * subFrameAge, currentPos.y - dy * subFrameAge, currentPos.z - dz * subFrameAge);
|
|
36778
|
+
}
|
|
36779
|
+
if (generator._emit(playTime - dt * subFrameAge, 1, isWorld ? emitPos : undefined) === 0) {
|
|
36780
|
+
// Buffer full: settle the frame's distance budget instead of carrying it over
|
|
36781
|
+
this._distanceAccumulator = 0;
|
|
36782
|
+
break;
|
|
36783
|
+
}
|
|
36784
|
+
subFrameAge += ageStep;
|
|
36785
|
+
}
|
|
36786
|
+
}
|
|
36787
|
+
lastPos.copyFrom(currentPos);
|
|
36788
|
+
};
|
|
36688
36789
|
_proto._emitByBurst = function _emitByBurst(lastPlayTime, playTime) {
|
|
36689
36790
|
var main = this._generator.main;
|
|
36690
36791
|
var duration = main.duration;
|
|
@@ -36781,6 +36882,7 @@ __decorate([
|
|
|
36781
36882
|
return EmissionModule;
|
|
36782
36883
|
}(ParticleGeneratorModule);
|
|
36783
36884
|
/** @internal */ EmissionModule._emissionShapeMacro = ShaderMacro.getByName("RENDERER_EMISSION_SHAPE");
|
|
36885
|
+
EmissionModule._tempEmitPosition = new engineMath.Vector3();
|
|
36784
36886
|
__decorate([
|
|
36785
36887
|
deepClone
|
|
36786
36888
|
], EmissionModule.prototype, "rateOverTime", void 0);
|
|
@@ -36793,6 +36895,15 @@ __decorate([
|
|
|
36793
36895
|
__decorate([
|
|
36794
36896
|
ignoreClone
|
|
36795
36897
|
], EmissionModule.prototype, "_shapeRand", void 0);
|
|
36898
|
+
__decorate([
|
|
36899
|
+
ignoreClone
|
|
36900
|
+
], EmissionModule.prototype, "_distanceAccumulator", void 0);
|
|
36901
|
+
__decorate([
|
|
36902
|
+
ignoreClone
|
|
36903
|
+
], EmissionModule.prototype, "_lastEmitPosition", void 0);
|
|
36904
|
+
__decorate([
|
|
36905
|
+
ignoreClone
|
|
36906
|
+
], EmissionModule.prototype, "_hasLastEmitPosition", void 0);
|
|
36796
36907
|
__decorate([
|
|
36797
36908
|
deepClone
|
|
36798
36909
|
], EmissionModule.prototype, "_bursts", void 0);
|
|
@@ -38479,11 +38590,15 @@ __decorate([
|
|
|
38479
38590
|
}
|
|
38480
38591
|
} else {
|
|
38481
38592
|
this._isPlaying = false;
|
|
38593
|
+
// Invalidate the rateOverDistance baseline so emitter movement during the stop
|
|
38594
|
+
// interval doesn't burst on resume.
|
|
38482
38595
|
if (stopMode === ParticleStopMode.StopEmittingAndClear) {
|
|
38483
38596
|
this._clearActiveParticles();
|
|
38484
38597
|
this._playTime = 0;
|
|
38485
38598
|
this._firstActiveTransformedBoundingBox = this._firstFreeTransformedBoundingBox;
|
|
38486
38599
|
this.emission._reset();
|
|
38600
|
+
} else {
|
|
38601
|
+
this.emission._invalidateDistanceBaseline();
|
|
38487
38602
|
}
|
|
38488
38603
|
}
|
|
38489
38604
|
};
|
|
@@ -38495,37 +38610,40 @@ __decorate([
|
|
|
38495
38610
|
};
|
|
38496
38611
|
/**
|
|
38497
38612
|
* @internal
|
|
38498
|
-
*/ _proto._emit = function _emit(playTime, count) {
|
|
38499
|
-
var emission =
|
|
38500
|
-
if (emission.enabled) {
|
|
38501
|
-
|
|
38502
|
-
|
|
38503
|
-
|
|
38504
|
-
|
|
38505
|
-
|
|
38506
|
-
|
|
38507
|
-
|
|
38508
|
-
|
|
38509
|
-
|
|
38510
|
-
|
|
38511
|
-
|
|
38512
|
-
|
|
38513
|
-
|
|
38514
|
-
|
|
38515
|
-
|
|
38516
|
-
|
|
38517
|
-
|
|
38518
|
-
|
|
38519
|
-
|
|
38520
|
-
|
|
38521
|
-
|
|
38522
|
-
|
|
38523
|
-
|
|
38524
|
-
|
|
38613
|
+
*/ _proto._emit = function _emit(playTime, count, emitWorldPositionOverride) {
|
|
38614
|
+
var _this = this, emission = _this.emission, main = _this.main;
|
|
38615
|
+
if (!emission.enabled) {
|
|
38616
|
+
return 0;
|
|
38617
|
+
}
|
|
38618
|
+
var budget = main.maxParticles - this._getNotRetiredParticleCount();
|
|
38619
|
+
if (count > budget) {
|
|
38620
|
+
count = budget;
|
|
38621
|
+
}
|
|
38622
|
+
if (count <= 0) {
|
|
38623
|
+
return 0;
|
|
38624
|
+
}
|
|
38625
|
+
var position = ParticleGenerator._tempVector30;
|
|
38626
|
+
var direction = ParticleGenerator._tempVector31;
|
|
38627
|
+
var transform = this._renderer.entity.transform;
|
|
38628
|
+
var shape = emission.shape;
|
|
38629
|
+
var positionScale = main._getPositionScale();
|
|
38630
|
+
for(var i = 0; i < count; i++){
|
|
38631
|
+
if (shape == null ? void 0 : shape.enabled) {
|
|
38632
|
+
shape._generatePositionAndDirection(emission._shapeRand, playTime, position, direction);
|
|
38633
|
+
position.multiply(positionScale);
|
|
38634
|
+
direction.normalize().multiply(positionScale);
|
|
38635
|
+
} else {
|
|
38636
|
+
position.set(0, 0, 0);
|
|
38637
|
+
direction.set(0, 0, -1);
|
|
38638
|
+
// Speed is scaled by shape scale in world simulation space
|
|
38639
|
+
// So if no shape and in world simulation space, we shouldn't scale the speed
|
|
38640
|
+
if (main.simulationSpace === ParticleSimulationSpace.Local) {
|
|
38641
|
+
direction.multiply(positionScale);
|
|
38525
38642
|
}
|
|
38526
|
-
this._addNewParticle(position, direction, transform, playTime);
|
|
38527
38643
|
}
|
|
38644
|
+
this._addNewParticle(position, direction, transform, playTime, emitWorldPositionOverride);
|
|
38528
38645
|
}
|
|
38646
|
+
return count;
|
|
38529
38647
|
};
|
|
38530
38648
|
/**
|
|
38531
38649
|
* @internal
|
|
@@ -38927,7 +39045,7 @@ __decorate([
|
|
|
38927
39045
|
this._transformedBoundsArray[previousFreeElement * ParticleBufferUtils.boundsFloatStride + boundsTimeOffset] = this._playTime;
|
|
38928
39046
|
}
|
|
38929
39047
|
};
|
|
38930
|
-
_proto._addNewParticle = function _addNewParticle(position, direction, transform, playTime) {
|
|
39048
|
+
_proto._addNewParticle = function _addNewParticle(position, direction, transform, playTime, emitWorldPositionOverride) {
|
|
38931
39049
|
var firstFreeElement = this._firstFreeElement;
|
|
38932
39050
|
var nextFreeElement = firstFreeElement + 1;
|
|
38933
39051
|
if (nextFreeElement >= this._currentParticleCount) {
|
|
@@ -38950,7 +39068,7 @@ __decorate([
|
|
|
38950
39068
|
}
|
|
38951
39069
|
var pos, rot;
|
|
38952
39070
|
if (main.simulationSpace === ParticleSimulationSpace.World) {
|
|
38953
|
-
pos = transform.worldPosition;
|
|
39071
|
+
pos = emitWorldPositionOverride != null ? emitWorldPositionOverride : transform.worldPosition;
|
|
38954
39072
|
rot = transform.worldRotationQuaternion;
|
|
38955
39073
|
}
|
|
38956
39074
|
var startSpeed = main.startSpeed.evaluate(undefined, main._startSpeedRand.random());
|
|
@@ -39070,18 +39188,18 @@ __decorate([
|
|
|
39070
39188
|
}
|
|
39071
39189
|
// Initialize feedback buffer for this particle
|
|
39072
39190
|
if (this._useTransformFeedback) {
|
|
39073
|
-
this._addFeedbackParticle(firstFreeElement, position, direction, startSpeed, transform);
|
|
39191
|
+
this._addFeedbackParticle(firstFreeElement, position, direction, startSpeed, transform, pos);
|
|
39074
39192
|
}
|
|
39075
39193
|
this._firstFreeElement = nextFreeElement;
|
|
39076
39194
|
};
|
|
39077
|
-
_proto._addFeedbackParticle = function _addFeedbackParticle(index, shapePosition, direction, startSpeed, transform) {
|
|
39195
|
+
_proto._addFeedbackParticle = function _addFeedbackParticle(index, shapePosition, direction, startSpeed, transform, emitWorldPosition) {
|
|
39078
39196
|
var position;
|
|
39079
39197
|
if (this.main.simulationSpace === ParticleSimulationSpace.Local) {
|
|
39080
39198
|
position = shapePosition;
|
|
39081
39199
|
} else {
|
|
39082
39200
|
position = ParticleGenerator._tempVector32;
|
|
39083
39201
|
engineMath.Vector3.transformByQuat(shapePosition, transform.worldRotationQuaternion, position);
|
|
39084
|
-
position.add(transform.worldPosition);
|
|
39202
|
+
position.add(emitWorldPosition != null ? emitWorldPosition : transform.worldPosition);
|
|
39085
39203
|
}
|
|
39086
39204
|
this._feedbackSimulator.writeParticleData(index, position, direction.x * startSpeed, direction.y * startSpeed, direction.z * startSpeed);
|
|
39087
39205
|
};
|
|
@@ -41768,6 +41886,7 @@ exports.DisorderedArray = DisorderedArray;
|
|
|
41768
41886
|
exports.Downsampling = Downsampling;
|
|
41769
41887
|
exports.DynamicCollider = DynamicCollider;
|
|
41770
41888
|
exports.DynamicColliderConstraints = DynamicColliderConstraints;
|
|
41889
|
+
exports.DynamicColliderKinematicTransformSyncMode = DynamicColliderKinematicTransformSyncMode;
|
|
41771
41890
|
exports.EmissionModule = EmissionModule;
|
|
41772
41891
|
exports.Engine = Engine;
|
|
41773
41892
|
exports.EngineObject = EngineObject;
|