-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHelper.cs
More file actions
29 lines (24 loc) · 700 Bytes
/
Copy pathHelper.cs
File metadata and controls
29 lines (24 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using ExileCore.PoEMemory.MemoryObjects;
using SharpDX;
namespace DefaultNamespace;
public static class Helper
{
private static long _lastTime;
internal static float _deltaTime;
public static void GetDeltaTime()
{
var now = DateTime.Now.Ticks;
// ReSharper disable once PossibleLossOfFraction
float dT = (now - _lastTime) / 10000;
_lastTime = now;
_deltaTime = dT;
}
internal static Random random = new Random();
internal static float MoveTowards(float cur, float tar, float max)
{
if (Math.Abs(tar - cur) <= max)
return tar;
return cur + Math.Sign(tar - cur) * max;
}
}