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

Release Event #33

Open
MainzerKaiser opened this issue Jan 13, 2024 · 2 comments
Open

Release Event #33

MainzerKaiser opened this issue Jan 13, 2024 · 2 comments

Comments

@MainzerKaiser
Copy link

Are there plans to introduce more methods to the OrbitControl than the onChange Event?
I would like to trigger a function upon release of the touch event.

Wrapping the canvas with the orbitControl inside a view, a pressable or a TouchableWithoutFeedback and use its release event didnt work so far.

@TiagoCavalcante
Copy link
Owner

Hi @MainzerKaiser, thanks for creating the issues, and sorry for the long delay in answering!

This seems like a great addition!

While this still hasn't been implemented, you can achieve almost the same behavior by using the touch events in the Canvas (though the behavior isn't the same when using multiple canvases with the same controls).

<View style={{ flex: 1 }} {...events}>
  <Canvas
    onTouchStart={() => { /*  */ }}
    onTouchMove={() => { /*  */ }}
    onTouchEnd={() => { /*  */ }}
    onTouchEndCapture={() => { /*  */ }}
    onTouchCancel={() => { /*  */ }}
  >
    <OrbitControls /* ... */>

    {/* ... */}
  </Canvas>
</View>

@MainzerKaiser
Copy link
Author

Hi Tiago,
thank you for the idea. The solution in the other issue regarding the first touch fix is related to this as i thought i have a performance issue. With the fix I can smoothly run my app with the onChange in the Orbitcrontrol with having up to 6 canvases in parallel on my android phone.
Also, switching to the Canvas onTouchEnd leads to the problem of not having the orbit event (including target camera position). I would not know how to solve that yet. But there is no need anymore. Thanks for the hint anyways, that is much appreciated!!

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

No branches or pull requests

2 participants