@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
31 lines (26 loc) • 845 B
text/typescript
declare type USDZExporter = {
exportAndOpen(): Promise<any>,
}
/**
* Internal registry for USDZ exporters. This is used by NeedleXRSession.start("immersive-ar")
*/
export namespace InternalUSDZRegistry {
const usdzExporter: USDZExporter[] = [];
export function exportAndOpen(): boolean {
if (!usdzExporter?.length) return false;
for (const exp of usdzExporter) {
exp.exportAndOpen();
}
return true;
}
export function registerExporter(exporter: USDZExporter) {
usdzExporter.push(exporter);
}
export function unregisterExporter(exporter: USDZExporter) {
if (!usdzExporter) return;
const index = usdzExporter.indexOf(exporter);
if (index >= 0) {
usdzExporter.splice(index, 1);
}
}
}