Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
{
"scenes" : [ { "nodes" : [ 0 ] } ],
"nodes" : [ { "mesh" : 0 } ],
"meshes" : [
{
"primitives" : [ {
"attributes" : { "POSITION" : 1 },
"indices" : 0
} ]
}
],
"buffers" : [
{
"uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=",
"byteLength" : 44
}
],
"bufferViews" : [
{
"buffer" : 0,
"byteOffset" : 0,
"byteLength" : 6,
"target" : 34963
},
{
"buffer" : 0,
"byteOffset" : 8,
"byteLength" : 36,
"target" : 34962
}
],
"accessors" : [
{
"bufferView" : 0,
"byteOffset" : 0,
"componentType" : 5123,
"count" : 3,
"type" : "SCALAR"
},
{
"bufferView" : 1,
"byteOffset" : 0,
"componentType" : 5126,
"count" : 3,
"type" : "VEC3",
"max" : [ 1.0, 1.0 ]
}
],
"asset" : {
"version" : "2.0"
}
}

View File

@@ -0,0 +1,53 @@
{
"scenes" : [ { "nodes" : [ 0 ] } ],
"nodes" : [ { "mesh" : 0 } ],
"meshes" : [
{
"primitives" : [ {
"attributes" : { "POSITION" : 1 },
"indices" : 0
} ]
}
],
"buffers" : [
{
"uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=",
"byteLength" : 44
}
],
"bufferViews" : [
{
"buffer" : 0,
"byteOffset" : 0,
"byteLength" : 6,
"target" : 34963
},
{
"buffer" : 0,
"byteOffset" : 8,
"byteLength" : 36,
"target" : 34962
}
],
"accessors" : [
{
"byteOffset" : 0,
"componentType" : 5123,
"count" : 3,
"type" : "SCALAR"
},
{
"bufferView" : 1,
"byteOffset" : 0,
"componentType" : 5126,
"count" : 3,
"type" : "VEC3",
"min" : [ 0.0, 0.0, 0.0 ],
"max" : [ 1.0, 1.0, 1.0 ]
}
],
"asset" : {
"version" : "2.0"
}
}

View File

@@ -0,0 +1,46 @@
use std::{fs, io};
use gltf_json::validation::{Error, Validate};
use gltf_json::Path;
fn import_json(filename: &str) -> gltf_json::Root {
let file = fs::File::open(filename).unwrap();
let reader = io::BufReader::new(file);
gltf_json::Root::from_reader(reader).unwrap()
}
#[test]
fn test_accessor_bounds_validate() {
// file with missing min/max values
let json = import_json("tests/minimal_accessor_invalid.gltf");
let mut errs = vec![];
json.validate(&json, gltf_json::Path::new, &mut |path, err| {
errs.push((path(), err))
});
assert_eq!(
errs,
[
(
Path("meshes[0].primitives[0].attributes[\"POSITION\"].min".into()),
Error::Missing
),
(
Path("meshes[0].primitives[0].attributes[\"POSITION\"].max".into()),
Error::Invalid
)
]
);
}
#[test]
fn test_non_sparse_accessor_without_buffer_view_validate() {
let json = import_json("tests/non_sparse_accessor_without_buffer_view.gltf");
let mut errs = vec![];
json.validate(&json, gltf_json::Path::new, &mut |path, err| {
errs.push((path(), err))
});
assert_eq!(
errs,
[(Path("accessors[0].bufferView".into()), Error::Missing)]
);
}