Thanks… the docs weren’t clear that I had to instantiate a new object. I thought it was already supposed to be present and I could manipulate it directly. Good now.
Is there a way to determine if the viewer is in a TOP, ORBIT or WALK view? And is there a way to manually set the view type?
edit: I see the Viewer.onViewSwitchDone callback returns view objects and I see a mode field on the View object with orbit or fps values. I also see isTop and isOrbit functions. Should I be setting the mode for my custom view for proper navigation between views? Any other properties to track? I assume to mimic a TOP view, I need to manually remove any roof object?
edit 2: I now see that the objects that are to be hidden in named views is configured for each named view. It’d be nice to get a View object by name and then just make some camera adjustments, but looking at the API, is this possible? I don’t see anything so far.
You are correct, there is no direct way to get current view parameters, however you can store current view returned from ‘onViewSwitchDone’ and store it in a mutable variable.
Please take a look at this post:
You could infer the view parameters from the last view used.
To set view to ORBIT or WALK you would need to set view.mode to either orbit or fps
TOP view is special mode of ‘orbit’ view with parameters:
view.noPitchRotate set to true
view.rotation[1] set to -90;
There might be some other adjustments you need to consider, like minDistance, and maxDistance, depending on your specific needs.