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
25 changes: 2 additions & 23 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,7 @@
"type": "object",
"properties": {
"eye_offset": {
"type": "number",
"format": "float"
"$ref": "#/components/schemas/Point3d"
},
"fov_y": {
"type": "number",
Expand All @@ -708,32 +707,19 @@
"is_ortho": {
"type": "boolean"
},
"ortho_scale_enabled": {
"type": "boolean"
},
"ortho_scale_factor": {
"type": "number",
"format": "float"
},
"pivot_position": {
"$ref": "#/components/schemas/Point3d"
},
"pivot_rotation": {
"$ref": "#/components/schemas/Point4d"
},
"world_coord_system": {
"$ref": "#/components/schemas/WorldCoordinateSystem"
}
},
"required": [
"eye_offset",
"fov_y",
"is_ortho",
"ortho_scale_enabled",
"ortho_scale_factor",
"pivot_position",
"pivot_rotation",
"world_coord_system"
"pivot_rotation"
]
},
"ClientMetrics": {
Expand Down Expand Up @@ -7848,13 +7834,6 @@
]
}
]
},
"WorldCoordinateSystem": {
"type": "string",
"enum": [
"right_handed_up_z",
"right_handed_up_y"
]
}
},
"responses": {
Expand Down
26 changes: 6 additions & 20 deletions modeling-cmds/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,18 +1139,6 @@ pub struct CameraSettings {
pub ortho: bool,
}

#[allow(missing_docs)]
#[repr(u8)]
#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
pub enum WorldCoordinateSystem {
#[default]
RightHandedUpZ,
RightHandedUpY,
}

#[allow(missing_docs)]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
Expand All @@ -1159,25 +1147,23 @@ pub enum WorldCoordinateSystem {
pub struct CameraViewState {
pub pivot_rotation: Quaternion,
pub pivot_position: Point3d,
pub eye_offset: f32,
pub eye_offset: Point3d,
pub fov_y: f32,
pub ortho_scale_factor: f32,
pub is_ortho: bool,
pub ortho_scale_enabled: bool,
pub world_coord_system: WorldCoordinateSystem,
}

impl Default for CameraViewState {
fn default() -> Self {
CameraViewState {
pivot_rotation: Default::default(),
pivot_position: Default::default(),
eye_offset: 10.0,
eye_offset: Point3d {
x: 0.0,
y: 0.0,
z: 10.0,
},
fov_y: 45.0,
ortho_scale_factor: 1.6,
is_ortho: false,
ortho_scale_enabled: true,
world_coord_system: Default::default(),
}
}
}
Expand Down
Loading