Function anim::apply_smooth_handles

Function Documentation

void anim::apply_smooth_handles(Keyframe &keyframe, const Keyframe *prev_keyframe_ptr, const Keyframe *next_keyframe_ptr, double smooth_factor = 1.0 / 3.0)

Computes HandleMode::Smooth handles for a keyframe.

Produces collinear handles for a smooth (C1-continuous) transition, with magnitude proportional to the distance to the adjacent keyframes.

Parameters:
  • keyframe – The keyframe to update (modified in place).

  • prev_keyframe_ptr – Previous keyframe, or nullptr if this is the first.

  • next_keyframe_ptr – Next keyframe, or nullptr if this is the last.

  • smooth_factor – Fraction of the neighbour distance used for the handle length.