88
99namespace libgltf
1010{
11- #if defined(LIBGLTF_PLATFORM_WINDOWS)
12- # if defined(UNICODE)
11+ #if defined(LIBGLTF_USE_WCHAR)
1312 typedef std::wstring GLTFString;
14- # else
15- typedef std::string GLTFString;
16- # endif
17- #elif defined(LIBGLTF_PLATFORM_LINUX) || defined(LIBGLTF_PLATFORM_MACOS) || defined(PLATFORM_ANDROID) || defined(PLATFORM_IOS)
18- typedef std::string GLTFString;
1913#else
20- # error Sorry, not support your platform.
14+ typedef std::string GLTFString;
2115#endif
2216
2317 struct SGlTF ;
@@ -38,6 +32,49 @@ namespace libgltf
3832 std::shared_ptr<struct SExtension > extensions;
3933 };
4034
35+ /* !
36+ * struct: SGlTFChildofRootProperty
37+ */
38+ struct SGlTFChildofRootProperty : SGlTFProperty
39+ {
40+ SGlTFChildofRootProperty ();
41+
42+ // Check valid
43+ operator bool () const ;
44+
45+ // The user-defined name of this object.
46+ GLTFString name;
47+ };
48+
49+ /* !
50+ * struct: SMaterial
51+ * The material appearance of a primitive.
52+ */
53+ struct SMaterial : SGlTFChildofRootProperty
54+ {
55+ SMaterial ();
56+
57+ // Check valid
58+ operator bool () const ;
59+
60+ // The alpha cutoff value of the material.
61+ float alphaCutoff;
62+ // The emissive map texture.
63+ std::shared_ptr<struct STextureInfo > emissiveTexture;
64+ // A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.
65+ std::shared_ptr<struct SMaterialPBRMetallicRoughness > pbrMetallicRoughness;
66+ // The occlusion map texture.
67+ std::shared_ptr<struct SMaterialOcclusionTextureInfo > occlusionTexture;
68+ // The alpha rendering mode of the material.
69+ GLTFString alphaMode;
70+ // Specifies whether the material is double sided.
71+ bool doubleSided;
72+ // The normal map texture.
73+ std::shared_ptr<struct SMaterialNormalTextureInfo > normalTexture;
74+ // The emissive color of the material.
75+ std::vector<float > emissiveFactor;
76+ };
77+
4178 /* !
4279 * struct: SAsset
4380 * Metadata about the glTF asset.
@@ -59,20 +96,6 @@ namespace libgltf
5996 GLTFString copyright;
6097 };
6198
62- /* !
63- * struct: SGlTFChildofRootProperty
64- */
65- struct SGlTFChildofRootProperty : SGlTFProperty
66- {
67- SGlTFChildofRootProperty ();
68-
69- // Check valid
70- operator bool () const ;
71-
72- // The user-defined name of this object.
73- GLTFString name;
74- };
75-
7699 /* !
77100 * struct: SSampler
78101 * Texture sampler properties for filtering and wrapping modes.
@@ -114,32 +137,16 @@ namespace libgltf
114137 };
115138
116139 /* !
117- * struct: SMaterial
118- * The material appearance of a primitive .
140+ * struct: SExtras
141+ * Application-specific data .
119142 */
120- struct SMaterial : SGlTFChildofRootProperty
143+ struct SExtras
121144 {
122- SMaterial ();
145+ SExtras ();
123146
124147 // Check valid
125148 operator bool () const ;
126149
127- // The alpha cutoff value of the material.
128- float alphaCutoff;
129- // The emissive map texture.
130- std::shared_ptr<struct STextureInfo > emissiveTexture;
131- // A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.
132- std::shared_ptr<struct SMaterialPBRMetallicRoughness > pbrMetallicRoughness;
133- // The occlusion map texture.
134- std::shared_ptr<struct SMaterialOcclusionTextureInfo > occlusionTexture;
135- // The alpha rendering mode of the material.
136- GLTFString alphaMode;
137- // Specifies whether the material is double sided.
138- bool doubleSided;
139- // The normal map texture.
140- std::shared_ptr<struct SMaterialNormalTextureInfo > normalTexture;
141- // The emissive color of the material.
142- std::vector<float > emissiveFactor;
143150 };
144151
145152 /* !
@@ -281,16 +288,20 @@ namespace libgltf
281288 };
282289
283290 /* !
284- * struct: SExtras
285- * Application-specific data .
291+ * struct: SMesh
292+ * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene .
286293 */
287- struct SExtras
294+ struct SMesh : SGlTFChildofRootProperty
288295 {
289- SExtras ();
296+ SMesh ();
290297
291298 // Check valid
292299 operator bool () const ;
293300
301+ // An array of primitives, each defining geometry to be rendered with a material.
302+ std::vector<std::shared_ptr<struct SMeshPrimitive >> primitives;
303+ // Array of weights to be applied to the Morph Targets.
304+ std::vector<float > weights;
294305 };
295306
296307 /* !
@@ -528,23 +539,6 @@ namespace libgltf
528539 GLTFString uri;
529540 };
530541
531- /* !
532- * struct: SMesh
533- * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.
534- */
535- struct SMesh : SGlTFChildofRootProperty
536- {
537- SMesh ();
538-
539- // Check valid
540- operator bool () const ;
541-
542- // An array of primitives, each defining geometry to be rendered with a material.
543- std::vector<std::shared_ptr<struct SMeshPrimitive >> primitives;
544- // Array of weights to be applied to the Morph Targets.
545- std::vector<float > weights;
546- };
547-
548542 /* !
549543 * struct: STexture
550544 * A texture and its sampler.
0 commit comments