1
0
Fork 0

src/Viewer/sview.*: added support for damping in rotate steps.

This commit is contained in:
Julian Smith 2021-02-10 22:06:04 +00:00
parent 9008b3194f
commit 1ff0ce2222
2 changed files with 9 additions and 3 deletions

View file

@ -144,11 +144,11 @@ struct SviewPosDir
/* Generic damping support. Improved version of class in view.hxx and view.cxx.
We model dx/dt = (target-current)/damping_time, do damping_time is time for
value to change by a factor or e. */
value to change by a factor of e. */
struct Damping {
/* If m_wrap_max is non-zero, we wrap to ensure values are always between 0
and m_wrap_max. E.g. use m_wrap_max=360 for an angle. */
and m_wrap_max. E.g. use m_wrap_max=360 for an angle in degrees. */
Damping(double damping_time, double wrap_max=0, double current=0)
:
m_damping_time(damping_time),
@ -1353,7 +1353,10 @@ struct SviewViewEyeTarget : SviewView
step->getDoubleValue("heading"),
step->getDoubleValue("pitch"),
step->getDoubleValue("roll"),
step->getBoolValue("fixed")
step->getBoolValue("fixed"),
step->getDoubleValue("damping-heading"),
step->getDoubleValue("damping-pitch"),
step->getDoubleValue("damping-roll")
));
}
else if (!strcmp(type, "rotate-current-view")) {

View file

@ -132,6 +132,9 @@ An sview-step is:
fixed:
If false (the default), mouse drags modify heading and
pitch.
damping-time-heading, damping-time-pitch, damping-time-roll:
Damping times for heading, pitch and roll; zero gives no
damping. See 'agl' below for details of damping.
"rotate-current-view":
Rotate view direction by current /sim/current-view/....
"rotate-to-target":