Exemplo n.º 1
0
 public BufferView(BufferView bufferView, GLTFRoot gltfRoot) : base(bufferView, gltfRoot)
 {
     Buffer     = new BufferId(bufferView.Buffer, gltfRoot);
     ByteOffset = bufferView.ByteOffset;
     ByteLength = bufferView.ByteLength;
     ByteStride = bufferView.ByteStride;
     Target     = bufferView.Target;
 }
Exemplo n.º 2
0
        public static BufferView Deserialize(GLTFRoot root, JsonReader reader)
        {
            var bufferView = new BufferView();

            while (reader.Read() && reader.TokenType == JsonToken.PropertyName)
            {
                var curProp = reader.Value.ToString();

                switch (curProp)
                {
                case "buffer":
                    bufferView.Buffer = BufferId.Deserialize(root, reader);
                    break;

                case "byteOffset":
                    bufferView.ByteOffset = reader.ReadDoubleAsUInt32();
                    break;

                case "byteLength":
                    bufferView.ByteLength = reader.ReadDoubleAsUInt32();
                    break;

                case "byteStride":
                    bufferView.ByteStride = reader.ReadDoubleAsUInt32();
                    break;

                case "target":
                    bufferView.Target = (BufferViewTarget)reader.ReadAsInt32().Value;
                    break;

                default:
                    bufferView.DefaultPropertyDeserializer(root, reader);
                    break;
                }
            }

            return(bufferView);
        }
Exemplo n.º 3
0
 public BufferId(BufferId id, GLTFRoot newRoot) : base(id, newRoot)
 {
 }