Skip to content

Commit

Permalink
fix local space particle is rendered one frame behind
Browse files Browse the repository at this point in the history
  • Loading branch information
Alchemist0823 committed Aug 16, 2024
1 parent b12ce57 commit 9fe3832
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/three.quarks/src/SpriteBatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ShaderMaterial,
Scene,
PerspectiveCamera,
MeshPhysicalMaterial,
MeshPhysicalMaterial, Object3D,
} from 'three';
import {
Vector2,
Expand Down Expand Up @@ -283,6 +283,8 @@ export class SpriteBatch extends VFXBatch {
const rotation = this.quaternion2_;
const translation = this.vector2_;
const scale = this.vector3_;
if ((system.emitter as unknown as Object3D).updateMatrixWorld)
(system.emitter as unknown as Object3D).updateMatrixWorld(true);
system.emitter.matrixWorld.decompose(translation, rotation, scale);
this.rotationMat_.setFromMatrix4(system.emitter.matrixWorld);

Expand Down

0 comments on commit 9fe3832

Please sign in to comment.