-
Notifications
You must be signed in to change notification settings - Fork 216
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
Conditional macro required to build with vsg 1.0 and vsg 1.1 #1132
Comments
It's not possible to use a default parameter and have the simulationTime set to something sensible. Even just having a second constructor that matches the old API would be left with no way to set the simulationTime to some valid. For most application I would expect them to just let the Viewer::advatanceToNextFrame() set the FrameStamp and as the implementation is contained with the Viewer.cpp this won't affect client applications. The only time I can see the constructor change being a issue is when users are creating and using their own FrameStamp. What is the actual code in vsgvr that is causing problems? |
I should add the new FrameStamp::simulationTime is part of the Animation work merged with the 1.1.x branch. simulationTime is something missing from the VSG compared to the OSG, but now it's caught up in this regard. |
|
I'm not familiar with vsgvr but the code looks kinda hacky, can't help but feel that isn't probably the cleanest way to implement what is required. The compile workaround is for the addition of FrameStamp.simulationTime is broken, it should be passing the simulationTimem without this non of the VSG's new animation functionality will work. Personally I'd recommend letting Viewer::advatanceToNextFrame(..) do it's thing and set everything that is required and work in a more cooperative way with the VSG rather than digging into controlling things that are probably left to the VSG to manage, If there is work that needs to be done for the VR side then one can subclass from Viewer and override methods but call the underlying Viewer method to do the work it needs to do. Taking the approach that vsgvr has taken really opens up to it breaking when the underlying functionality evolves. |
I'm going to close this Issue as the VSG is doing the right thing, not allowing code to compile that would break the VSG in difficult to determine ways. This issue is with vsgvr doing things wrong. |
Thanks for your quick review. I personally tried to simply fix a build error I had with vsgvr and vsg 1.1 and came to this topic.
The viewer class in vsgvr was derived from vsg::Viewer (see https://github.com/geefr/vsgvr/blob/aead073464dfc3143ac35f2709cfdecca0a50f40/vsgvr/include/vsgvr/app/Viewer.h#L58). [1] https://github.com/geefr/vsgvr/blob/aead073464dfc3143ac35f2709cfdecca0a50f40/vsgvr/src/vsgvr/app/Viewer.cpp#L113 The relevant source code is
As far as I can tell, the base method could be used with respect to the time source if the retrieval of the time source could be overridden. Another difference at https://github.com/geefr/vsgvr/blob/aead073464dfc3143ac35f2709cfdecca0a50f40/vsgvr/src/vsgvr/app/Viewer.cpp#L147 is that additional layers are managed here:
where in vsg at this location there is
Possibly the latter code fragment could be moved to a virtual method that could be replaced in vsgvr. |
I'm afraid I'm not in a position to go review vsgxr and figure out things. The best I can do is recommend you have a look at the merge of the Animation branch for what changes were made to Viewer to enable animation. |
To prevent applications from reimplementing this method, which can lead to major problems, it is made more customizable. It is now possible to change the time source by overwriting `Viewer::advanceToNextTimePoint()` and to add special stuff with `Viewer::advanceToNextFrameHook()`. See vsg-dev#1132.
To prevent applications from reimplementing this method, which can lead to major problems, it is made more customizable. It is now possible to change the time source by overwriting `Viewer::advanceToNextTimePoint()` and to add special stuff with `Viewer::advanceToNextFrameHook()`. See vsg-dev#1132.
Further investigating showed me, that I need to correct that statement as I did found this:
|
|
Describe the bug
In vsg 1.1, there was an api change to
vsg::FrameStamp::create()
that added a third parameter. This forces clients to add a condition to be able to build with vsg 1.0 as well.To Reproduce
Steps to reproduce the behavior:
Expected behavior
A default parameter for the third argument would avoid the need for such differences.
The text was updated successfully, but these errors were encountered: