src/Viewer/sview.*: added support for damping in rotate steps.
This commit is contained in:
parent
9008b3194f
commit
1ff0ce2222
2 changed files with 9 additions and 3 deletions
|
@ -144,11 +144,11 @@ struct SviewPosDir
|
||||||
/* Generic damping support. Improved version of class in view.hxx and view.cxx.
|
/* 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
|
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 {
|
struct Damping {
|
||||||
|
|
||||||
/* If m_wrap_max is non-zero, we wrap to ensure values are always between 0
|
/* 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)
|
Damping(double damping_time, double wrap_max=0, double current=0)
|
||||||
:
|
:
|
||||||
m_damping_time(damping_time),
|
m_damping_time(damping_time),
|
||||||
|
@ -1353,7 +1353,10 @@ struct SviewViewEyeTarget : SviewView
|
||||||
step->getDoubleValue("heading"),
|
step->getDoubleValue("heading"),
|
||||||
step->getDoubleValue("pitch"),
|
step->getDoubleValue("pitch"),
|
||||||
step->getDoubleValue("roll"),
|
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")) {
|
else if (!strcmp(type, "rotate-current-view")) {
|
||||||
|
|
|
@ -132,6 +132,9 @@ An sview-step is:
|
||||||
fixed:
|
fixed:
|
||||||
If false (the default), mouse drags modify heading and
|
If false (the default), mouse drags modify heading and
|
||||||
pitch.
|
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-current-view":
|
||||||
Rotate view direction by current /sim/current-view/....
|
Rotate view direction by current /sim/current-view/....
|
||||||
"rotate-to-target":
|
"rotate-to-target":
|
||||||
|
|
Loading…
Add table
Reference in a new issue