1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use gltf_derive::Validate;
use serde_derive::{Deserialize, Serialize};
#[cfg(feature = "extensions")]
use serde_json::{Map, Value};

/// Contains data structures for sparse storage.
pub mod sparse {
    use super::*;

    /// Indices of those attributes that deviate from their initialization value.
    #[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
    pub struct Indices {}

    /// Sparse storage of attributes that deviate from their initialization value.
    #[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
    pub struct Sparse {}

    /// Array of size `count * number_of_components` storing the displaced
    /// accessor attributes pointed by `accessor::sparse::Indices`.
    #[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
    pub struct Values {}
}

/// A typed view into a buffer view.
#[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
pub struct Accessor {
    #[cfg(feature = "extensions")]
    #[serde(default, flatten)]
    pub others: Map<String, Value>,
}