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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#[cfg(feature = "KHR_texture_transform")]
use crate::{extras::Extras, validation::Validate};
use gltf_derive::Validate;
use serde_derive::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
pub struct Sampler {}
#[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
pub struct Texture {}
#[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
pub struct Info {
#[cfg(feature = "KHR_texture_transform")]
#[serde(default, rename = "KHR_texture_transform", skip_serializing_if = "Option::is_none")]
pub texture_transform: Option<TextureTransform>,
}
#[cfg(feature = "KHR_texture_transform")]
#[derive(Clone, Debug, Default, Deserialize, Serialize, Validate)]
#[serde(default, rename_all = "camelCase")]
pub struct TextureTransform {
pub offset: TextureTransformOffset,
pub rotation: TextureTransformRotation,
pub scale: TextureTransformScale,
pub tex_coord: Option<u32>,
#[cfg_attr(feature = "extras", serde(skip_serializing_if = "Option::is_none"))]
pub extras: Extras,
}
#[cfg(feature = "KHR_texture_transform")]
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub struct TextureTransformOffset(pub [f32; 2]);
#[cfg(feature = "KHR_texture_transform")]
impl Default for TextureTransformOffset {
fn default() -> Self {
Self([0.0, 0.0])
}
}
#[cfg(feature = "KHR_texture_transform")]
impl Validate for TextureTransformOffset {}
#[cfg(feature = "KHR_texture_transform")]
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub struct TextureTransformRotation(pub f32);
#[cfg(feature = "KHR_texture_transform")]
impl Default for TextureTransformRotation {
fn default() -> Self {
Self(0.0)
}
}
#[cfg(feature = "KHR_texture_transform")]
impl Validate for TextureTransformRotation {}
#[cfg(feature = "KHR_texture_transform")]
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub struct TextureTransformScale(pub [f32; 2]);
#[cfg(feature = "KHR_texture_transform")]
impl Default for TextureTransformScale {
fn default() -> Self {
Self([1.0, 1.0])
}
}
#[cfg(feature = "KHR_texture_transform")]
impl Validate for TextureTransformScale {}