1
0
Fork 0

make lookat work correctly for when the user changed view direction;

Remember: dynamic_view.lookat(heading, pitch, roll) moves view
smoothly to this direction, while dynamic_view.lookat() moves it back.
This can be used for quick view changes to the panel etc. It's currently
only used in the bo105 (flaps-up binding).
This commit is contained in:
mfranz 2007-02-07 16:58:46 +00:00
parent 96cc08519b
commit a1556fa69a

View file

@ -81,6 +81,9 @@ var ViewAxis = {
me.applied_offset = v;
me.prop.setDoubleValue(raw + me.applied_offset);
},
static : func(v) {
normdeg(v - me.prop.getValue() + me.applied_offset);
},
};
@ -177,12 +180,12 @@ var ViewManager = {
},
lookat : func(heading = nil, pitch = nil, roll = nil) {
if (heading == nil) {
interpolate(me.blendN, 0, 0.1);
interpolate(me.blendN, 0, 0.2);
} else {
me.target_heading = heading;
me.target_pitch = pitch;
me.target_roll = roll;
interpolate(me.blendN, 1, 0.1);
me.target_heading = me.heading_axis.static(heading);
me.target_pitch = me.pitch_axis.static(pitch);
me.target_roll = me.roll_axis.static(roll);
interpolate(me.blendN, 1, 0.2);
}
},
freeze : func {