@luma.gl/engine 8.6.0-alpha.4 → 9.0.0-alpha.10
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/dist/animation/key-frames.d.ts +1 -0
- package/dist/animation/key-frames.d.ts.map +1 -1
- package/dist/animation/key-frames.js.map +1 -1
- package/dist/animation/timeline.d.ts +2 -2
- package/dist/animation/timeline.d.ts.map +1 -1
- package/dist/animation/timeline.js.map +1 -1
- package/dist/geometries/cone-geometry.d.ts.map +1 -1
- package/dist/geometries/cone-geometry.js +1 -1
- package/dist/geometries/cone-geometry.js.map +1 -1
- package/dist/geometries/cube-geometry.d.ts +4 -0
- package/dist/geometries/cube-geometry.d.ts.map +1 -1
- package/dist/geometries/cube-geometry.js +31 -7
- package/dist/geometries/cube-geometry.js.map +1 -1
- package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
- package/dist/geometries/cylinder-geometry.js +1 -1
- package/dist/geometries/cylinder-geometry.js.map +1 -1
- package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/ico-sphere-geometry.js +1 -1
- package/dist/geometries/ico-sphere-geometry.js.map +1 -1
- package/dist/geometries/plane-geometry.d.ts.map +1 -1
- package/dist/geometries/plane-geometry.js +1 -1
- package/dist/geometries/plane-geometry.js.map +1 -1
- package/dist/geometries/sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/sphere-geometry.js +1 -1
- package/dist/geometries/sphere-geometry.js.map +1 -1
- package/dist/geometries/truncated-cone-geometry.d.ts +15 -3
- package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
- package/dist/geometries/truncated-cone-geometry.js +29 -15
- package/dist/geometries/truncated-cone-geometry.js.map +1 -1
- package/dist/geometry/geometry-table.d.ts +15 -0
- package/dist/geometry/geometry-table.d.ts.map +1 -0
- package/dist/geometry/geometry-table.js +2 -0
- package/dist/{transform/transform-types.js.map → geometry/geometry-table.js.map} +1 -1
- package/dist/geometry/geometry-utils.js.map +1 -1
- package/dist/geometry/geometry.d.ts +32 -14
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +57 -34
- package/dist/geometry/geometry.js.map +1 -1
- package/dist/geometry/primitive-utils.d.ts +1 -0
- package/dist/geometry/primitive-utils.d.ts.map +1 -0
- package/dist/geometry/primitive-utils.js +2 -0
- package/dist/geometry/primitive-utils.js.map +1 -0
- package/dist/index.d.ts +6 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/animation-loop.d.ts +23 -84
- package/dist/lib/animation-loop.d.ts.map +1 -1
- package/dist/lib/animation-loop.js +106 -193
- package/dist/lib/animation-loop.js.map +1 -1
- package/dist/lib/animation-props.d.ts +24 -0
- package/dist/lib/animation-props.d.ts.map +1 -0
- package/dist/lib/animation-props.js +2 -0
- package/dist/lib/animation-props.js.map +1 -0
- package/dist/lib/clip-space.d.ts +1 -0
- package/dist/lib/clip-space.d.ts.map +1 -0
- package/dist/lib/clip-space.js +2 -0
- package/dist/lib/clip-space.js.map +1 -0
- package/dist/lib/model-utils.d.ts +4 -3
- package/dist/lib/model-utils.d.ts.map +1 -1
- package/dist/lib/model-utils.js +24 -70
- package/dist/lib/model-utils.js.map +1 -1
- package/dist/lib/model.d.ts +34 -104
- package/dist/lib/model.d.ts.map +1 -1
- package/dist/lib/model.js +111 -502
- package/dist/lib/model.js.map +1 -1
- package/dist/lib/pipeline-factory.d.ts +60 -0
- package/dist/lib/pipeline-factory.d.ts.map +1 -0
- package/dist/lib/pipeline-factory.js +219 -0
- package/dist/lib/pipeline-factory.js.map +1 -0
- package/dist/lib/render-loop.d.ts +5 -18
- package/dist/lib/render-loop.d.ts.map +1 -1
- package/dist/lib/render-loop.js +16 -23
- package/dist/lib/render-loop.js.map +1 -1
- package/package.json +6 -6
- package/src/animation/key-frames.ts +1 -0
- package/src/animation/timeline.ts +2 -2
- package/src/geometries/cone-geometry.ts +1 -1
- package/src/geometries/cube-geometry.ts +160 -8
- package/src/geometries/cylinder-geometry.ts +1 -1
- package/src/geometries/ico-sphere-geometry.ts +2 -2
- package/src/geometries/plane-geometry.ts +1 -1
- package/src/geometries/sphere-geometry.ts +2 -2
- package/src/geometries/truncated-cone-geometry.ts +30 -12
- package/src/geometry/geometry-table.ts +16 -0
- package/src/geometry/geometry-utils.ts +1 -1
- package/src/geometry/geometry.ts +97 -47
- package/src/geometry/primitive-utils.ts +30 -0
- package/src/index.ts +13 -12
- package/src/lib/animation-loop.ts +136 -314
- package/src/lib/animation-props.ts +31 -0
- package/src/{utils → lib}/clip-space.ts +5 -2
- package/src/lib/model-utils.ts +60 -32
- package/src/lib/model.ts +127 -639
- package/src/lib/pipeline-factory.ts +234 -0
- package/src/lib/render-loop.ts +24 -22
- package/dist/lib/program-manager.d.ts +0 -39
- package/dist/lib/program-manager.d.ts.map +0 -1
- package/dist/lib/program-manager.js +0 -175
- package/dist/lib/program-manager.js.map +0 -1
- package/dist/transform/buffer-transform.d.ts +0 -36
- package/dist/transform/buffer-transform.d.ts.map +0 -1
- package/dist/transform/buffer-transform.js +0 -255
- package/dist/transform/buffer-transform.js.map +0 -1
- package/dist/transform/texture-transform.d.ts +0 -57
- package/dist/transform/texture-transform.d.ts.map +0 -1
- package/dist/transform/texture-transform.js +0 -412
- package/dist/transform/texture-transform.js.map +0 -1
- package/dist/transform/transform-shader-utils.d.ts +0 -26
- package/dist/transform/transform-shader-utils.d.ts.map +0 -1
- package/dist/transform/transform-shader-utils.js +0 -149
- package/dist/transform/transform-shader-utils.js.map +0 -1
- package/dist/transform/transform-types.d.ts +0 -44
- package/dist/transform/transform-types.d.ts.map +0 -1
- package/dist/transform/transform-types.js +0 -2
- package/dist/transform/transform.d.ts +0 -47
- package/dist/transform/transform.d.ts.map +0 -1
- package/dist/transform/transform.js +0 -198
- package/dist/transform/transform.js.map +0 -1
- package/dist/utils/clip-space.d.ts +0 -5
- package/dist/utils/clip-space.d.ts.map +0 -1
- package/dist/utils/clip-space.js +0 -34
- package/dist/utils/clip-space.js.map +0 -1
- package/src/lib/program-manager.ts +0 -187
- package/src/transform/buffer-transform.ts +0 -214
- package/src/transform/texture-transform.ts +0 -344
- package/src/transform/transform-shader-utils.ts +0 -169
- package/src/transform/transform-types.ts +0 -42
- package/src/transform/transform.ts +0 -189
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
import { uid } from '@luma.gl/api';
|
|
1
2
|
import Geometry from '../geometry/geometry';
|
|
2
|
-
import { uid } from '@luma.gl/webgl';
|
|
3
3
|
const INDEX_OFFSETS = {
|
|
4
4
|
x: [2, 0, 1],
|
|
5
5
|
y: [0, 1, 2],
|
|
6
6
|
z: [1, 2, 0]
|
|
7
7
|
};
|
|
8
|
+
export function makeTruncatedConeGeometry(props) {
|
|
9
|
+
const {
|
|
10
|
+
indices,
|
|
11
|
+
attributes
|
|
12
|
+
} = tesselateTruncatedCone(props);
|
|
13
|
+
return {
|
|
14
|
+
length: indices.length,
|
|
15
|
+
indices,
|
|
16
|
+
attributes
|
|
17
|
+
};
|
|
18
|
+
}
|
|
8
19
|
export class TruncatedConeGeometry extends Geometry {
|
|
9
20
|
constructor(props = {}) {
|
|
10
21
|
const {
|
|
@@ -17,7 +28,19 @@ export class TruncatedConeGeometry extends Geometry {
|
|
|
17
28
|
super({ ...props,
|
|
18
29
|
id,
|
|
19
30
|
indices,
|
|
20
|
-
attributes: {
|
|
31
|
+
attributes: {
|
|
32
|
+
POSITION: {
|
|
33
|
+
size: 3,
|
|
34
|
+
value: attributes.POSITION
|
|
35
|
+
},
|
|
36
|
+
NORMAL: {
|
|
37
|
+
size: 3,
|
|
38
|
+
value: attributes.NORMAL
|
|
39
|
+
},
|
|
40
|
+
TEXCOORD_0: {
|
|
41
|
+
size: 2,
|
|
42
|
+
value: attributes.TEXCOORD_0
|
|
43
|
+
},
|
|
21
44
|
...props.attributes
|
|
22
45
|
}
|
|
23
46
|
});
|
|
@@ -25,7 +48,7 @@ export class TruncatedConeGeometry extends Geometry {
|
|
|
25
48
|
|
|
26
49
|
}
|
|
27
50
|
|
|
28
|
-
function tesselateTruncatedCone(props) {
|
|
51
|
+
function tesselateTruncatedCone(props = {}) {
|
|
29
52
|
const {
|
|
30
53
|
bottomRadius = 0,
|
|
31
54
|
topRadius = 0,
|
|
@@ -110,18 +133,9 @@ function tesselateTruncatedCone(props) {
|
|
|
110
133
|
return {
|
|
111
134
|
indices,
|
|
112
135
|
attributes: {
|
|
113
|
-
POSITION:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
NORMAL: {
|
|
118
|
-
size: 3,
|
|
119
|
-
value: normals
|
|
120
|
-
},
|
|
121
|
-
TEXCOORD_0: {
|
|
122
|
-
size: 2,
|
|
123
|
-
value: texCoords
|
|
124
|
-
}
|
|
136
|
+
POSITION: positions,
|
|
137
|
+
NORMAL: normals,
|
|
138
|
+
TEXCOORD_0: texCoords
|
|
125
139
|
}
|
|
126
140
|
};
|
|
127
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":["Geometry","uid","INDEX_OFFSETS","x","y","z","TruncatedConeGeometry","constructor","props","id","indices","attributes","tesselateTruncatedCone","bottomRadius","topRadius","height","nradial","nvertical","verticalAxis","topCap","bottomCap","extra","numVertices","slant","Math","atan2","msin","sin","mcos","cos","mpi","PI","cosSlant","sinSlant","start","end","vertsAroundEdge","Uint16Array","indexOffset","positions","Float32Array","normals","texCoords","i3","i2","i","v","ringRadius","j","index","POSITION","size","value","NORMAL","TEXCOORD_0"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,sBAArB;AACA,SAAQC,GAAR,QAAkB,gBAAlB;AAEA,MAAMC,aAAa,GAAG;AACpBC,EAAAA,CAAC,EAAE,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CADiB;AAEpBC,EAAAA,CAAC,EAAE,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAFi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AG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACAtC,MAAAA,OAAO,CAACuC,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACAtC,MAAAA,OAAO,CAACuC,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACD;AACF;;AAED,SAAO;AACLtC,IAAAA,OADK;AAELC,IAAAA,UAAU,EAAE;AACVuC,MAAAA,QAAQ,EAAE;AAACC,QAAAA,IAAI,EAAE,CAAP;AAAUC,QAAAA,KAAK,EAAEb;AAAjB,OADA;AAEVc,MAAAA,MAAM,EAAE;AAACF,QAAAA,IAAI,EAAE,CAAP;AAAUC,QAAAA,KAAK,EAAEX;AAAjB,OAFE;AAGVa,MAAAA,UAAU,EAAE;AAACH,QAAAA,IAAI,EAAE,CAAP;AAAUC,QAAAA,KAAK,EAAEV;AAAjB;AAHF;AAFP,GAAP;AAQD","sourcesContent":["import Geometry from '../geometry/geometry';\nimport {uid} from '@luma.gl/webgl';\n\nconst INDEX_OFFSETS = {\n x: [2, 0, 1],\n y: [0, 1, 2],\n z: [1, 2, 0]\n};\n\nexport type TruncatedConeGeometryProps = {\n id?: string;\n topRadius?: number;\n bottomRadius?: number;\n topCap?: boolean;\n bottomCap?: boolean;\n attributes?\n};\n\n// Primitives inspired by TDL http://code.google.com/p/webglsamples/,\n// copyright 2011 Google Inc. new BSD License\n// (http://www.opensource.org/licenses/bsd-license.php).\nexport class TruncatedConeGeometry extends Geometry {\n constructor(props: TruncatedConeGeometryProps = {}) {\n const {id = uid('truncated-code-geometry')} = props;\n const {indices, attributes} = tesselateTruncatedCone(props);\n super({\n ...props,\n id,\n indices,\n attributes: {...attributes, ...props.attributes}\n });\n }\n}\n\n/* eslint-disable max-statements, complexity */\nfunction tesselateTruncatedCone(props) {\n const {\n bottomRadius = 0,\n topRadius = 0,\n height = 1,\n nradial = 10,\n nvertical = 10,\n verticalAxis = 'y',\n topCap = false,\n bottomCap = false\n } = props;\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n const numVertices = (nradial + 1) * (nvertical + 1 + extra);\n\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const msin = Math.sin;\n const mcos = Math.cos;\n const mpi = Math.PI;\n const cosSlant = mcos(slant);\n const sinSlant = msin(slant);\n const start = topCap ? -2 : 0;\n const end = nvertical + (bottomCap ? 2 : 0);\n const vertsAroundEdge = nradial + 1;\n\n const indices = new Uint16Array(nradial * (nvertical + extra) * 6);\n const indexOffset = INDEX_OFFSETS[verticalAxis];\n\n const positions = new Float32Array(numVertices * 3);\n const normals = new Float32Array(numVertices * 3);\n const texCoords = new Float32Array(numVertices * 2);\n\n let i3 = 0;\n let i2 = 0;\n for (let i = start; i <= end; i++) {\n let v = i / nvertical;\n let y = height * v;\n let ringRadius;\n\n if (i < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (i > nvertical) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius + (topRadius - bottomRadius) * (i / nvertical);\n }\n if (i === -2 || i === nvertical + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let j = 0; j < vertsAroundEdge; j++) {\n const sin = msin((j * mpi * 2) / nradial);\n const cos = mcos((j * mpi * 2) / nradial);\n\n positions[i3 + indexOffset[0]] = sin * ringRadius;\n positions[i3 + indexOffset[1]] = y;\n positions[i3 + indexOffset[2]] = cos * ringRadius;\n\n normals[i3 + indexOffset[0]] = i < 0 || i > nvertical ? 0 : sin * cosSlant;\n normals[i3 + indexOffset[1]] = i < 0 ? -1 : i > nvertical ? 1 : sinSlant;\n normals[i3 + indexOffset[2]] = i < 0 || i > nvertical ? 0 : cos * cosSlant;\n\n texCoords[i2 + 0] = j / nradial;\n texCoords[i2 + 1] = v;\n\n i2 += 2;\n i3 += 3;\n }\n }\n\n for (let i = 0; i < nvertical + extra; i++) {\n for (let j = 0; j < nradial; j++) {\n const index = (i * nradial + j) * 6;\n indices[index + 0] = vertsAroundEdge * (i + 0) + 0 + j;\n indices[index + 1] = vertsAroundEdge * (i + 0) + 1 + j;\n indices[index + 2] = vertsAroundEdge * (i + 1) + 1 + j;\n indices[index + 3] = vertsAroundEdge * (i + 0) + 0 + j;\n indices[index + 4] = vertsAroundEdge * (i + 1) + 1 + j;\n indices[index + 5] = vertsAroundEdge * (i + 1) + 0 + j;\n }\n }\n\n return {\n indices,\n attributes: {\n POSITION: {size: 3, value: positions},\n NORMAL: {size: 3, value: normals},\n TEXCOORD_0: {size: 2, value: texCoords}\n }\n };\n}\n"],"file":"truncated-cone-geometry.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":["uid","Geometry","INDEX_OFFSETS","x","y","z","makeTruncatedConeGeometry","props","indices","attributes","tesselateTruncatedCone","length","TruncatedConeGeometry","constructor","id","POSITION","size","value","NORMAL","TEXCOORD_0","bottomRadius","topRadius","height","nradial","nvertical","verticalAxis","topCap","bottomCap","extra","numVertices","slant","Math","atan2","msin","sin","mcos","cos","mpi","PI","cosSlant","sinSlant","start","end","vertsAroundEdge","Uint16Array","indexOffset","positions","Float32Array","normals","texCoords","i3","i2","i","v","ringRadius","j","index"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,cAAlB;AACA,OAAOC,QAAP,MAAqB,sBAArB;AAGA,MAAMC,aAAa,GAAG;AACpBC,EAAAA,CAAC,EAAE,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CADiB;AAEpBC,EAAAA,CAAC,EAAE,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAFiB;AAGpBC,EAAAA,CAAC,EAAE,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP;AAHiB,CAAtB;AAsBA,OAAO,SAASC,yBAAT,CAAmCC,KAAnC,EAAsF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ACgD,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACA/C,MAAAA,OAAO,CAACgD,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACA/C,MAAAA,OAAO,CAACgD,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACA/C,MAAAA,OAAO,CAACgD,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACA/C,MAAAA,OAAO,CAACgD,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACA/C,MAAAA,OAAO,CAACgD,KAAK,GAAG,CAAT,CAAP,GAAqBb,eAAe,IAAIS,CAAC,GAAG,CAAR,CAAf,GAA4B,CAA5B,GAAgCG,CAArD;AACD;AACF;;AAED,SAAO;AACL/C,IAAAA,OADK;AAELC,IAAAA,UAAU,EAAE;AACVM,MAAAA,QAAQ,EAAE+B,SADA;AAEV5B,MAAAA,MAAM,EAAE8B,OAFE;AAGV7B,MAAAA,UAAU,EAAE8B;AAHF;AAFP,GAAP;AAQD","sourcesContent":["import {uid} from '@luma.gl/api';\nimport Geometry from '../geometry/geometry';\nimport {GeometryTable} from '../geometry/geometry-table';\n\nconst INDEX_OFFSETS = {\n x: [2, 0, 1],\n y: [0, 1, 2],\n z: [1, 2, 0]\n};\n\nexport type TruncatedConeGeometryProps = {\n topRadius?: number;\n bottomRadius?: number;\n topCap?: boolean;\n bottomCap?: boolean;\n height?: number;\n nradial?: number;\n nvertical?: number;\n verticalAxis?: 'x' | 'y' | 'z';\n};\n\n/**\n * Primitives inspired by TDL http://code.google.com/p/webglsamples/,\n * copyright 2011 Google Inc. new BSD License\n * (http://www.opensource.org/licenses/bsd-license.php).\n */\nexport function makeTruncatedConeGeometry(props?: TruncatedConeGeometryProps): GeometryTable {\n const {indices, attributes} = tesselateTruncatedCone(props);\n return {\n length: indices.length,\n indices,\n attributes\n };\n}\n\nexport class TruncatedConeGeometry extends Geometry {\n constructor(props: TruncatedConeGeometryProps & {id?: string; attributes?} = {}) {\n const {id = uid('truncated-code-geometry')} = props;\n const {indices, attributes} = tesselateTruncatedCone(props);\n super({\n ...props,\n id,\n indices,\n attributes: {\n POSITION: {size: 3, value: attributes.POSITION},\n NORMAL: {size: 3, value: attributes.NORMAL},\n TEXCOORD_0: {size: 2, value: attributes.TEXCOORD_0},\n ...props.attributes}\n });\n }\n}\n\n/* eslint-disable max-statements, complexity */\nfunction tesselateTruncatedCone(props: TruncatedConeGeometryProps = {}) {\n const {\n bottomRadius = 0,\n topRadius = 0,\n height = 1,\n nradial = 10,\n nvertical = 10,\n verticalAxis = 'y',\n topCap = false,\n bottomCap = false\n } = props;\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n const numVertices = (nradial + 1) * (nvertical + 1 + extra);\n\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const msin = Math.sin;\n const mcos = Math.cos;\n const mpi = Math.PI;\n const cosSlant = mcos(slant);\n const sinSlant = msin(slant);\n const start = topCap ? -2 : 0;\n const end = nvertical + (bottomCap ? 2 : 0);\n const vertsAroundEdge = nradial + 1;\n\n const indices = new Uint16Array(nradial * (nvertical + extra) * 6);\n const indexOffset = INDEX_OFFSETS[verticalAxis];\n\n const positions = new Float32Array(numVertices * 3);\n const normals = new Float32Array(numVertices * 3);\n const texCoords = new Float32Array(numVertices * 2);\n\n let i3 = 0;\n let i2 = 0;\n for (let i = start; i <= end; i++) {\n let v = i / nvertical;\n let y = height * v;\n let ringRadius;\n\n if (i < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (i > nvertical) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius + (topRadius - bottomRadius) * (i / nvertical);\n }\n if (i === -2 || i === nvertical + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let j = 0; j < vertsAroundEdge; j++) {\n const sin = msin((j * mpi * 2) / nradial);\n const cos = mcos((j * mpi * 2) / nradial);\n\n positions[i3 + indexOffset[0]] = sin * ringRadius;\n positions[i3 + indexOffset[1]] = y;\n positions[i3 + indexOffset[2]] = cos * ringRadius;\n\n normals[i3 + indexOffset[0]] = i < 0 || i > nvertical ? 0 : sin * cosSlant;\n normals[i3 + indexOffset[1]] = i < 0 ? -1 : i > nvertical ? 1 : sinSlant;\n normals[i3 + indexOffset[2]] = i < 0 || i > nvertical ? 0 : cos * cosSlant;\n\n texCoords[i2 + 0] = j / nradial;\n texCoords[i2 + 1] = v;\n\n i2 += 2;\n i3 += 3;\n }\n }\n\n for (let i = 0; i < nvertical + extra; i++) {\n for (let j = 0; j < nradial; j++) {\n const index = (i * nradial + j) * 6;\n indices[index + 0] = vertsAroundEdge * (i + 0) + 0 + j;\n indices[index + 1] = vertsAroundEdge * (i + 0) + 1 + j;\n indices[index + 2] = vertsAroundEdge * (i + 1) + 1 + j;\n indices[index + 3] = vertsAroundEdge * (i + 0) + 0 + j;\n indices[index + 4] = vertsAroundEdge * (i + 1) + 1 + j;\n indices[index + 5] = vertsAroundEdge * (i + 1) + 0 + j;\n }\n }\n\n return {\n indices,\n attributes: {\n POSITION: positions,\n NORMAL: normals,\n TEXCOORD_0: texCoords\n }\n };\n}\n"],"file":"truncated-cone-geometry.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TypedArray, VertexFormat } from '@luma.gl/api';
|
|
2
|
+
/** Holds one geometry */
|
|
3
|
+
export declare type GeometryTable = {
|
|
4
|
+
length: number;
|
|
5
|
+
schema?: Record<string, VertexFormat>;
|
|
6
|
+
attributes: {
|
|
7
|
+
POSITION: TypedArray;
|
|
8
|
+
NORMAL: TypedArray;
|
|
9
|
+
TEXCOORD_0: TypedArray;
|
|
10
|
+
[key: string]: TypedArray;
|
|
11
|
+
};
|
|
12
|
+
indices?: Uint16Array | Uint32Array;
|
|
13
|
+
topology?: 'point-list' | 'line-list' | 'line-strip' | 'triangle-list' | 'triangle-strip';
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=geometry-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry-table.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry-table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAE3D,yBAAyB;AACzB,oBAAY,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACtC,UAAU,EAAE;QACV,QAAQ,EAAE,UAAU,CAAC;QACrB,MAAM,EAAE,UAAU,CAAC;QACnB,UAAU,EAAE,UAAU,CAAC;QACvB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;KAC3B,CAAC;IACF,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IACpC,QAAQ,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;CAC3F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"geometry-table.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/geometry/geometry-utils.ts"],"names":["unpackIndexedGeometry","geometry","indices","attributes","vertexCount","value","length","unpackedAttributes","attributeName","attribute","constant","size","unpackedValue","constructor","x","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AP;AAGD","sourcesContent":["import type Geometry from './geometry';\n\nexport function unpackIndexedGeometry(geometry) {\n const {indices, attributes} = geometry;\n if (!indices) {\n return geometry;\n }\n\n const vertexCount = indices.value.length;\n const unpackedAttributes = {};\n\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const {constant, value, size} = attribute;\n if (constant || !size) {\n continue; // eslint-disable-line\n }\n const unpackedValue = new value.constructor(vertexCount * size);\n for (let x = 0; x < vertexCount; ++x) {\n const index = indices.value[x];\n for (let i = 0; i < size; i++) {\n unpackedValue[x * size + i] = value[index * size + i];\n }\n }\n unpackedAttributes[attributeName] = {size, value: unpackedValue};\n }\n\n return {\n attributes: Object.assign({}, attributes, unpackedAttributes)\n };\n}\n"],"file":"geometry-utils.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/geometry/geometry-utils.ts"],"names":["unpackIndexedGeometry","geometry","indices","attributes","vertexCount","value","length","unpackedAttributes","attributeName","attribute","constant","size","unpackedValue","constructor","x","index","i","Object","assign"],"mappings":"AAEA,OAAO,SAASA,qBAAT,CAA+BC,QAA/B,EAAyC;AAC9C,QAAM;AAACC,IAAAA,OAAD;AAAUC,IAAAA;AAAV,MAAwBF,QAA9B;;AACA,MAAI,CAACC,OAAL,EAAc;AACZ,WAAOD,QAAP;AACD;;AAED,QAAMG,WAAW,GAAGF,OAAO,CAACG,KAAR,CAAcC,MAAlC;AACA,QAAMC,kBAAkB,GAAG,EAA3B;;AAEA,OAAK,MAAMC,aAAX,IAA4BL,UAA5B,EAAwC;AACtC,UAAMM,SAAS,GAAGN,UAAU,CAACK,aAAD,CAA5B;AACA,UAAM;AAACE,MAAAA,QAAD;AAAWL,MAAAA,KAAX;AAAkBM,MAAAA;AAAlB,QAA0BF,SAAhC;;AACA,QAAIC,QAAQ,IAAI,CAACC,IAAjB,EAAuB;AACrB;AACD;;AACD,UAAMC,aAAa,GAAG,IAAIP,KAAK,CAACQ,WAAV,CAAsBT,WAAW,GAAGO,IAApC,CAAtB;;AACA,SAAK,IAAIG,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGV,WAApB,EAAiC,EAAEU,CAAnC,EAAsC;AACpC,YAAMC,KAAK,GAAGb,OAAO,CAACG,KAAR,CAAcS,CAAd,CAAd;;AACA,WAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGL,IAApB,EAA0BK,CAAC,EAA3B,EAA+B;AAC7BJ,QAAAA,aAAa,CAACE,CAAC,GAAGH,IAAJ,GAAWK,CAAZ,CAAb,GAA8BX,KAAK,CAACU,KAAK,GAAGJ,IAAR,GAAeK,CAAhB,CAAnC;AACD;AACF;;AACDT,IAAAA,kBAAkB,CAACC,aAAD,CAAlB,GAAoC;AAACG,MAAAA,IAAD;AAAON,MAAAA,KAAK,EAAEO;AAAd,KAApC;AACD;;AAED,SAAO;AACLT,IAAAA,UAAU,EAAEc,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBf,UAAlB,EAA8BI,kBAA9B;AADP,GAAP;AAGD","sourcesContent":["// import type Geometry from './geometry';\n\nexport function unpackIndexedGeometry(geometry) {\n const {indices, attributes} = geometry;\n if (!indices) {\n return geometry;\n }\n\n const vertexCount = indices.value.length;\n const unpackedAttributes = {};\n\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const {constant, value, size} = attribute;\n if (constant || !size) {\n continue; // eslint-disable-line\n }\n const unpackedValue = new value.constructor(vertexCount * size);\n for (let x = 0; x < vertexCount; ++x) {\n const index = indices.value[x];\n for (let i = 0; i < size; i++) {\n unpackedValue[x * size + i] = value[index * size + i];\n }\n }\n unpackedAttributes[attributeName] = {size, value: unpackedValue};\n }\n\n return {\n attributes: Object.assign({}, attributes, unpackedAttributes)\n };\n}\n"],"file":"geometry-utils.js"}
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
+
import type { PrimitiveTopology, TypedArray } from '@luma.gl/api';
|
|
1
2
|
import GL from '@luma.gl/constants';
|
|
2
3
|
/**
|
|
3
|
-
* Rendering primitives - "
|
|
4
|
+
* Rendering primitives - "topology" specifies how to extract primitives from vertices.
|
|
5
|
+
* @deprecated - use string constants instead
|
|
4
6
|
*/
|
|
5
|
-
export declare type
|
|
7
|
+
export declare type GLTopology = GL.POINTS | // draw single points.
|
|
6
8
|
GL.LINES | // draw lines. Each vertex connects to the one after it.
|
|
7
9
|
GL.LINE_LOOP | // draw lines. Each set of two vertices is treated as a separate line segment.
|
|
8
10
|
GL.LINE_STRIP | // draw a connected group of line segments from the first vertex to the last
|
|
9
11
|
GL.TRIANGLES | // draw triangles. Each set of three vertices creates a separate triangle.
|
|
10
12
|
GL.TRIANGLE_STRIP | // draw a connected group of triangles.
|
|
11
13
|
GL.TRIANGLE_FAN;
|
|
14
|
+
export declare type GeometryAttribute = {
|
|
15
|
+
size?: number;
|
|
16
|
+
value: TypedArray;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
12
19
|
export declare type GeometryProps = {
|
|
13
20
|
id?: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
indices?: any;
|
|
21
|
+
attributes?: Record<string, GeometryAttribute | TypedArray>;
|
|
22
|
+
indices?: GeometryAttribute | TypedArray;
|
|
17
23
|
vertexCount?: number;
|
|
24
|
+
/** Determines how vertices are read from the 'vertex' attributes */
|
|
25
|
+
topology?: 'point-list' | 'line-list' | 'line-strip' | 'triangle-list' | 'triangle-strip';
|
|
26
|
+
/** @deprecated */
|
|
27
|
+
drawMode?: GLTopology;
|
|
18
28
|
};
|
|
19
29
|
export default class Geometry {
|
|
20
30
|
/** @deprecated */
|
|
@@ -28,17 +38,25 @@ export default class Geometry {
|
|
|
28
38
|
TRIANGLE_FAN: GL;
|
|
29
39
|
};
|
|
30
40
|
readonly id: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
userData: Record<string, unknown>;
|
|
42
|
+
/** Determines how vertices are read from the 'vertex' attributes */
|
|
43
|
+
topology?: PrimitiveTopology;
|
|
44
|
+
/** @deprecated */
|
|
45
|
+
readonly drawMode: GLTopology;
|
|
46
|
+
readonly vertexCount: number;
|
|
47
|
+
readonly attributes: {
|
|
48
|
+
POSITION: GeometryAttribute;
|
|
49
|
+
NORMAL: GeometryAttribute;
|
|
50
|
+
TEXCOORD_0: GeometryAttribute;
|
|
51
|
+
COLOR_0?: GeometryAttribute;
|
|
52
|
+
};
|
|
53
|
+
readonly indices?: Uint16Array | Uint32Array;
|
|
36
54
|
constructor(props?: GeometryProps);
|
|
37
|
-
|
|
55
|
+
/** @deprecated Use string topology constants instead */
|
|
56
|
+
get mode(): GLTopology;
|
|
38
57
|
getVertexCount(): number;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_setAttributes(attributes: any, indices: any): this;
|
|
58
|
+
_print(attributeName: string): string;
|
|
59
|
+
_setAttributes(attributes: Record<string, GeometryAttribute>, indices: any): this;
|
|
42
60
|
_calculateVertexCount(attributes: any, indices: any): number;
|
|
43
61
|
}
|
|
44
62
|
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,iBAAiB,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEpC;;;GAGG;AACH,oBAAY,UAAU,GACpB,EAAE,CAAC,MAAM,GAAI,sBAAsB;AACnC,EAAE,CAAC,KAAK,GAAI,wDAAwD;AACpE,EAAE,CAAC,SAAS,GAAI,8EAA8E;AAC9F,EAAE,CAAC,UAAU,GAAI,4EAA4E;AAC7F,EAAE,CAAC,SAAS,GAAI,0EAA0E;AAC1F,EAAE,CAAC,cAAc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DrC,wDAAwD;IACxD,IAAI,IAAI,eAEP;IAED,cAAc,IAAI,MAAM;IAWxB,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IASrC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,OAAO,KAAA,GAAG,IAAI;IAK5E,qBAAqB,CAAC,UAAU,KAAA,EAAE,OAAO,KAAA,GAAG,MAAM;CAgBnD"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import { uid, assert } from '@luma.gl/api';
|
|
2
3
|
import GL from '@luma.gl/constants';
|
|
3
|
-
import { uid, assert } from '@luma.gl/webgl';
|
|
4
4
|
export default class Geometry {
|
|
5
5
|
constructor(props = {}) {
|
|
6
6
|
_defineProperty(this, "id", void 0);
|
|
7
7
|
|
|
8
|
+
_defineProperty(this, "userData", {});
|
|
9
|
+
|
|
10
|
+
_defineProperty(this, "topology", void 0);
|
|
11
|
+
|
|
8
12
|
_defineProperty(this, "drawMode", GL.TRIANGLES);
|
|
9
13
|
|
|
10
14
|
_defineProperty(this, "vertexCount", void 0);
|
|
11
15
|
|
|
12
|
-
_defineProperty(this, "attributes",
|
|
16
|
+
_defineProperty(this, "attributes", void 0);
|
|
13
17
|
|
|
14
18
|
_defineProperty(this, "indices", void 0);
|
|
15
19
|
|
|
16
|
-
_defineProperty(this, "userData", {});
|
|
17
|
-
|
|
18
20
|
const {
|
|
19
21
|
id = uid('geometry'),
|
|
20
22
|
drawMode = GL.TRIANGLES,
|
|
@@ -24,32 +26,8 @@ export default class Geometry {
|
|
|
24
26
|
} = props;
|
|
25
27
|
this.id = id;
|
|
26
28
|
this.drawMode = drawMode;
|
|
29
|
+
this.topology = props.topology || convertToTopology(drawMode);
|
|
27
30
|
|
|
28
|
-
this._setAttributes(attributes, indices);
|
|
29
|
-
|
|
30
|
-
this.vertexCount = vertexCount || this._calculateVertexCount(this.attributes, this.indices);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get mode() {
|
|
34
|
-
return this.drawMode;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
getVertexCount() {
|
|
38
|
-
return this.vertexCount;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
getAttributes() {
|
|
42
|
-
return this.indices ? {
|
|
43
|
-
indices: this.indices,
|
|
44
|
-
...this.attributes
|
|
45
|
-
} : this.attributes;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
_print(attributeName) {
|
|
49
|
-
return "Geometry ".concat(this.id, " attribute ").concat(attributeName);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
_setAttributes(attributes, indices) {
|
|
53
31
|
if (indices) {
|
|
54
32
|
this.indices = ArrayBuffer.isView(indices) ? {
|
|
55
33
|
value: indices,
|
|
@@ -57,11 +35,12 @@ export default class Geometry {
|
|
|
57
35
|
} : indices;
|
|
58
36
|
}
|
|
59
37
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
38
|
+
this.attributes = {};
|
|
39
|
+
|
|
40
|
+
for (const [attributeName, attributeValue] of Object.entries(attributes)) {
|
|
41
|
+
const attribute = ArrayBuffer.isView(attributeValue) ? {
|
|
42
|
+
value: attributeValue
|
|
43
|
+
} : attributeValue;
|
|
65
44
|
assert(ArrayBuffer.isView(attribute.value), "".concat(this._print(attributeName), ": must be typed array or object with value as typed array"));
|
|
66
45
|
|
|
67
46
|
if ((attributeName === 'POSITION' || attributeName === 'positions') && !attribute.size) {
|
|
@@ -81,6 +60,22 @@ export default class Geometry {
|
|
|
81
60
|
delete this.indices.isIndexed;
|
|
82
61
|
}
|
|
83
62
|
|
|
63
|
+
this.vertexCount = vertexCount || this._calculateVertexCount(this.attributes, this.indices);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get mode() {
|
|
67
|
+
return this.drawMode;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
getVertexCount() {
|
|
71
|
+
return this.vertexCount;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
_print(attributeName) {
|
|
75
|
+
return "Geometry ".concat(this.id, " attribute ").concat(attributeName);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_setAttributes(attributes, indices) {
|
|
84
79
|
return this;
|
|
85
80
|
}
|
|
86
81
|
|
|
@@ -119,4 +114,32 @@ _defineProperty(Geometry, "DRAW_MODE", {
|
|
|
119
114
|
TRIANGLE_STRIP: GL.TRIANGLE_STRIP,
|
|
120
115
|
TRIANGLE_FAN: GL.TRIANGLE_FAN
|
|
121
116
|
});
|
|
117
|
+
|
|
118
|
+
function convertToTopology(drawMode) {
|
|
119
|
+
switch (drawMode) {
|
|
120
|
+
case GL.POINTS:
|
|
121
|
+
return 'point-list';
|
|
122
|
+
|
|
123
|
+
case GL.LINES:
|
|
124
|
+
return 'line-list';
|
|
125
|
+
|
|
126
|
+
case GL.LINE_STRIP:
|
|
127
|
+
return 'line-strip';
|
|
128
|
+
|
|
129
|
+
case GL.TRIANGLES:
|
|
130
|
+
return 'triangle-list';
|
|
131
|
+
|
|
132
|
+
case GL.TRIANGLE_STRIP:
|
|
133
|
+
return 'triangle-strip';
|
|
134
|
+
|
|
135
|
+
case GL.TRIANGLE_FAN:
|
|
136
|
+
return 'triangle-fan';
|
|
137
|
+
|
|
138
|
+
case GL.LINE_LOOP:
|
|
139
|
+
return 'line-loop';
|
|
140
|
+
|
|
141
|
+
default:
|
|
142
|
+
throw new Error(String(drawMode));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
122
145
|
//# sourceMappingURL=geometry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/geometry/geometry.ts"],"names":["GL","uid","assert","Geometry","constructor","props","TRIANGLES","id","drawMode","attributes","indices","vertexCount","_setAttributes","_calculateVertexCount","mode","getVertexCount","getAttributes","_print","attributeName","ArrayBuffer","isView","value","size","attribute","isIndexed","undefined","Object","assign","length","Infinity","constant","Math","min","Number","isFinite","POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLE_STRIP","TRIANGLE_FAN"],"mappings":";AACA,OAAOA,EAAP,MAAe,oBAAf;AACA,SAAQC,GAAR,EAAaC,MAAb,QAA0B,gBAA1B;AAuBA,eAAe,MAAMC,QAAN,CAAe;AAoB5BC,EAAAA,WAAW,CAACC,KAAoB,GAAG,EAAxB,EAA4B;AAAA;;AAAA,sCAPTL,EAAE,CAACM,SAOM;;AAAA;;AAAA,wCAJ1B,EAI0B;;AAAA;;AAAA,sCAFP,EAEO;;AACrC,UAAM;AACJC,MAAAA,EAAE,GAAGN,GAAG,CAAC,UAAD,CADJ;AAEJO,MAAAA,QAAQ,GAAGR,EAAE,CAACM,SAFV;AAGJG,MAAAA,UAAU,GAAG,EAHT;AAIJC,MAAAA,OAAO,GAAG,IAJN;AAKJC,MAAAA,WAAW,GAAG;AALV,QAMFN,KANJ;AAQA,SAAKE,EAAL,GAAUA,EAAV;AACA,SAAKC,QAAL,GAAgBA,QAAhB;;AAEA,SAAKI,cAAL,CAAoBH,UAApB,EAAgCC,OAAhC;;AAEA,SAAKC,WAAL,GAAmBA,WAAW,IAAI,KAAKE,qBAAL,CAA2B,KAAKJ,UAAhC,EAA4C,KAAKC,OAAjD,CAAlC;AACD;;AAEO,MAAJI,IAAI,GAAG;AACT,WAAO,KAAKN,QAAZ;AACD;;AAEDO,EAAAA,cAAc,GAAW;AACvB,WAAO,KAAKJ,WAAZ;AACD;;AAGDK,EAAAA,aAAa,GAAG;AACd,WAAO,KAAKN,OAAL,GAAe;AAACA,MAAAA,OAAO,EAAE,KAAKA,OAAf;AAAwB,SAAG,KAAKD;AAAhC,KAAf,GAA6D,KAAKA,UAAzE;AACD;;AAIDQ,EAAAA,MAAM,CAACC,aAAD,EAAwB;AAC5B,8BAAmB,KAAKX,EAAxB,wBAAwCW,aAAxC;AACD;;AAODN,EAAAA,cAAc,CAACH,UAAD,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,EAAa;AACX,aAAOA,OAAO,CAACW,KAAR,CAAcO,MAArB;AACD;;AACD,QAAIjB,WAAW,GAAGkB,QAAlB;;AACA,SAAK,MAAMX,aAAX,IAA4BT,UAA5B,EAAwC;AACtC,YAAMc,SAAS,GAAGd,UAAU,CAACS,aAAD,CAA5B;AACA,YAAM;AAACG,QAAAA,KAAD;AAAQC,QAAAA,IAAR;AAAcQ,QAAAA;AAAd,UAA0BP,SAAhC;;AACA,UAAI,CAACO,QAAD,IAAaT,KAAb,IAAsBC,IAAI,IAAI,CAAlC,EAAqC;AACnCX,QAAAA,WAAW,GAAGoB,IAAI,CAACC,GAAL,CAASrB,WAAT,EAAsBU,KAAK,CAACO,MAAN,GAAeN,IAArC,CAAd;AACD;AACF;;AAEDpB,IAAAA,MAAM,CAAC+B,MAAM,CAACC,QAAP,CAAgBvB,WAAhB,CAAD,CAAN;AACA,WAAOA,WAAP;AACD;;AAjH2B;;gBAATR,Q,eAEA;AACjBgC,EAAAA,MAAM,EAAEnC,EAAE,CAACmC,MADM;AAEjBC,EAAAA,KAAK,EAAEpC,EAAE,CAACoC,KAFO;AAGjBC,EAAAA,SAAS,EAAErC,EAAE,CAACqC,SAHG;AAIjBC,EAAAA,UAAU,EAAEtC,EAAE,CAACsC,UAJE;AAKjBhC,EAAAA,SAAS,EAAEN,EAAE,CAACM,SALG;AAMjBiC,EAAAA,cAAc,EAAEvC,EAAE,CAACuC,cANF;AAOjBC,EAAAA,YAAY,EAAExC,EAAE,CAACwC;AAPA,C","sourcesContent":["// luma.gl, MIT license\nimport GL from '@luma.gl/constants';\nimport {uid, assert} from '@luma.gl/webgl';\n\n/**\n * Rendering primitives - \"opology\" specifies how to extract primitives from vertices.\n */\nexport type Topology =\n GL.POINTS | // draw single points.\n GL.LINES | // draw lines. Each vertex connects to the one after it.\n GL.LINE_LOOP | // draw lines. Each set of two vertices is treated as a separate line segment.\n GL.LINE_STRIP | // draw a connected group of line segments from the first vertex to the last\n GL.TRIANGLES | // draw triangles. Each set of three vertices creates a separate triangle.\n GL.TRIANGLE_STRIP | // draw a connected group of triangles.\n GL.TRIANGLE_FAN // draw a connected group of triangles.\n ;\n\nexport type GeometryProps = {\n id?: string;\n drawMode?: Topology,\n attributes?: {},\n indices?;\n vertexCount?: number\n};\n\nexport default class Geometry {\n /** @deprecated */\n static DRAW_MODE = {\n POINTS: GL.POINTS, // draw single points.\n LINES: GL.LINES, // draw lines. Each vertex connects to the one after it.\n LINE_LOOP: GL.LINE_LOOP, // draw lines. Each set of two vertices is treated as a separate line segment.\n LINE_STRIP: GL.LINE_STRIP, // draw a connected group of line segments from the first vertex to the last\n TRIANGLES: GL.TRIANGLES, // draw triangles. Each set of three vertices creates a separate triangle.\n TRIANGLE_STRIP: GL.TRIANGLE_STRIP, // draw a connected group of triangles.\n TRIANGLE_FAN: GL.TRIANGLE_FAN // draw a connected group of triangles.\n };\n\n readonly id: string;\n readonly drawMode: Topology = GL.TRIANGLES;\n\n vertexCount: number;\n attributes = {};\n indices;\n userData: Record<string, any> = {};\n\n constructor(props: GeometryProps = {}) {\n const {\n id = uid('geometry'),\n drawMode = GL.TRIANGLES,\n attributes = {},\n indices = null,\n vertexCount = null\n } = props;\n\n this.id = id;\n this.drawMode = drawMode;\n\n this._setAttributes(attributes, indices);\n\n this.vertexCount = vertexCount || this._calculateVertexCount(this.attributes, this.indices);\n }\n\n get mode() {\n return this.drawMode;\n }\n\n getVertexCount(): number {\n return this.vertexCount;\n }\n\n // Return an object with all attributes plus indices added as a field.\n getAttributes() {\n return this.indices ? {indices: this.indices, ...this.attributes} : this.attributes;\n }\n\n // PRIVATE\n\n _print(attributeName): string {\n return `Geometry ${this.id} attribute ${attributeName}`;\n }\n\n // Attribute\n // value: typed array\n // type: indices, vertices, uvs\n // size: elements per vertex\n // target: WebGL buffer type (string or constant)\n _setAttributes(attributes, indices): this {\n if (indices) {\n this.indices = ArrayBuffer.isView(indices) ? {value: indices, size: 1} : indices;\n }\n\n for (const attributeName in attributes) {\n let attribute = attributes[attributeName];\n\n // Wrap \"unwrapped\" arrays and try to autodetect their type\n attribute = ArrayBuffer.isView(attribute) ? {value: attribute} : attribute;\n\n assert(\n ArrayBuffer.isView(attribute.value),\n `${this._print(attributeName)}: must be typed array or object with value as typed array`\n );\n\n if ((attributeName === 'POSITION' || attributeName === 'positions') && !attribute.size) {\n attribute.size = 3;\n }\n\n // Move indices to separate field\n if (attributeName === 'indices') {\n assert(!this.indices);\n this.indices = attribute;\n } else {\n this.attributes[attributeName] = attribute;\n }\n }\n\n if (this.indices && this.indices.isIndexed !== undefined) {\n this.indices = Object.assign({}, this.indices);\n delete this.indices.isIndexed;\n }\n\n return this;\n }\n\n _calculateVertexCount(attributes, indices): number {\n if (indices) {\n return indices.value.length;\n }\n let vertexCount = Infinity;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const {value, size, constant} = attribute;\n if (!constant && value && size >= 1) {\n vertexCount = Math.min(vertexCount, value.length / size);\n }\n }\n\n assert(Number.isFinite(vertexCount));\n return vertexCount;\n }\n}\n"],"file":"geometry.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/geometry/geometry.ts"],"names":["uid","assert","GL","Geometry","constructor","props","TRIANGLES","id","drawMode","attributes","indices","vertexCount","topology","convertToTopology","ArrayBuffer","isView","value","size","attributeName","attributeValue","Object","entries","attribute","_print","isIndexed","undefined","assign","_calculateVertexCount","mode","getVertexCount","_setAttributes","length","Infinity","constant","Math","min","Number","isFinite","POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLE_STRIP","TRIANGLE_FAN","Error","String"],"mappings":";AAEA,SAAQA,GAAR,EAAaC,MAAb,QAA0B,cAA1B;AACA,OAAOC,EAAP,MAAe,oBAAf;AAyCA,eAAe,MAAMC,QAAN,CAAe;AA6B5BC,EAAAA,WAAW,CAACC,KAAoB,GAAG,EAAxB,EAA4B;AAAA;;AAAA,sCAhBH,EAgBG;;AAAA;;AAAA,sCAXPH,EAAE,CAACI,SAWI;;AAAA;;AAA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CAAd;AACD;AACF;;AAEDhB,IAAAA,MAAM,CAACmC,MAAM,CAACC,QAAP,CAAgB1B,WAAhB,CAAD,CAAN;AACA,WAAOA,WAAP;AACD;;AAjI2B;;gBAATR,Q,eAEA;AACjBmC,EAAAA,MAAM,EAAEpC,EAAE,CAACoC,MADM;AAEjBC,EAAAA,KAAK,EAAErC,EAAE,CAACqC,KAFO;AAGjBC,EAAAA,SAAS,EAAEtC,EAAE,CAACsC,SAHG;AAIjBC,EAAAA,UAAU,EAAEvC,EAAE,CAACuC,UAJE;AAKjBnC,EAAAA,SAAS,EAAEJ,EAAE,CAACI,SALG;AAMjBoC,EAAAA,cAAc,EAAExC,EAAE,CAACwC,cANF;AAOjBC,EAAAA,YAAY,EAAEzC,EAAE,CAACyC;AAPA,C;;AAkIrB,SAAS9B,iBAAT,CAA2BL,QAA3B,EAAoE;AAClE,UAAQA,QAAR;AACE,SAAKN,EAAE,CAACoC,MAAR;AAAgB,aAAO,YAAP;;AAChB,SAAKpC,EAAE,CAACqC,KAAR;AAAe,aAAO,WAAP;;AACf,SAAKrC,EAAE,CAACuC,UAAR;AAAoB,aAAO,YAAP;;AACpB,SAAKvC,EAAE,CAACI,SAAR;AAAmB,aAAO,eAAP;;AACnB,SAAKJ,EAAE,CAACwC,cAAR;AAAwB,aAAO,gBAAP;;AAExB,SAAKxC,EAAE,CAACyC,YAAR;AAAsB,aAAO,cAAP;;AACtB,SAAKzC,EAAE,CAACsC,SAAR;AAAmB,aAAO,WAAP;;AACnB;AACE,YAAM,IAAII,KAAJ,CAAUC,MAAM,CAACrC,QAAD,CAAhB,CAAN;AAVJ;AAYD","sourcesContent":["// luma.gl, MIT license\nimport type {PrimitiveTopology, TypedArray} from '@luma.gl/api';\nimport {uid, assert} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\n\n/**\n * Rendering primitives - \"topology\" specifies how to extract primitives from vertices.\n * @deprecated - use string constants instead\n */\nexport type GLTopology =\n GL.POINTS | // draw single points.\n GL.LINES | // draw lines. Each vertex connects to the one after it.\n GL.LINE_LOOP | // draw lines. Each set of two vertices is treated as a separate line segment.\n GL.LINE_STRIP | // draw a connected group of line segments from the first vertex to the last\n GL.TRIANGLES | // draw triangles. Each set of three vertices creates a separate triangle.\n GL.TRIANGLE_STRIP | // draw a connected group of triangles.\n GL.TRIANGLE_FAN // draw a connected group of triangles.\n ;\n\nexport type GeometryAttribute = {\n size?: number;\n value: TypedArray;\n [key: string]: any\n}\n\nexport type GeometryProps = {\n id?: string;\n attributes?: Record<string, GeometryAttribute | TypedArray>,\n indices?: GeometryAttribute | TypedArray;\n vertexCount?: number;\n /** Determines how vertices are read from the 'vertex' attributes */\n topology?: 'point-list' | 'line-list' | 'line-strip' | 'triangle-list' | 'triangle-strip';\n /** @deprecated */\n drawMode?: GLTopology;\n};\n\ntype GeometryAttributes = {\n POSITION: GeometryAttribute,\n NORMAL: GeometryAttribute,\n TEXCOORD_0: GeometryAttribute,\n COLOR_0?: GeometryAttribute,\n indices?: {size?: number, value: Uint32Array | Uint16Array};\n};\n\nexport default class Geometry {\n /** @deprecated */\n static DRAW_MODE = {\n POINTS: GL.POINTS, // draw single points.\n LINES: GL.LINES, // draw lines. Each vertex connects to the one after it.\n LINE_LOOP: GL.LINE_LOOP, // draw lines. Each set of two vertices is treated as a separate line segment.\n LINE_STRIP: GL.LINE_STRIP, // draw a connected group of line segments from the first vertex to the last\n TRIANGLES: GL.TRIANGLES, // draw triangles. Each set of three vertices creates a separate triangle.\n TRIANGLE_STRIP: GL.TRIANGLE_STRIP, // draw a connected group of triangles.\n TRIANGLE_FAN: GL.TRIANGLE_FAN // draw a connected group of triangles.\n };\n\n readonly id: string;\n userData: Record<string, unknown> = {};\n\n /** Determines how vertices are read from the 'vertex' attributes */\n topology?: PrimitiveTopology;\n /** @deprecated */\n readonly drawMode: GLTopology = GL.TRIANGLES;\n\n readonly vertexCount: number;\n readonly attributes: {\n POSITION: GeometryAttribute,\n NORMAL: GeometryAttribute,\n TEXCOORD_0: GeometryAttribute,\n COLOR_0?: GeometryAttribute,\n };\n readonly indices?: Uint16Array | Uint32Array;\n\n constructor(props: GeometryProps = {}) {\n const {\n id = uid('geometry'),\n drawMode = GL.TRIANGLES,\n attributes = {},\n indices = null,\n vertexCount = null\n } = props;\n\n this.id = id;\n this.drawMode = drawMode;\n this.topology = props.topology || convertToTopology(drawMode);\n\n if (indices) {\n // @ts-expect-error\n this.indices = ArrayBuffer.isView(indices) ? {value: indices, size: 1} : indices;\n }\n\n // @ts-expect-error\n this.attributes = {};\n\n for (const [attributeName, attributeValue] of Object.entries(attributes)) {\n\n // Wrap \"unwrapped\" arrays and try to autodetect their type\n const attribute: GeometryAttribute = ArrayBuffer.isView(attributeValue) ? {value: attributeValue} : attributeValue;\n\n assert(\n ArrayBuffer.isView(attribute.value),\n `${this._print(attributeName)}: must be typed array or object with value as typed array`\n );\n\n if ((attributeName === 'POSITION' || attributeName === 'positions') && !attribute.size) {\n attribute.size = 3;\n }\n\n // Move indices to separate field\n if (attributeName === 'indices') {\n assert(!this.indices);\n // @ts-expect-error\n this.indices = attribute;\n } else {\n this.attributes[attributeName] = attribute;\n }\n }\n\n // @ts-expect-error\n if (this.indices && this.indices.isIndexed !== undefined) {\n this.indices = Object.assign({}, this.indices);\n // @ts-expect-error\n delete this.indices.isIndexed;\n }\n\n this.vertexCount = vertexCount || this._calculateVertexCount(this.attributes, this.indices);\n }\n\n /** @deprecated Use string topology constants instead */\n get mode() {\n return this.drawMode;\n }\n\n getVertexCount(): number {\n return this.vertexCount;\n }\n\n // Return an object with all attributes plus indices added as a field.\n // getAttributes(): GeometryAttributes {\n // return this.indices ? {indices: this.indices, ...this.attributes} : this.attributes;\n // }\n\n // PRIVATE\n\n _print(attributeName: string): string {\n return `Geometry ${this.id} attribute ${attributeName}`;\n }\n\n // GeometryAttribute\n // value: typed array\n // type: indices, vertices, uvs\n // size: elements per vertex\n // target: WebGL buffer type (string or constant)\n _setAttributes(attributes: Record<string, GeometryAttribute>, indices): this {\n\n return this;\n }\n\n _calculateVertexCount(attributes, indices): number {\n if (indices) {\n return indices.value.length;\n }\n let vertexCount = Infinity;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const {value, size, constant} = attribute;\n if (!constant && value && size >= 1) {\n vertexCount = Math.min(vertexCount, value.length / size);\n }\n }\n\n assert(Number.isFinite(vertexCount));\n return vertexCount;\n }\n}\n\nfunction convertToTopology(drawMode: GLTopology): PrimitiveTopology {\n switch (drawMode) {\n case GL.POINTS: return 'point-list'; // draw single points.\n case GL.LINES: return 'line-list'; // draw lines. Each vertex connects to the one after it.\n case GL.LINE_STRIP: return 'line-strip'; // draw a connected group of line segments from the first vertex to the last\n case GL.TRIANGLES: return 'triangle-list'; // draw triangles. Each set of three vertices creates a separate triangle.\n case GL.TRIANGLE_STRIP: return 'triangle-strip'; // draw a connected group of triangles.\n\n case GL.TRIANGLE_FAN: return 'triangle-fan'; // draw a connected group of triangles.\n case GL.LINE_LOOP: return 'line-loop'; // draw lines. Each set of two vertices is treated as a separate line segment.\n default:\n throw new Error(String(drawMode));\n }\n}\n"],"file":"geometry.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=primitive-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive-utils.d.ts","sourceRoot":"","sources":["../../src/geometry/primitive-utils.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"primitive-utils.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export {
|
|
1
|
+
export type { AnimationProps } from './lib/animation-props';
|
|
2
|
+
export type { AnimationLoopProps } from './lib/animation-loop';
|
|
3
|
+
export { AnimationLoop } from './lib/animation-loop';
|
|
3
4
|
export { RenderLoop } from './lib/render-loop';
|
|
4
5
|
export type { ModelProps } from './lib/model';
|
|
5
6
|
export { default as Model } from './lib/model';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
7
|
+
export { PipelineFactory } from './lib/pipeline-factory';
|
|
8
|
+
export { Timeline } from './animation/timeline';
|
|
9
|
+
export { KeyFrames } from './animation/key-frames';
|
|
8
10
|
export { default as Geometry } from './geometry/geometry';
|
|
9
11
|
export type { ConeGeometryProps } from './geometries/cone-geometry';
|
|
10
12
|
export { ConeGeometry } from './geometries/cone-geometry';
|
|
@@ -20,7 +22,4 @@ export type { SphereGeometryProps } from './geometries/sphere-geometry';
|
|
|
20
22
|
export { SphereGeometry } from './geometries/sphere-geometry';
|
|
21
23
|
export type { TruncatedConeGeometryProps } from './geometries/truncated-cone-geometry';
|
|
22
24
|
export { TruncatedConeGeometry } from './geometries/truncated-cone-geometry';
|
|
23
|
-
export { Timeline } from './animation/timeline';
|
|
24
|
-
export { KeyFrames } from './animation/key-frames';
|
|
25
|
-
export { default as ClipSpace } from './utils/clip-space';
|
|
26
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,YAAY,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAMjD,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAGxD,YAAY,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,YAAY,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,YAAY,EAAC,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAC,sBAAsB,EAAC,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACnE,YAAY,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,YAAY,EAAC,0BAA0B,EAAC,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAC,qBAAqB,EAAC,MAAM,sCAAsC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { AnimationLoop } from './lib/animation-loop';
|
|
2
2
|
export { RenderLoop } from './lib/render-loop';
|
|
3
3
|
export { default as Model } from './lib/model';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { PipelineFactory } from './lib/pipeline-factory';
|
|
5
|
+
export { Timeline } from './animation/timeline';
|
|
6
|
+
export { KeyFrames } from './animation/key-frames';
|
|
6
7
|
export { default as Geometry } from './geometry/geometry';
|
|
7
8
|
export { ConeGeometry } from './geometries/cone-geometry';
|
|
8
9
|
export { CubeGeometry } from './geometries/cube-geometry';
|
|
@@ -11,7 +12,4 @@ export { IcoSphereGeometry } from './geometries/ico-sphere-geometry';
|
|
|
11
12
|
export { PlaneGeometry } from './geometries/plane-geometry';
|
|
12
13
|
export { SphereGeometry } from './geometries/sphere-geometry';
|
|
13
14
|
export { TruncatedConeGeometry } from './geometries/truncated-cone-geometry';
|
|
14
|
-
export { Timeline } from './animation/timeline';
|
|
15
|
-
export { KeyFrames } from './animation/key-frames';
|
|
16
|
-
export { default as ClipSpace } from './utils/clip-space';
|
|
17
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["AnimationLoop","RenderLoop","default","Model","PipelineFactory","Timeline","KeyFrames","Geometry","ConeGeometry","CubeGeometry","CylinderGeometry","IcoSphereGeometry","PlaneGeometry","SphereGeometry","TruncatedConeGeometry"],"mappings":"AAGA,SAAQA,aAAR,QAA4B,sBAA5B;AACA,SAAQC,UAAR,QAAyB,mBAAzB;AAEA,SAAQC,OAAO,IAAIC,KAAnB,QAA+B,aAA/B;AAEA,SAAQC,eAAR,QAA8B,wBAA9B;AAGA,SAAQC,QAAR,QAAuB,sBAAvB;AACA,SAAQC,SAAR,QAAwB,wBAAxB;AAMA,SAAQJ,OAAO,IAAIK,QAAnB,QAAkC,qBAAlC;AAIA,SAAQC,YAAR,QAA2B,4BAA3B;AAEA,SAAQC,YAAR,QAA2B,4BAA3B;AAEA,SAAQC,gBAAR,QAA+B,gCAA/B;AAEA,SAAQC,iBAAR,QAAgC,kCAAhC;AAEA,SAAQC,aAAR,QAA4B,6BAA5B;AAEA,SAAQC,cAAR,QAA6B,8BAA7B;AAEA,SAAQC,qBAAR,QAAoC,sCAApC","sourcesContent":["// luma.gl Engine API\nexport type {AnimationProps} from './lib/animation-props';\nexport type {AnimationLoopProps} from './lib/animation-loop';\nexport {AnimationLoop} from './lib/animation-loop';\nexport {RenderLoop} from './lib/render-loop';\nexport type {ModelProps} from './lib/model';\nexport {default as Model} from './lib/model';\n\nexport {PipelineFactory} from './lib/pipeline-factory';\n\n// Animation\nexport {Timeline} from './animation/timeline';\nexport {KeyFrames} from './animation/key-frames';\n\n// Utils\n// export {default as ClipSpace} from './lib/clip-space';\n\n// Geometries\nexport {default as Geometry} from './geometry/geometry';\n\n// Primitives\nexport type {ConeGeometryProps} from './geometries/cone-geometry';\nexport {ConeGeometry} from './geometries/cone-geometry';\nexport type {CubeGeometryProps} from './geometries/cube-geometry';\nexport {CubeGeometry} from './geometries/cube-geometry';\nexport type {CylinderGeometryProps} from './geometries/cylinder-geometry';\nexport {CylinderGeometry} from './geometries/cylinder-geometry';\nexport type {IcoSphereGeometryProps} from './geometries/ico-sphere-geometry';\nexport {IcoSphereGeometry} from './geometries/ico-sphere-geometry';\nexport type {PlaneGeometryProps} from './geometries/plane-geometry';\nexport {PlaneGeometry} from './geometries/plane-geometry';\nexport type {SphereGeometryProps} from './geometries/sphere-geometry';\nexport {SphereGeometry} from './geometries/sphere-geometry';\nexport type {TruncatedConeGeometryProps} from './geometries/truncated-cone-geometry';\nexport {TruncatedConeGeometry} from './geometries/truncated-cone-geometry';\n\n"],"file":"index.js"}
|