Exemplo n.º 1
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.Key("magFilter"); f.Value((int)magFilter);
     f.Key("minFilter"); f.Value((int)minFilter);
     f.Key("wrapS"); f.Value((int)wrapS);
     f.Key("wrapT"); f.Value((int)wrapT);
 }
Exemplo n.º 2
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            if (children != null && children.Any())
            {
                f.Key("children");
                f.BeginList();
                foreach (var child in children)
                {
                    f.Value(child);
                }
                f.EndList();
            }

            if (!string.IsNullOrEmpty(name))
            {
                f.KeyValue(() => name);
            }
            if (matrix != null)
            {
                f.KeyValue(() => matrix);
            }
            if (translation != null)
            {
                f.KeyValue(() => translation);
            }
            if (rotation != null)
            {
                f.KeyValue(() => rotation);
            }
            if (scale != null)
            {
                f.KeyValue(() => scale);
            }

            if (mesh >= 0)
            {
                f.KeyValue(() => mesh);
            }
            if (camera >= 0)
            {
                f.KeyValue(() => camera);
            }
            if (skin >= 0)
            {
                f.KeyValue(() => skin);

                if (extras.count > 0)
                {
                    f.KeyValue(() => extras);
                }
            }
        }
Exemplo n.º 3
0
 void PrimitiveMembers(GLTFJsonFormatter f)
 {
     if (targetNames.Count > 0)
     {
         f.Key("targetNames");
         f.BeginList();
         foreach (var x in targetNames)
         {
             f.Value(x);
         }
         f.EndList();
     }
 }
Exemplo n.º 4
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            f.KeyValue(() => buffer);
            f.KeyValue(() => byteOffset);
            f.KeyValue(() => byteLength);
            if (target != GLTFBufferTarget.NONE)
            {
                f.Key("target"); f.Value((int)target);
            }

            /* When this is not defined, data is tightly packed. When two or more accessors use the same bufferView, this field must be defined.
             * if (byteStride >= 4)
             * {
             *  f.KeyValue(() => byteStride);
             * }
             */
        }
Exemplo n.º 5
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            if (!String.IsNullOrEmpty(name))
            {
                f.Key("name"); f.Value(name);
            }
            if (pbrMetallicRoughness != null)
            {
                f.Key("pbrMetallicRoughness"); f.GLTFValue(pbrMetallicRoughness);
            }
            if (normalTexture != null)
            {
                f.Key("normalTexture"); f.GLTFValue(normalTexture);
            }
            if (occlusionTexture != null)
            {
                f.Key("occlusionTexture"); f.GLTFValue(occlusionTexture);
            }
            if (emissiveTexture != null)
            {
                f.Key("emissiveTexture"); f.GLTFValue(emissiveTexture);
            }
            if (emissiveFactor != null)
            {
                f.Key("emissiveFactor"); f.Serialize(emissiveFactor);
            }

            f.KeyValue(() => doubleSided);

            if (!string.IsNullOrEmpty(alphaMode))
            {
                f.KeyValue(() => alphaMode);
            }

            if (extensions != null)
            {
                f.KeyValue(() => extensions);
            }
        }
Exemplo n.º 6
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            f.KeyValue(() => bufferView);
            f.KeyValue(() => byteOffset);
            f.KeyValue(() => type);
            f.Key("componentType"); f.Value((int)componentType);
            f.KeyValue(() => count);
            if (max != null && max.Any())
            {
                f.KeyValue(() => max);
            }
            if (min != null && min.Any())
            {
                f.KeyValue(() => min);
            }

            if (sparse != null && sparse.count > 0)
            {
                f.KeyValue(() => sparse);
            }

            f.KeyValue(() => normalized);
            f.KeyValue(() => name);
        }
Exemplo n.º 7
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.Key("generator"); f.Value(generator);
     f.Key("version"); f.Value(version);
 }
Exemplo n.º 8
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => bufferView);
     f.KeyValue(() => byteOffset);
     f.Key("componentType"); f.Value((int)componentType);
 }