优化collision

This commit is contained in:
YHH
2020-06-15 08:46:38 +08:00
parent 246e9a9511
commit 7f8f1cf0d0
8 changed files with 132 additions and 7 deletions

View File

@@ -27,6 +27,10 @@ class MathHelper {
return rightMin + (value - leftMin) * (rightMax - rightMin) / (leftMax - leftMin);
}
public static lerp(value1: number, value2: number, amount: number){
return value1 + (value2 - value1) * amount;
}
public static clamp(value: number, min: number, max: number){
if (value < min)
return min;