diff options
author | chai <chaifix@163.com> | 2022-02-18 14:38:20 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-02-18 14:38:20 +0800 |
commit | 63795c45af9ecca5aea36fbe291b18fcd9fb9b7d (patch) | |
tree | 60d811d8a0b1944ab32d24aa28394183b82cadeb /JamHelper/Assets/JamUtils/Scripts/Smooth-Motion-in-Unity/README.md | |
parent | a41c8da0787e0285d4c5b16a5cf5bc3e7a34f521 (diff) |
*rename folder name
Diffstat (limited to 'JamHelper/Assets/JamUtils/Scripts/Smooth-Motion-in-Unity/README.md')
-rw-r--r-- | JamHelper/Assets/JamUtils/Scripts/Smooth-Motion-in-Unity/README.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/JamHelper/Assets/JamUtils/Scripts/Smooth-Motion-in-Unity/README.md b/JamHelper/Assets/JamUtils/Scripts/Smooth-Motion-in-Unity/README.md new file mode 100644 index 0000000..016072b --- /dev/null +++ b/JamHelper/Assets/JamUtils/Scripts/Smooth-Motion-in-Unity/README.md @@ -0,0 +1,12 @@ +# Smooth Motion in Unity (refactored) + +This is an improved (refactored) version of the code from the ["Timesteps and Achieving Smooth Motion in Unity"](https://www.kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8?utm_source=youtube&utm_type=SMVideo) article. + +Now, there are only 2 components instead of original 3: + +1. [`InterpolationFactorController`](https://github.com/DevelAx/Smooth-Motion-in-Unity/blob/master/InterpolationFactorController.cs) a singleton scene component (the original name was `InterpolationController`) that calculates the current *interpolation factor*. +2. [`InterpolationObjectController`](https://github.com/DevelAx/Smooth-Motion-in-Unity/blob/master/InterpolationObjectController.cs) a component for a moving object (the original name was `InterpolatedTransform`) which calculates the current interpolation for the object in the `Update()` method before it's being rendered and then restores its original `transform` values for the next `FixedUpdate()` call. +3. The `InterpolatedTransformUpdater` component was removed as unnecessary. + +## Remarks +For these scripts to work correctly the user's script must change the object's `transform` only in the `FixedUpdate()` method. When teleporting the object the user should call the (`InterpolationObjectController`).`ResetTransforms()` method after it. |