Skip to content

2.2.0

Choose a tag to compare

@poetmountain poetmountain released this 05 Dec 00:25
· 27 commits to main since this release

After a long spell of mostly maintenance releases, I'm very excited to present some big, new functionality to MotionMachine that I've been thinking about implementing for a long time. Animating objects along a CGPath! This opens up a lot of new possibilities for both animating views on-screen, as well as interpolating generic values in more complex ways. And as with all other MotionMachine classes, these new Path classes act in the ways you'd expect -- reverse them, repeat them, nest them in MotionGroup and MotionSequence, whatever you'd like!

  • Added PathMotion class to allow a CGPoint to be animated along the length of a CGPath! PathMotion conforms to the Moveable protocol and interacts with the MotionMachine ecosystem as you'd expect from the other motion classes, and you can use all of the normal easing equations. Using the startPosition and endPosition parameters you can even specify a portion of the path to animate along.
  • Added PathPhysicsMotion class to allow a CGPoint to be animated along the length of a CGPath using the same physics system that PhysicsMotion uses! Like PathMotion, it conforms to the Moveable protocol and interacts with the MotionMachine ecosystem as you'd expect from the other motion classes.
  • Added simple collision handling to PhysicsSystem, the physics engine that powers PhysicsMotion and PathPhysicsMotion. Collision points can be specified using the starting and ending points of a motion, and a restitution value to control how much velocity is lost during a collision can be set using the new PhysicsConfiguration object. This collision support gives PhysicsMotion and the new PathPhysicsMotion some interesting uses -- I'd love to hear what you come up with!

Please see the updated user guide, documentation, and examples for more information about the new Path classes and physics collision support!