Commit f125c56c authored by Carola Nitz's avatar Carola Nitz

360 video: adjust values when they get out of bounds

(cherry picked from commit 7712970f)
parent 7da7983f
......@@ -965,7 +965,16 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
#if !TARGET_OS_TV
- (BOOL)updateViewpoint:(CGFloat)yaw pitch:(CGFloat)pitch roll:(CGFloat)roll fov:(CGFloat)fov absolute:(BOOL)absolute
{
NSLog(@"update with yaw:%f pitch:%f roll:%f, fov:%f", yaw, pitch, roll, fov);
//adjusting the values
if (fabs(yaw) > 180) {
yaw = yaw > 0 ? yaw - 360 : yaw + 360;
}
if (fabs(roll) > 180) {
roll = roll > 0 ? roll - 360 : roll + 360;
}
if (fabs(pitch) > 90) {
pitch = pitch > 0 ? pitch - 180 : pitch + 180;
}
return [_mediaPlayer updateViewpoint:yaw pitch:pitch roll:roll fov:fov absolute:absolute];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment