77#include < memory>
88
99#define LIBGLTF_MAJOR_VERSION 0
10- #define LIBGLTF_MINOR_VERSION 1
11- #define LIBGLTF_PATCH_VERSION 2
10+ #define LIBGLTF_MINOR_VERSION 0
11+ #define LIBGLTF_PATCH_VERSION 0
1212
1313#if defined(UNICODE)
14+ #if defined(USING_CHAR16)
15+ typedef std::u16string GLTFString;
16+ #elif defined(USING_CHAR32)
17+ typedef std::u32string GLTFString;
18+ #else
1419typedef std::wstring GLTFString;
20+ #endif
1521#else
1622typedef std::string GLTFString;
1723#endif
@@ -35,7 +41,7 @@ namespace libgltf
3541 SGlTFProperty ();
3642
3743 // Check valid
38- operator bool () const ;
44+ virtual operator bool () const ;
3945
4046 std::shared_ptr<struct SExtras > extras;
4147 std::shared_ptr<struct SExtension > extensions;
@@ -49,7 +55,7 @@ namespace libgltf
4955 SGlTFChildofRootProperty ();
5056
5157 // Check valid
52- operator bool () const ;
58+ virtual operator bool () const ;
5359
5460 // The user-defined name of this object.
5561 GLTFString name;
@@ -64,7 +70,7 @@ namespace libgltf
6470 SMaterial ();
6571
6672 // Check valid
67- operator bool () const ;
73+ virtual operator bool () const ;
6874
6975 // The alpha cutoff value of the material.
7076 float alphaCutoff;
@@ -93,7 +99,7 @@ namespace libgltf
9399 SAsset ();
94100
95101 // Check valid
96- operator bool () const ;
102+ virtual operator bool () const ;
97103
98104 // The minimum glTF version that this asset targets.
99105 GLTFString minVersion;
@@ -114,7 +120,7 @@ namespace libgltf
114120 SSampler ();
115121
116122 // Check valid
117- operator bool () const ;
123+ virtual operator bool () const ;
118124
119125 // s wrapping mode.
120126 int32_t wrapS;
@@ -135,7 +141,7 @@ namespace libgltf
135141 SAnimationSampler ();
136142
137143 // Check valid
138- operator bool () const ;
144+ virtual operator bool () const ;
139145
140146 // The index of an accessor containing keyframe input values, e.g., time.
141147 std::shared_ptr<struct SGlTFId > input;
@@ -154,7 +160,7 @@ namespace libgltf
154160 SExtras ();
155161
156162 // Check valid
157- operator bool () const ;
163+ virtual operator bool () const ;
158164 };
159165
160166 /* !
@@ -166,7 +172,7 @@ namespace libgltf
166172 SScene ();
167173
168174 // Check valid
169- operator bool () const ;
175+ virtual operator bool () const ;
170176
171177 // The indices of each root node.
172178 std::vector<std::shared_ptr<struct SGlTFId >> nodes;
@@ -181,7 +187,7 @@ namespace libgltf
181187 SCameraPerspective ();
182188
183189 // Check valid
184- operator bool () const ;
190+ virtual operator bool () const ;
185191
186192 // The floating-point aspect ratio of the field of view.
187193 float aspectRatio;
@@ -202,7 +208,7 @@ namespace libgltf
202208 SBufferView ();
203209
204210 // Check valid
205- operator bool () const ;
211+ virtual operator bool () const ;
206212
207213 // The length of the bufferView in bytes.
208214 int32_t byteLength;
@@ -225,7 +231,7 @@ namespace libgltf
225231 STextureInfo ();
226232
227233 // Check valid
228- operator bool () const ;
234+ virtual operator bool () const ;
229235
230236 // The index of the texture.
231237 std::shared_ptr<struct SGlTFId > index;
@@ -241,7 +247,7 @@ namespace libgltf
241247 SMaterialNormalTextureInfo ();
242248
243249 // Check valid
244- operator bool () const ;
250+ virtual operator bool () const ;
245251
246252 // The scalar multiplier applied to each normal vector of the normal texture.
247253 float scale;
@@ -255,7 +261,7 @@ namespace libgltf
255261 SMaterialOcclusionTextureInfo ();
256262
257263 // Check valid
258- operator bool () const ;
264+ virtual operator bool () const ;
259265
260266 // A scalar multiplier controlling the amount of occlusion applied.
261267 float strength;
@@ -270,7 +276,7 @@ namespace libgltf
270276 SAccessorSparseValues ();
271277
272278 // Check valid
273- operator bool () const ;
279+ virtual operator bool () const ;
274280
275281 // The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
276282 std::shared_ptr<struct SGlTFId > bufferView;
@@ -287,7 +293,7 @@ namespace libgltf
287293 SAnimationChannelTarget ();
288294
289295 // Check valid
290- operator bool () const ;
296+ virtual operator bool () const ;
291297
292298 // The index of the node to target.
293299 std::shared_ptr<struct SGlTFId > node;
@@ -304,7 +310,7 @@ namespace libgltf
304310 SMesh ();
305311
306312 // Check valid
307- operator bool () const ;
313+ virtual operator bool () const ;
308314
309315 // An array of primitives, each defining geometry to be rendered with a material.
310316 std::vector<std::shared_ptr<struct SMeshPrimitive >> primitives;
@@ -321,7 +327,7 @@ namespace libgltf
321327 SAccessorSparse ();
322328
323329 // Check valid
324- operator bool () const ;
330+ virtual operator bool () const ;
325331
326332 // Number of entries stored in the sparse array.
327333 int32_t count;
@@ -340,7 +346,7 @@ namespace libgltf
340346 SMeshPrimitive ();
341347
342348 // Check valid
343- operator bool () const ;
349+ virtual operator bool () const ;
344350
345351 // The index of the accessor that contains the indices.
346352 std::shared_ptr<struct SGlTFId > indices;
@@ -363,7 +369,7 @@ namespace libgltf
363369 SKHR_materials_pbrSpecularGlossinessglTFextension ();
364370
365371 // Check valid
366- operator bool () const ;
372+ virtual operator bool () const ;
367373
368374 // The specular RGB color of the material.
369375 std::vector<float > specularFactor;
@@ -386,7 +392,7 @@ namespace libgltf
386392 SExtension ();
387393
388394 // Check valid
389- operator bool () const ;
395+ virtual operator bool () const ;
390396
391397 // Manual code lines
392398 std::map<GLTFString, std::shared_ptr<struct SObject >> properties;
@@ -401,7 +407,7 @@ namespace libgltf
401407 SAnimationChannel ();
402408
403409 // Check valid
404- operator bool () const ;
410+ virtual operator bool () const ;
405411
406412 // The index of the node and TRS property to target.
407413 std::shared_ptr<struct SAnimationChannelTarget > target;
@@ -417,7 +423,7 @@ namespace libgltf
417423 SGlTFId ();
418424
419425 // Check valid
420- operator bool () const ;
426+ virtual operator bool () const ;
421427
422428 operator int32_t () const ;
423429
@@ -433,7 +439,7 @@ namespace libgltf
433439 SAccessorSparseIndices ();
434440
435441 // Check valid
436- operator bool () const ;
442+ virtual operator bool () const ;
437443
438444 // The indices data type.
439445 int32_t componentType;
@@ -452,7 +458,7 @@ namespace libgltf
452458 SNode ();
453459
454460 // Check valid
455- operator bool () const ;
461+ virtual operator bool () const ;
456462
457463 // The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.
458464 std::vector<float > scale;
@@ -483,7 +489,7 @@ namespace libgltf
483489 SAnimation ();
484490
485491 // Check valid
486- operator bool () const ;
492+ virtual operator bool () const ;
487493
488494 // An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets.
489495 std::vector<std::shared_ptr<struct SAnimationChannel >> channels;
@@ -500,7 +506,7 @@ namespace libgltf
500506 SSkin ();
501507
502508 // Check valid
503- operator bool () const ;
509+ virtual operator bool () const ;
504510
505511 // Indices of skeleton nodes, used as joints in this skin.
506512 std::vector<std::shared_ptr<struct SGlTFId >> joints;
@@ -519,7 +525,7 @@ namespace libgltf
519525 SMaterialPBRMetallicRoughness ();
520526
521527 // Check valid
522- operator bool () const ;
528+ virtual operator bool () const ;
523529
524530 // The roughness of the material.
525531 float roughnessFactor;
@@ -541,7 +547,7 @@ namespace libgltf
541547 SKHR_draco_mesh_compressionextension ();
542548
543549 // Check valid
544- operator bool () const ;
550+ virtual operator bool () const ;
545551
546552 // A dictionary object, where each key corresponds to an attribute and its unique attribute id stored in the compressed geometry.
547553 std::map<GLTFString, std::shared_ptr<struct SGlTFId >> attributes;
@@ -558,7 +564,7 @@ namespace libgltf
558564 SCamera ();
559565
560566 // Check valid
561- operator bool () const ;
567+ virtual operator bool () const ;
562568
563569 // Specifies if the camera uses a perspective or orthographic projection.
564570 GLTFString type;
@@ -577,7 +583,7 @@ namespace libgltf
577583 SImage ();
578584
579585 // Check valid
580- operator bool () const ;
586+ virtual operator bool () const ;
581587
582588 // The image's MIME type.
583589 GLTFString mimeType;
@@ -596,7 +602,7 @@ namespace libgltf
596602 STexture ();
597603
598604 // Check valid
599- operator bool () const ;
605+ virtual operator bool () const ;
600606
601607 // The index of the image used by this texture.
602608 std::shared_ptr<struct SGlTFId > source;
@@ -613,7 +619,7 @@ namespace libgltf
613619 SCameraOrthographic ();
614620
615621 // Check valid
616- operator bool () const ;
622+ virtual operator bool () const ;
617623
618624 // The floating-point horizontal magnification of the view. Must not be zero.
619625 float xmag;
@@ -634,7 +640,7 @@ namespace libgltf
634640 SBuffer ();
635641
636642 // Check valid
637- operator bool () const ;
643+ virtual operator bool () const ;
638644
639645 // The length of the buffer in bytes.
640646 int32_t byteLength;
@@ -651,7 +657,7 @@ namespace libgltf
651657 SAccessor ();
652658
653659 // Check valid
654- operator bool () const ;
660+ virtual operator bool () const ;
655661
656662 // The number of attributes referenced by this accessor.
657663 int32_t count;
@@ -682,7 +688,7 @@ namespace libgltf
682688 SGlTF ();
683689
684690 // Check valid
685- operator bool () const ;
691+ virtual operator bool () const ;
686692
687693 // An array of textures.
688694 std::vector<std::shared_ptr<struct STexture >> textures;
0 commit comments