Exemple #1
0
    public void Init()
    {
        switch (holoResolution)
        {
        case HoloResolution.Holo_896x504:
            resolution = new HoloCapture.Resolution(896, 504);
            break;

        case HoloResolution.Holo_1280x720:
            resolution = new HoloCapture.Resolution(1280, 720);
            break;
        }
        int frame;

        switch (holoFrame)
        {
        case HoloCamFrame.Holo15:
            frame = 15;
            break;

        case HoloCamFrame.Holo30:
            frame = 30;
            break;

        default:
            frame = 15;
            break;
        }
        HoloCaptureHelper.Instance.Init(resolution, frame, true, EnableHolograms, Opacity, false,
                                        UnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr(), OnFrameSampleCallback);

        _videoTexture = new Texture2D(resolution.width, resolution.height, TextureFormat.BGRA32, false);
    }
Exemple #2
0
    public void Init()
    {
        switch (holoResolution)
        {
        case HoloResolution.Holo_896x504:
            resolution = new HoloCapture.Resolution(896, 504);
            break;

        case HoloResolution.Holo_1280x720:
            resolution = new HoloCapture.Resolution(1280, 720);
            break;
        }
        int frame;

        switch (holoFrame)
        {
        case HoloCamFrame.Holo15:
            frame = 15;
            break;

        case HoloCamFrame.Holo30:
            frame = 30;
            break;

        default:
            frame = 15;
            break;
        }
#if UNITY_WSA || UNITY_EDITOR
#if UNITY_2020_1_OR_NEWER
        //Note:
        //please add those packages on PackageManager
        //1.XR Plugin Management 4.x
        //2.Windows XR Plugin 4.x
        HoloCaptureHelper.Instance.Init(resolution, frame, true, EnableHolograms, Opacity, false,
                                        UnityEngine.XR.WindowsMR.WindowsMREnvironment.OriginSpatialCoordinateSystem, OnFrameSampleCallback);
#else
        HoloCaptureHelper.Instance.Init(resolution, frame, true, EnableHolograms, Opacity, false,
                                        UnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr(), OnFrameSampleCallback);
#endif
#endif

        videoTexture = new Texture2D(resolution.width, resolution.height, TextureFormat.BGRA32, false);
    }
    public void Init()
    {
        switch (holoResolution)
        {
        case HoloResolution.Holo_896x504:
            resolution = new HoloCapture.Resolution(896, 504);
            break;

        case HoloResolution.Holo_1280x720:
            resolution = new HoloCapture.Resolution(1280, 720);
            break;

        case HoloResolution.HoloOne_1344x756:
            resolution = new HoloCapture.Resolution(1344, 756);
            break;

        case HoloResolution.HoloOne_1408x792:
            resolution = new HoloCapture.Resolution(1408, 792);
            break;

        case HoloResolution.HoloTwo_424x240:
            resolution = new HoloCapture.Resolution(424, 240);
            break;

        case HoloResolution.HoloTwo_500x282:
            resolution = new HoloCapture.Resolution(500, 282);
            break;

        case HoloResolution.HoloTwo_640x360:
            resolution = new HoloCapture.Resolution(640, 360);
            break;

        case HoloResolution.HoloTwo_760x428:
            resolution = new HoloCapture.Resolution(760, 428);
            break;

        case HoloResolution.HoloTwo_960x540:
            resolution = new HoloCapture.Resolution(960, 540);
            break;

        case HoloResolution.HoloTwo_1128x636:
            resolution = new HoloCapture.Resolution(1128, 636);
            break;

        case HoloResolution.HoloTwo_1920x1080:
            resolution = new HoloCapture.Resolution(1920, 1080);
            break;

        default:
            resolution = new HoloCapture.Resolution(896, 504);
            break;
        }
        int frame;

        switch (holoFrame)
        {
        case HoloCamFrame.Holo15:
            frame = 15;
            break;

        case HoloCamFrame.Holo30:
            frame = 30;
            break;

        case HoloCamFrame.HoloOne20:
            frame = 20;
            break;

        case HoloCamFrame.HoloOne24:
            frame = 24;
            break;

        default:
            frame = 15;
            break;
        }
        HoloCaptureHelper.Instance.Init(resolution, frame, true, EnableHolograms, false,
                                        UnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr(), OnFrameSampleCallback);

        _videoTexture = new Texture2D(resolution.width, resolution.height, TextureFormat.BGRA32, false);
    }