Changeset 4323
- Timestamp:
- Apr 7, 2014 1:00:38 AM (10 years ago)
- Location:
- trunk/packages/vizservers/geovis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/geovis/RendererCmd.cpp
r4320 r4323 180 180 } 181 181 #endif /*USE_THREADS*/ 182 return TCL_OK; 183 } 184 185 static int 186 CameraGoOp(ClientData clientData, Tcl_Interp *interp, int objc, 187 Tcl_Obj *const *objv) 188 { 189 int x, y; 190 if (Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK || 191 Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) { 192 return TCL_ERROR; 193 } 194 double duration = 1.0; 195 if (objc > 4) { 196 if (Tcl_GetDoubleFromObj(interp, objv[4], &duration) != TCL_OK) { 197 return TCL_ERROR; 198 } 199 } 200 201 osgEarth::GeoPoint mapPoint; 202 if (g_renderer->mapMouseCoords(x, y, mapPoint)) { 203 osgEarth::Viewpoint vpt = g_renderer->getViewpoint(); 204 vpt.x() = mapPoint.x(); 205 vpt.y() = mapPoint.y(); 206 g_renderer->setViewpoint(vpt, duration); 207 } else { 208 // Out of map bounds 209 } 182 210 return TCL_OK; 183 211 } … … 369 397 {"delete", 2, CameraDeleteViewpointOp, 3, 3, "name"}, 370 398 {"dist", 2, CameraSetDistanceOp, 3, 3, "distance"}, 371 {"get", 1, CameraGetViewpointOp, 2, 2, ""}, 399 {"get", 2, CameraGetViewpointOp, 2, 2, ""}, 400 {"go", 2, CameraGoOp, 4, 5, "x y ?duration?"}, 372 401 {"orient", 1, CameraOrientOp, 6, 6, "qw qx qy qz"}, 373 402 {"pan", 1, CameraPanOp, 4, 4, "panX panY"}, -
trunk/packages/vizservers/geovis/geovis_protocol.txt
r4320 r4323 35 35 camera get 36 36 Request camera parameters 37 camera go <x> <y> <?duration?> 38 Move camera to new focal point. 39 <x>,<y> = Screen/mouse coordinates 40 <duration> = Duration of viewpoint move animation in seconds 37 41 camera orient <quatW> <quatX> <quatY> <quatZ> 38 42 Set scene orientation using a quaternion
Note: See TracChangeset
for help on using the changeset viewer.