summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tracker-wii/wii_camera.cpp10
-rw-r--r--tracker-wii/wii_camera.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp
index cc019992..06a607c0 100644
--- a/tracker-wii/wii_camera.cpp
+++ b/tracker-wii/wii_camera.cpp
@@ -274,16 +274,14 @@ void WIICamera::get_status(struct wii_info& wii)
wii.bBatteryDrained = m_pDev->bBatteryDrained;
//draw horizon
- static int p = 0;
- static int r = 0;
if (m_pDev->Nunchuk.Acceleration.Orientation.UpdateAge < 10)
{
- p = m_pDev->Acceleration.Orientation.Pitch;
- r = m_pDev->Acceleration.Orientation.Roll;
+ pitch_ = m_pDev->Acceleration.Orientation.Pitch;
+ roll_ = m_pDev->Acceleration.Orientation.Roll;
}
- wii.Pitch = p;
- wii.Roll = r;
+ wii.Pitch = pitch_;
+ wii.Roll = roll_;
}
void WIICamera::on_state_change(wiimote &remote,
diff --git a/tracker-wii/wii_camera.h b/tracker-wii/wii_camera.h
index e1788be5..ab728564 100644
--- a/tracker-wii/wii_camera.h
+++ b/tracker-wii/wii_camera.h
@@ -66,6 +66,8 @@ private:
pt_settings s;
+ int pitch_ = 0, roll_ = 0;
+
static constexpr inline double dt_eps = 1./384;
};