Skip to content

AnimationPlayer impacts multiple views #2427

@AnthonyGlt

Description

@AnthonyGlt

Context

this.player = new AnimationPlayer();

The animationplayer is unique for every instance of globecontrols but the callback can be mixed up between multiple views.

for example, I have 2 different views here, and when I trigger an animation on VIEW-1, the VIEW-2 is also affected:

Screencast.from.07-10-2024.15.59.52.webm

Possible Cause/Fix/Solution

It seems to be this part of the code that is causing this issue:

if (this.enableDamping && state === this.states.ORBIT && this.player.isStopped() && (sphericalDelta.theta > EPS || sphericalDelta.phi > EPS)) {
this.player.setCallback(() => { this.update(this.states.ORBIT); });
this.player.playLater(durationDampingOrbital, 2);

But as we can notice, player.stop() is also called in a lot of places... Maybe some code cleanup can be done concerning this player.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions