Container.getWorldPoint() / getLocalPoint() throw "tempMatrix.applyITRS is not a function" in 4.2.1

オープン
#7,388 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript
領域
game-dev

調査の方向性

Start in Transform.js at Container.getWorldTransformMatrix and the getWorldPoint/getLocalPoint entry points, then inspect the TransformMatrix instance and its applyITRS method. Reproduce the calls from the issue in Phaser 4.2.1; done means both methods work without the reported TypeError, including the documented container and sprite setup.

索引モデルが issue の本文から書いたものです。

説明

Description:

Phaser 4.2.1: Calling container.getWorldPoint(x, y) or container.getLocalPoint(x, y) throws:
TypeError: tempMatrix.applyITRS is not a function at Container.getWorldTransformMatrix (Transform.js:517) at Container.getWorldPoint (Transform.js:627) at Container.getLocalPoint (Transform.js:584)

Root cause: getWorldTransformMatrix() creates new TransformMatrix() but the instance lacks applyITRS at runtime (method exists in source but not on constructed object).

Minimal reproduction:

const container = scene.add.container(100, 100);
const sprite = scene.add.sprite(50, 50, 'key');
container.add(sprite);
container.getWorldPoint(0, 0);  // throws
// or
container.getLocalPoint(200, 200);  // throws

Environment: Phaser 4.2.1, WebGL renderer, TypeScript project, OS: Kubuntu

Workaround: Manual transform walking up parentContainer chain
See getWorldPointManual/getLocalPointManual in this commit: https://github.com/FreezingMoon/AncientBeast/commit/516f4b41

主要言語
JavaScript
スター
40.7k
フォーク
7.2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

phaserjs/phaser のほかの issue

phaserjs/phaser の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。