// Attempts to get a selection for this squid or a selection for a limb of this squid
// under the point (x, y)
Attempts to get a selection for this squid or a selection for a limb of this squid
under the point (x, y)
Attempts to get a selection for this squid or a selection for a limb of this squid under the point ( x y )
pub fn try_select(&self, underneath: glm::Vec2, camera: &Camera, self_reference: SquidRef) -> Option<NewSelection> {
        match &self.data {
            SquidData::Rect(rect) => {
                if rect::is_point_over(rect, underneath, camera) {
                    return Some(NewSelection {
                        selection: Selection::new(self_reference, None),
                        info: NewSelectionInfo {
                            color: Some(rect.data.get_real().color.0),
                        },
                    });
                }
            }
            SquidData::Circle(circle) => {
                if circle::is_point_over(circle, underneath, camera) {
                    return Some(NewSelection {
                        selection: Selection::new(self_reference, None),
                        info: NewSelectionInfo {
                            color: Some(circle.data.get_real().color.0),
                        },
                    });
                }
            }
            SquidData::Tri(tri) => {
                if tri::is_point_over(tri, underneath, camera) {
                    return Some(NewSelection {
                        selection: Selection::new(self_reference, None),
                        info: NewSelectionInfo {
                            color: Some(tri.data.get_real().color.0),
                        },
                    });
                }
            }
        }
        None
    }
pub fn try_select ( & self , underneath : glm :: Vec2 , camera : & Camera , self_reference : SquidRef ) -> Option < NewSelection > { match & self . data { SquidData :: Rect ( rect ) => { if rect :: is_point_over ( rect , underneath , camera ) { return Some ( NewSelection { selection : Selection :: new ( self_reference , None ) , info : NewSelectionInfo { color : Some ( rect . data . get_real ( ) . color . 0 ) , } , } ) ; } } SquidData :: Circle ( circle ) => { if circle :: is_point_over ( circle , underneath , camera ) { return Some ( NewSelection { selection : Selection :: new ( self_reference , None ) , info : NewSelectionInfo { color : Some ( circle . data . get_real ( ) . color . 0 ) , } , } ) ; } } SquidData :: Tri ( tri ) => { if tri :: is_point_over ( tri , underneath , camera ) { return Some ( NewSelection { selection : Selection :: new ( self_reference , None ) , info : NewSelectionInfo { color : Some ( tri . data . get_real ( ) . color . 0 ) , } , } ) ; } } } None }
Attempts to get a selection for this squid or a selection for a limb of this squid
under the point (x, y)
Attempts to get a selection for this squid or a selection for a limb of this squid under the point ( x y )
&self
underneath
glm::Vec2
camera
&Camera
self_reference
SquidRef