Example #1
0
        public static ILightData ParseData(LightBuffer lightBuffer)
        {
            ILightData    data     = null;
            LightDataType dataType = lightBuffer.ReadDataType();

            switch (dataType)
            {
            case LightDataType.Object:
                byte[] tempBuffer = new byte[lightBuffer.buffer.Length - lightBuffer.offset];
                Buffer.BlockCopy(lightBuffer.buffer, lightBuffer.offset, tempBuffer, 0, tempBuffer.Length);
                LightBuffer objectBuffer = new LightBuffer(tempBuffer);
                LightObject tempObj      = new LightObject();
                tempObj.key = objectBuffer.ReadByte();
                int dataCount = objectBuffer.ReadByte();
                for (int i = 0; i < dataCount; i++)
                {
                    tempObj.AddLightData(ParseData(objectBuffer));
                }
                data = tempObj;
                lightBuffer.offset += objectBuffer.offset;
                break;

            case LightDataType.Int:
                data = LightInt.Deserialize(lightBuffer);
                break;
            }
            return(data);
        }
Example #2
0
 serializableUnityARLightData(UnityARLightData lightData)
 {
     whichLight = lightData.arLightingType;
     if (whichLight == LightDataType.DirectionalLightEstimate)
     {
         lightSHC = lightData.arDirectonalLightEstimate.sphericalHarmonicsCoefficients;
         Vector3 lightDir       = lightData.arDirectonalLightEstimate.primaryLightDirection;
         float   lightIntensity = lightData.arDirectonalLightEstimate.primaryLightIntensity;
         primaryLightDirAndIntensity = new SerializableVector4(lightDir.x, lightDir.y, lightDir.z, lightIntensity);
     }
     else
     {
         ambientIntensity        = lightData.arLightEstimate.ambientIntensity;
         ambientColorTemperature = lightData.arLightEstimate.ambientColorTemperature;
     }
 }
Example #3
0
 public UnityARLightData(LightDataType ldt, UnityARLightEstimate ule, UnityARDirectionalLightEstimate udle)
 {
     arLightingType            = ldt;
     arLightEstimate           = ule;
     arDirectonalLightEstimate = udle;
 }
Example #4
0
 public UnityMarshalLightData(LightDataType ldt, UnityARLightEstimate ule, MarshalDirectionalLightEstimate mdle)
 {
     arLightingType            = ldt;
     arLightEstimate           = ule;
     arDirectonalLightEstimate = mdle;
 }