Skip to content

Commit fbfdc70

Browse files
committed
"time-independent" => "framerate-independent"
1 parent acd946b commit fbfdc70

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

MathHelper/MathHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace UnityUtilities
55
{
66
/// <summary>
7-
/// The MathHelper contains methods to help with mapping and angles and a really nifty method for time-independent eased lerping.
7+
/// The MathHelper contains methods to help with mapping and angles and a really nifty method for framerate-independent eased lerping.
88
/// </summary>
99
public static class MathHelper
1010
{
@@ -128,7 +128,7 @@ public static float NormalizeAngleDeg180(float angle)
128128
#region Miscellaneous
129129

130130
/// <summary>
131-
/// Provides a time-independent T for lerping towards a target.
131+
/// Provides a framerate-independent t for lerping towards a target.
132132
///
133133
/// Example:
134134
///
@@ -150,13 +150,13 @@ public static float NormalizeAngleDeg180(float angle)
150150
/// starting value, but since it's called every frame, the actual speed changes the higher
151151
/// the framerate is.
152152
///
153-
/// This function replaces the lerp T to make it time-independent and easier to estimate.
153+
/// This function replaces the lerp T to make it framerate-independent and easier to estimate.
154154
///
155155
/// For more info, see https://www.scirra.com/blog/ashley/17/using-lerp-with-delta-time.
156156
/// </summary>
157157
/// <param name="factor">How much % the lerp should cover per second.</param>
158158
/// <param name="deltaTime">How much time passed since the last call.</param>
159-
/// <returns>The time-independent lerp T.</returns>
159+
/// <returns>The framerate-independent lerp t.</returns>
160160
public static float EasedLerpFactor(float factor, float deltaTime = 0f)
161161
{
162162
if (deltaTime == 0f)

MathHelper/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# MathHelper
22

3-
The MathHelper contains methods to help with mapping and angles and a really nifty method for time-independent eased lerping.
3+
The MathHelper contains methods to help with mapping and angles and a really nifty method for framerate-independent eased lerping.
44

55
## Examples
66

7-
### Time-Independent Eased Lerping
7+
### Framerate-Independent Eased Lerping
88

99
There are essentially two ways of lerping a value over time: linear (constant speed) or eased (e.g. getting slower the closer you are to the target, see http://easings.net.)
1010

1111
For linear lerping (and most of the easing functions), you need to track the start and end positions and the time that elapsed.
1212

1313
Calling something like `currentValue = Mathf.Lerp(currentValue, 1f, 0.95f);` every frame provides an easy way of eased lerping without tracking elapsed time or the starting value, but since it's called every frame, the actual speed changes the higher the framerate is.
1414

15-
EasedLerpFactor replaces the lerp T to make it time-independent and easier to estimate.
15+
EasedLerpFactor replaces the lerp parameter t to make it framerate-independent and easier to estimate.
1616

1717
You can find more information about the formula used [here](https://www.scirra.com/blog/ashley/17/using-lerp-with-delta-time).
1818

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you find any bugs or have suggestions, please add an [Issue](https://github.c
1010
* [Countdown](https://github.com/TobiasWehrum/unity-utilities/tree/master/Countdown): Useful for things like cooldowns or spawn delays. It is also helpful for tweening things by using the `PercentElapsed` property.
1111
* [EditorHelper](https://github.com/TobiasWehrum/unity-utilities/tree/master/EditorHelper): Gets the `[Tooltip]` attribute content of fields for editor classes. Might get more helper methods in the future.
1212
* [LINQExtensions](https://github.com/TobiasWehrum/unity-utilities/tree/master/LINQExtensions): A collection of extension methods for `IEnumerable`, `List` and arrays.
13-
* [MathHelper](https://github.com/TobiasWehrum/unity-utilities/tree/master/MathHelper): Helper methods for time-independent eased lerping, mapping and angles.
13+
* [MathHelper](https://github.com/TobiasWehrum/unity-utilities/tree/master/MathHelper): Helper methods for framerate-independent eased lerping, mapping and angles.
1414
* [MeshCreator](https://github.com/TobiasWehrum/unity-utilities/tree/master/MeshCreator): Makes it more convenient to create meshes via code.
1515
* [NoiseOutputValue](https://github.com/TobiasWehrum/unity-utilities/tree/master/NoiseOutputValue): Enter a range and a speed in the editor, get an output value that fluctuates over time using [Perlin Noise](http://docs.unity3d.com/ScriptReference/Mathf.PerlinNoise.html).
1616
* [RandomBag](https://github.com/TobiasWehrum/unity-utilities/tree/master/RandomBag): A `RandomBag` gives you random items from a group while ensuring that in a certain interval every item was given back the same number of times.

0 commit comments

Comments
 (0)