예제 #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);
 }
예제 #2
0
 void PrimitiveMembers(GLTFJsonFormatter f)
 {
     if (targetNames.Count > 0)
     {
         f.Key("targetNames");
         f.BeginList();
         foreach (var x in targetNames)
         {
             f.Value(x);
         }
         f.EndList();
     }
 }
예제 #3
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.Key("extras"); f.GLTFValue(extras);
                }
            }
        }
예제 #4
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            f.KeyValue(() => buffer);
            f.KeyValue(() => byteOffset);
            f.KeyValue(() => byteLength);
            if (target != glBufferTarget.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);
             * }
             */
        }
예제 #5
0
파일: glTFMaterial.cs 프로젝트: notargs/VCI
        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.Key("extensions"); f.GLTFValue(extensions);
            }
        }
예제 #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.Key("sparse"); f.GLTFValue(sparse);
            }

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