pub fn dilate(&mut self, current: &glm::Vec2, _options: &InteractionOptions) {
        match &mut self.data {
            SquidData::Rect(rect) => {
                let expression = rect.dilate_behavior.express(current);
                let mut new_data = *rect.data.get_real();
                new_data.position = MultiLerp::Linear(expression.position);
                new_data.size = expression.total_scale_factor * rect.prescale_size;
                rect.data.set(new_data);
                rect.mesh = None;
            }
            SquidData::Circle(circle) => {
                let mut new_data = *circle.data.get_real();
                let expression = circle.dilate_behavior.express(current);
                new_data.position = MultiLerp::Linear(expression.position);
                new_data.radius = circle.prescale_size * expression.total_scale_factor;
                circle.data.set(new_data);
            }
            SquidData::Tri(tri) => {
                let mut new_data = *tri.data.get_real();
                let expression = tri.dilate_behavior.express(current);
                new_data.position = MultiLerp::Linear(expression.position);
                new_data.p1 = MultiLerp::Linear(expression.total_scale_factor * tri.prescale_size[0]);
                new_data.p2 = MultiLerp::Linear(expression.total_scale_factor * tri.prescale_size[1]);
                new_data.p3 = MultiLerp::Linear(expression.total_scale_factor * tri.prescale_size[2]);
                tri.data.set(new_data);
            }
        }
    }
// Dilates a squid body toward/from a point
Dilates a squid body toward/from a point
Dilates a squid body toward / from a point
pub fn dilate(&mut self, current: &glm::Vec2, _options: &InteractionOptions) {
        match &mut self.data {
            SquidData::Rect(rect) => {
                let expression = rect.dilate_behavior.express(current);
                let mut new_data = *rect.data.get_real();
                new_data.position = MultiLerp::Linear(expression.position);
                new_data.size = expression.total_scale_factor * rect.prescale_size;
                rect.data.set(new_data);
                rect.mesh = None;
            }
            SquidData::Circle(circle) => {
                let mut new_data = *circle.data.get_real();
                let expression = circle.dilate_behavior.express(current);
                new_data.position = MultiLerp::Linear(expression.position);
                new_data.radius = circle.prescale_size * expression.total_scale_factor;
                circle.data.set(new_data);
            }
            SquidData::Tri(tri) => {
                let mut new_data = *tri.data.get_real();
                let expression = tri.dilate_behavior.express(current);
                new_data.position = MultiLerp::Linear(expression.position);
                new_data.p1 = MultiLerp::Linear(expression.total_scale_factor * tri.prescale_size[0]);
                new_data.p2 = MultiLerp::Linear(expression.total_scale_factor * tri.prescale_size[1]);
                new_data.p3 = MultiLerp::Linear(expression.total_scale_factor * tri.prescale_size[2]);
                tri.data.set(new_data);
            }
        }
    }
pub fn dilate ( & mut self , current : & glm :: Vec2 , _options : & InteractionOptions ) { match & mut self . data { SquidData :: Rect ( rect ) => { let expression = rect . dilate_behavior . express ( current ) ; let mut new_data = * rect . data . get_real ( ) ; new_data . position = MultiLerp :: Linear ( expression . position ) ; new_data . size = expression . total_scale_factor * rect . prescale_size ; rect . data . set ( new_data ) ; rect . mesh = None ; } SquidData :: Circle ( circle ) => { let mut new_data = * circle . data . get_real ( ) ; let expression = circle . dilate_behavior . express ( current ) ; new_data . position = MultiLerp :: Linear ( expression . position ) ; new_data . radius = circle . prescale_size * expression . total_scale_factor ; circle . data . set ( new_data ) ; } SquidData :: Tri ( tri ) => { let mut new_data = * tri . data . get_real ( ) ; let expression = tri . dilate_behavior . express ( current ) ; new_data . position = MultiLerp :: Linear ( expression . position ) ; new_data . p1 = MultiLerp :: Linear ( expression . total_scale_factor * tri . prescale_size [ 0 ] ) ; new_data . p2 = MultiLerp :: Linear ( expression . total_scale_factor * tri . prescale_size [ 1 ] ) ; new_data . p3 = MultiLerp :: Linear ( expression . total_scale_factor * tri . prescale_size [ 2 ] ) ; tri . data . set ( new_data ) ; } } }
Dilates a squid body toward/from a point
Dilates a squid body toward / from a point
&mut self
current
&glm::Vec2
_options
&InteractionOptions
&mut self
current
&glm::Vec2
_options
&InteractionOptions