@@ -739,6 +739,55 @@ pub struct CameraSettings {
739739 pub ortho : bool ,
740740}
741741
742+ #[ allow( missing_docs) ]
743+ #[ repr( u8 ) ]
744+ #[ derive( Default , Clone , Copy , Debug , Eq , PartialEq , Serialize , Deserialize , JsonSchema ) ]
745+ #[ serde( rename_all = "snake_case" ) ]
746+ #[ cfg_attr( feature = "ts-rs" , derive( ts_rs:: TS ) ) ]
747+ #[ cfg_attr( feature = "ts-rs" , ts( export_to = "ModelingCmd.ts" ) ) ]
748+ pub enum WorldCoordinateSystem {
749+ #[ default]
750+ RightHandedUpZ ,
751+ RightHandedUpY ,
752+ }
753+
754+ #[ allow( missing_docs) ]
755+ #[ repr( C ) ]
756+ #[ derive( Clone , Copy , Debug , PartialEq , Serialize , Deserialize , JsonSchema ) ]
757+ #[ cfg_attr( feature = "ts-rs" , derive( ts_rs:: TS ) ) ]
758+ #[ cfg_attr( feature = "ts-rs" , ts( export_to = "ModelingCmd.ts" ) ) ]
759+ pub struct CameraViewState {
760+ pub pivot_rotation : [ f32 ; 4 ] ,
761+ pub pivot_position : [ f32 ; 3 ] ,
762+ pub eye_offset : f32 ,
763+ pub fov_y : f32 ,
764+ pub ortho_scale_factor : f32 ,
765+ pub is_ortho : bool ,
766+ pub ortho_scale_enabled : bool ,
767+ pub world_coord_system : WorldCoordinateSystem ,
768+ }
769+
770+ impl Default for CameraViewState {
771+ fn default ( ) -> Self {
772+ CameraViewState {
773+ pivot_rotation : [ 0.0 , 0.0 , 0.0 , 1.0 ] ,
774+ pivot_position : Default :: default ( ) ,
775+ eye_offset : 10.0 ,
776+ fov_y : 45.0 ,
777+ ortho_scale_factor : 1.6 ,
778+ is_ortho : false ,
779+ ortho_scale_enabled : true ,
780+ world_coord_system : WorldCoordinateSystem :: default ( ) ,
781+ }
782+ }
783+ }
784+
785+ #[ cfg( feature = "cxx" ) ]
786+ impl_extern_type ! {
787+ [ Trivial ]
788+ CameraViewState = "Endpoints::CameraViewState"
789+ }
790+
742791impl From < CameraSettings > for crate :: output:: DefaultCameraZoom {
743792 fn from ( settings : CameraSettings ) -> Self {
744793 Self { settings }
0 commit comments