-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Keep camera on reload #705
Conversation
Yes we do. But I think behavior could be default :) |
I added
Using opaque state objects would allow to delegate the storing of the states (which would then be optional, and not needed for this PR for example) to the app and simplify the API to:
However my lack of c++ skills is standing in the way of me implementing it that way. Options are then:
Thoughts? |
I do think storing the states in the App would be better, but I'm not sure I will be able to help shortly. Could you push a branch showing what did not work for you ? |
Basically I have a
Using pointers ( |
You are modifying libf3d public API! |
Let me know if you need help with this @snoyer , the release rush is running out. I'm not available on discord for a few days though. |
Thanks! so far it's working as a proof of concept, it does solve the use case that is. Having the camera state as a pointer feels off though, I guess it'd be fine within the app code but what if it needs to be exposed through bindings? (don't really want to have to |
Could you give a go to the implementation with an opaque object and I can try to make it work ? |
That's where's it at now, f3d/library/private/camera_impl.h Lines 23 to 28 in 5416af1
Lines 12 to 16 in 5416af1
|
ok ! Could you rebase your branch on master ? I will then take a look this week I hope |
5416af1
to
759c317
Compare
Just tested and it seems to work fine. Am I missing anything ? |
BTW I wonder if we should add a modifier to keep cameraState when switching between files, it seems like a usefull feature. |
It is functional.
|
Ok, got it, Ill take a look. |
I think I'll go this way, and we will not need any opaque object :) |
I'm going to need to learn myself some more git first to rebranch from yours but I'll see what I can do :)
Careful you don't run into #443 when you go there, there's no telling how deep it could drag you ;p |
Yeah, I'll avoid #443 for now.
Here is how I would do it:
hth, |
Are we looking at restoring the camera on previous/next model in this PR or just on reloading the current model? If we want to do prev/next we need to first assess and decide whether the camera state should be:
|
imo a camera state should be absolute, so I'd focus on that first. If we get fancy we camera positions in the future, we may want to revisit it at some point, but for now seems good enough. So lets only focus on keeping camera location on the UP interaction for now with an absolute position :) |
Need any help with this one @snoyer ? |
closing in favor of: #705 |
Felt bad opening an issue without at least looking into it a bit so here's an attempt at reloading the current file without resetting the camera.
The use case is:
This implementation is based on what's been discussed on Discord:
I don't know if this behaviour should be the default or not?
If not,
shift+up
could be used, but do we have access to modifiers in interactor callbacks?The type of model/scene could also play a role maybe (eg. only reset the camera if the file defines cameras)?