fn adjust_tangents(&mut self, at: usize) {
        let length = self.keyframes.len();
        let mut tangent = T::FLAT_TANGENT;

        match self.tangents_control[at] {
            TangentControl::Auto => {
                if length > 2 {
                    let p = if at > 0 { at - 1 } else { 0 };
                    let n = if (at + 1) < length {
                        at + 1
                    } else {
                        length - 1
                    };

                    tangent = T::auto_tangent(
                        self.time_stamps[p],
                        self.time_stamps[at],
                        self.time_stamps[n],
                        &self.keyframes[p],
                        &self.keyframes[at],
                        &self.keyframes[n],
                    );
                }
            }
            TangentControl::Free => {
                // Copy left tangent into the right tangent
                self.tangents_out[at] = self.tangents_in[at];
                return;
            }
            TangentControl::Flat => {}
            _ => {
                // Do nothing
                return;
            }
        }

        self.tangents_in[at] = tangent;
        self.tangents_out[at] = tangent;
    }
/// Adjust tangents for a single keyframe according with their [`TangentControl`].
Adjust tangents for a single keyframe according with their [`TangentControl`].
Adjust tangents for a single keyframe according with their [ ` TangentControl ` ] .
fn adjust_tangents(&mut self, at: usize) {
        let length = self.keyframes.len();
        let mut tangent = T::FLAT_TANGENT;
        match self.tangents_control[at] {
            TangentControl::Auto => {
                if length > 2 {
                    let p = if at > 0 { at - 1 } else { 0 };
                    let n = if (at + 1) < length {
                        at + 1
                    } else {
                        length - 1
                    };
                    tangent = T::auto_tangent(
                        self.time_stamps[p],
                        self.time_stamps[at],
                        self.time_stamps[n],
                        &self.keyframes[p],
                        &self.keyframes[at],
                        &self.keyframes[n],
                    );
                }
            }
            TangentControl::Free => {
                // Copy left tangent into the right tangent
                self.tangents_out[at] = self.tangents_in[at];
                return;
            }
            TangentControl::Flat => {}
            _ => {
                // Do nothing
                return;
            }
        }
        self.tangents_in[at] = tangent;
        self.tangents_out[at] = tangent;
    }
fn adjust_tangents ( & mut self , at : usize ) { let length = self . keyframes . len ( ) ; let mut tangent = T :: FLAT_TANGENT ; match self . tangents_control [ at ] { TangentControl :: Auto => { if length > 2 { let p = if at > 0 { at - 1 } else { 0 } ; let n = if ( at + 1 ) < length { at + 1 } else { length - 1 } ; tangent = T :: auto_tangent ( self . time_stamps [ p ] , self . time_stamps [ at ] , self . time_stamps [ n ] , & self . keyframes [ p ] , & self . keyframes [ at ] , & self . keyframes [ n ] , ) ; } } TangentControl :: Free => { // Copy left tangent into the right tangent self . tangents_out [ at ] = self . tangents_in [ at ] ; return ; } TangentControl :: Flat => { } _ => { // Do nothing return ; } } self . tangents_in [ at ] = tangent ; self . tangents_out [ at ] = tangent ; }
Adjust tangents for a single keyframe according with their [`TangentControl`].
Adjust tangents for a single keyframe according with their [ ` TangentControl ` ] .
&mut self
at
usize
&mut self
at
usize