Skip to content

Commit

Permalink
Optimize|liblegacy|Smoother: Smoother_Evaluate should not continuousl…
Browse files Browse the repository at this point in the history
…y log its internal state

There is no point doing this all the time when this info is only ever
relevant when debugging Smoother.
  • Loading branch information
danij-deng committed Oct 3, 2014
1 parent 4ec8ad7 commit 3a8a750
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions doomsday/liblegacy/src/smoother.cpp
Expand Up @@ -200,14 +200,9 @@ dd_bool Smoother_EvaluateComponent(Smoother const *sm, int component, coord_t *v

dd_bool Smoother_Evaluate(Smoother const *sm, coord_t *xyz)
{
const pos_t *past;
const pos_t *now;
float t;
int i;

DENG_ASSERT(sm);
past = &sm->past;
now = &sm->now;
DENG2_ASSERT(sm);
pos_t const *past = &sm->past;
pos_t const *now = &sm->now;

if(!Smoother_IsValid(sm))
return false;
Expand All @@ -218,7 +213,7 @@ dd_bool Smoother_Evaluate(Smoother const *sm, coord_t *xyz)
xyz[VX] = past->xyz[VX];
xyz[VY] = past->xyz[VY];
xyz[VZ] = past->xyz[VZ];
LOGDEV_XVERBOSE("Smoother %p falling behind") << sm;
//LOGDEV_XVERBOSE("Smoother %p falling behind") << sm;
return true;
}
//DENG_ASSERT(sm->at <= now->time);
Expand All @@ -228,13 +223,13 @@ dd_bool Smoother_Evaluate(Smoother const *sm, coord_t *xyz)
xyz[VX] = now->xyz[VX];
xyz[VY] = now->xyz[VY];
xyz[VZ] = now->xyz[VZ];
LOGDEV_XVERBOSE("Smoother %p stalling") << sm;
//LOGDEV_XVERBOSE("Smoother %p stalling") << sm;
return true;
}

// We're somewhere between past and now.
t = (sm->at - past->time) / (now->time - past->time);
for(i = 0; i < 3; ++i)
float const t = (sm->at - past->time) / (now->time - past->time);
for(int i = 0; i < 3; ++i)
{
// Linear interpolation.
xyz[i] = now->xyz[i] * t + past->xyz[i] * (1-t);
Expand Down

0 comments on commit 3a8a750

Please sign in to comment.