PlanarControls upgrades #2075
valentinMachado
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
I agree that it would be a good idea to have a method to travel to a |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In ud-viz our widget give the possibility to travel to a box3 which is useful to focus some feature of the batchtable for example. In order to contribute them to itowns we would need to have a similar function in order to not write this code multiple time.
Could be a method (initiateTravelToBox3 maybe) with the same signature as initiateTravel but instead of a target position this is a box 3, there would be some math to compute the target camera position based on the box 3 then it could call the initiateTravel method. Or maybe the math code belong to CameraUtil and the user write a combination of CameraUtil math method + initiateTravel of PlanarControls ?
What do you think ?
Another thing is that the initiateTravel does not return a Promise resolving when the travel is actually done, forcing itowns user to write something not quite elegant like this:
Since initiateTravel do an initialization and is not actually updating camera state (do in handleTravel) the only way (with this code structure as far as I know) would be to create a reference
this.travelResolve
set in initiateTravel and call in handleTravel to allow the user to write something like:Which can be nice for the user to write good asynchronous code but also kind of confusing since the initialization of the travel is not asynchronous (the travel is)
so maybe we could just create a method
travel
doing the initiateTravel + set this.travelResolve and returning a Promise
What do you think ?
Beta Was this translation helpful? Give feedback.
All reactions