Пример #1
0
    public void Update()
    {
        if (mRadianceCollector != null)
        {
            if (mCloudSocket.AttributeDataListLength > 0)
            {
                Debug.Log("Start Syn View Point");
                ClientObjectAttribute clientObjAttribute = mCloudSocket.DequeueAttributeData();

                int height = (int)clientObjAttribute.Param % mWebClientExchangeCode;
                int width  = (int)clientObjAttribute.Param / mWebClientExchangeCode;

                //Debug.Log("Param:" + (int)clientObjAttribute.Param + "  ExchangeCode:" + mWebClientExchangeCode);
                //Debug.Log("Width:" + width +"  Height:"+ height);

                if (times == 1 && File.Exists(firstLoadDataPath + index + ".bin"))
                {
                    while (File.Exists(firstLoadDataPath + index + ".bin"))
                    {
                        byte[] data = File.ReadAllBytes(firstLoadDataPath + index + ".bin");
                        //mCloudSocket.EnqueueRadianceData(new RadianceData((ushort)clientObjAttribute.LightPosZ, (ushort)width, (ushort)height, data));
                        NetworkServer.SendRawData(mCTSMarker, new XPacket((ushort)eMsgID.S2C_RadianceStream, (ushort)width, (ushort)height), data);
                        index++;
                    }
                }
                else if (times == 1)
                {
                    mRadianceCollector.Collect(width, height, clientObjAttribute);

                    mRadianceCollector.SendRadianceData(mCTSMarker, (ushort)clientObjAttribute.LightPosZ, (ushort)width, (ushort)height, ComponentTransformittedSet, ReuseDataInfoObj, true);
                }
                else
                {
                    mRadianceCollector.Collect(width, height, clientObjAttribute);

                    mRadianceCollector.SendRadianceData(mCTSMarker, (ushort)clientObjAttribute.LightPosZ, (ushort)width, (ushort)height, ComponentTransformittedSet, ReuseDataInfoObj, false);
                }

                times++;
            }
        }
    }
Пример #2
0
        //判断该路径中是否有注视行为
        public bool isValidGaze(List <BrowseRecord> _record, out HashSet <string> gezeComponents)
        {
            int mWebClientExchangeCode = 4000;
            int Param = 3840451;
            //List<BrowseRecord> tmpList = getLastPoints(_record);
            HashSet <string> result = new HashSet <string>();

            for (int i = 0; i < _record.Count; i++)
            {
                int height = Param % mWebClientExchangeCode;
                int width  = Param / mWebClientExchangeCode;
                ClientObjectAttribute clientObject = new ClientObjectAttribute();
                clientObject.CameraPosX = _record[i].pos.x;
                clientObject.CameraPosY = _record[i].pos.y;
                clientObject.CameraPosZ = _record[i].pos.z;
                clientObject.CameraRotX = _record[i].rot.x;
                clientObject.CameraRotY = _record[i].rot.y;
                clientObject.CameraRotZ = _record[i].rot.z;
                mRadianceCollector.Setup();
                mRadianceCollector.Collect(width, height, clientObject);
                HashSet <string> components = mRadianceCollector.getCenterComponents(width, height, clientObject);
                if (result == new HashSet <string>())
                {
                    result = components;
                }
                else
                {
                    result.IntersectWith(components);
                }
                //Debug.Log(components);
            }
            if (result.Count == 0)
            {
                gezeComponents = result;
                return(true);
            }
            gezeComponents = null;
            return(false);
        }