summaryrefslogtreecommitdiff
path: root/grapher/Models/Calculations
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-25 23:03:00 -0700
committerJacob Palecki <[email protected]>2020-09-25 23:03:00 -0700
commit206cdc1712d02d15b85393a57ca744fbc014a55c (patch)
tree5d28926aee87c077ffc4ed7222469bbf2f28bd2c /grapher/Models/Calculations
parentLast mouse move perfetly responsive at 100 FPS (diff)
downloadrawaccel-206cdc1712d02d15b85393a57ca744fbc014a55c.tar.xz
rawaccel-206cdc1712d02d15b85393a57ca744fbc014a55c.zip
SetActive changes field default, bugs fixed
Diffstat (limited to 'grapher/Models/Calculations')
-rw-r--r--grapher/Models/Calculations/AccelCalculator.cs8
-rw-r--r--grapher/Models/Calculations/AccelChartData.cs12
2 files changed, 9 insertions, 11 deletions
diff --git a/grapher/Models/Calculations/AccelCalculator.cs b/grapher/Models/Calculations/AccelCalculator.cs
index 0838154..e2f7bcc 100644
--- a/grapher/Models/Calculations/AccelCalculator.cs
+++ b/grapher/Models/Calculations/AccelCalculator.cs
@@ -90,7 +90,7 @@ namespace grapher.Models.Calculations
continue;
}
- while (Math.Pow(10,log) < outMagnitude)
+ while (Math.Pow(10,log) < outMagnitude && logIndex < data.LogToIndex.Length)
{
data.LogToIndex[logIndex] = index;
log += 0.01;
@@ -140,7 +140,7 @@ namespace grapher.Models.Calculations
index--;
- while (log <= 4.0)
+ while (log <= 5.0)
{
data.LogToIndex[logIndex] = index;
log += 0.01;
@@ -193,7 +193,7 @@ namespace grapher.Models.Calculations
continue;
}
- while (Math.Pow(10,log) < magnitudeWithoutSens)
+ while (Math.Pow(10,log) < magnitudeWithoutSens && logIndex < data.Combined.LogToIndex.Length)
{
data.Combined.LogToIndex[logIndex] = index;
log += 0.01;
@@ -290,7 +290,7 @@ namespace grapher.Models.Calculations
index--;
- while (log <= 4.0)
+ while (log <= 5.0)
{
data.Combined.LogToIndex[logIndex] = index;
log += 0.01;
diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs
index 98d501b..60d4c89 100644
--- a/grapher/Models/Calculations/AccelChartData.cs
+++ b/grapher/Models/Calculations/AccelChartData.cs
@@ -14,7 +14,7 @@ namespace grapher.Models.Calculations
VelocityPoints = new SortedDictionary<double, double>();
GainPoints = new SortedDictionary<double, double>();
OutVelocityToPoints = new Dictionary<double, (double, double, double)>();
- LogToIndex = new int[601];
+ LogToIndex = new int[701];
}
#endregion Constructors
@@ -85,15 +85,13 @@ namespace grapher.Models.Calculations
{
log = -2;
}
- else if (log > 4)
+ else if (log > 5)
{
- log = 4;
- }
- else
- {
- log = log * 100 + 200;
+ log = 5;
}
+ log = log * 100 + 200;
+
var velIdx = LogToIndex[(int)log];
return velIdx;