diff --git a/modeling-cmds/openapi/api.json b/modeling-cmds/openapi/api.json index 7674ba62..7989aa4c 100644 --- a/modeling-cmds/openapi/api.json +++ b/modeling-cmds/openapi/api.json @@ -2604,14 +2604,23 @@ ] }, { - "description": "Adjust zoom of the default camera.", + "description": "Moves the camera towards its pivot", "type": "object", "properties": { "magnitude": { - "description": "Move the camera forward along the vector it's looking at, by this magnitudedefaultCameraZoom. Basically, how much should the camera move forward by.", + "description": "How much should the camera move", "type": "number", "format": "float" }, + "screen_point": { + "nullable": true, + "description": "Optional screen space position to zoom towards. If given, the camera's pivot will be set to the projection of this point onto the XY plane of the current pivot.", + "allOf": [ + { + "$ref": "#/components/schemas/Point2d" + } + ] + }, "type": { "type": "string", "enum": [ diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 0c442804..df5e8615 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -408,15 +408,16 @@ define_modeling_cmd_enum! { pub sequence: Option, } - /// Adjust zoom of the default camera. + /// Moves the camera towards its pivot #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct DefaultCameraZoom { - /// Move the camera forward along the vector it's looking at, - /// by this magnitudedefaultCameraZoom. - /// Basically, how much should the camera move forward by. + /// How much should the camera move pub magnitude: f32, + /// Optional screen space position to zoom towards. If given, the camera's pivot will + /// be set to the projection of this point onto the XY plane of the current pivot. + pub screen_point: Option, } /// Export a sketch to a file.