diff options
author | BastiaanOlij <mux213@gmail.com> | 2016-11-15 09:24:19 +1100 |
---|---|---|
committer | BastiaanOlij <mux213@gmail.com> | 2017-01-12 16:34:42 +1100 |
commit | 51c60f7a49fad577f1c99ef0cf276933913a8b50 (patch) | |
tree | 66e21fb055f7cc7ef6e4ce24593874d0f3c2b9f9 /platform/iphone/os_iphone.cpp | |
parent | 5c13bae8dfbb3e4c2b67c0ec2177926079e78a2f (diff) |
Fixed up release motionManager and negate z for gyro and magnetometer
Diffstat (limited to 'platform/iphone/os_iphone.cpp')
-rw-r--r-- | platform/iphone/os_iphone.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index a30d1c7194..cfd2a844c6 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -325,6 +325,7 @@ static const float ACCEL_RANGE = 1; void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { + ///@TODO I've made the Z negative like the original accelerometer code, this probably needs more work input->set_accelerometer(Vector3(p_x / (float)ACCEL_RANGE, p_y / (float)ACCEL_RANGE, -p_z / (float)ACCEL_RANGE)); /* @@ -365,11 +366,13 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { }; void OSIPhone::update_magnetometer(float p_x, float p_y, float p_z) { - input->set_magnetometer(Vector3(p_x, p_y, p_z)); + ///@TODO I've made the Z negative like the original accelerometer code, this probably needs more work + input->set_magnetometer(Vector3(p_x, p_y, -p_z)); }; void OSIPhone::update_gyroscope(float p_x, float p_y, float p_z) { - input->set_gyroscope(Vector3(p_x, p_y, p_z)); + ///@TODO I've made the Z negative like the original accelerometer code, this probably needs more work + input->set_gyroscope(Vector3(p_x, p_y, -p_z)); }; void OSIPhone::delete_main_loop() { |