17inline std::tuple<MoveX, MoveY> direction_for(
const TrackState& track,
float deadzone_cells = 2.5f)
19 if (track.state != TrackPhase::Locked && track.state != TrackPhase::Coasting)
23 const float dx = track.cx - (kGridW - 1) / 2.0f;
24 const float dy = track.cy - (kGridH - 1) / 2.0f;
27 if (dx < -deadzone_cells)
30 }
else if (dx > deadzone_cells)
34 if (dy < -deadzone_cells)
37 }
else if (dy > deadzone_cells)
41 return std::make_tuple(x, y);
Encapsulates horizontal movement states and utility methods.
Definition move_types.h:67
static constexpr MoveXValue None
Local alias for None state.
Definition move_types.h:70
static constexpr MoveXValue Right
Local alias for Right state.
Definition move_types.h:72
static constexpr MoveXValue Left
Local alias for Left state.
Definition move_types.h:74
Encapsulates vertical movement states and utility methods.
Definition move_types.h:105
static constexpr MoveYValue Up
Local alias for Up state.
Definition move_types.h:110
static constexpr MoveYValue None
Local alias for None state.
Definition move_types.h:108
static constexpr MoveYValue Down
Local alias for Down state.
Definition move_types.h:112
movement definitions for the Smart Camera project.
Value types shared by the motion detector and the tracker (pure C++20, natively tested).