-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Root::push()
and Index::push()
to assist with glTF construction.
These methods reduce the amount of boilerplate and possible mistakes involved in constructing a glTF asset from scratch. Most use cases are served by `Root::push()`; `Index::push()` is useful for cases like animation samplers where the vector of objects is not in the `Root`, or in algorithmically complex situations such as pushing both within and outside closures, which would produce borrow conflicts if `&mut Root` was required for everything. This introduces a new paradigm for child object access: implementing `AsMut<Vec<T>>`. This could also replace the `Get` trait's function via `AsRef<[T]>` implementations, but that would be a breaking change, so if that is to be done, let's do it separately. This commit includes those `AsRef` implementations, though, since they're harmless and parallel to the `AsMut` implementations.
- Loading branch information
Showing
2 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters