summaryrefslogtreecommitdiff
path: root/src/view/view_racing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/view_racing.c')
-rw-r--r--src/view/view_racing.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/view/view_racing.c b/src/view/view_racing.c
index b588ede..f2468af 100644
--- a/src/view/view_racing.c
+++ b/src/view/view_racing.c
@@ -112,6 +112,9 @@ static void _controller_cb(void *data)
angle = math_helper_range_map(fabsf(controller_data->throttle), 0, 1, s_info.vel_min_angle, s_info.vel_max_angle);
view_base_set_angle(s_info.velocity, angle, 180.0, 180.0);
+ angle = math_helper_range_map(controller_data->cam_elevation, 0, 1, 0, 90);
+ view_base_set_angle(s_info.camera_elevation_indicator, 90 - angle, 180.0, 180.0);
+
if (controller_data->throttle < 0) {
evas_object_color_set(s_info.velocity, 0, 255, 255, 255);
} else {
@@ -165,17 +168,20 @@ static Eina_Bool _camera_azimuth_animator_cb(void *data)
s_info.cam_azimuth = 0;
}
-
if (s_info.cam_azimuth < -1) {
- s_info.cam_azimuth = 1;
- } else if (s_info.cam_azimuth > 1) {
s_info.cam_azimuth = -1;
+ } else if (s_info.cam_azimuth > 1) {
+ s_info.cam_azimuth = 1;
}
- float angle = math_helper_range_map(s_info.cam_azimuth, -1, 1, -180.0f, 180.0f);
+ controller_racing_set_cam_azimuth(s_info.cam_azimuth);
+
+ float angle = math_helper_range_map(s_info.cam_azimuth, -1, 1, -90.0f, 90.0f);
view_base_set_angle(s_info.camera_azimuth_indicator, angle, 180.0, 180.0);
_D("[CAM] AZIMUTH: % f", s_info.cam_azimuth);
+
+
return ECORE_CALLBACK_RENEW;
}
@@ -231,7 +237,7 @@ static void _view_racing_create_gui(Evas_Object *parent)
evas_object_color_set(s_info.camera_azimuth_indicator, 0, 255, 255, 255);
s_info.camera_elevation_indicator = _create_image(parent, 180, -5, 17, 17,
- 180.0f,
+ 90.0f,
"images/circle.png", HORIZONTAL_ALIGN_CENTER, VERTICAL_ALIGN_TOP);
evas_object_color_set(s_info.camera_elevation_indicator, 255, 0, 0, 255);