Граф коммитов

46 Коммитов

Автор SHA1 Сообщение Дата
Sergio R. Z. Masson 4888f0a386
Removed Visual Studio project and NuGet infrastructure (#148)
* Removed many uncessary things and forced the project to be CMake only

* Updated README status badge
2024-09-05 11:46:31 -07:00
Yejneshwar d01d109037
Ability to flush a GLB manifest to a stream (#143) 2024-09-03 13:07:24 -07:00
Eric Bouchard 142f92c10e
Fix build error when Set-StrictMode is enabled. (#142) 2024-09-03 13:05:36 -07:00
Eric Bouchard 9bf27e7ed9
Size calls assert/abort when not of type array (#125) 2023-08-29 17:30:38 -03:00
Sergio Ricardo Zerbetto Masson 6fa8df9ce0 Fixed small issue with Clang compiler flags based on Compiler definition 2023-04-26 10:28:44 -03:00
Sergio Ricardo Zerbetto Masson 785600e05e Removed rapidjson .hpp from nuget package 2023-04-14 12:10:54 -03:00
Sergio Ricardo Zerbetto Masson 6ae8c4352d Added rapidjson headers as content of Microsoft.gltf.CPP package 2023-04-14 12:10:36 -03:00
Sergio R. Z. Masson e5c217382b Added Windows VS2019 and VS2017 NuGet packages (#114)
* Created windows specific nuget packages for VS2017 and VS2019
2023-04-14 12:10:10 -03:00
Sergio R. Z. Masson 444ceeec14 Added new msvc security flags (#113)
Added new MSVC security flags when they are available in visual Studio to improve library security.

Added /Qspectre to mitigate certain Spectre variant 1 security vulnerabilities.
https://learn.microsoft.com/en-us/cpp/build/reference/qspectre?view=msvc-170

Added SHA-256 hash for the checksum:
https://learn.microsoft.com/en-us/cpp/build/reference/zh?view=msvc-170
2023-04-14 12:09:49 -03:00
Eric Bouchard 197e5c59d0
Add missing scene name (#117) 2023-04-04 14:20:41 -07:00
Sergio R. Z. Masson 382dea2c80
Added guard:ehcont for 64bit windows (#99)
- Added security flag guard:ehcont for MSVC.
- Updated wininit script to use Visual Studio 2019 as default generator. 
- Re-enabled vcpkg tests now that rapidjson has been updated.
2022-07-19 09:29:24 -03:00
Sergio R. Z. Masson eaccf166e2
Bugfix/update rapid json (#94)
Updated rapidjson version to latest.

Updated CI and removed legacy Visual Studio 2017 integration tests (No longer supported by Azure)

Temporarily disabled vcpkg integration tests since we are currently incompatible with its version of rapidjson. Once vcpkg updates its rapid-json we should we enable vcpkg integration tests. 

Fixes #93
2022-06-27 19:19:00 -03:00
Dave db5c8dfd02
Expand ReadSparseBinaryData index check to check for overflow (#89)
* Modified check to verify that currentIndex value isn't the result of an overflow

* Removed an unnecessary curly brace

* Modified fix
2021-11-05 12:36:15 -07:00
Krzysztof Domanski d806b75c6b
Krzysztof domanski fix type compare warning (#88)
* Change static cast from "int" to use the index type

By using "int", this produces "error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]"
Static cast is technically not needed at all here since all usages of this function specialize it with an unsigned int, but in order to be future proof static cast it to the type of indices.
2021-10-28 09:12:21 -07:00
Krzysztof Domanski 05718d5c36
Update Version.h (#75)
Use curly braces in member initialisation. 
"major" and "minor" are macros defined by the gcc compiler. The macros are defined in sys/sysmacros.h which is getting pulled in by #include <string> 
Using curly braces stops the macro from being expanded.
2021-08-09 17:56:16 -07:00
Celaleddin c5c133f742
use pow instead of std::powf (#74) 2021-08-09 16:37:11 -07:00
Dave Solares ac3e70392f
Fix issue with VS 2019 building and added VS2019 testing (#83)
* test compare

* test change

* test

* Fix for win build

* Updated yaml to support building against vs2019

* fix yaml
2021-06-21 10:13:06 -07:00
Dave Solares 813c637e19
Update autopkg file for Windows glTF.CPP (#79)
* Updated autopkg path

* typo

* typo
2021-06-08 14:47:56 -07:00
Dave Solares 8e4441e55b
Fix OOB Writing issue when using sparse accessors (#78)
* Fix OOB issue

* Moved check to outer loop
2021-05-26 10:38:29 -07:00
Cedric Guillemet dfce43037d
inlined output function so dtor/ctor matches between vs2017 and vs2019 (#73) 2021-03-09 09:20:17 -08:00
Park DongHa 9428f114b5
Update externals version and use VcPkg in CI (#66)
* cmake: use find_package with VcPkg

* cmake: define macro for <experimental/filesystem>

* VC++ requires _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING

* azure: vcpkg for windows build

* provide job variable: `vcpkgRoot`

* azure: explicit use of vcpkgTriplet

* cmake: alias for googletest target

* place gitignore under Build/
* azure: copy gtest DLL files after build

* cmake: update external/ and ios.toolchain.cmake

* ios-cmake: https://github.com/leetal/ios-cmake/releases/tag/3.1.2
* external: update ref commit
* cmake: workaround find_package(RapidJSON) in IOS

* cmake: change variable usage to command

* add_compile_definitions/add_compile_options

* Delete .gitignore

The file is unnecessary change. Remove.

* Update azure-pipelines.yml for Azure Pipelines

* build: recover build jobs without VcPkg

* build: add MacOS jobs for VcPkg

* build: use macos-10.15

* build macos: change vcpkgRoot
2020-12-04 16:05:53 -08:00
Dave Solares feefb41669
Adding iterative parse flag to prevent stack overflow issue (#65) 2020-10-19 17:21:31 -07:00
Vladimir Orlov 6193909559
Missing includes for VS2019: (#63)
* Math.h requires cstdint for uint8_t etc
* Color.cpp requires limits for std::numeric_limits

Co-authored-by: Владимир Орлов <vladimir.orlov@playrix.com>
2020-10-05 11:06:23 -07:00
MiiBond 20b0a2b1b5
Fix aspectRatio deserialization (#62)
Co-authored-by: Michael Bond <mbond@adobe.com>
2020-09-25 15:03:53 -07:00
Sean 8d12da1079
Add missing includes (#53) (#54)
* Add missing includes (#53)

* <algorithm> is needed for std::all_of()
* <tuple> is needed for std::tie()
* <string.h> is needed for memcpy() and strncmp()

* Update macos image to 10.14

* Fix clang warning

* ios deployment version 10

* removed min version

* 10.11 version

Co-authored-by: Gary Hsu <bghgary@users.noreply.github.com>
Co-authored-by: Cedric Guillemet <cedric.guillemet@gmail.com>
2020-05-29 08:19:35 -07:00
Arseny Kapoulkine 204d699802
Implement generalized float accessor data decoding (#51)
* Implement generalized float accessor data decoding

This change introduces GLTFResourceReader::ReadFloatData that, in
contrast with ReadBinaryData, doesn't require knowledge of the specific
data type and instead decodes the data into floating-point values in
accordance with ES3 rules that are used by glTF specification for
animation and geometry data.

This makes the code much more concise, because there's no need to
enumerate individual types and implement custom fragile conversions, and
trivially extends the code to support additions to the geometry
encodings provided by KHR_mesh_quantization extension.

* Fix a bug with unnormalized data decoding

We were previously assuming that the values are always normalized, but
this is obviously not true; we now correctly take into account
accessor.normalized and either do an integer->float cast or a full blown
transform.

* Add unit test coverage for ReadFloatData

Note that this change also fixes the test behavior in
AnimationUtilsTests - the tests were incorrectly creating unnormalized
accessors for animation data.

* Remove unused ComponentToFloat overload

This should fix macOS build

* Review feedback

Move ReadFloatData after ReadBinaryData

* Review feedback

Remove redundant inline and rename DecodeFloats.

* Reindent new file using spaces

* Rename ComponentToFloat to DecodeToFloat

* Remove ToUint8 that is no longer necessary.

* Remove two unused constants...

* Move ComponentToFloat and FloatToComponent

Instead of duplicating the definitions of decoding functions as
DecodeToFloat, move ComponentToFloat to ResourceReaderUtils.

This change also moves FloatToComponent for symmetry.

* Restore color and weight uint8->uint32 pack

The generic function has the exact same behavior but this is more direct
which might be a bit faster.

* Simplify DecodeToFloats a bit

There's no need to use algorithms here; as far as I can tell most other
decoding functions in the library just use for loops.

* Move PackColors(float) earlier in the file

* Restore all original validity checks

This change is now insufficient to load quantized glTF files - that can
be submitted as a separate PR.
2020-02-24 08:55:11 -08:00
MiiBond 6d2312c68b Fix serialization of texture transform extension for normalTexture (#47)
* Fix serialization of texture transform extension for normalTexture property
* Add tests and support texture transform for occlusionTexture
2019-08-19 11:15:17 -07:00
mebrunn e5d84deff8
Add support for missing component types to AnimationUtils::GetRotations (#41)
* Add support for missing component types to AnimationUtils::GetRotations

* Tidy test code
2019-06-19 12:13:54 -07:00
Chris Chenery ff6ad8bd5f
Use find_program to determine the available powershell command (#40)
Update CMakeLists.txt to use find_program to determine the available powershell command (could be 'powershell' or 'pwsh'). Resolves issue #30
2019-05-07 10:37:30 -07:00
Chris Chenery 68ca1fb217
Update and fix various unit tests (#38)
Update and fix various unit tests that used glTF 1.0 manifest fragments as input. Also moved the Serialize specific tests from GLTFSerializerTests to SerializeTests, the Deserialize specific tests from GLTFSerializerTests to a new file called DeserializeTest, and deleted GLTFSerializerTests.
2019-04-17 21:21:55 +01:00
Chris Chenery bf524fe3e9
Chriche/optional (#36)
Use a utility Optional type for class member variables that are not required and have no default value specified. The following classes have been modified:

- BufferView: byteStride & target members
- Perspective: zfar & aspectRatio members
- Sampler: magFilter & minFilter members
- TextureTransform: texCoord member
2019-04-16 00:03:46 +01:00
mebrunn fc96348a60
Preseve the optional semantics of the TextureTransform texCoord (#33)
* Preseve the optional semantics of the TextureTransform texCoord
* Add unit test for texCoord property
2019-03-21 09:10:25 -07:00
mebrunn a49a3c4638
Add support for serializing & deserializing the KHR_texture_transform extension (#31)
* Add support for the KHR_texture_transform extension with unit tests (based on Khronos TextureTransformTest model)
* Add support for nested extension serialization/deserialization
2019-03-19 13:41:27 -07:00
blake-fisher d8bdd40a62
Publish pdb files in main nuget package (#29)
Also, stop creating a separate symbols package.
2019-01-28 16:50:03 -08:00
Chris Chenery a3908a0d33
Remove Exception const char* constructors (#27)
* Test removing const char* exception constructors

* Remove commented code
2019-01-22 11:03:10 -08:00
Chris Chenery f53c4f4504
Chriche/disableschemavalidation (#25)
* Allow individual schema documents to be disabled during deserialization

* Replace SchemaLocator with ISchemaLocator interface

* Update schema valiation to allow validation of glTF extensions. Added relevant unit tests.

* Add extra unit tests

* Remove ISchemaLocator parameter from Deserialize API

* Respond to PR comments
2019-01-21 14:08:37 -08:00
blake-fisher e5b11270df
Add ARM64 support (#23) 2019-01-09 11:47:48 -08:00
Adam Gritt 4969243c4a
Fix Validation of documents with Points or Lines. (#22)
* Fix Validation of documents with Points or Lines.
2018-12-07 13:40:16 -08:00
Adam Gritt e910d8792e
Fix GLBResourceReader handling of GLB files with no binary chunk. (#17) 2018-11-09 13:58:55 -08:00
Adam Gritt aaeca2d749
Fix validation of accessors with no bufferViews since this is allowed by the spec. (#16) 2018-11-09 13:58:43 -08:00
Chris Chenery ac4ae2132f
Agritt/samples (#12)
* Added a sample command line sample for deserializing glTF files

* Downgrade version of Windows platform.

* Simplify project file.

* Add Serialize sample.

* Update Serialize sample to support creation of GLBs

* Update comments for Serialize sample

* Move path sanitizing into main functions for Serializer & Deserialize samples. Made small changes to comments and error messages.

* Add Samples to cmake build
2018-10-17 16:08:41 -07:00
David Ferguson 93b985f0b3 Updated copyright notice to comply with MS NuGet publishing requirements. (#5) 2018-08-30 15:10:45 -07:00
BillSchnurr afb4c7a71e Bschnurr/fix glb empty (#4)
* Handle empty bin files with writing out glb's

* removing unused headers in test

* Now getting the output stream from the streamWriter directly to check the stream state

* removed white space and rename test file

* adding a default document to the test to make generate manifest data for the Flush(..) call

* Updating test to complete the round trip back to a document

* removing extra StreamReaderWriter from unit test

* removing white space
2018-08-30 15:10:35 -07:00
Adam Gritt f3d76ec7d9
Cleanup NuGet paths. (#3) 2018-08-21 13:49:56 -07:00
Bart Siwek e978e3a705
MeshPrimitiveUtils now contains methods for serializing triangulated and segmented indices. (#2)
* MeshPrimitiveUtils now contains methods for serializing triangulated and segmented indices.
2018-08-16 19:23:37 +02:00
Adam Gritt e061a37d75 Initial copy from internal repository. 2018-08-09 11:49:29 -07:00