Skip to content

Stop computing the glb length in the example#305

Open
wlinna wants to merge 1 commit intogltf-rs:mainfrom
wlinna:simplify-example
Open

Stop computing the glb length in the example#305
wlinna wants to merge 1 commit intogltf-rs:mainfrom
wlinna:simplify-example

Conversation

@wlinna
Copy link
Contributor

@wlinna wlinna commented Aug 1, 2021

to_writer computes the length internally, and the length provided in the header is ignored. Thus computing it yourself only adds complexity.

@IcanDivideBy0
Copy link
Collaborator

Hello, thanks!
It feels a bit weird to have a random zero in the middle of an example. IMO we should either add a comment to explain that length is recomputed anyways thus we can set the header length to whatever, or add an impl Default for Header. There's no much room for changing anything in the header:

  • magic: Must be b"glTF".
  • version: Must be 2.
  • length: is ignored most of the time ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants