Cocos AIR glTF contracts
Stop once you can answer the task. Do not read another same-topic reference for the same question.
Scope: glTF/GLB loading, shared instances, extension support and decoder deployment.
Environment: use package imports in apps; source paths require an AIR checkout. See context.
Quick Start
For complete setup and teardown, read Quick Start.
Siblings: direct dependencies; reuse loaded skills.
Triggers
- Load a model URL or existing bytes
- Deploy and inject compressed-model decoders
- Check extension support in this browser
- Instantiate several copies with shared assets
- Loop clips per model instance
- Diagnose loads without a GLTFError code
- Register custom extension handlers
Exact API and symptom mappings: triggers.
Contracts
Configure required decoders before loading; declared extension support is not deployed-decoder or browser proof. Dispose instances before shared asset destruction and distinguish GLTFError from tagged TypeError/RangeError.
Read references/contracts.md only when the task needs exact option rules, limits, error behavior or source annotations. Prefer the topic references below for a narrower question.
Common Mistakes
- [HIGH] Decoders are external and require explicit deployment.
- [HIGH] Decoder-required does not mean supported.
- [HIGH] Catching only GLTFError misses other failure shapes.
- [MEDIUM] Check public exports; destroy instances before shared assets.
Read relevant wrong/right examples before implementation.
Reference map
- Load or instantiate? - Options and shared lifetime
- Extension supported? - Statuses and hooks
- Compressed model fails? - Injection and deployment
- Missing error code? - Errors, reports and progress