You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
1972
1975
*
1973
1976
* @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.
1974
-
* @param {*} hitArea - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.
1975
-
* @param {Phaser.Types.Input.HitAreaCallback} hitAreaCallback - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.
1977
+
* @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame.
1978
+
* @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback.
1976
1979
*
1977
1980
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
1978
1981
*/
@@ -2735,8 +2738,17 @@ var MathSmoothStep = __webpack_require__(5514);
2735
2738
2736
2739
/**
2737
2740
* Smoothstep is a sigmoid-like interpolation and clamping function.
2738
-
*
2739
-
* The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.
2741
+
*
2742
+
* The function depends on three parameters, the input x, the "left edge"
2743
+
* and the "right edge", with the left edge being assumed smaller than the right edge.
2744
+
*
2745
+
* The function receives a real number x as an argument and returns 0 if x is less than
2746
+
* or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly
2747
+
* interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the
2748
+
* smoothstep function is zero at both edges.
2749
+
*
2750
+
* This is convenient for creating a sequence of transitions using smoothstep to interpolate
2751
+
* each segment as an alternative to using more sophisticated or expensive interpolation techniques.
2740
2752
*
2741
2753
* @function Phaser.Actions.SmoothStep
2742
2754
* @since 3.0.0
@@ -2747,7 +2759,7 @@ var MathSmoothStep = __webpack_require__(5514);
2747
2759
* @param {string} property - The property of the Game Object to interpolate.
2748
2760
* @param {number} min - The minimum interpolation value.
2749
2761
* @param {number} max - The maximum interpolation value.
2750
-
* @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`)
2762
+
* @param {boolean} [inc=false] - Should the property value be incremented (`true`) or set (`false`)?
2751
2763
*
2752
2764
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
2753
2765
*/
@@ -15706,7 +15718,7 @@ var CONST = {
15706
15718
* @type {string}
15707
15719
* @since 3.0.0
15708
15720
*/
15709
-
VERSION: '3.61.0-beta.3',
15721
+
VERSION: '3.61.0-beta.4',
15710
15722
15711
15723
BlendModes: __webpack_require__(95723),
15712
15724
@@ -141247,6 +141259,30 @@ var Body = new Class({
141247
141259
* @since 3.0.0
141248
141260
*/
141249
141261
this._bounds = new Rectangle();
141262
+
141263
+
/**
141264
+
* Is this Body under direct control, outside of the physics engine? For example,
141265
+
* are you trying to move it via a Tween? Or have it follow a path? If so then
141266
+
* you can enable this boolean so that the Body will calculate its velocity based
141267
+
* purely on its change in position each frame. This allows you to then tween
141268
+
* the position and still have it collide with other objects. However, setting
141269
+
* the velocity will have no impact on this Body while this is set.
141270
+
*
141271
+
* @name Phaser.Physics.Arcade.Body#directControl
141272
+
* @type {boolean}
141273
+
* @since 3.61.0
141274
+
*/
141275
+
this.directControl = false;
141276
+
141277
+
/**
141278
+
* Stores the previous position of the Game Object when directControl is enabled.
141279
+
*
141280
+
* @name Phaser.Physics.Arcade.Body#autoFrame
141281
+
* @type {Phaser.Math.Vector2}
141282
+
* @private
141283
+
* @since 3.61.0
141284
+
*/
141285
+
this.autoFrame = this.position.clone();
141250
141286
},
141251
141287
141252
141288
/**
@@ -141432,6 +141468,7 @@ var Body = new Class({
141432
141468
141433
141469
this.prev.x = pos.x;
141434
141470
this.prev.y = pos.y;
141471
+
141435
141472
this.prevFrame.x = pos.x;
141436
141473
this.prevFrame.y = pos.y;
141437
141474
}
@@ -141457,36 +141494,63 @@ var Body = new Class({
141457
141494
*/
141458
141495
update: function (delta)
141459
141496
{
141460
-
this.prev.x = this.position.x;
141461
-
this.prev.y = this.position.y;
141497
+
var prev = this.prev;
141498
+
var pos = this.position;
141499
+
var vel = this.velocity;
141462
141500
141463
-
if (this.moves)
141501
+
prev.set(pos.x, pos.y);
141502
+
141503
+
if (!this.moves)
141464
141504
{
141465
-
this.world.updateMotion(this, delta);
141505
+
this._dx = pos.x - prev.x;
141506
+
this._dy = pos.y - prev.y;
141466
141507
141467
-
var vx = this.velocity.x;
141468
-
var vy = this.velocity.y;
141508
+
return;
141509
+
}
141469
141510
141470
-
this.newVelocity.set(vx * delta, vy * delta);
141511
+
if (this.directControl)
141512
+
{
141513
+
var autoFrame = this.autoFrame;
141471
141514
141472
-
this.position.add(this.newVelocity);
141515
+
vel.set(
141516
+
(pos.x - autoFrame.x) / delta,
141517
+
(pos.y - autoFrame.y) / delta
141518
+
);
141473
141519
141474
-
this.updateCenter();
141520
+
this.world.updateMotion(this, delta);
141475
141521
141476
-
this.angle = Math.atan2(vy, vx);
141477
-
this.speed = Math.sqrt(vx * vx + vy * vy);
141522
+
this._dx = pos.x - autoFrame.x;
141523
+
this._dy = pos.y - autoFrame.y;
141524
+
}
141525
+
else
141526
+
{
141527
+
this.world.updateMotion(this, delta);
141478
141528
141479
-
// Now the update will throw collision checks at the Body
141480
-
// And finally we'll integrate the new position back to the Sprite in postUpdate
0 commit comments