Exemplo n.º 1
0
        public virtual void Assemble(ARSession session)
        {
            if (session.AssembleMode == AssembleMode.Auto)
            {
                Camera        = Camera.main;
                CameraRoot    = Camera.transform;
                RenderCameras = new List <RenderCameraController>(session.GetComponentsInChildren <RenderCameraController>());
                FrameSource   = session.GetComponentInChildren <FrameSource>();
                FrameFilters  = new List <FrameFilter>(session.GetComponentsInChildren <FrameFilter>());
            }

            foreach (var renderCamera in RenderCameras)
            {
                renderCamera.OnAssemble(session);
            }
            if (FrameSource)
            {
                FrameSource.OnAssemble(session);
            }
            foreach (var filter in FrameFilters)
            {
                filter.OnAssemble(session);
            }

            try
            {
                Assemble();
            }
            catch (Exception ex)
            {
                Debug.LogError("Fail to Assemble: " + ex.Message);
            }
        }
 public override void OnAssemble(ARSession session)
 {
     Session = session;
     session.WorldRootChanged += (WorldRootController worldRoot) =>
     {
         mapRoot.transform.parent = worldRoot.transform;
     };
 }
 public override void OnAssemble(ARSession session)
 {
     if (depthRenderer)
     {
         depthRenderer.RenderDepthCamera = session.Assembly.Camera;
     }
     session.WorldRootChanged += (WorldRootController worldRoot) =>
     {
         mapRoot.transform.parent = worldRoot.transform;
     };
 }
Exemplo n.º 4
0
 /// <summary>
 /// <para xml:lang="en">Usually only for internal assemble use. Assemble response.</para>
 /// <para xml:lang="zh">通常只在内部组装时使用。组装响应方法。</para>
 /// </summary>
 internal void OnAssemble(ARSession session)
 {
     arSession = session;
     if (!TargetCamera)
     {
         TargetCamera = session.Assembly.Camera;
     }
     if (enabled)
     {
         arSession.FrameChange += OnFrameChange;
         arSession.FrameUpdate += OnFrameUpdate;
     }
     cameraRenderer = GetComponent <CameraImageRenderer>();
     if (cameraRenderer)
     {
         cameraRenderer.OnAssemble(session);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// <para xml:lang="en">Usually only for internal assemble use. Assemble response.</para>
 /// <para xml:lang="zh">通常只在内部组装时使用。组装响应方法。</para>
 /// </summary>
 public void OnAssemble(ARSession session)
 {
     arSession            = session;
     session.FrameChange += OnFrameChange;
     session.FrameUpdate += OnFrameUpdate;
 }
Exemplo n.º 6
0
 public override void OnAssemble(ARSession session)
 {
     SimultaneousNumChanged += session.Assembly.ResetBufferCapacity;
 }
Exemplo n.º 7
0
 public virtual void OnAssemble(ARSession session)
 {
 }
 /// <summary>
 /// <para xml:lang="en">Usually only for internal assemble use. Assemble response.</para>
 /// <para xml:lang="zh">通常只在内部组装时使用。组装响应方法。</para>
 /// </summary>
 public void OnAssemble(ARSession session)
 {
     arSession = session;
 }
 public override void OnAssemble(ARSession session)
 {
     session.FrameUpdate += OnFrameUpdate;
 }