diff options
| author | BastiaanOlij | 2016-11-19 23:04:06 +1100 |
|---|---|---|
| committer | BastiaanOlij | 2017-01-12 16:34:42 +1100 |
| commit | efa9ded5f9d0f8176dcdd17c09de6fa9df926f45 (patch) | |
| tree | b4eccfe9d19c7c7b8fbeada09bf2cd7e8ec6b649 /platform/iphone/os_iphone.cpp | |
| parent | ee98e06952555f140ffa9f3d18972760028cf87a (diff) | |
| download | godot-efa9ded5f9d0f8176dcdd17c09de6fa9df926f45.tar.gz godot-efa9ded5f9d0f8176dcdd17c09de6fa9df926f45.tar.zst godot-efa9ded5f9d0f8176dcdd17c09de6fa9df926f45.zip | |
Added logic for adjusting to screen orientation and removed final negative z
Diffstat (limited to '')
| -rw-r--r-- | platform/iphone/os_iphone.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 7e35bf787..0ef6cd7c3 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -325,8 +325,8 @@ 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)); + // Found out the Z should not be negated! Pass as is! + input->set_accelerometer(Vector3(p_x / (float)ACCEL_RANGE, p_y / (float)ACCEL_RANGE, p_z / (float)ACCEL_RANGE)); /* if (p_x != last_accel.x) { @@ -366,8 +366,7 @@ 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) { - ///@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)); + input->set_magnetometer(Vector3(p_x, p_y, p_z)); }; void OSIPhone::update_gyroscope(float p_x, float p_y, float p_z) { |
