Commit ea71a4d4 authored by Ellen Dekkers's avatar Ellen Dekkers

flyTo function where only the new scene center needs to be specified while the...

flyTo function where only the new scene center needs to be specified while the eye position is recomputed automatically

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10447 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c9829824
......@@ -1013,11 +1013,24 @@ void get_all_objects( std::vector < BaseObjectData*>& _objects ) {
}
/// Fly to point and viewing direction (animated).
/// Fly to point and viewing direction (animated).
void flyTo (const ACG::Vec3d &_position, const ACG::Vec3d &_center, double _time) {
examiner_widgets_[activeExaminer_]->flyTo(_position,_center,_time);
}
/// Fly to point and keep viewing direction (animated).
void flyTo (const ACG::Vec3d &_center, bool _move_back, double _time) {
ACG::Vec3d eye = PluginFunctions::viewerProperties().glState().eye();
ACG::Vec3d t = _center - eye;
ACG::Vec3d e = eye + t * (_move_back ? -0.5f : 0.5f);
examiner_widgets_[activeExaminer_]->flyTo(e, _center, _time);
}
// ===============================================================================
// Getting data from objects and casting between them
// ===============================================================================
......
......@@ -394,6 +394,16 @@ void setFixedView(int _mode, int _viewer = ACTIVE_VIEWER );
DLLEXPORT
void flyTo (const ACG::Vec3d &_position, const ACG::Vec3d &_center, double _time=1000.0);
/** Fly to point and keep viewing direction (animated).
* @param _center The new scene center ( the point we are looking at )
* @param _move_back Get closer if \c _move_back=\c true, get more distant else.
* @param _time Animation time in ms
*/
DLLEXPORT
void flyTo (const ACG::Vec3d &_center, bool _move_back = true, double _time=1000.0);
/** @} */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment