fn to_object_space(&self, screen_pos: Vector2) -> Vector2 {
        let camera = self.camera.get();
        let origin_world_space = Vector4(0.0, 0.0, 0.0, 1.0);
        let origin_clip_space = camera.view_projection_matrix() * origin_world_space;
        let inv_object_matrix = self.transform_matrix().try_inverse().unwrap();

        let shape = self.app.display.scene().frp.shape.value();
        let clip_space_z = origin_clip_space.z;
        let clip_space_x = origin_clip_space.w * 2.0 * screen_pos.x / shape.width;
        let clip_space_y = origin_clip_space.w * 2.0 * screen_pos.y / shape.height;
        let clip_space = Vector4(clip_space_x, clip_space_y, clip_space_z, origin_clip_space.w);
        let world_space = camera.inversed_view_projection_matrix() * clip_space;
        (inv_object_matrix * world_space).xy()
    }
/// Transforms screen position to the object (display object) coordinate system.
Transforms screen position to the object (display object) coordinate system.
Transforms screen position to the object ( display object ) coordinate system .
fn to_object_space(&self, screen_pos: Vector2) -> Vector2 {
        let camera = self.camera.get();
        let origin_world_space = Vector4(0.0, 0.0, 0.0, 1.0);
        let origin_clip_space = camera.view_projection_matrix() * origin_world_space;
        let inv_object_matrix = self.transform_matrix().try_inverse().unwrap();
        let shape = self.app.display.scene().frp.shape.value();
        let clip_space_z = origin_clip_space.z;
        let clip_space_x = origin_clip_space.w * 2.0 * screen_pos.x / shape.width;
        let clip_space_y = origin_clip_space.w * 2.0 * screen_pos.y / shape.height;
        let clip_space = Vector4(clip_space_x, clip_space_y, clip_space_z, origin_clip_space.w);
        let world_space = camera.inversed_view_projection_matrix() * clip_space;
        (inv_object_matrix * world_space).xy()
    }
fn to_object_space ( & self , screen_pos : Vector2 ) -> Vector2 { let camera = self . camera . get ( ) ; let origin_world_space = Vector4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ; let origin_clip_space = camera . view_projection_matrix ( ) * origin_world_space ; let inv_object_matrix = self . transform_matrix ( ) . try_inverse ( ) . unwrap ( ) ; let shape = self . app . display . scene ( ) . frp . shape . value ( ) ; let clip_space_z = origin_clip_space . z ; let clip_space_x = origin_clip_space . w * 2.0 * screen_pos . x / shape . width ; let clip_space_y = origin_clip_space . w * 2.0 * screen_pos . y / shape . height ; let clip_space = Vector4 ( clip_space_x , clip_space_y , clip_space_z , origin_clip_space . w ) ; let world_space = camera . inversed_view_projection_matrix ( ) * clip_space ; ( inv_object_matrix * world_space ) . xy ( ) }
Transforms screen position to the object (display object) coordinate system.
Transforms screen position to the object ( display object ) coordinate system .
&self
screen_pos
Vector2
&self
screen_pos
Vector2