pub fn express(&mut self, current: &glm::Vec2, options: &InteractionOptions) -> Option<Expression> {
        use crate::math_helpers::AsAngle;

        if !self.revolving {
            None
        } else {
            let mu0 = (self.point - self.origin).as_angle();
            let mu1 = (current - self.origin).as_angle();
            let total_delta_mu = mu0 - mu1;

            let raw_delta_rotation = angle_difference(self.rotation + *self.accumulator.residue(), total_delta_mu);
            let delta_rotation = self.accumulator.accumulate(&raw_delta_rotation, options.rotation_snapping).unwrap_or_default();

            self.rotation += delta_rotation;

            Some(Expression {
                origin_rotation: self.rotation,
                origin: self.origin,
                start: self.start,
                delta_object_rotation: delta_rotation,
            })
        }
    }
// Returns origin point to rotate around a certain amount
Returns origin point to rotate around a certain amount
Returns origin point to rotate around a certain amount
pub fn express(&mut self, current: &glm::Vec2, options: &InteractionOptions) -> Option<Expression> {
        use crate::math_helpers::AsAngle;
        if !self.revolving {
            None
        } else {
            let mu0 = (self.point - self.origin).as_angle();
            let mu1 = (current - self.origin).as_angle();
            let total_delta_mu = mu0 - mu1;
            let raw_delta_rotation = angle_difference(self.rotation + *self.accumulator.residue(), total_delta_mu);
            let delta_rotation = self.accumulator.accumulate(&raw_delta_rotation, options.rotation_snapping).unwrap_or_default();
            self.rotation += delta_rotation;
            Some(Expression {
                origin_rotation: self.rotation,
                origin: self.origin,
                start: self.start,
                delta_object_rotation: delta_rotation,
            })
        }
    }
pub fn express ( & mut self , current : & glm :: Vec2 , options : & InteractionOptions ) -> Option < Expression > { use crate :: math_helpers :: AsAngle ; if ! self . revolving { None } else { let mu0 = ( self . point - self . origin ) . as_angle ( ) ; let mu1 = ( current - self . origin ) . as_angle ( ) ; let total_delta_mu = mu0 - mu1 ; let raw_delta_rotation = angle_difference ( self . rotation + * self . accumulator . residue ( ) , total_delta_mu ) ; let delta_rotation = self . accumulator . accumulate ( & raw_delta_rotation , options . rotation_snapping ) . unwrap_or_default ( ) ; self . rotation += delta_rotation ; Some ( Expression { origin_rotation : self . rotation , origin : self . origin , start : self . start , delta_object_rotation : delta_rotation , } ) } }
Returns origin point to rotate around a certain amount
Returns origin point to rotate around a certain amount
&mut self
current
&glm::Vec2
options
&InteractionOptions
&mut self
current
&glm::Vec2
options
&InteractionOptions