Commit Graph

10 Commits

Author SHA1 Message Date
mackong
122541eedc web: fix animation stopped premature (#6630) 2023-03-14 10:52:34 -07:00
Philip Rideout
9f53c62e06 gltfio: Update Web API.
Java API changes will come next.
2022-09-29 16:28:50 -07:00
Philip Rideout
8dc6fde588 gltfio API change: assets are now always 'instanced' etc
This change was motivated by some internal work at Google and has the
benefit of simplifying the gltfio API and implementation. There are 2
major API changes:

(1) Consolidate separate loader entry points for GLB and GLTF.

The distinction between GLB and GLTF can be made from the file content
alone, because GLB has a 4-byte magic string in its header. There is no
need for separate entry points.  Clients do not (and should not) need
to check the file name extension.

(2) Remove the distinction between "instanced" and "non-instanced"
glTF assets.

In the new scheme, all assets have at least 1 instance.

Broadly speaking, in gltfio an "asset" is a collection of Filament
objects like textures and vertex buffers, while an "instance" is a
collection of entities and components (e.g. the transform hierarchy).

This API change makes life easier for clients because they no longer
need to decide a priori if they will ever need to add instances.

This change also moves some public-facing methods from FilamentAsset to
FilamentInstance:

    - getSkinCount, getSkinNameAt
    - getJointCountAt, getJointsAt
    - attachSkin, detachSkin
2022-08-18 08:58:24 -07:00
Philip Rideout
c0452b5e9d JS: Update API for Camera construction / destruction. 2020-06-29 18:35:24 -07:00
Philip Rideout
a5c49cc1b6 Improve JS API for Scene::addEntities.
This repairs the `animation.html` sample. Using a JS array is more
natural for web developers and more consistent with the latest
JavaScript bindings in gltfio.
2020-06-18 12:16:01 -07:00
Philip Rideout
167493b85c Update Skybox / Clear API for web. 2020-04-10 17:06:47 -07:00
Philip Rideout
4891bb6157 Fix SameSite warning for locally run web samples. 2020-03-30 15:58:24 -07:00
Philip Rideout
4690ce5602 WebGL: Improve the callback API for glTF.
After the native async functionality landed, there was no way for web
clients to be notified that the decoding has finished. This PR changes
the existing `onDone` callback so that it gets called after all textures
have been decoded. (Previously it was called after downloading rather
than decoding.)

This has the side effect of simplifying the API because clients no
longer need to call a finalize function.
2020-02-24 11:38:55 -08:00
Philip Rideout
be4ad2ec07 WebGL: add a light source to the animation demo. 2019-10-31 16:45:01 -07:00
Philip Rideout
0e81207758 WebGL: add demo for glTF animation.
Fixes #1583.
2019-09-06 16:44:03 -07:00