Skip to content

Commit

Permalink
Fixed|Renderer: Moving planes need decoration update on every frame
Browse files Browse the repository at this point in the history
Whenever a plane's smoothed height changes, the surface needs to be
marked for decoration update so light decorations on the plane will
be correctly placed during the move.

IssueID #1705
  • Loading branch information
skyjake committed Apr 21, 2014
1 parent f9fd727 commit 8ff55a2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doomsday/client/src/world/plane.cpp
Expand Up @@ -263,6 +263,7 @@ void Plane::lerpSmoothedHeight()
{
d->heightSmoothed = newHeightSmoothed;
d->notifySmoothedHeightChanged();
d->surface._needDecorationUpdate = true;
}
}

Expand All @@ -277,19 +278,25 @@ void Plane::resetSmoothedHeight()
d->heightSmoothed = newHeightSmoothed;
d->notifySmoothedHeightChanged();
}

d->surface._needDecorationUpdate = true;
}

void Plane::updateHeightTracking()
{
d->oldHeight[0] = d->oldHeight[1];
d->oldHeight[1] = d->height;

d->surface._needDecorationUpdate = true;

if(!de::fequal(d->oldHeight[0], d->oldHeight[1]))
{
if(de::abs(d->oldHeight[0] - d->oldHeight[1]) >= MAX_SMOOTH_MOVE)
{
// Too fast: make an instantaneous jump.
d->oldHeight[0] = d->oldHeight[1];

d->surface._needDecorationUpdate = true;
}
}
}
Expand Down

0 comments on commit 8ff55a2

Please sign in to comment.