コード例 #1
0
 public bool SetCameraView(ref SVFCameraView camView)
 {
     if (s_logstack)
     {
         logger.Log("[INTEROP]SetCameraView");
     }
     if (instanceId == InvalidID)
     {
         return(false);
     }
     return(InteropSetCameraView(instanceId, ref camView));
 }
コード例 #2
0
 public void IssuePluginEvent(SVFCameraView camView)
 {
     if (s_logstack)
     {
         logger.Log("[INTEROP]IssuePluginEvent");
     }
     if (instanceId != InvalidID)
     {
         InteropSetCameraView(instanceId, ref camView);
         int complexId = ((0xFFFF & camView.cameraId) << 16) | (0xFFFF & instanceId);
         GL.IssuePluginEvent(InteropGetRenderEventFunc(), complexId);
     }
 }
コード例 #3
0
    public void UpdateCamera()
    {
        var cam = Camera.current;

        if (cam == null)
        {
            return;
        }
        CameraView camView = cameraViews.Find(cam, targetDevice, flipHandedness);

        if (null != camView)
        {
            camView.Update(cam, transform.localToWorldMatrix);

            if (null != pluginInterop)
            {
                SVFCameraView svfCamView = cameraViews[cam].InteropCamView;
                pluginInterop.SetCameraView(ref svfCamView);
            }
        }
    }
コード例 #4
0
ファイル: CameraViews.cs プロジェクト: mhwang55/VRBeats
    public CameraView(int id, Camera cam, TargetDevices tgt, bool flipHand)
    {
        cameraId   = id;
        isFlipHand = flipHand;

        viewportWidth   = (float)cam.pixelWidth;
        viewportHeight  = (float)cam.pixelHeight;
        isGameCamera    = (cam.cameraType == CameraType.Game);
        isPreviewCamera = (cam.name == "Preview Camera");

        q1       = new Matrix4x4();
        q1       = Matrix4x4.identity;
        q1[1, 1] = -1.0f;

        if (tgt == TargetDevices.AutoDetect)
        {
            AutoDetectDevice();
        }
        else
        {
            ConfigureSetupMVP(tgt);
        }

        isStereoscopic = cam.stereoEnabled;
        if (cam.stereoEnabled)
        {
            if (cam.stereoTargetEye != StereoTargetEyeMask.Left && cam.stereoTargetEye != StereoTargetEyeMask.Right)
            {
                Debug.LogError("ERROR: stereo camera must be either Left or Right, cannot be 'None' or 'Both'");
                throw new Exception("Fix the camera settings");
            }
        }
        targetEye = (false == cam.stereoEnabled) ? StereoTargetEyeMask.Left : cam.stereoTargetEye;
        MVP       = new Matrix4x4();
        // When isGameCamera is true the plugin does backface culling and front face culling when false.
        _svfCamView = new SVFCameraView()
        {
            cameraId = cameraId, isGameCamera = isLeftHandedness, isStereoscopic = isStereoscopic, viewportWidth = viewportWidth, viewportHeight = viewportHeight, targetEye = targetEye
        };
    }
コード例 #5
0
 private static extern bool InteropSetCameraView(int instanceId, ref SVFCameraView camView);