aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Turvey <mwturvey@users.noreply.github.com>2017-05-26 16:39:47 -0700
committerGitHub <noreply@github.com>2017-05-26 16:39:47 -0700
commitc9b8dccdf41d89a7c696337357f115aa9f1066ca (patch)
tree04127647caab97e8f50ea99b9d648fa40b7396e9
parentd6d0cf051f54173e3f1378de148019474dc514b1 (diff)
parent80abe91650bed72dc9049fe836b11168c44d6700 (diff)
downloadlibsurvive-c9b8dccdf41d89a7c696337357f115aa9f1066ca.tar.gz
libsurvive-c9b8dccdf41d89a7c696337357f115aa9f1066ca.tar.bz2
Merge pull request #75 from mwturvey/ToriFixes
More changes to torii fitness calculations
-rw-r--r--src/poser_turveytori.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/poser_turveytori.c b/src/poser_turveytori.c
index c89f62a..c7ef901 100644
--- a/src/poser_turveytori.c
+++ b/src/poser_turveytori.c
@@ -386,7 +386,7 @@ FLT getPointFitnessForPna(Point pointIn, PointsAndAngle *pna)
return dist;
}
-int compareFlts(const void * b, const void * a)
+int compareFlts(const void * a, const void * b)
{
FLT a2 = *(const FLT*)a;
FLT b2 = *(const FLT*)b;
@@ -411,7 +411,7 @@ FLT getPointFitness(Point pointIn, PointsAndAngle *pna, size_t pnaCount, int deu
worstFitness = fitness;
}
- fitnesses[i] = fitness;
+ fitnesses[i] = FLT_FABS(fitness);
if (deubgPrint)
{
printf(" [%d, %d](%f)\n", pna[i].ai, pna[i].bi, fitness);
@@ -1534,7 +1534,7 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData )
counter++;
// let's just do this occasionally for now...
- if (counter % 12 == 0)
+ if (counter % 4 == 0)
QuickPose(so, 0);
}
if (1 == l->lh && axis) // only once per full cycle...
@@ -1544,7 +1544,7 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData )
counter++;
// let's just do this occasionally for now...
- if (counter % 12 == 0)
+ if (counter % 4 == 0)
QuickPose(so, 1);
}
// axis changed, time to increment the circular buffer index.