static void _frame_update(internal_UnityARCamera camera)
        {
            UnityARCamera pubCamera = new UnityARCamera();

            pubCamera.projectionMatrix   = camera.projectionMatrix;
            pubCamera.worldTransform     = camera.worldTransform;
            pubCamera.trackingState      = camera.trackingState;
            pubCamera.trackingReason     = camera.trackingReason;
            pubCamera.videoParams        = camera.videoParams;
            pubCamera.worldMappingStatus = camera.worldMappngStatus;

            if (camera.getLightEstimation == 1)
            {
                pubCamera.lightData = camera.lightData;
            }

            pubCamera.displayTransform = camera.displayTransform;
            s_Camera = pubCamera;

            if (camera.getPointCloudData == 1)
            {
                UpdatePointCloudData(ref s_Camera);
            }

            if (ARFrameUpdatedEvent != null)
            {
                ARFrameUpdatedEvent(s_Camera);
            }
        }
示例#2
0
 private static void _ar_tracking_changed(internal_UnityARCamera camera)
 {
     s_Camera.trackingState  = camera.trackingState;
     s_Camera.trackingReason = camera.trackingReason;
     if (UnityARSessionNativeInterface.ARSessionTrackingChangedEvent != null)
     {
         UnityARSessionNativeInterface.ARSessionTrackingChangedEvent(s_Camera);
     }
 }
示例#3
0
 static void _ar_tracking_changed(internal_UnityARCamera camera)
 {
     // we only update the current camera's tracking state since that's all
     // this cllback is for
     s_Camera.trackingReason = camera.trackingReason;
     if (ARSessionTrackingChangedEvent != null)
     {
         ARSessionTrackingChangedEvent(s_Camera);
     }
 }
示例#4
0
        static void _frame_update(internal_UnityARCamera camera)
        {
            UnityARCamera pubCamera = new UnityARCamera();

            pubCamera.projectionMatrix   = camera.projectionMatrix;
            pubCamera.worldTransform     = camera.worldTransform;
            pubCamera.trackingState      = camera.trackingState;
            pubCamera.trackingReason     = camera.trackingReason;
            pubCamera.videoParams        = camera.videoParams;
            pubCamera.worldMappingStatus = camera.worldMappngStatus;
            pubCamera.pointCloud         = ARPointCloud.FromPtr(camera.pointCloud);

#if !UNITY_EDITOR
            var faceAnchors     = new ARFaceAnchor[camera.anchorsSize];
            int faceAnchorCount = 0;
            for (uint i = 0; i < camera.anchorsSize; i++)
            {
                UnityARFaceAnchorData faceAnchorData = UnityARFaceAnchorData.GetUnityARFaceAnchorData(camera.anchors, i);
                if (faceAnchorData.ptrIdentifier != IntPtr.Zero)
                {
                    faceAnchors[i] = new ARFaceAnchor(faceAnchorData);
                    faceAnchorCount++;
                }
            }
            if (faceAnchors.Length != faceAnchorCount)
            {
                Array.Resize(ref faceAnchors, faceAnchorCount);
            }

            pubCamera.faceAnchors = faceAnchors;
#endif

            if (camera.getLightEstimation == 1)
            {
                pubCamera.lightData = camera.lightData;
            }

            pubCamera.displayTransform = camera.displayTransform;
            s_Camera = pubCamera;

            if (ARFrameUpdatedEvent != null)
            {
                ARFrameUpdatedEvent(s_Camera);
            }
        }
        static void _frame_update(internal_UnityARCamera camera)
        {
            UnityARCamera pubCamera = new UnityARCamera();

            pubCamera.projectionMatrix = camera.projectionMatrix;
            pubCamera.worldTransform   = camera.worldTransform;
            pubCamera.trackingState    = camera.trackingState;
            pubCamera.trackingReason   = camera.trackingReason;
            s_Camera = pubCamera;

            if (camera.getPointCloudData == 1)
            {
                UpdatePointCloudData(ref s_Camera);
            }

            if (ARFrameUpdatedEvent != null)
            {
                ARFrameUpdatedEvent(s_Camera);
            }
        }
示例#6
0
        private static void _frame_update(internal_UnityARCamera camera)
        {
            UnityARCamera unityARCamera = default(UnityARCamera);

            unityARCamera.projectionMatrix = camera.projectionMatrix;
            unityARCamera.worldTransform   = camera.worldTransform;
            unityARCamera.trackingState    = camera.trackingState;
            unityARCamera.trackingReason   = camera.trackingReason;
            unityARCamera.videoParams      = camera.videoParams;
            unityARCamera.lightData        = camera.lightData;
            unityARCamera.displayTransform = camera.displayTransform;
            s_Camera = unityARCamera;
            if (camera.getPointCloudData == 1)
            {
                UpdatePointCloudData(ref s_Camera);
            }
            if (UnityARSessionNativeInterface.ARFrameUpdatedEvent != null)
            {
                UnityARSessionNativeInterface.ARFrameUpdatedEvent(s_Camera);
            }
        }
示例#7
0
        static void _frame_update(internal_UnityARCamera camera)
        {
            UnityARCamera pubCamera = new UnityARCamera();

            pubCamera.projectionMatrix = camera.projectionMatrix;
            pubCamera.worldTransform   = camera.worldTransform;
            pubCamera.trackingState    = camera.trackingState;
            pubCamera.trackingReason   = camera.trackingReason;
            pubCamera.videoParams      = camera.videoParams;
            pubCamera.lightEstimation  = camera.lightEstimation;
            pubCamera.displayTransform = camera.displayTransform;

            /*
             * //Store the ARKit transform; this will be used to calculate the offset between Tracker and ARKit upon calibration
             * lastARKitWorldTransform = camera.worldTransform;
             *
             * if (tracker_enabled) {
             *      //If the HTC Tracker is attached to the phone, use its position and rotation directly
             *      pubCamera.worldTransform = customWorldTransform;
             * } else {
             *      //Otherwise offset the world transform by the offset calculated at calibration
             *      pubCamera.worldTransform = UnityARMatrixOps.offset(camera.worldTransform, offset_position, offset_rotation);
             * }
             */

            s_Camera = pubCamera;

            if (camera.getPointCloudData == 1)
            {
                UpdatePointCloudData(ref s_Camera);
            }

            if (ARFrameUpdatedEvent != null)
            {
                ARFrameUpdatedEvent(s_Camera);
            }
        }