View limits greater than 180 degrees are clipped to 180. Example:
<view n="0">
<internal archive="y">true</internal>
<config>
<x-offset-m archive="y" type="double">-0.5</x-offset-m>
<y-offset-m archive="y" type="double">1.16375</y-offset-m>
<z-offset-m archive="y" type="double">-27.7515</z-offset-m>
<pitch-offset-deg>-12.0</pitch-offset-deg>
<default-field-of-view-deg type="double">75.0</default-field-of-view-deg>
<limits>
<enabled type="bool">true</enabled>
<left>
<heading-max-deg type="double">200.0</heading-max-deg>
<x-offset-max-m type="double">0.15</x-offset-max-m>
<x-offset-threshold-deg type="double">65.0</x-offset-threshold-deg>
</left>
<right>
<heading-max-deg type="double">200.0</heading-max-deg>
<x-offset-max-m type="double">0.15</x-offset-max-m>
<x-offset-threshold-deg type="double">65.0</x-offset-threshold-deg>
</right>
</limits>
</config>
</view>
@cgdae One for you to look at. Michael, please list which version/commits you are testing.
Hi, James,
Using all -next as of Apr 12 (today).
-next as of 06 Jun is now respecting the limits, but the movement near them is jerky.
I don't think anything changed in the viewing code between Apr 12 and Jun 6, so i'm not able to explain this. And i haven't noticed any such problems myself.
Can you give full details about what aircraft was/is having this problem?
Tu-144D: https://gitlab.com/mdanil/Tu-144/-/blob/master/Tu-144D-set.xml#L605
as far as I remember, I haven't touched my view definitions for a long while, too.
I checked again, and now camera rotation limits are respected again.
@mike402, Michael, Are there any remaining concerns or is this ticket ready to close?
Sorry about the long delay. If I use
<heading-max-deg type="double">90.0</heading-max-deg>or any other value less than 180, it works.So it seems that it only stopped working with a limit of more than 180 degrees (but you can turn your head more than 180 if you're flexible enough or use your shoulders). In this case it still gets limited to 180 degrees, but shakes a bit when it hits the limit. Same happens for setting exactly 180.
Last edit: Anonymous 2020-10-22
Diff:
Oops. I wanted to say,
view.naspilot_view_limiterhas not changed for longer than the bug existed, so the problem must be elsewhere. Probably the C++ view system rewrite.I've had a look and i can't see where the changes to the view system in the last couple of years could have broken this. In fact i can't find any C++ code that refers to
heading-max-deg- it looks like view limits are implemented entirely in Nasal? In which case i'm struggling to see how it could ever work without artefacts such as shaking, because of Nasal callback generally running slower than frame rate.Ultimately i'd like to switch to use Sviews for the main window, where it will be easy to implement viewing limits, but that will probably have to wait until we've got a replacement for PUI working. In the meantime, i'll have a look at whether there is a simple way to implement viewing limits in the current C++ code main window view code.
Having said that all that, please let me know if i've missed something here and there is something that might have broken viewing limits that could be easily fixed.
Thank you for checking, Jules! So the new views implementation is not enabled so far? Has the old one been changed in any way?
I was somewhat suspicious of the
normdeg()s in the limiter Nasal but according to git blame, those lines have not changed recently at all, but I can not think of any other place.If you will be rewriting it in C++, I have a small feature idea: vertical angle limiting. Right now it's only possible to limit horizontal angles, which means there is no way to model something like a fixed camera without aircraft-side hacks.
On Thu, 19 Aug 2021 22:56:50 -0000
"Michael Danilov" mike402@users.sourceforge.net wrote:
The main (aka old) view system had fairly extensive changes a couple of
years ago to improve support for views of multiplayer aircraft.
The Sview system is different; it was added to allow 'extra view'
windows with CompositeViewer (only available on next). This was
necessary because the main view code doesn't support multiple instances
of the viewing state, but it's also intended to be more flexible and
powerful.
Yes, i noticed this too. It's all a bit of a mystery...
Sure, that should be easy enough to add.
Thanks,
--
http://op59.net