Skip to content

✨ Quality: Missing matrixWorldNeedsUpdate in overridden updateMatrix#884

Open
chinhkrb113 wants to merge 1 commit intoanomalyco:mainfrom
chinhkrb113:contribai/improve/quality/missing-matrixworldneedsupdate-in-overri
Open

✨ Quality: Missing matrixWorldNeedsUpdate in overridden updateMatrix#884
chinhkrb113 wants to merge 1 commit intoanomalyco:mainfrom
chinhkrb113:contribai/improve/quality/missing-matrixworldneedsupdate-in-overri

Conversation

@chinhkrb113
Copy link
Copy Markdown

✨ Code Quality

Problem

When overriding updateMatrix on a Three.js Object3D (or Sprite), you must set this.matrixWorldNeedsUpdate = true. Without this, the object's world matrix will not be recalculated when its local transform changes, causing the sprite to appear frozen in place, incorrectly scaled, or improperly rotated in the scene.

Severity: high
File: packages/core/src/3d/SpriteUtils.ts

Solution

When overriding updateMatrix on a Three.js Object3D (or Sprite), you must set this.matrixWorldNeedsUpdate = true. Without this, the object's world matrix will not be recalculated when its local transform changes, causing the sprite to appear frozen in place, incorrectly scaled, or improperly rotated in the scene.

Changes

  • packages/core/src/3d/SpriteUtils.ts (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced


🤖 About this PR

This pull request was generated by ContribAI, an AI agent
that helps improve open source projects. The change was:

  1. Discovered by automated code analysis
  2. Generated by AI with context-aware code generation
  3. Self-reviewed by AI quality checks

If you have questions or feedback about this PR, please comment below.
We appreciate your time reviewing this contribution!

Closes #883

…trix

When overriding `updateMatrix` on a Three.js `Object3D` (or `Sprite`), you must set `this.matrixWorldNeedsUpdate = true`. Without this, the object's world matrix will not be recalculated when its local transform changes, causing the sprite to appear frozen in place, incorrectly scaled, or improperly rotated in the scene.


Affected files: SpriteUtils.ts

Signed-off-by: ChinhLee <76194645+chinhkrb113@users.noreply.github.com>
@simonklee
Copy link
Copy Markdown
Member

I have questions about this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(core): missing matrixworldneedsupdate in overridden updatematrix

2 participants