Remove static variable from MyAvatar::update (made it a member).

This commit is contained in:
Phil Palmer 2020-12-28 05:37:06 -05:00
parent 2be87fe7dc
commit 1e54d41f95
2 changed files with 4 additions and 6 deletions

View file

@ -676,12 +676,9 @@ void MyAvatar::update(float deltaTime) {
} }
// Recenter the body when foot tracking starts or ends. // Recenter the body when foot tracking starts or ends.
{ if (_isBodyPartTracked._feet != _isBodyPartTracked._feetPreviousUpdate) {
static bool prevFeetWereTracked = _isBodyPartTracked._feet;
if (_isBodyPartTracked._feet != prevFeetWereTracked) {
centerBodyInternal(false); centerBodyInternal(false);
prevFeetWereTracked = _isBodyPartTracked._feet; _isBodyPartTracked._feetPreviousUpdate = _isBodyPartTracked._feet;
}
} }
// put the average hand azimuth into sensor space. // put the average hand azimuth into sensor space.

View file

@ -2733,6 +2733,7 @@ private:
// Indicates which parts of the body are under direct control (tracked). // Indicates which parts of the body are under direct control (tracked).
struct { struct {
bool _feet{ false }; // Left or right foot. bool _feet{ false }; // Left or right foot.
bool _feetPreviousUpdate{ false };// Value of _feet on the previous update.
bool _hips{ false }; bool _hips{ false };
bool _leftHand{ false }; bool _leftHand{ false };
bool _rightHand{ false }; bool _rightHand{ false };