All Projects → phest → interpolations

phest / interpolations

Licence: Unknown, Unknown licenses found Licenses found Unknown LICENSE Unknown LICENSE.meta
Lightweight Unity library for smoothing movements and value progressions in code (dragging, easing, tweening).

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to interpolations

smooth-corners
CSS superellipse masks using the Houdini API
Stars: ✭ 133 (+358.62%)
Mutual labels:  smoothing, curve-interpolation
SwiftTweener
A pure Swift animation engine.
Stars: ✭ 74 (+155.17%)
Mutual labels:  easing-functions, tweening
ux-animate
A simple but powerful tweening, spring physics, animation library for Rust
Stars: ✭ 19 (-34.48%)
Mutual labels:  tweening, motion
Tween.js
JavaScript/TypeScript animation engine
Stars: ✭ 8,409 (+28896.55%)
Mutual labels:  easing-functions
Kute.js
KUTE.js is a JavaScript animation engine for modern browsers.
Stars: ✭ 2,270 (+7727.59%)
Mutual labels:  easing-functions
ReactZooApp
ReactZooApp
Stars: ✭ 33 (+13.79%)
Mutual labels:  motion
room-glimpse
Read what your Raspberry Pi sees (picamera + Azure Cognitive / IoT)
Stars: ✭ 15 (-48.28%)
Mutual labels:  motion
PhaserCHOP-TD-Summit-Talk
Project files associated with http://github.com/dbraun/PhaserCHOP and David Braun's "Quantitative Easing" talk at the 2019 TouchDesigner Summit https://www.youtube.com/watch?v=S4PQW4f34c8
Stars: ✭ 36 (+24.14%)
Mutual labels:  easing-functions
piCamBot
Security camera based on a raspberry pi and Telegram, controllable by smartphone
Stars: ✭ 43 (+48.28%)
Mutual labels:  motion
Juicer
Juicer is a generic animation / motion library for macOS & iOS & tvOS written in Swift
Stars: ✭ 13 (-55.17%)
Mutual labels:  motion
use-spring
Hooke's law hook
Stars: ✭ 53 (+82.76%)
Mutual labels:  motion
Animationeasingfunctions
Android Animation Easing Functions. Let's make animation more real!
Stars: ✭ 2,427 (+8268.97%)
Mutual labels:  easing-functions
dynamic-motion
Provide additional functionality to Android MotionLayout.
Stars: ✭ 34 (+17.24%)
Mutual labels:  motion
Androidviewanimations
Cute view animation collection.
Stars: ✭ 12,008 (+41306.9%)
Mutual labels:  easing-functions
WebCamCap
Motion capture tool for 2D/3D motion capture with LED markers.
Stars: ✭ 20 (-31.03%)
Mutual labels:  motion
animol
A minimal, super lightweight (3KB minimized and gzipped), zero dependency, JavaScript animation library.
Stars: ✭ 24 (-17.24%)
Mutual labels:  easing-functions
Interactive Data Editor
A Software to interactively edit data in a graphical manner
Stars: ✭ 35 (+20.69%)
Mutual labels:  smoothing
opensim-moco
Solve optimal control problems for musculoskeletal models using OpenSim and direct collocation.
Stars: ✭ 45 (+55.17%)
Mutual labels:  motion
FluentTransitions
▶ Smooth UI animations & transitions for .NET
Stars: ✭ 27 (-6.9%)
Mutual labels:  tweening
discrete frechet
Compute the Fréchet distance between two polygonal curves in Euclidean space.
Stars: ✭ 68 (+134.48%)
Mutual labels:  smoothing

Interpolations

Lightweight Unity library for smoothing movements and value progressions in code (dragging, easing, tweening).

https://twitter.com/stephbysteph/status/1125462189450465280

API is currently experimental and may change.

Current Features

  • Drag outs
    • On the fly dampening of changes over time (float and Vector3)
    • Optional control and status of snapping
  • Easings
    • Robert Penner easing equations, optimized
    • Easings methods pluggable to Unity's Lerp methods
  • Tweens
    • Lightweight and flexible tweening suite
    • Tween class extendable with two one-line methods
    • If needed, direct control over Tween instances and updating, for specific requirements in update timing or instancing
    • Optional runner abstraction handling instances and updates, with choice over which update event function to update within
    • Optional abstraction sugar for different tween types
    • Tween characteristics can be modified while tweening, for dynamic changes
    • Tween instances can be reused, yo-yo-ed, or recycled
    • Tween easings configurable through editor
    • Pure tweens for tweens without side effects
    • Closure tweens for custom tween instances (Float, Vector2-3, Quaternion, Color)
    • Convenience tweens for Transform control (Position, Rotation, Scale)

Examples

Smoothing out sudden value changes

// (Within an update call, i.e. FixedUpdate)
mixer.volume = Volume;
                 |
                 v
mixer.volume = mixer.volume.DragOut(Volume, 30);

Adding easing to a lerp call

Vector3.Lerp(a, b, ratio);
                     |
                     v
Vector3.Lerp(a, b, I.Cubic.InOut(ratio));

Check this cheat sheet for the effect of the different equations.

Tweening a position, the abstracted way

Tweens.Run(new PositionTween(transform))
      .To(targetPosition)
      .Timing(0, 1, I.Circ.InOut);

or using a shortcut:

Tweens.RunPosition(transform)
      .To(targetPosition)
      .Timing(0, 1, I.Circ.InOut);

or having it update within FixedUpdate/LateUpdate instead of Update:

Tweens.Fixed.Run...
Tweens.Late.Run...

Tweening a position, the controlling way

Tween<Vector3> positionTween;
...
positionTween = new PositionTween(transform))
      .To(targetPosition)
      .Timing(0, 1, I.Circ.InOut)
      .Start();
...
// In Update, FixedUpdate, or etc
positionTween.Update(Time.timeDelta)

Custom tweening instances

Tweens.RunFloat
(
    () => mixer.GetFloat("sfxVol", out float vol) ? vol : 0,
    vol =>
    {
        mixer.SetFloat("sfxVol", vol);
        indicator.alpha = vol;
    }
)
.To(targetVolume)
.Timing(0, 1, I.Sine.Out);
Tweens.Run(new ColorTween(myScript.GetColor, myScript.SetColor))
      .To(Color.yellow)
      .Timing(0, 1, I.Cubic.InOut);

Features Roadmap

  • Pre-setter value processor closure in Tween
  • More drag out types (Color, Quaternion, Vector2, etc)
  • More closure tween types (Vector4, etc)
  • Documentation

Possible features

  • More convenience tweens for Unity classes (CanvasGroup, Image, etc)
  • Eased sliders (editor and UI)
  • Bezier and CatmullRom Interpolations

Meta

Interpolations https://github.com/phest/interpolations

By Steph Thirion.

Easing equations by Robert Penner, optimized by Tween.js authors.

All code open source under MIT License. See LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].