kernel-legacy icon indicating copy to clipboard operation
kernel-legacy copied to clipboard

Helpers for non-linear Lerp

Open nearnshaw opened this issue 5 years ago • 0 comments

It would be great to have an easy way to make something move at a speed that isn't constant, following a curve if we plot time / progress.

In older versions of the SDK, we had transitions with different settings that let you choose between different kinds of movement. For example:

  • linear
  • exponential
  • ease-in
  • ease-out
  • ease-in-and-out
  • bounce-in
  • bounce-out

These changes are sometimes subtle, but can be used to communicate a lot about the weight, material, etc of object that's moving.

This could be possible in various ways. We should explore the different options. One is to create a new function of Vector3 that's like lerp, but has an extra "mode" field to select different curves. Another is to use the existing lerp function, but instead of adding constant increments on every frame to the "fraction" field, we could use another function to calculate what the new increment should be to follow one of these curves. Another is to create a lerp component that hides away all of the complexity of moving an object, and give it a "mode" field. Maybe this can be done as part of a game-kit and not the core SDK.

nearnshaw avatar Mar 20 '19 19:03 nearnshaw