public abstract void SetCameraScreenPosition(CameraScreen screen, DeviceOrientations orientation);
public override void SetCameraScreenPosition(CameraScreen screen, DeviceOrientations orientation) { double x; double positionFromCameraFocus = 0; positionFromCameraFocus = screen.position - Selection; if (swipingDirection == SwipingDirection.RIGHT) { if (positionFromCameraFocus > 0) { positionFromCameraFocus = -(ItemCount - positionFromCameraFocus); } } else if (swipingDirection == SwipingDirection.LEFT) { if (positionFromCameraFocus < 0) { positionFromCameraFocus = ItemCount + positionFromCameraFocus; } } x = positionFromCameraFocus * screenDistance + Offset; double distance = 0; if (orientation == DeviceOrientations.Portrait) { switch (screen.Camera.Orientation) { case 0: case 180: distance = DataOperations.GetDistanceForFrustrumWidth(screen.Width, Camera.AspectRatio, Camera.Fov); break; case 90: case 360: distance = DataOperations.GetDistanceForFrustrumWidth(screen.Height * 1.1f, Camera.AspectRatio, Camera.Fov); break; } } else { // Increades the screen distance in the x axis when in landscape mode // TODO: Remove magic number and determine how much space is needed to get off screen x = x * 2; switch (screen.Camera.Orientation) { case 0: case 180: distance = DataOperations.GetDistanceForFrustrumHeight(screen.Height + (screen.Camera.ImageResolution.PixelAspectRatio + DeviceInfo.GetAspectRatio()) * 0.5f, Camera.Fov); break; case 90: case 360: distance = DataOperations.GetDistanceForFrustrumHeight(screen.Width, Camera.Fov); break; } } if (screen.targetDistanceFromCamera != distance) { if (screen.position == Selection) { screen.Node.RunActionsAsync(new EaseBackOut(new MoveTo(0.25f, new Vector3(0, 0, (float)distance)))); } else if (screen.position != Selection) { screen.Node.RunActionsAsync(new EaseBackOut(new MoveTo(0.25f, new Vector3(0, 0, (float)distance * 1.5f)))); } } screen.Node.SetWorldPosition(new Vector3((float)x, 0, screen.Node.Position.Z)); }