Skip to main content

Module gltf

Module gltf 

Source
Expand description

The glTF scene: a skinned fox and a morph-target cube, animated from the documents they were loaded from.

Both assets under unlit3d_asset_files/assets are loaded as glTF documents and drawn through one MeshSource: the fox’s mesh is deformed by its own skeleton under the document’s Walk animation, and the morph stress test’s mesh is deformed by its eight morph targets under the document’s Pulse animation. In the window each clip plays at its own real duration and loops. A snapshot capture instead walks a fixed six-step sequence and stores each step as its own snapshot, so a wrong joint matrix, a mispacked morph delta or a stale binding shows up as a frame that does not move the way it should.

Re-exports§

use super::SceneControl; 🔒
use super::SceneDef; 🔒
use super::SceneOptions; 🔒
use super::TEST_SIZE; 🔒
use unlit_ecs::bundle; 🔒
use unlit3d::gltf::LitGltf; 🔒
use unlit3d::prelude::*; 🔒

Constants§

CAMERA_EYE 🔒
Where the camera sits, and the point it looks at.
CAMERA_TARGET 🔒
FOX_ANIMATION 🔒
The animation each document plays, by the name the document gives it.
FOX_PLACEMENT 🔒
Where the fox stands.
FRAMES 🔒
The frames a snapshot capture freezes, one snapshot each.
MORPH_ANIMATION 🔒
MORPH_PLACEMENT 🔒
Where the morph cube stands, so it sits beside the fox rather than inside it.

Statics§

SCENE
The scene: two glTF documents whose clips play in real time, with six frames stored as snapshots.

Functions§

animation_index 🔒
The index of the animation name in document.
build 🔒
Build the glTF scene’s world content.