@luma.gl/engine 9.0.0-alpha.3 → 9.0.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -1
- package/dist/animation/key-frames.d.ts +1 -1
- package/dist/animation/key-frames.d.ts.map +1 -1
- package/dist/animation/key-frames.js +0 -20
- package/dist/animation/key-frames.js.map +1 -1
- package/dist/animation/timeline.d.ts +5 -5
- package/dist/animation/timeline.d.ts.map +1 -1
- package/dist/animation/timeline.js +0 -30
- package/dist/animation/timeline.js.map +1 -1
- package/dist/{lib → animation-loop}/animation-loop.d.ts +28 -29
- package/dist/animation-loop/animation-loop.d.ts.map +1 -0
- package/dist/{lib → animation-loop}/animation-loop.js +96 -175
- package/dist/animation-loop/animation-loop.js.map +1 -0
- package/dist/{lib → animation-loop}/animation-props.d.ts +7 -7
- package/dist/animation-loop/animation-props.d.ts.map +1 -0
- package/dist/animation-loop/animation-props.js.map +1 -0
- package/dist/animation-loop/make-animation-loop.d.ts +6 -0
- package/dist/animation-loop/make-animation-loop.d.ts.map +1 -0
- package/dist/animation-loop/make-animation-loop.js +28 -0
- package/dist/animation-loop/make-animation-loop.js.map +1 -0
- package/dist/animation-loop/render-loop.d.ts +23 -0
- package/dist/animation-loop/render-loop.d.ts.map +1 -0
- package/dist/animation-loop/render-loop.js +7 -0
- package/dist/animation-loop/render-loop.js.map +1 -0
- package/dist/dist.dev.js +14977 -0
- package/dist/geometries/cone-geometry.d.ts +1 -1
- package/dist/geometries/cone-geometry.d.ts.map +1 -1
- package/dist/geometries/cone-geometry.js +6 -5
- package/dist/geometries/cone-geometry.js.map +1 -1
- package/dist/geometries/cube-geometry.d.ts +2 -2
- package/dist/geometries/cube-geometry.d.ts.map +1 -1
- package/dist/geometries/cube-geometry.js +15 -8
- package/dist/geometries/cube-geometry.js.map +1 -1
- package/dist/geometries/cylinder-geometry.d.ts +1 -1
- package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
- package/dist/geometries/cylinder-geometry.js +6 -5
- package/dist/geometries/cylinder-geometry.js.map +1 -1
- package/dist/geometries/ico-sphere-geometry.d.ts +2 -2
- package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/ico-sphere-geometry.js +9 -18
- package/dist/geometries/ico-sphere-geometry.js.map +1 -1
- package/dist/geometries/plane-geometry.d.ts +2 -2
- package/dist/geometries/plane-geometry.d.ts.map +1 -1
- package/dist/geometries/plane-geometry.js +10 -19
- package/dist/geometries/plane-geometry.js.map +1 -1
- package/dist/geometries/sphere-geometry.d.ts +2 -2
- package/dist/geometries/sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/sphere-geometry.js +9 -13
- package/dist/geometries/sphere-geometry.js.map +1 -1
- package/dist/geometries/truncated-cone-geometry.d.ts +2 -2
- package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
- package/dist/geometries/truncated-cone-geometry.js +9 -14
- package/dist/geometries/truncated-cone-geometry.js.map +1 -1
- package/dist/geometry/geometry-table.d.ts +2 -2
- package/dist/geometry/geometry-table.d.ts.map +1 -1
- package/dist/geometry/geometry-table.js.map +1 -1
- package/dist/geometry/geometry-utils.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.js +0 -9
- package/dist/geometry/geometry-utils.js.map +1 -1
- package/dist/geometry/geometry.d.ts +35 -58
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +26 -89
- package/dist/geometry/geometry.js.map +1 -1
- package/dist/geometry/primitive-utils.js.map +1 -1
- package/dist/index.cjs +2576 -0
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -13
- package/dist/index.js.map +1 -1
- package/dist/lib/clip-space.d.ts +8 -0
- package/dist/lib/clip-space.d.ts.map +1 -1
- package/dist/lib/clip-space.js +36 -1
- package/dist/lib/clip-space.js.map +1 -1
- package/dist/lib/pipeline-factory.d.ts +19 -14
- package/dist/lib/pipeline-factory.d.ts.map +1 -1
- package/dist/lib/pipeline-factory.js +52 -63
- package/dist/lib/pipeline-factory.js.map +1 -1
- package/dist/{lib → model}/model-utils.d.ts +2 -2
- package/dist/model/model-utils.d.ts.map +1 -0
- package/dist/{lib → model}/model-utils.js +3 -8
- package/dist/model/model-utils.js.map +1 -0
- package/dist/model/model.d.ts +67 -0
- package/dist/model/model.d.ts.map +1 -0
- package/dist/{lib → model}/model.js +59 -76
- package/dist/model/model.js.map +1 -0
- package/dist/scenegraph/group-node.d.ts +21 -0
- package/dist/scenegraph/group-node.d.ts.map +1 -0
- package/dist/scenegraph/group-node.js +95 -0
- package/dist/scenegraph/group-node.js.map +1 -0
- package/dist/scenegraph/model-node.d.ts +18 -0
- package/dist/scenegraph/model-node.d.ts.map +1 -0
- package/dist/scenegraph/model-node.js +29 -0
- package/dist/scenegraph/model-node.js.map +1 -0
- package/dist/scenegraph/scenegraph-node.d.ts +56 -0
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -0
- package/dist/scenegraph/scenegraph-node.js +142 -0
- package/dist/scenegraph/scenegraph-node.js.map +1 -0
- package/dist/transform/transform.d.ts +98 -0
- package/dist/transform/transform.d.ts.map +1 -0
- package/dist/transform/transform.js +67 -0
- package/dist/transform/transform.js.map +1 -0
- package/dist.min.js +314 -0
- package/package.json +22 -12
- package/src/animation/timeline.ts +2 -2
- package/src/{lib → animation-loop}/animation-loop.ts +115 -97
- package/src/{lib → animation-loop}/animation-props.ts +6 -5
- package/src/animation-loop/make-animation-loop.ts +44 -0
- package/src/animation-loop/render-loop.ts +23 -0
- package/src/geometries/cone-geometry.ts +1 -1
- package/src/geometries/cube-geometry.ts +6 -3
- package/src/geometries/cylinder-geometry.ts +2 -2
- package/src/geometries/ico-sphere-geometry.ts +7 -6
- package/src/geometries/plane-geometry.ts +5 -4
- package/src/geometries/sphere-geometry.ts +4 -3
- package/src/geometries/truncated-cone-geometry.ts +4 -3
- package/src/geometry/geometry-table.ts +1 -1
- package/src/geometry/geometry-utils.ts +3 -3
- package/src/geometry/geometry.ts +72 -115
- package/src/index.ts +28 -12
- package/src/lib/clip-space.ts +17 -15
- package/src/lib/pipeline-factory.ts +60 -50
- package/src/{lib → model}/model-utils.ts +5 -4
- package/src/model/model.ts +230 -0
- package/src/scenegraph/group-node.ts +103 -0
- package/src/scenegraph/model-node.ts +50 -0
- package/src/scenegraph/scenegraph-node.ts +204 -0
- package/src/transform/transform.ts +246 -0
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/bundle.js.map +0 -1
- package/dist/lib/animation-loop.d.ts.map +0 -1
- package/dist/lib/animation-loop.js.map +0 -1
- package/dist/lib/animation-props.d.ts.map +0 -1
- package/dist/lib/animation-props.js.map +0 -1
- package/dist/lib/model-utils.d.ts.map +0 -1
- package/dist/lib/model-utils.js.map +0 -1
- package/dist/lib/model.d.ts +0 -41
- package/dist/lib/model.d.ts.map +0 -1
- package/dist/lib/model.js.map +0 -1
- package/dist/lib/render-loop.d.ts +0 -14
- package/dist/lib/render-loop.d.ts.map +0 -1
- package/dist/lib/render-loop.js +0 -49
- package/dist/lib/render-loop.js.map +0 -1
- package/src/bundle.ts +0 -4
- package/src/lib/model.ts +0 -179
- package/src/lib/render-loop.ts +0 -58
- /package/dist/{lib → animation-loop}/animation-props.js +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { luma } from '@luma.gl/core';
|
|
2
|
+
import { AnimationLoop } from "./animation-loop.js";
|
|
3
|
+
export function makeAnimationLoop(AnimationLoopTemplateCtor, props) {
|
|
4
|
+
let renderLoop = null;
|
|
5
|
+
const device = (props === null || props === void 0 ? void 0 : props.device) || luma.createDevice();
|
|
6
|
+
const animationLoop = new AnimationLoop({
|
|
7
|
+
...props,
|
|
8
|
+
device,
|
|
9
|
+
async onInitialize(animationProps) {
|
|
10
|
+
var _renderLoop;
|
|
11
|
+
renderLoop = new AnimationLoopTemplateCtor(animationProps);
|
|
12
|
+
return await ((_renderLoop = renderLoop) === null || _renderLoop === void 0 ? void 0 : _renderLoop.onInitialize(animationProps));
|
|
13
|
+
},
|
|
14
|
+
onRender: animationProps => {
|
|
15
|
+
var _renderLoop2;
|
|
16
|
+
return (_renderLoop2 = renderLoop) === null || _renderLoop2 === void 0 ? void 0 : _renderLoop2.onRender(animationProps);
|
|
17
|
+
},
|
|
18
|
+
onFinalize: animationProps => {
|
|
19
|
+
var _renderLoop3;
|
|
20
|
+
return (_renderLoop3 = renderLoop) === null || _renderLoop3 === void 0 ? void 0 : _renderLoop3.onFinalize(animationProps);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
animationLoop.getInfo = () => {
|
|
24
|
+
return this.AnimationLoopTemplateCtor.info;
|
|
25
|
+
};
|
|
26
|
+
return animationLoop;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=make-animation-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-animation-loop.js","names":["luma","AnimationLoop","makeAnimationLoop","AnimationLoopTemplateCtor","props","renderLoop","device","createDevice","animationLoop","onInitialize","animationProps","_renderLoop","onRender","_renderLoop2","onFinalize","_renderLoop3","getInfo","info"],"sources":["../../src/animation-loop/make-animation-loop.ts"],"sourcesContent":["// luma.gl, MIT license\nimport {luma} from '@luma.gl/core';\nimport {AnimationLoopTemplate} from './render-loop'\nimport {AnimationLoop, AnimationLoopProps} from './animation-loop'\nimport type {AnimationProps} from './animation-props';\n\nexport type MakeAnimationLoopProps = Omit<AnimationLoopProps, 'onCreateDevice' | 'onInitialize' | 'onRedraw' | 'onFinalize'>;\n\n/** Instantiates and runs the render loop */\nexport function makeAnimationLoop(AnimationLoopTemplateCtor: typeof AnimationLoopTemplate, props?: MakeAnimationLoopProps): AnimationLoop {\n let renderLoop: AnimationLoopTemplate | null = null;\n\n const device = props?.device || luma.createDevice();\n\n // Create an animation loop;\n const animationLoop = new AnimationLoop({\n ... props,\n\n device,\n\n async onInitialize(animationProps: AnimationProps): Promise<unknown> {\n // @ts-expect-error abstract to prevent instantiation\n renderLoop = new AnimationLoopTemplateCtor(animationProps);\n // Any async loading can be handled here\n return await renderLoop?.onInitialize(animationProps);\n },\n\n onRender: (animationProps: AnimationProps) => renderLoop?.onRender(animationProps),\n \n onFinalize: (animationProps: AnimationProps) => renderLoop?.onFinalize(animationProps)\n });\n\n // @ts-expect-error Hack: adds info for the website to find\n animationLoop.getInfo = () => {\n // @ts-ignore\n // eslint-disable-next-line no-invalid-this\n return this.AnimationLoopTemplateCtor.info;\n }\n\n // Start the loop automatically\n // animationLoop.start();\n\n return animationLoop;\n}\n"],"mappings":"AACA,SAAQA,IAAI,QAAO,eAAe;AAAC,SAE3BC,aAAa;AAMrB,OAAO,SAASC,iBAAiBA,CAACC,yBAAuD,EAAEC,KAA8B,EAAiB;EACxI,IAAIC,UAAwC,GAAG,IAAI;EAEnD,MAAMC,MAAM,GAAG,CAAAF,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,MAAM,KAAIN,IAAI,CAACO,YAAY,CAAC,CAAC;EAGnD,MAAMC,aAAa,GAAG,IAAIP,aAAa,CAAC;IACtC,GAAIG,KAAK;IAETE,MAAM;IAEN,MAAMG,YAAYA,CAACC,cAA8B,EAAoB;MAAA,IAAAC,WAAA;MAEnEN,UAAU,GAAG,IAAIF,yBAAyB,CAACO,cAAc,CAAC;MAE1D,OAAO,QAAAC,WAAA,GAAMN,UAAU,cAAAM,WAAA,uBAAVA,WAAA,CAAYF,YAAY,CAACC,cAAc,CAAC;IACvD,CAAC;IAEDE,QAAQ,EAAGF,cAA8B;MAAA,IAAAG,YAAA;MAAA,QAAAA,YAAA,GAAKR,UAAU,cAAAQ,YAAA,uBAAVA,YAAA,CAAYD,QAAQ,CAACF,cAAc,CAAC;IAAA;IAElFI,UAAU,EAAGJ,cAA8B;MAAA,IAAAK,YAAA;MAAA,QAAAA,YAAA,GAAKV,UAAU,cAAAU,YAAA,uBAAVA,YAAA,CAAYD,UAAU,CAACJ,cAAc,CAAC;IAAA;EACxF,CAAC,CAAC;EAGFF,aAAa,CAACQ,OAAO,GAAG,MAAM;IAG5B,OAAO,IAAI,CAACb,yBAAyB,CAACc,IAAI;EAC5C,CAAC;EAKD,OAAOT,aAAa;AACtB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AnimationProps } from './animation-props';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal class that represents a "componentized" rendering life cycle
|
|
4
|
+
* (resource construction, repeated rendering, resource destruction)
|
|
5
|
+
*
|
|
6
|
+
* @note A motivation for this class compared to the raw animation loop is
|
|
7
|
+
* that it simplifies TypeScript code by allowing resources to be typed unconditionally
|
|
8
|
+
* since they are allocated in the constructor rather than in onInitialized
|
|
9
|
+
*
|
|
10
|
+
* @note Introduced in luma.gl v9
|
|
11
|
+
*
|
|
12
|
+
* @example AnimationLoopTemplate is intended to be subclassed,
|
|
13
|
+
* but the subclass should not be instantiated directly. Instead the subclass
|
|
14
|
+
* (i.e. the constructor of the subclass) should be used
|
|
15
|
+
* as an argument to create an AnimationLoop.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class AnimationLoopTemplate {
|
|
18
|
+
constructor(animationProps?: AnimationProps);
|
|
19
|
+
onInitialize(animationProps: AnimationProps): Promise<unknown>;
|
|
20
|
+
abstract onRender(animationProps: AnimationProps): unknown;
|
|
21
|
+
abstract onFinalize(animationProps: AnimationProps): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=render-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-loop.d.ts","sourceRoot":"","sources":["../../src/animation-loop/render-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,qBAAqB;gBAC7B,cAAc,CAAC,EAAE,cAAc;IACrC,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IACpE,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO;IAC1D,QAAQ,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;CAC1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-loop.js","names":["AnimationLoopTemplate","constructor","animationProps","onInitialize"],"sources":["../../src/animation-loop/render-loop.ts"],"sourcesContent":["import type {AnimationProps} from './animation-props';\n\n/**\n * Minimal class that represents a \"componentized\" rendering life cycle\n * (resource construction, repeated rendering, resource destruction)\n * \n * @note A motivation for this class compared to the raw animation loop is \n * that it simplifies TypeScript code by allowing resources to be typed unconditionally \n * since they are allocated in the constructor rather than in onInitialized\n * \n * @note Introduced in luma.gl v9\n * \n * @example AnimationLoopTemplate is intended to be subclassed, \n * but the subclass should not be instantiated directly. Instead the subclass\n * (i.e. the constructor of the subclass) should be used \n * as an argument to create an AnimationLoop.\n */\nexport abstract class AnimationLoopTemplate {\n constructor(animationProps?: AnimationProps) {}\n async onInitialize(animationProps: AnimationProps): Promise<unknown> { return null; }\n abstract onRender(animationProps: AnimationProps): unknown;\n abstract onFinalize(animationProps: AnimationProps): void;\n}\n"],"mappings":"AAiBA,OAAO,MAAeA,qBAAqB,CAAC;EAC1CC,WAAWA,CAACC,cAA+B,EAAE,CAAC;EAC9C,MAAMC,YAAYA,CAACD,cAA8B,EAAoB;IAAE,OAAO,IAAI;EAAE;AAGtF"}
|