Beispiel #1
0
    protected override smartar.Rotation GetImageSensorRotation()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        smartar.Rotation imageSensorRotation = smartar.Rotation.ROTATION_0;
        smartARController_.cameraDevice_.GetImageSensorRotation(out imageSensorRotation);
        return(imageSensorRotation);
#else
        return(smartar.Rotation.ROTATION_0);
#endif
    }
Beispiel #2
0
    public override smartar.Rotation GetImageSensorRotation()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        if (smartARController_ != null)
        {
            smartar.Rotation imageSensorRotation = smartar.Rotation.ROTATION_0;
            smartARController_.cameraDevice_.GetImageSensorRotation(out imageSensorRotation);
            return(imageSensorRotation);
        }
        else
#endif
        {
            return(smartar.Rotation.ROTATION_0);
        }
    }
Beispiel #3
0
    public override smartar.Rotation GetCameraRotation()
    {
        smartar.Rotation cameraRotation = smartar.Rotation.ROTATION_0;
        if (smartARController_ != null)
        {
            smartARController_.cameraDevice_.GetRotation(out cameraRotation);
#if UNITY_ANDROID && !UNITY_EDITOR
            smartar.Facing facing = smartar.Facing.FACING_BACK;
            smartARController_.cameraDevice_.GetFacing(out facing);
            if (facing == smartar.Facing.FACING_FRONT)
            {
                smartar.Rotation imageSensorRotation = smartar.Rotation.ROTATION_0;
                smartARController_.cameraDevice_.GetImageSensorRotation(out imageSensorRotation);
                if (imageSensorRotation == smartar.Rotation.ROTATION_90)
                {
                    cameraRotation = (smartar.Rotation)((360 + (int)cameraRotation - 180) % 360);
                }
            }
#endif
        }
        return(cameraRotation);
    }
Beispiel #4
0
 protected override void callAdjustPose(smartar.Vector3 srcPosition, smartar.Quaternion srcRotation, out smartar.Vector3 rotPosition, out smartar.Quaternion rotRotation)
 {
     smartar.Rotation screenRotation = GetScreenRotation();
     smartar.Rotation cameraRotation = GetCameraRotation();
     SmartARController.adjustPose(cameraRotation, screenRotation, IsFlipX(), IsFlipY(), srcPosition, srcRotation, out rotPosition, out rotRotation);
 }