Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
9 changes: 5 additions & 4 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,16 @@ define_modeling_cmd_enum! {
pub sequence: Option<u32>,
}

/// 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<Point2d>,
}

/// Export a sketch to a file.
Expand Down
Loading