Skip to content

Commit 3469ff2

Browse files
committed
Arcade Physics World has gained two new private properties _tempMatrix and _tempMatrix2. These are used by all bodies in the simulation that need a temporal matrix for calculations, rather than having their own instances.
1 parent 2c52584 commit 3469ff2

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/physics/arcade/World.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var SeparateY = require('./SeparateY');
2727
var Set = require('../../structs/Set');
2828
var StaticBody = require('./StaticBody');
2929
var TileIntersectsBody = require('./tilemap/TileIntersectsBody');
30+
var TransformMatrix = require('../../gameobjects/components/TransformMatrix');
3031
var Vector2 = require('../../math/Vector2');
3132
var Wrap = require('../../math/Wrap');
3233

@@ -478,6 +479,26 @@ var World = new Class({
478479
*/
479480
this.treeMinMax = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
480481

482+
/**
483+
* A temporary Transform Matrix used by bodies for calculations without them needing their own local copy.
484+
*
485+
* @name Phaser.Physics.Arcade.World#_tempMatrix
486+
* @type {Phaser.GameObjects.Components.TransformMatrix}
487+
* @private
488+
* @since 3.12.0
489+
*/
490+
this._tempMatrix = new TransformMatrix();
491+
492+
/**
493+
* A temporary Transform Matrix used by bodies for calculations without them needing their own local copy.
494+
*
495+
* @name Phaser.Physics.Arcade.World#_tempMatrix2
496+
* @type {Phaser.GameObjects.Components.TransformMatrix}
497+
* @private
498+
* @since 3.12.0
499+
*/
500+
this._tempMatrix2 = new TransformMatrix();
501+
481502
if (this.drawDebug)
482503
{
483504
this.createDebugGraphic();

0 commit comments

Comments
 (0)