@@ -1113,6 +1113,35 @@ interactor& interactor_impl::initCommands()
11131113 },
11141114 command_documentation_t { " azimuth_camera value" , " tilt the camera right or left" });
11151115
1116+ this ->addCommand (
1117+ " rotate_up" ,
1118+ [&](const std::vector<std::string>& args)
1119+ {
1120+ check_args (args, 2 , " rotate_up" );
1121+ int axis = -1 ;
1122+ if (args[0 ] == " x" || args[0 ] == " X" )
1123+ {
1124+ axis = 0 ;
1125+ }
1126+ else if (args[0 ] == " y" || args[0 ] == " Y" )
1127+ {
1128+ axis = 1 ;
1129+ }
1130+ else if (args[0 ] == " z" || args[0 ] == " Z" )
1131+ {
1132+ axis = 2 ;
1133+ }
1134+ else
1135+ {
1136+ throw interactor::invalid_args_exception (" rotate_up: axis must be x, y, or z" );
1137+ }
1138+ double angle = options::parse<double >(args[1 ]);
1139+ this ->Internals ->Window .RotateUpVector (axis, angle);
1140+ this ->Internals ->Style ->ResetTemporaryUp ();
1141+ },
1142+ command_documentation_t { " rotate_up x/y/z angle" , " rotate the scene up vector around an axis" },
1143+ std::bind (complNames, std::placeholders::_1, std::vector<std::string>{ " x" , " y" , " z" }));
1144+
11161145 this ->addCommand (
11171146 " increase_light_intensity" ,
11181147 [&](const std::vector<std::string>&) { this ->Internals ->IncreaseLightIntensity (false ); },
@@ -1608,9 +1637,11 @@ interactor& interactor_impl::initBindings()
16081637 this ->addBinding ({mod_t ::ANY , " 1" }, " set_camera front" , " Camera" , std::bind (docStr, " Front View camera" ));
16091638 this ->addBinding ({mod_t ::ANY , " 2" }, " elevation_camera -90" , " Camera" , std::bind (docStr, " Rotate camera down" ));
16101639 this ->addBinding ({mod_t ::ANY , " 3" }, " set_camera right" , " Camera" , std::bind (docStr, " Right View camera" ));
1611- this ->addBinding ({mod_t ::ANY , " 4" }, " roll_camera -90" , " Camera" , std::bind (docStr, " Rotate camera right" ));
1640+ this ->addBinding ({mod_t ::NONE , " 4" }, " roll_camera -90" , " Camera" , std::bind (docStr, " Rotate camera right" ));
1641+ this ->addBinding ({mod_t ::CTRL , " 4" }, " rotate_up x 90" , " Scene" , std::bind (docStr, " Rotate scene up +90 around X" ));
16121642 this ->addBinding ({mod_t ::ANY , " 5" }, " toggle scene.camera.orthographic" , " Camera" , std::bind (docTglOpt, " Orthographic Projection" , std::cref (opts.scene .camera .orthographic )), f3d::interactor::BindingType::TOGGLE );
1613- this ->addBinding ({mod_t ::ANY , " 6" }, " roll_camera 90" , " Camera" , std::bind (docStr, " Rotate camera left" ));
1643+ this ->addBinding ({mod_t ::NONE , " 6" }, " roll_camera 90" , " Camera" , std::bind (docStr, " Rotate camera left" ));
1644+ this ->addBinding ({mod_t ::CTRL , " 6" }, " rotate_up x -90" , " Scene" , std::bind (docStr, " Rotate scene up -90 around X" ));
16141645 this ->addBinding ({mod_t ::ANY , " 7" }, " set_camera top" , " Camera" , std::bind (docStr, " Top View camera" ));
16151646 this ->addBinding ({mod_t ::ANY , " 8" }, " elevation_camera 90" , " Camera" , std::bind (docStr, " Rotate camera up" ));
16161647 this ->addBinding ({mod_t ::ANY , " 9" }, " set_camera isometric" , " Camera" , std::bind (docStr, " Isometric View camera" ));
0 commit comments