@luma.gl/engine 9.0.0-alpha.16 → 9.0.0-alpha.19

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.
Files changed (188) hide show
  1. package/dist/animation/key-frames.d.ts +1 -1
  2. package/dist/animation/key-frames.d.ts.map +1 -1
  3. package/dist/animation/key-frames.js +55 -54
  4. package/dist/animation/key-frames.js.map +1 -0
  5. package/dist/animation/timeline.d.ts +4 -4
  6. package/dist/animation/timeline.d.ts.map +1 -1
  7. package/dist/animation/timeline.js +101 -94
  8. package/dist/animation/timeline.js.map +1 -0
  9. package/dist/animation-loop/animation-loop.d.ts +4 -2
  10. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  11. package/dist/animation-loop/animation-loop.js +358 -414
  12. package/dist/animation-loop/animation-loop.js.map +1 -0
  13. package/dist/animation-loop/animation-props.d.ts +3 -1
  14. package/dist/animation-loop/animation-props.d.ts.map +1 -1
  15. package/dist/animation-loop/animation-props.js +1 -0
  16. package/dist/animation-loop/animation-props.js.map +1 -0
  17. package/dist/animation-loop/make-animation-loop.d.ts +1 -1
  18. package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
  19. package/dist/animation-loop/make-animation-loop.js +25 -26
  20. package/dist/animation-loop/make-animation-loop.js.map +1 -0
  21. package/dist/animation-loop/render-loop.js +5 -17
  22. package/dist/animation-loop/render-loop.js.map +1 -0
  23. package/dist/dist.dev.js +12517 -0
  24. package/dist/geometries/cone-geometry.d.ts +1 -1
  25. package/dist/geometries/cone-geometry.d.ts.map +1 -1
  26. package/dist/geometries/cone-geometry.js +18 -12
  27. package/dist/geometries/cone-geometry.js.map +1 -0
  28. package/dist/geometries/cube-geometry.d.ts +1 -1
  29. package/dist/geometries/cube-geometry.d.ts.map +1 -1
  30. package/dist/geometries/cube-geometry.js +60 -187
  31. package/dist/geometries/cube-geometry.js.map +1 -0
  32. package/dist/geometries/cylinder-geometry.d.ts +1 -1
  33. package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
  34. package/dist/geometries/cylinder-geometry.js +15 -10
  35. package/dist/geometries/cylinder-geometry.js.map +1 -0
  36. package/dist/geometries/ico-sphere-geometry.d.ts +1 -1
  37. package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
  38. package/dist/geometries/ico-sphere-geometry.js +160 -141
  39. package/dist/geometries/ico-sphere-geometry.js.map +1 -0
  40. package/dist/geometries/plane-geometry.d.ts +1 -1
  41. package/dist/geometries/plane-geometry.d.ts.map +1 -1
  42. package/dist/geometries/plane-geometry.js +111 -93
  43. package/dist/geometries/plane-geometry.js.map +1 -0
  44. package/dist/geometries/sphere-geometry.d.ts +1 -1
  45. package/dist/geometries/sphere-geometry.d.ts.map +1 -1
  46. package/dist/geometries/sphere-geometry.js +95 -76
  47. package/dist/geometries/sphere-geometry.js.map +1 -0
  48. package/dist/geometries/truncated-cone-geometry.d.ts +1 -1
  49. package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
  50. package/dist/geometries/truncated-cone-geometry.js +126 -105
  51. package/dist/geometries/truncated-cone-geometry.js.map +1 -0
  52. package/dist/geometry/geometry-table.d.ts +1 -1
  53. package/dist/geometry/geometry-table.d.ts.map +1 -1
  54. package/dist/geometry/geometry-table.js +1 -0
  55. package/dist/geometry/geometry-table.js.map +1 -0
  56. package/dist/geometry/geometry-utils.js +32 -22
  57. package/dist/geometry/geometry-utils.js.map +1 -0
  58. package/dist/geometry/geometry.d.ts +4 -4
  59. package/dist/geometry/geometry.d.ts.map +1 -1
  60. package/dist/geometry/geometry.js +109 -96
  61. package/dist/geometry/geometry.js.map +1 -0
  62. package/dist/geometry/primitive-utils.js +1 -30
  63. package/dist/geometry/primitive-utils.js.map +1 -0
  64. package/dist/index.cjs +2268 -0
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +17 -20
  68. package/dist/index.js.map +1 -0
  69. package/dist/lib/clip-space.d.ts +8 -0
  70. package/dist/lib/clip-space.d.ts.map +1 -1
  71. package/dist/lib/clip-space.js +32 -45
  72. package/dist/lib/clip-space.js.map +1 -0
  73. package/dist/lib/model-utils.js +28 -101
  74. package/dist/lib/model-utils.js.map +1 -0
  75. package/dist/lib/model.d.ts +1 -1
  76. package/dist/lib/model.d.ts.map +1 -1
  77. package/dist/lib/model.js +129 -121
  78. package/dist/lib/model.js.map +1 -0
  79. package/dist/lib/pipeline-factory.d.ts +3 -3
  80. package/dist/lib/pipeline-factory.d.ts.map +1 -1
  81. package/dist/lib/pipeline-factory.js +165 -136
  82. package/dist/lib/pipeline-factory.js.map +1 -0
  83. package/dist.min.js +295 -0
  84. package/package.json +22 -13
  85. package/src/animation/timeline.ts +1 -1
  86. package/src/animation-loop/animation-loop.ts +5 -5
  87. package/src/animation-loop/make-animation-loop.ts +2 -1
  88. package/src/geometry/geometry.ts +2 -2
  89. package/src/index.ts +1 -1
  90. package/src/lib/clip-space.ts +14 -11
  91. package/src/lib/pipeline-factory.ts +1 -1
  92. package/dist/bundle.d.ts +0 -2
  93. package/dist/bundle.d.ts.map +0 -1
  94. package/dist/bundle.js +0 -5
  95. package/dist/dist.min.js +0 -31
  96. package/dist/es5/animation/key-frames.js +0 -84
  97. package/dist/es5/animation/key-frames.js.map +0 -1
  98. package/dist/es5/animation/timeline.js +0 -183
  99. package/dist/es5/animation/timeline.js.map +0 -1
  100. package/dist/es5/animation-loop/animation-loop.js +0 -534
  101. package/dist/es5/animation-loop/animation-loop.js.map +0 -1
  102. package/dist/es5/animation-loop/animation-props.js +0 -2
  103. package/dist/es5/animation-loop/animation-props.js.map +0 -1
  104. package/dist/es5/animation-loop/make-animation-loop.js +0 -53
  105. package/dist/es5/animation-loop/make-animation-loop.js.map +0 -1
  106. package/dist/es5/animation-loop/render-loop.js +0 -39
  107. package/dist/es5/animation-loop/render-loop.js.map +0 -1
  108. package/dist/es5/bundle.js +0 -6
  109. package/dist/es5/bundle.js.map +0 -1
  110. package/dist/es5/geometries/cone-geometry.js +0 -43
  111. package/dist/es5/geometries/cone-geometry.js.map +0 -1
  112. package/dist/es5/geometries/cube-geometry.js +0 -84
  113. package/dist/es5/geometries/cube-geometry.js.map +0 -1
  114. package/dist/es5/geometries/cylinder-geometry.js +0 -39
  115. package/dist/es5/geometries/cylinder-geometry.js.map +0 -1
  116. package/dist/es5/geometries/ico-sphere-geometry.js +0 -185
  117. package/dist/es5/geometries/ico-sphere-geometry.js.map +0 -1
  118. package/dist/es5/geometries/plane-geometry.js +0 -137
  119. package/dist/es5/geometries/plane-geometry.js.map +0 -1
  120. package/dist/es5/geometries/sphere-geometry.js +0 -120
  121. package/dist/es5/geometries/sphere-geometry.js.map +0 -1
  122. package/dist/es5/geometries/truncated-cone-geometry.js +0 -160
  123. package/dist/es5/geometries/truncated-cone-geometry.js.map +0 -1
  124. package/dist/es5/geometry/geometry-table.js +0 -2
  125. package/dist/es5/geometry/geometry-table.js.map +0 -1
  126. package/dist/es5/geometry/geometry-utils.js +0 -39
  127. package/dist/es5/geometry/geometry-utils.js.map +0 -1
  128. package/dist/es5/geometry/geometry.js +0 -150
  129. package/dist/es5/geometry/geometry.js.map +0 -1
  130. package/dist/es5/geometry/primitive-utils.js +0 -2
  131. package/dist/es5/geometry/primitive-utils.js.map +0 -1
  132. package/dist/es5/index.js +0 -112
  133. package/dist/es5/index.js.map +0 -1
  134. package/dist/es5/lib/clip-space.js +0 -2
  135. package/dist/es5/lib/clip-space.js.map +0 -1
  136. package/dist/es5/lib/model-utils.js +0 -52
  137. package/dist/es5/lib/model-utils.js.map +0 -1
  138. package/dist/es5/lib/model.js +0 -173
  139. package/dist/es5/lib/model.js.map +0 -1
  140. package/dist/es5/lib/pipeline-factory.js +0 -244
  141. package/dist/es5/lib/pipeline-factory.js.map +0 -1
  142. package/dist/esm/animation/key-frames.js +0 -57
  143. package/dist/esm/animation/key-frames.js.map +0 -1
  144. package/dist/esm/animation/timeline.js +0 -113
  145. package/dist/esm/animation/timeline.js.map +0 -1
  146. package/dist/esm/animation-loop/animation-loop.js +0 -367
  147. package/dist/esm/animation-loop/animation-loop.js.map +0 -1
  148. package/dist/esm/animation-loop/animation-props.js +0 -2
  149. package/dist/esm/animation-loop/animation-props.js.map +0 -1
  150. package/dist/esm/animation-loop/make-animation-loop.js +0 -28
  151. package/dist/esm/animation-loop/make-animation-loop.js.map +0 -1
  152. package/dist/esm/animation-loop/render-loop.js +0 -7
  153. package/dist/esm/animation-loop/render-loop.js.map +0 -1
  154. package/dist/esm/bundle.js +0 -4
  155. package/dist/esm/bundle.js.map +0 -1
  156. package/dist/esm/geometries/cone-geometry.js +0 -21
  157. package/dist/esm/geometries/cone-geometry.js.map +0 -1
  158. package/dist/esm/geometries/cube-geometry.js +0 -67
  159. package/dist/esm/geometries/cube-geometry.js.map +0 -1
  160. package/dist/esm/geometries/cylinder-geometry.js +0 -18
  161. package/dist/esm/geometries/cylinder-geometry.js.map +0 -1
  162. package/dist/esm/geometries/ico-sphere-geometry.js +0 -170
  163. package/dist/esm/geometries/ico-sphere-geometry.js.map +0 -1
  164. package/dist/esm/geometries/plane-geometry.js +0 -119
  165. package/dist/esm/geometries/plane-geometry.js.map +0 -1
  166. package/dist/esm/geometries/sphere-geometry.js +0 -102
  167. package/dist/esm/geometries/sphere-geometry.js.map +0 -1
  168. package/dist/esm/geometries/truncated-cone-geometry.js +0 -136
  169. package/dist/esm/geometries/truncated-cone-geometry.js.map +0 -1
  170. package/dist/esm/geometry/geometry-table.js +0 -2
  171. package/dist/esm/geometry/geometry-table.js.map +0 -1
  172. package/dist/esm/geometry/geometry-utils.js +0 -37
  173. package/dist/esm/geometry/geometry-utils.js.map +0 -1
  174. package/dist/esm/geometry/geometry.js +0 -119
  175. package/dist/esm/geometry/geometry.js.map +0 -1
  176. package/dist/esm/geometry/primitive-utils.js +0 -2
  177. package/dist/esm/geometry/primitive-utils.js.map +0 -1
  178. package/dist/esm/index.js +0 -16
  179. package/dist/esm/index.js.map +0 -1
  180. package/dist/esm/lib/clip-space.js +0 -2
  181. package/dist/esm/lib/clip-space.js.map +0 -1
  182. package/dist/esm/lib/model-utils.js +0 -40
  183. package/dist/esm/lib/model-utils.js.map +0 -1
  184. package/dist/esm/lib/model.js +0 -146
  185. package/dist/esm/lib/model.js.map +0 -1
  186. package/dist/esm/lib/pipeline-factory.js +0 -180
  187. package/dist/esm/lib/pipeline-factory.js.map +0 -1
  188. package/src/bundle.ts +0 -4
