MCPcopy Create free account
hub / github.com/melonjs/melonJS / scale

Method scale

packages/melonjs/src/math/matrix3d.ts:620–639  ·  view source on GitHub ↗

* scale the matrix * @param x - a number representing the abscissa of the scaling vector. * @param [y] - a number representing the ordinate of the scaling vector. * @param [z] - a number representing the depth vector * @returns Reference to this object for method chaining

(x: number, y = x, z = 1)

Source from the content-addressed store, hash-verified

618 * @returns Reference to this object for method chaining
619 */
620 scale(x: number, y = x, z = 1) {
621 const a = this.val;
622
623 a[0] = a[0] * x;
624 a[1] = a[1] * x;
625 a[2] = a[2] * x;
626 a[3] = a[3] * x;
627
628 a[4] = a[4] * y;
629 a[5] = a[5] * y;
630 a[6] = a[6] * y;
631 a[7] = a[7] * y;
632
633 a[8] = a[8] * z;
634 a[9] = a[9] * z;
635 a[10] = a[10] * z;
636 a[11] = a[11] * z;
637
638 return this;
639 }
640
641 /**
642 * adds a 2D scaling transformation.

Callers 15

scaleVMethod · 0.95
scaleXMethod · 0.95
scaleYMethod · 0.95
updateMethod · 0.45
testPolygonPolygonFunction · 0.45
testEllipseEllipseFunction · 0.45
testPolygonEllipseFunction · 0.45
buildFlipTransformFunction · 0.45
setTileTransformMethod · 0.45
getRenderableMethod · 0.45
buildFlipTransformFunction · 0.45
replayIntoFunction · 0.45

Calls

no outgoing calls

Tested by 2

buildFlipTransformFunction · 0.36
replayIntoFunction · 0.36