Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic dolly speed/rotation sensitivity #249

Closed
wants to merge 10 commits into from

Conversation

keywizzle
Copy link
Contributor

-Removed excess rotation after mouse is idle for >100ms

untrack(() => (cam.position.z = this.scrollFling!.y))
const setScrollFactor = this.dynamicDolly
untrack(() => {
cam.position.z = this.scrollFling!.y
Copy link
Member

@trusktr trusktr Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The untrack could also be untrack(() => cam.position).z =. There is an infinite loop here (not sure if you noticed that, without untrack).

This is one thing that needs to be fixed. It was based on an older pattern when things were all event based, and sub props (x/y/z) made the parent object emit an event (I basically ported it verbatim to Solid reactivity). In this case setting .z triggers reactivity for .position, which triggers the same effect we're setting the value in.

I think either we can remove reactivity for .position (and .rotation, etc) and have only the x/y/z properties be reactive, or have .position (etc) be Solid mutables (return createMutable(this) in XYZValues). The thing is, this is currently possible: el1.position = el2.position, and would no longer work. Hmmm

@trusktr
Copy link
Member

trusktr commented May 29, 2023

Closing in favor of the other PR with the branch inside our repo: #251

@trusktr trusktr closed this May 29, 2023
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.

2 participants