MCPcopy
hub / github.com/4ian/GDevelop / _updateLocalTransformation

Function _updateLocalTransformation

GDJS/Runtime/CustomRuntimeObject.ts:521–541  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

519 }
520
521 _updateLocalTransformation() {
522 const absScaleX = Math.abs(this._scaleX);
523 const absScaleY = Math.abs(this._scaleY);
524 const centerX = this.getUnscaledCenterX() * absScaleX;
525 const centerY = this.getUnscaledCenterY() * absScaleY;
526 const angleInRadians = (this.angle * Math.PI) / 180;
527
528 this._localTransformation.setToTranslation(this.x, this.y);
529 this._localTransformation.rotateAround(angleInRadians, centerX, centerY);
530 if (this._flippedX) {
531 this._localTransformation.flipX(centerX);
532 }
533 if (this._flippedY) {
534 this._localTransformation.flipY(centerY);
535 }
536 this._localTransformation.scale(absScaleX, absScaleY);
537
538 this._localInverseTransformation.copyFrom(this._localTransformation);
539 this._localInverseTransformation.invert();
540 this._isLocalTransformationDirty = false;
541 }
542
543 /**
544 * Return an array containing the coordinates of the point passed as parameter

Callers

nothing calls this directly

Calls 7

flipXMethod · 0.65
flipYMethod · 0.65
setToTranslationMethod · 0.45
rotateAroundMethod · 0.45
scaleMethod · 0.45
copyFromMethod · 0.45
invertMethod · 0.45

Tested by

no test coverage detected