Skip to content

Commit 2341f77

Browse files
committed
Updated code for GetTransformedPoint
1 parent dc05c29 commit 2341f77

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: '2ac4ba60-552b-11e7-965c-39a419b0ea9b'
2+
build: '02a4bdd0-55d7-11e7-87f5-37983a7cf73e'
33
};
44
module.exports = CHECKSUM;

v3/src/input/components/GetTransformedPoint.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ var GetTransformedPoint = function (matrix, gameObject, x, y, output)
1010
{
1111
if (output === undefined) { output = { x: 0, y: 0 }; }
1212

13-
matrix.applyITRS(gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX, gameObject.scaleY);
14-
// matrix.invert();
15-
matrix.transformPoint(x, y, output);
13+
matrix.applyITRS(gameObject.x, gameObject.y, -gameObject.rotation, gameObject.scaleX, gameObject.scaleY);
14+
matrix.invert();
15+
// matrix.transformPoint(x, y, output);
16+
var ma = matrix.matrix;
17+
var a = ma[0];
18+
var b = ma[1];
19+
var c = ma[2];
20+
var d = ma[3];
21+
var e = ma[4];
22+
var f = ma[5];
23+
24+
var tx = x * a + y * c + e;
25+
var ty = x * b + y * d + f;
26+
27+
output.x = tx;
28+
output.y = ty;
1629

1730
// var a = matrix.matrix[0];
1831
// var b = matrix.matrix[1];

0 commit comments

Comments
 (0)