@@ -1,83 +1,102 @@
1
1
  import { uid } from '@luma.gl/api';
2
- import Geometry from '../geometry/geometry.js';
3
- // Primitives inspired by TDL http://code.google.com/p/webglsamples/,
4
- // copyright 2011 Google Inc. new BSD License
5
- // (http://www.opensource.org/licenses/bsd-license.php).
2
+ import Geometry from "../geometry/geometry.js";
6
3
  export class SphereGeometry extends Geometry {
7
- constructor(props = {}) {
8
- const { id = uid('sphere-geometry') } = props;
9
- const { indices, attributes } = tesselateSphere(props);
10
- super({
11
- ...props,
12
- id,
13
- indices,
14
- attributes: { ...attributes, ...props.attributes }
15
- });
16
- }
4
+ constructor() {
5
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6
+ const {
7
+ id = uid('sphere-geometry')
8
+ } = props;
9
+ const {
10
+ indices,
11
+ attributes
12
+ } = tesselateSphere(props);
13
+ super({
14
+ ...props,
15
+ id,
16
+ indices,
17
+ attributes: {
18
+ ...attributes,
19
+ ...props.attributes
20
+ }
21
+ });
22
+ }
17
23
  }
18
- /* eslint-disable max-statements, complexity */
19
24
  function tesselateSphere(props) {
20
- const { nlat = 10, nlong = 10 } = props;
21
- const startLat = 0;
22
- const endLat = Math.PI;
23
- const latRange = endLat - startLat;
24
- const startLong = 0;
25
- const endLong = 2 * Math.PI;
26
- const longRange = endLong - startLong;
27
- const numVertices = (nlat + 1) * (nlong + 1);
28
- const radius = (n1, n2, n3, u, v) => props.radius || 1;
29
- const positions = new Float32Array(numVertices * 3);
30
- const normals = new Float32Array(numVertices * 3);
31
- const texCoords = new Float32Array(numVertices * 2);
32
- const IndexType = numVertices > 0xffff ? Uint32Array : Uint16Array;
33
- const indices = new IndexType(nlat * nlong * 6);
34
- // Create positions, normals and texCoords
35
- for (let y = 0; y <= nlat; y++) {
36
- for (let x = 0; x <= nlong; x++) {
37
- const u = x / nlong;
38
- const v = y / nlat;
39
- const index = x + y * (nlong + 1);
40
- const i2 = index * 2;
41
- const i3 = index * 3;
42
- const theta = longRange * u;
43
- const phi = latRange * v;
44
- const sinTheta = Math.sin(theta);
45
- const cosTheta = Math.cos(theta);
46
- const sinPhi = Math.sin(phi);
47
- const cosPhi = Math.cos(phi);
48
- const ux = cosTheta * sinPhi;
49
- const uy = cosPhi;
50
- const uz = sinTheta * sinPhi;
51
- const r = radius(ux, uy, uz, u, v);
52
- positions[i3 + 0] = r * ux;
53
- positions[i3 + 1] = r * uy;
54
- positions[i3 + 2] = r * uz;
55
- normals[i3 + 0] = ux;
56
- normals[i3 + 1] = uy;
57
- normals[i3 + 2] = uz;
58
- texCoords[i2 + 0] = u;
59
- texCoords[i2 + 1] = 1 - v;
60
- }
25
+ const {
26
+ nlat = 10,
27
+ nlong = 10
28
+ } = props;
29
+ const startLat = 0;
30
+ const endLat = Math.PI;
31
+ const latRange = endLat - startLat;
32
+ const startLong = 0;
33
+ const endLong = 2 * Math.PI;
34
+ const longRange = endLong - startLong;
35
+ const numVertices = (nlat + 1) * (nlong + 1);
36
+ const radius = (n1, n2, n3, u, v) => props.radius || 1;
37
+ const positions = new Float32Array(numVertices * 3);
38
+ const normals = new Float32Array(numVertices * 3);
39
+ const texCoords = new Float32Array(numVertices * 2);
40
+ const IndexType = numVertices > 0xffff ? Uint32Array : Uint16Array;
41
+ const indices = new IndexType(nlat * nlong * 6);
42
+ for (let y = 0; y <= nlat; y++) {
43
+ for (let x = 0; x <= nlong; x++) {
44
+ const u = x / nlong;
45
+ const v = y / nlat;
46
+ const index = x + y * (nlong + 1);
47
+ const i2 = index * 2;
48
+ const i3 = index * 3;
49
+ const theta = longRange * u;
50
+ const phi = latRange * v;
51
+ const sinTheta = Math.sin(theta);
52
+ const cosTheta = Math.cos(theta);
53
+ const sinPhi = Math.sin(phi);
54
+ const cosPhi = Math.cos(phi);
55
+ const ux = cosTheta * sinPhi;
56
+ const uy = cosPhi;
57
+ const uz = sinTheta * sinPhi;
58
+ const r = radius(ux, uy, uz, u, v);
59
+ positions[i3 + 0] = r * ux;
60
+ positions[i3 + 1] = r * uy;
61
+ positions[i3 + 2] = r * uz;
62
+ normals[i3 + 0] = ux;
63
+ normals[i3 + 1] = uy;
64
+ normals[i3 + 2] = uz;
65
+ texCoords[i2 + 0] = u;
66
+ texCoords[i2 + 1] = 1 - v;
67
+ }
68
+ }
69
+ const numVertsAround = nlong + 1;
70
+ for (let x = 0; x < nlong; x++) {
71
+ for (let y = 0; y < nlat; y++) {
72
+ const index = (x * nlat + y) * 6;
73
+ indices[index + 0] = y * numVertsAround + x;
74
+ indices[index + 1] = y * numVertsAround + x + 1;
75
+ indices[index + 2] = (y + 1) * numVertsAround + x;
76
+ indices[index + 3] = (y + 1) * numVertsAround + x;
77
+ indices[index + 4] = y * numVertsAround + x + 1;
78
+ indices[index + 5] = (y + 1) * numVertsAround + x + 1;
61
79
  }
62
- // Create indices
63
- const numVertsAround = nlong + 1;
64
- for (let x = 0; x < nlong; x++) {
65
- for (let y = 0; y < nlat; y++) {
66
- const index = (x * nlat + y) * 6;
67
- indices[index + 0] = y * numVertsAround + x;
68
- indices[index + 1] = y * numVertsAround + x + 1;
69
- indices[index + 2] = (y + 1) * numVertsAround + x;
70
- indices[index + 3] = (y + 1) * numVertsAround + x;
71
- indices[index + 4] = y * numVertsAround + x + 1;
72
- indices[index + 5] = (y + 1) * numVertsAround + x + 1;
73
- }
80
+ }
81
+ return {
82
+ indices: {
83
+ size: 1,
84
+ value: indices
85
+ },
86
+ attributes: {
87
+ POSITION: {
88
+ size: 3,
89
+ value: positions
90
+ },
91
+ NORMAL: {
92
+ size: 3,
93
+ value: normals
94
+ },
95
+ TEXCOORD_0: {
96
+ size: 2,
97
+ value: texCoords
98
+ }
74
99
  }
75
- return {
76
- indices: { size: 1, value: indices },
77
- attributes: {
78
- POSITION: { size: 3, value: positions },
79
- NORMAL: { size: 3, value: normals },
80
- TEXCOORD_0: { size: 2, value: texCoords }
81
- }
82
- };
100
+ };
83
101
  }
102
+ //# sourceMappingURL=sphere-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sphere-geometry.js","names":["uid","Geometry","SphereGeometry","constructor","props","arguments","length","undefined","id","indices","attributes","tesselateSphere","nlat","nlong","startLat","endLat","Math","PI","latRange","startLong","endLong","longRange","numVertices","radius","n1","n2","n3","u","v","positions","Float32Array","normals","texCoords","IndexType","Uint32Array","Uint16Array","y","x","index","i2","i3","theta","phi","sinTheta","sin","cosTheta","cos","sinPhi","cosPhi","ux","uy","uz","r","numVertsAround","size","value","POSITION","NORMAL","TEXCOORD_0"],"sources":["../../src/geometries/sphere-geometry.ts"],"sourcesContent":["import {uid} from '@luma.gl/api';\nimport Geometry from '../geometry/geometry';\n\nexport type SphereGeometryProps = {\n id?: string;\n radius?: number;\n nlat?: number;\n nlong?: number;\n attributes?: any\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 SphereGeometry extends Geometry {\n constructor(props: SphereGeometryProps = {}) {\n const {id = uid('sphere-geometry')} = props;\n const {indices, attributes} = tesselateSphere(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 tesselateSphere(props: SphereGeometryProps) {\n const {nlat = 10, nlong = 10} = props;\n\n const startLat = 0;\n const endLat = Math.PI;\n const latRange = endLat - startLat;\n const startLong = 0;\n const endLong = 2 * Math.PI;\n const longRange = endLong - startLong;\n const numVertices = (nlat + 1) * (nlong + 1);\n\n const radius = (n1: number, n2: number, n3: number, u: number, v: number) => props.radius || 1;\n\n const positions = new Float32Array(numVertices * 3);\n const normals = new Float32Array(numVertices * 3);\n const texCoords = new Float32Array(numVertices * 2);\n\n const IndexType = numVertices > 0xffff ? Uint32Array : Uint16Array;\n const indices = new IndexType(nlat * nlong * 6);\n\n // Create positions, normals and texCoords\n for (let y = 0; y <= nlat; y++) {\n for (let x = 0; x <= nlong; x++) {\n const u = x / nlong;\n const v = y / nlat;\n\n const index = x + y * (nlong + 1);\n const i2 = index * 2;\n const i3 = index * 3;\n\n const theta = longRange * u;\n const phi = latRange * v;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n\n const r = radius(ux, uy, uz, u, v);\n\n positions[i3 + 0] = r * ux;\n positions[i3 + 1] = r * uy;\n positions[i3 + 2] = r * uz;\n\n normals[i3 + 0] = ux;\n normals[i3 + 1] = uy;\n normals[i3 + 2] = uz;\n\n texCoords[i2 + 0] = u;\n texCoords[i2 + 1] = 1 - v;\n }\n }\n\n // Create indices\n const numVertsAround = nlong + 1;\n for (let x = 0; x < nlong; x++) {\n for (let y = 0; y < nlat; y++) {\n const index = (x * nlat + y) * 6;\n\n indices[index + 0] = y * numVertsAround + x;\n indices[index + 1] = y * numVertsAround + x + 1;\n indices[index + 2] = (y + 1) * numVertsAround + x;\n\n indices[index + 3] = (y + 1) * numVertsAround + x;\n indices[index + 4] = y * numVertsAround + x + 1;\n indices[index + 5] = (y + 1) * numVertsAround + x + 1;\n }\n }\n\n return {\n indices: {size: 1, value: 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"],"mappings":"AAAA,SAAQA,GAAG,QAAO,cAAc;AAAC,OAC1BC,QAAQ;AAaf,OAAO,MAAMC,cAAc,SAASD,QAAQ,CAAC;EAC3CE,WAAWA,CAAA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AO,CAAC6B,KAAK,GAAG,CAAC,CAAC,GAAGF,CAAC,GAAGiB,cAAc,GAAGhB,CAAC,GAAG,CAAC;MAC/C5B,OAAO,CAAC6B,KAAK,GAAG,CAAC,CAAC,GAAG,CAACF,CAAC,GAAG,CAAC,IAAIiB,cAAc,GAAGhB,CAAC,GAAG,CAAC;IACvD;EACF;EAEA,OAAO;IACL5B,OAAO,EAAE;MAAC6C,IAAI,EAAE,CAAC;MAAEC,KAAK,EAAE9C;IAAO,CAAC;IAClCC,UAAU,EAAE;MACV8C,QAAQ,EAAE;QAACF,IAAI,EAAE,CAAC;QAAEC,KAAK,EAAE1B;MAAS,CAAC;MACrC4B,MAAM,EAAE;QAACH,IAAI,EAAE,CAAC;QAAEC,KAAK,EAAExB;MAAO,CAAC;MACjC2B,UAAU,EAAE;QAACJ,IAAI,EAAE,CAAC;QAAEC,KAAK,EAAEvB;MAAS;IACxC;EACF,CAAC;AACH"}
@@ -1,6 +1,6 @@
1
1
  import Geometry from '../geometry/geometry';
2
2
  import { GeometryTable } from '../geometry/geometry-table';
3
- export type TruncatedConeGeometryProps = {
3
+ export declare type TruncatedConeGeometryProps = {
4
4
  topRadius?: number;
5
5
  bottomRadius?: number;
6
6
  topCap?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"truncated-cone-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAQzD,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,EAAE,0BAA0B,GAAG,aAAa,CAO3F;AAED,qBAAa,qBAAsB,SAAQ,QAAQ;gBACrC,KAAK,GAAE,0BAA0B,GAAG;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,GAAG,CAAA;KAAM;CAcrF"}
1
+ {"version":3,"file":"truncated-cone-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAQzD,oBAAY,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,EAAE,0BAA0B,GAAG,aAAa,CAO3F;AAED,qBAAa,qBAAsB,SAAQ,QAAQ;gBACrC,KAAK,GAAE,0BAA0B,GAAG;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,GAAG,CAAA;KAAM;CAcrF"}
@@ -1,115 +1,136 @@
1
1
  import { uid } from '@luma.gl/api';
2
- import Geometry from '../geometry/geometry.js';
2
+ import Geometry from "../geometry/geometry.js";
3
3
  const INDEX_OFFSETS = {
4
- x: [2, 0, 1],
5
- y: [0, 1, 2],
6
- z: [1, 2, 0]
4
+ x: [2, 0, 1],
5
+ y: [0, 1, 2],
6
+ z: [1, 2, 0]
7
7
  };
8
- /**
9
- * Primitives inspired by TDL http://code.google.com/p/webglsamples/,
10
- * copyright 2011 Google Inc. new BSD License
11
- * (http://www.opensource.org/licenses/bsd-license.php).
12
- */
13
8
  export function makeTruncatedConeGeometry(props) {
14
- const { indices, attributes } = tesselateTruncatedCone(props);
15
- return {
16
- length: indices.length,
17
- indices,
18
- attributes
19
- };
9
+ const {
10
+ indices,
11
+ attributes
12
+ } = tesselateTruncatedCone(props);
13
+ return {
14
+ length: indices.length,
15
+ indices,
16
+ attributes
17
+ };
20
18
  }
21
19
  export class TruncatedConeGeometry extends Geometry {
22
- constructor(props = {}) {
23
- const { id = uid('truncated-code-geometry') } = props;
24
- const { indices, attributes } = tesselateTruncatedCone(props);
25
- super({
26
- ...props,
27
- id,
28
- indices,
29
- attributes: {
30
- POSITION: { size: 3, value: attributes.POSITION },
31
- NORMAL: { size: 3, value: attributes.NORMAL },
32
- TEXCOORD_0: { size: 2, value: attributes.TEXCOORD_0 },
33
- ...props.attributes
34
- }
35
- });
36
- }
20
+ constructor() {
21
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
22
+ const {
23
+ id = uid('truncated-code-geometry')
24
+ } = props;
25
+ const {
26
+ indices,
27
+ attributes
28
+ } = tesselateTruncatedCone(props);
29
+ super({
30
+ ...props,
31
+ id,
32
+ indices,
33
+ attributes: {
34
+ POSITION: {
35
+ size: 3,
36
+ value: attributes.POSITION
37
+ },
38
+ NORMAL: {
39
+ size: 3,
40
+ value: attributes.NORMAL
41
+ },
42
+ TEXCOORD_0: {
43
+ size: 2,
44
+ value: attributes.TEXCOORD_0
45
+ },
46
+ ...props.attributes
47
+ }
48
+ });
49
+ }
37
50
  }
38
- /* eslint-disable max-statements, complexity */
39
- function tesselateTruncatedCone(props = {}) {
40
- const { bottomRadius = 0, topRadius = 0, height = 1, nradial = 10, nvertical = 10, verticalAxis = 'y', topCap = false, bottomCap = false } = props;
41
- const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);
42
- const numVertices = (nradial + 1) * (nvertical + 1 + extra);
43
- const slant = Math.atan2(bottomRadius - topRadius, height);
44
- const msin = Math.sin;
45
- const mcos = Math.cos;
46
- const mpi = Math.PI;
47
- const cosSlant = mcos(slant);
48
- const sinSlant = msin(slant);
49
- const start = topCap ? -2 : 0;
50
- const end = nvertical + (bottomCap ? 2 : 0);
51
- const vertsAroundEdge = nradial + 1;
52
- const indices = new Uint16Array(nradial * (nvertical + extra) * 6);
53
- const indexOffset = INDEX_OFFSETS[verticalAxis];
54
- const positions = new Float32Array(numVertices * 3);
55
- const normals = new Float32Array(numVertices * 3);
56
- const texCoords = new Float32Array(numVertices * 2);
57
- let i3 = 0;
58
- let i2 = 0;
59
- for (let i = start; i <= end; i++) {
60
- let v = i / nvertical;
61
- let y = height * v;
62
- let ringRadius;
63
- if (i < 0) {
64
- y = 0;
65
- v = 1;
66
- ringRadius = bottomRadius;
67
- }
68
- else if (i > nvertical) {
69
- y = height;
70
- v = 1;
71
- ringRadius = topRadius;
72
- }
73
- else {
74
- ringRadius = bottomRadius + (topRadius - bottomRadius) * (i / nvertical);
75
- }
76
- if (i === -2 || i === nvertical + 2) {
77
- ringRadius = 0;
78
- v = 0;
79
- }
80
- y -= height / 2;
81
- for (let j = 0; j < vertsAroundEdge; j++) {
82
- const sin = msin((j * mpi * 2) / nradial);
83
- const cos = mcos((j * mpi * 2) / nradial);
84
- positions[i3 + indexOffset[0]] = sin * ringRadius;
85
- positions[i3 + indexOffset[1]] = y;
86
- positions[i3 + indexOffset[2]] = cos * ringRadius;
87
- normals[i3 + indexOffset[0]] = i < 0 || i > nvertical ? 0 : sin * cosSlant;
88
- normals[i3 + indexOffset[1]] = i < 0 ? -1 : i > nvertical ? 1 : sinSlant;
89
- normals[i3 + indexOffset[2]] = i < 0 || i > nvertical ? 0 : cos * cosSlant;
90
- texCoords[i2 + 0] = j / nradial;
91
- texCoords[i2 + 1] = v;
92
- i2 += 2;
93
- i3 += 3;
94
- }
51
+ function tesselateTruncatedCone() {
52
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
53
+ const {
54
+ bottomRadius = 0,
55
+ topRadius = 0,
56
+ height = 1,
57
+ nradial = 10,
58
+ nvertical = 10,
59
+ verticalAxis = 'y',
60
+ topCap = false,
61
+ bottomCap = false
62
+ } = props;
63
+ const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);
64
+ const numVertices = (nradial + 1) * (nvertical + 1 + extra);
65
+ const slant = Math.atan2(bottomRadius - topRadius, height);
66
+ const msin = Math.sin;
67
+ const mcos = Math.cos;
68
+ const mpi = Math.PI;
69
+ const cosSlant = mcos(slant);
70
+ const sinSlant = msin(slant);
71
+ const start = topCap ? -2 : 0;
72
+ const end = nvertical + (bottomCap ? 2 : 0);
73
+ const vertsAroundEdge = nradial + 1;
74
+ const indices = new Uint16Array(nradial * (nvertical + extra) * 6);
75
+ const indexOffset = INDEX_OFFSETS[verticalAxis];
76
+ const positions = new Float32Array(numVertices * 3);
77
+ const normals = new Float32Array(numVertices * 3);
78
+ const texCoords = new Float32Array(numVertices * 2);
79
+ let i3 = 0;
80
+ let i2 = 0;
81
+ for (let i = start; i <= end; i++) {
82
+ let v = i / nvertical;
83
+ let y = height * v;
84
+ let ringRadius;
85
+ if (i < 0) {
86
+ y = 0;
87
+ v = 1;
88
+ ringRadius = bottomRadius;
89
+ } else if (i > nvertical) {
90
+ y = height;
91
+ v = 1;
92
+ ringRadius = topRadius;
93
+ } else {
94
+ ringRadius = bottomRadius + (topRadius - bottomRadius) * (i / nvertical);
95
+ }
96
+ if (i === -2 || i === nvertical + 2) {
97
+ ringRadius = 0;
98
+ v = 0;
99
+ }
100
+ y -= height / 2;
101
+ for (let j = 0; j < vertsAroundEdge; j++) {
102
+ const sin = msin(j * mpi * 2 / nradial);
103
+ const cos = mcos(j * mpi * 2 / nradial);
104
+ positions[i3 + indexOffset[0]] = sin * ringRadius;
105
+ positions[i3 + indexOffset[1]] = y;
106
+ positions[i3 + indexOffset[2]] = cos * ringRadius;
107
+ normals[i3 + indexOffset[0]] = i < 0 || i > nvertical ? 0 : sin * cosSlant;
108
+ normals[i3 + indexOffset[1]] = i < 0 ? -1 : i > nvertical ? 1 : sinSlant;
109
+ normals[i3 + indexOffset[2]] = i < 0 || i > nvertical ? 0 : cos * cosSlant;
110
+ texCoords[i2 + 0] = j / nradial;
111
+ texCoords[i2 + 1] = v;
112
+ i2 += 2;
113
+ i3 += 3;
114
+ }
115
+ }
116
+ for (let i = 0; i < nvertical + extra; i++) {
117
+ for (let j = 0; j < nradial; j++) {
118
+ const index = (i * nradial + j) * 6;
119
+ indices[index + 0] = vertsAroundEdge * (i + 0) + 0 + j;
120
+ indices[index + 1] = vertsAroundEdge * (i + 0) + 1 + j;
121
+ indices[index + 2] = vertsAroundEdge * (i + 1) + 1 + j;
122
+ indices[index + 3] = vertsAroundEdge * (i + 0) + 0 + j;
123
+ indices[index + 4] = vertsAroundEdge * (i + 1) + 1 + j;
124
+ indices[index + 5] = vertsAroundEdge * (i + 1) + 0 + j;
95
125
  }
96
- for (let i = 0; i < nvertical + extra; i++) {
97
- for (let j = 0; j < nradial; j++) {
98
- const index = (i * nradial + j) * 6;
99
- indices[index + 0] = vertsAroundEdge * (i + 0) + 0 + j;
100
- indices[index + 1] = vertsAroundEdge * (i + 0) + 1 + j;
101
- indices[index + 2] = vertsAroundEdge * (i + 1) + 1 + j;
102
- indices[index + 3] = vertsAroundEdge * (i + 0) + 0 + j;
103
- indices[index + 4] = vertsAroundEdge * (i + 1) + 1 + j;
104
- indices[index + 5] = vertsAroundEdge * (i + 1) + 0 + j;
105
- }
126
+ }
127
+ return {
128
+ indices,
129
+ attributes: {
130
+ POSITION: positions,
131
+ NORMAL: normals,
132
+ TEXCOORD_0: texCoords
106
133
  }
107
- return {
108
- indices,
109
- attributes: {
110
- POSITION: positions,
111
- NORMAL: normals,
112
- TEXCOORD_0: texCoords
113
- }
114
- };
134
+ };
115
135
  }
136
+ //# sourceMappingURL=truncated-cone-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncated-cone-geometry.js","names":["uid","Geometry","INDEX_OFFSETS","x","y","z","makeTruncatedConeGeometry","props","indices","attributes","tesselateTruncatedCone","length","TruncatedConeGeometry","constructor","arguments","undefined","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"],"sources":["../../src/geometries/truncated-cone-geometry.ts"],"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?: any} = {}) {\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"],"mappings":"AAAA,SAAQA,GAAG,QAAO,cAAc;AAAC,OAC1BC,QAAQ;AAGf,MAAMC,aAAa,GAAG;EACpBC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACZC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACZC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACb,CAAC;AAkBD,OAAO,SAASC,yBAAyBA,CAACC,KAAkC,EAAiB;EAC3F,MAAM;IAACC,OAAO;IAAEC;EAAU,CAAC,GAAGC,sBAAsB,CAACH,KAAK,CAAC;EAC3D,OAAO;IACLI,MAAM,EAAEH,OAAO,CAACG,MAAM;IACtBH,OAAO;IACPC;EACF,CAAC;AACH;AAEA,OAAO,MAAMG,qBAAqB,SAASX,QAAQ,CAAC;EAClDY,WAAWA,CAAA,EAA2E;IAAA,IAA1EN,KAA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AAIS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAGG,CAAC;MACtDjD,OAAO,CAACkD,KAAK,GAAG,CAAC,CAAC,GAAGb,eAAe,IAAIS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAGG,CAAC;IACxD;EACF;EAEA,OAAO;IACLjD,OAAO;IACPC,UAAU,EAAE;MACVQ,QAAQ,EAAE+B,SAAS;MACnB5B,MAAM,EAAE8B,OAAO;MACf7B,UAAU,EAAE8B;IACd;EACF,CAAC;AACH"}
@@ -1,6 +1,6 @@
1
1
  import type { TypedArray, VertexFormat } from '@luma.gl/api';
2
2
  /** Holds one geometry */
3
- export type GeometryTable = {
3
+ export declare type GeometryTable = {
4
4
  length: number;
5
5
  schema?: Record<string, VertexFormat>;
6
6
  attributes: {
@@ -1 +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,MAAM,MAAM,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
+ {"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,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=geometry-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry-table.js","names":[],"sources":["../../src/geometry/geometry-table.ts"],"sourcesContent":["// luma.gl, MIT license\nimport type {TypedArray, VertexFormat} from '@luma.gl/api';\n\n/** Holds one geometry */\nexport type GeometryTable = {\n length: number;\n schema?: Record<string, VertexFormat>;\n attributes: {\n POSITION: TypedArray,\n NORMAL: TypedArray,\n TEXCOORD_0: TypedArray,\n [key: string]: TypedArray,\n };\n indices?: Uint16Array | Uint32Array;\n topology?: 'point-list' | 'line-list' | 'line-strip' | 'triangle-list' | 'triangle-strip';\n}\n"],"mappings":""}
@@ -1,27 +1,37 @@
1
- // import type Geometry from './geometry.js';
2
1
  export function unpackIndexedGeometry(geometry) {
3
- const { indices, attributes } = geometry;
4
- if (!indices) {
5
- return geometry;
2
+ const {
3
+ indices,
4
+ attributes
5
+ } = geometry;
6
+ if (!indices) {
7
+ return geometry;
8
+ }
9
+ const vertexCount = indices.value.length;
10
+ const unpackedAttributes = {};
11
+ for (const attributeName in attributes) {
12
+ const attribute = attributes[attributeName];
13
+ const {
14
+ constant,
15
+ value,
16
+ size
17
+ } = attribute;
18
+ if (constant || !size) {
19
+ continue;
6
20
  }
7
- const vertexCount = indices.value.length;
8
- const unpackedAttributes = {};
9
- for (const attributeName in attributes) {
10
- const attribute = attributes[attributeName];
11
- const { constant, value, size } = attribute;
12
- if (constant || !size) {
13
- continue; // eslint-disable-line
14
- }
15
- const unpackedValue = new value.constructor(vertexCount * size);
16
- for (let x = 0; x < vertexCount; ++x) {
17
- const index = indices.value[x];
18
- for (let i = 0; i < size; i++) {
19
- unpackedValue[x * size + i] = value[index * size + i];
20
- }
21
- }
22
- unpackedAttributes[attributeName] = { size, value: unpackedValue };
21
+ const unpackedValue = new value.constructor(vertexCount * size);
22
+ for (let x = 0; x < vertexCount; ++x) {
23
+ const index = indices.value[x];
24
+ for (let i = 0; i < size; i++) {
25
+ unpackedValue[x * size + i] = value[index * size + i];
26
+ }
23
27
  }
24
- return {
25
- attributes: Object.assign({}, attributes, unpackedAttributes)
28
+ unpackedAttributes[attributeName] = {
29
+ size,
30
+ value: unpackedValue
26
31
  };
32
+ }
33
+ return {
34
+ attributes: Object.assign({}, attributes, unpackedAttributes)
35
+ };
27
36
  }
37
+ //# sourceMappingURL=geometry-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry-utils.js","names":["unpackIndexedGeometry","geometry","indices","attributes","vertexCount","value","length","unpackedAttributes","attributeName","attribute","constant","size","unpackedValue","constructor","x","index","i","Object","assign"],"sources":["../../src/geometry/geometry-utils.ts"],"sourcesContent":["// import type Geometry from './geometry';\n\nexport function unpackIndexedGeometry(geometry: any) {\n const {indices, attributes} = geometry;\n if (!indices) {\n return geometry;\n }\n\n const vertexCount = indices.value.length;\n const unpackedAttributes: Record<string, any> = {};\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"],"mappings":"AAEA,OAAO,SAASA,qBAAqBA,CAACC,QAAa,EAAE;EACnD,MAAM;IAACC,OAAO;IAAEC;EAAU,CAAC,GAAGF,QAAQ;EACtC,IAAI,CAACC,OAAO,EAAE;IACZ,OAAOD,QAAQ;EACjB;EAEA,MAAMG,WAAW,GAAGF,OAAO,CAACG,KAAK,CAACC,MAAM;EACxC,MAAMC,kBAAuC,GAAG,CAAC,CAAC;EAElD,KAAK,MAAMC,aAAa,IAAIL,UAAU,EAAE;IACtC,MAAMM,SAAS,GAAGN,UAAU,CAACK,aAAa,CAAC;IAC3C,MAAM;MAACE,QAAQ;MAAEL,KAAK;MAAEM;IAAI,CAAC,GAAGF,SAAS;IACzC,IAAIC,QAAQ,IAAI,CAACC,IAAI,EAAE;MACrB;IACF;IACA,MAAMC,aAAa,GAAG,IAAIP,KAAK,CAACQ,WAAW,CAACT,WAAW,GAAGO,IAAI,CAAC;IAC/D,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGV,WAAW,EAAE,EAAEU,CAAC,EAAE;MACpC,MAAMC,KAAK,GAAGb,OAAO,CAACG,KAAK,CAACS,CAAC,CAAC;MAC9B,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,IAAI,EAAEK,CAAC,EAAE,EAAE;QAC7BJ,aAAa,CAACE,CAAC,GAAGH,IAAI,GAAGK,CAAC,CAAC,GAAGX,KAAK,CAACU,KAAK,GAAGJ,IAAI,GAAGK,CAAC,CAAC;MACvD;IACF;IACAT,kBAAkB,CAACC,aAAa,CAAC,GAAG;MAACG,IAAI;MAAEN,KAAK,EAAEO;IAAa,CAAC;EAClE;EAEA,OAAO;IACLT,UAAU,EAAEc,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEf,UAAU,EAAEI,kBAAkB;EAC9D,CAAC;AACH"}
@@ -4,19 +4,19 @@ import GL from '@luma.gl/constants';
4
4
  * Rendering primitives - "topology" specifies how to extract primitives from vertices.
5
5
  * @deprecated - use string constants instead
6
6
  */
7
- export type GLTopology = GL.POINTS | // draw single points.
7
+ export declare type GLTopology = GL.POINTS | // draw single points.
8
8
  GL.LINES | // draw lines. Each vertex connects to the one after it.
9
9
  GL.LINE_LOOP | // draw lines. Each set of two vertices is treated as a separate line segment.
10
10
  GL.LINE_STRIP | // draw a connected group of line segments from the first vertex to the last
11
11
  GL.TRIANGLES | // draw triangles. Each set of three vertices creates a separate triangle.
12
12
  GL.TRIANGLE_STRIP | // draw a connected group of triangles.
13
13
  GL.TRIANGLE_FAN;
14
- export type GeometryAttribute = {
14
+ export declare type GeometryAttribute = {
15
15
  size?: number;
16
16
  value: TypedArray;
17
17
  [key: string]: any;
18
18
  };
19
- export type GeometryProps = {
19
+ export declare type GeometryProps = {
20
20
  id?: string;
21
21
  attributes?: Record<string, GeometryAttribute | TypedArray>;
22
22
  indices?: GeometryAttribute | TypedArray;
@@ -26,7 +26,7 @@ export type GeometryProps = {
26
26
  /** @deprecated */
27
27
  drawMode?: GLTopology;
28
28
  };
29
- type GeometryAttributes = {
29
+ declare type GeometryAttributes = {
30
30
  POSITION: GeometryAttribute;
31
31
  NORMAL: GeometryAttribute;
32
32
  TEXCOORD_0: GeometryAttribute;
@@ -1 +1 @@
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,MAAM,MAAM,UAAU,GACpB,EAAE,CAAC,MAAM,GAAI,sBAAsB;AACnC,EAAE,CAAC,KAAK,GAAI,wDAAwD;AACpE,EAAE,CAAC,SAA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