Skip to content

Commit bf81a7d

Browse files
committed
TransformMatrix.destroy is a new method that will clear out the array and object used by a Matrix internally.
1 parent cdfe2e0 commit bf81a7d

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ being passed to the simulation. The default value is 1 to remain consistent with
4545
* Utils.Array.SendToBack allows you to send an array element to the bottom of the array.
4646
* Utils.Array.SetAll will set a property on all elements of an array to the given value, with optional range limits.
4747
* Utils.Array.Swap will swap the position of two elements in an array.
48+
* TransformMatrix.destroy is a new method that will clear out the array and object used by a Matrix internally.
4849

4950
### Bug Fixes
5051

src/gameobjects/components/TransformMatrix.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,18 @@ var TransformMatrix = new Class({
562562
matrix[3] = cr * scaleY;
563563

564564
return this;
565+
},
566+
567+
/**
568+
* Destroys this Transform Matrix.
569+
*
570+
* @method Phaser.GameObjects.Components.TransformMatrix#destroy
571+
* @since 3.4.0
572+
*/
573+
destroy: function ()
574+
{
575+
this.matrix = null;
576+
this.decomposedMatrix = null;
565577
}
566578

567579
});

0 commit comments

Comments
 (0)