@luma.gl/engine 9.0.11 → 9.1.0-alpha.2

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 (138) hide show
  1. package/LICENSE +34 -0
  2. package/dist/animation/key-frames.d.ts.map +1 -1
  3. package/dist/animation/key-frames.js +3 -0
  4. package/dist/animation-loop/animation-loop-template.d.ts.map +1 -1
  5. package/dist/animation-loop/animation-loop-template.js +3 -0
  6. package/dist/animation-loop/animation-loop.d.ts +1 -1
  7. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  8. package/dist/animation-loop/animation-loop.js +5 -4
  9. package/dist/animation-loop/animation-props.d.ts.map +1 -1
  10. package/dist/animation-loop/animation-props.js +3 -0
  11. package/dist/animation-loop/request-animation-frame.d.ts +3 -0
  12. package/dist/animation-loop/request-animation-frame.d.ts.map +1 -0
  13. package/dist/animation-loop/request-animation-frame.js +16 -0
  14. package/dist/application-utils/load-file.d.ts +22 -0
  15. package/dist/application-utils/load-file.d.ts.map +1 -0
  16. package/dist/application-utils/load-file.js +43 -0
  17. package/dist/application-utils/random.d.ts +3 -0
  18. package/dist/application-utils/random.d.ts.map +1 -0
  19. package/dist/application-utils/random.js +16 -0
  20. package/dist/async-texture/async-texture.d.ts +50 -0
  21. package/dist/async-texture/async-texture.d.ts.map +1 -0
  22. package/dist/async-texture/async-texture.js +77 -0
  23. package/dist/computation.d.ts +4 -3
  24. package/dist/computation.d.ts.map +1 -1
  25. package/dist/computation.js +14 -6
  26. package/dist/debug/copy-texture-to-image.d.ts.map +1 -1
  27. package/dist/debug/copy-texture-to-image.js +4 -1
  28. package/dist/debug/debug-framebuffer.d.ts.map +1 -1
  29. package/dist/debug/debug-framebuffer.js +17 -12
  30. package/dist/debug/pixel-data-utils.d.ts +1 -1
  31. package/dist/dist.dev.js +1291 -648
  32. package/dist/dist.min.js +30 -28
  33. package/dist/geometries/cone-geometry.d.ts.map +1 -1
  34. package/dist/geometries/cone-geometry.js +4 -1
  35. package/dist/geometries/cube-geometry.d.ts.map +1 -1
  36. package/dist/geometries/cube-geometry.js +4 -1
  37. package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
  38. package/dist/geometries/cylinder-geometry.js +4 -1
  39. package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
  40. package/dist/geometries/ico-sphere-geometry.js +4 -1
  41. package/dist/geometries/plane-geometry.d.ts.map +1 -1
  42. package/dist/geometries/plane-geometry.js +4 -1
  43. package/dist/geometries/sphere-geometry.d.ts.map +1 -1
  44. package/dist/geometries/sphere-geometry.js +4 -1
  45. package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
  46. package/dist/geometries/truncated-cone-geometry.js +4 -1
  47. package/dist/geometry/geometry-table.d.ts +2 -1
  48. package/dist/geometry/geometry-table.d.ts.map +1 -1
  49. package/dist/geometry/geometry-utils.d.ts.map +1 -1
  50. package/dist/geometry/geometry-utils.js +3 -1
  51. package/dist/geometry/geometry.d.ts +5 -4
  52. package/dist/geometry/geometry.d.ts.map +1 -1
  53. package/dist/geometry/geometry.js +9 -5
  54. package/dist/geometry/gpu-geometry.d.ts +1 -1
  55. package/dist/geometry/gpu-geometry.d.ts.map +1 -1
  56. package/dist/geometry/gpu-geometry.js +18 -6
  57. package/dist/geometry/gpu-table.js +3 -0
  58. package/dist/index.cjs +491 -244
  59. package/dist/index.cjs.map +4 -4
  60. package/dist/index.d.ts +5 -0
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +8 -0
  63. package/dist/lib/clip-space.d.ts.map +1 -1
  64. package/dist/lib/clip-space.js +3 -0
  65. package/dist/lib/pipeline-factory.d.ts +3 -2
  66. package/dist/lib/pipeline-factory.d.ts.map +1 -1
  67. package/dist/lib/pipeline-factory.js +12 -8
  68. package/dist/lib/shader-factory.d.ts +3 -2
  69. package/dist/lib/shader-factory.d.ts.map +1 -1
  70. package/dist/lib/shader-factory.js +11 -4
  71. package/dist/model/model.d.ts +10 -6
  72. package/dist/model/model.d.ts.map +1 -1
  73. package/dist/model/model.js +65 -8
  74. package/dist/model/split-uniforms-and-bindings.d.ts +9 -0
  75. package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -0
  76. package/dist/model/split-uniforms-and-bindings.js +20 -0
  77. package/dist/scenegraph/group-node.d.ts +1 -1
  78. package/dist/scenegraph/group-node.d.ts.map +1 -1
  79. package/dist/scenegraph/group-node.js +3 -0
  80. package/dist/scenegraph/model-node.d.ts +2 -2
  81. package/dist/scenegraph/model-node.d.ts.map +1 -1
  82. package/dist/scenegraph/model-node.js +6 -3
  83. package/dist/scenegraph/scenegraph-node.d.ts +5 -6
  84. package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
  85. package/dist/scenegraph/scenegraph-node.js +11 -8
  86. package/dist/shader-inputs.d.ts +2 -3
  87. package/dist/shader-inputs.d.ts.map +1 -1
  88. package/dist/shader-inputs.js +7 -5
  89. package/dist/transform/buffer-transform.d.ts.map +1 -1
  90. package/dist/transform/buffer-transform.js +8 -2
  91. package/dist/transform/texture-transform.d.ts +2 -2
  92. package/dist/transform/texture-transform.d.ts.map +1 -1
  93. package/dist/transform/texture-transform.js +1 -0
  94. package/dist/utils/deep-equal.d.ts +9 -0
  95. package/dist/utils/deep-equal.d.ts.map +1 -0
  96. package/dist/utils/deep-equal.js +50 -0
  97. package/dist/utils/uid.d.ts +7 -0
  98. package/dist/utils/uid.d.ts.map +1 -0
  99. package/dist/utils/uid.js +14 -0
  100. package/package.json +7 -6
  101. package/src/animation/key-frames.ts +4 -0
  102. package/src/animation-loop/animation-loop-template.ts +4 -0
  103. package/src/animation-loop/animation-loop.ts +6 -4
  104. package/src/animation-loop/animation-props.ts +4 -0
  105. package/src/animation-loop/request-animation-frame.ts +19 -0
  106. package/src/application-utils/load-file.ts +53 -0
  107. package/src/application-utils/random.ts +18 -0
  108. package/src/async-texture/async-texture.ts +140 -0
  109. package/src/computation.ts +17 -9
  110. package/src/debug/copy-texture-to-image.ts +4 -1
  111. package/src/debug/debug-framebuffer.ts +18 -12
  112. package/src/debug/pixel-data-utils.ts +1 -1
  113. package/src/geometries/cone-geometry.ts +5 -1
  114. package/src/geometries/cube-geometry.ts +5 -1
  115. package/src/geometries/cylinder-geometry.ts +5 -1
  116. package/src/geometries/ico-sphere-geometry.ts +5 -1
  117. package/src/geometries/plane-geometry.ts +5 -1
  118. package/src/geometries/sphere-geometry.ts +5 -1
  119. package/src/geometries/truncated-cone-geometry.ts +5 -1
  120. package/src/geometry/geometry-table.ts +2 -1
  121. package/src/geometry/geometry-utils.ts +3 -1
  122. package/src/geometry/geometry.ts +16 -19
  123. package/src/geometry/gpu-geometry.ts +20 -14
  124. package/src/geometry/gpu-table.ts +4 -0
  125. package/src/index.ts +15 -0
  126. package/src/lib/clip-space.ts +4 -0
  127. package/src/lib/pipeline-factory.ts +17 -16
  128. package/src/lib/shader-factory.ts +13 -6
  129. package/src/model/model.ts +71 -17
  130. package/src/model/split-uniforms-and-bindings.ts +31 -0
  131. package/src/scenegraph/group-node.ts +4 -0
  132. package/src/scenegraph/model-node.ts +9 -5
  133. package/src/scenegraph/scenegraph-node.ts +17 -13
  134. package/src/shader-inputs.ts +8 -6
  135. package/src/transform/buffer-transform.ts +8 -9
  136. package/src/transform/texture-transform.ts +2 -1
  137. package/src/utils/deep-equal.ts +51 -0
  138. package/src/utils/uid.ts +16 -0
@@ -1 +1 @@
1
- {"version":3,"file":"cone-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/cone-geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAEhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,qBAAa,YAAa,SAAQ,qBAAqB;gBACzC,KAAK,GAAE,iBAAsB;CAW1C"}
1
+ {"version":3,"file":"cone-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/cone-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAGhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,qBAAa,YAAa,SAAQ,qBAAqB;gBACzC,KAAK,GAAE,iBAAsB;CAW1C"}
@@ -1,5 +1,8 @@
1
- import { uid } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { TruncatedConeGeometry } from "./truncated-cone-geometry.js";
5
+ import { uid } from "../utils/uid.js";
3
6
  export class ConeGeometry extends TruncatedConeGeometry {
4
7
  constructor(props = {}) {
5
8
  const { id = uid('cone-geometry'), radius = 1, cap = true } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"cube-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/cube-geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAG9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,KAAK,GAAE,iBAAsB;CAoB1C;AAqDD,eAAO,MAAM,0BAA0B,cA0CrC,CAAC;AAIH,eAAO,MAAM,2BAA2B,cA0CtC,CAAC;AAIH,eAAO,MAAM,uBAAuB,cA0ClC,CAAC"}
1
+ {"version":3,"file":"cube-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/cube-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAI9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,KAAK,GAAE,iBAAsB;CAoB1C;AAqDD,eAAO,MAAM,0BAA0B,cA0CrC,CAAC;AAIH,eAAO,MAAM,2BAA2B,cA0CtC,CAAC;AAIH,eAAO,MAAM,uBAAuB,cA0ClC,CAAC"}
@@ -1,5 +1,8 @@
1
- import { uid } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { Geometry } from "../geometry/geometry.js";
5
+ import { uid } from "../utils/uid.js";
3
6
  export class CubeGeometry extends Geometry {
4
7
  constructor(props = {}) {
5
8
  const { id = uid('cube-geometry'), indices = true } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"cylinder-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/cylinder-geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAEhE,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,qBAAqB;gBAC7C,KAAK,GAAE,qBAA0B;CAS9C"}
1
+ {"version":3,"file":"cylinder-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/cylinder-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAGhE,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,qBAAqB;gBAC7C,KAAK,GAAE,qBAA0B;CAS9C"}
@@ -1,5 +1,8 @@
1
- import { uid } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { TruncatedConeGeometry } from "./truncated-cone-geometry.js";
5
+ import { uid } from "../utils/uid.js";
3
6
  export class CylinderGeometry extends TruncatedConeGeometry {
4
7
  constructor(props = {}) {
5
8
  const { id = uid('cylinder-geometry'), radius = 1 } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"ico-sphere-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/ico-sphere-geometry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAO9C,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,QAAQ;gBACjC,KAAK,GAAE,sBAA2B;CAW/C"}
1
+ {"version":3,"file":"ico-sphere-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/ico-sphere-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAQ9C,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,QAAQ;gBACjC,KAAK,GAAE,sBAA2B;CAW/C"}
@@ -1,6 +1,9 @@
1
- import { uid } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { Vector3 } from '@math.gl/core';
3
5
  import { Geometry } from "../geometry/geometry.js";
6
+ import { uid } from "../utils/uid.js";
4
7
  /* eslint-disable comma-spacing, max-statements, complexity */
5
8
  const ICO_POSITIONS = [-1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 1, 0, -1, 0, 1, 0, 0];
6
9
  const ICO_INDICES = [3, 4, 5, 3, 5, 1, 3, 1, 0, 3, 0, 4, 4, 0, 2, 4, 2, 5, 2, 0, 1, 5, 2, 1];
@@ -1 +1 @@
1
- {"version":3,"file":"plane-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/plane-geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAG9C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAKF,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,KAAK,GAAE,kBAAuB;CAY3C"}
1
+ {"version":3,"file":"plane-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/plane-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAI9C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAKF,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,KAAK,GAAE,kBAAuB;CAY3C"}
@@ -1,6 +1,9 @@
1
- import { uid } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { Geometry } from "../geometry/geometry.js";
3
5
  import { unpackIndexedGeometry } from "../geometry/geometry-utils.js";
6
+ import { uid } from "../utils/uid.js";
4
7
  // Primitives inspired by TDL http://code.google.com/p/webglsamples/,
5
8
  // copyright 2011 Google Inc. new BSD License
6
9
  // (http://www.opensource.org/licenses/bsd-license.php).
@@ -1 +1 @@
1
- {"version":3,"file":"sphere-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/sphere-geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAE9C,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAKF,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,KAAK,GAAE,mBAAwB;CAW5C"}
1
+ {"version":3,"file":"sphere-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/sphere-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAG9C,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAKF,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,KAAK,GAAE,mBAAwB;CAW5C"}
@@ -1,5 +1,8 @@
1
- import { uid } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { Geometry } from "../geometry/geometry.js";
5
+ import { uid } from "../utils/uid.js";
3
6
  // Primitives inspired by TDL http://code.google.com/p/webglsamples/,
4
7
  // copyright 2011 Google Inc. new BSD License
5
8
  // (http://www.opensource.org/licenses/bsd-license.php).
@@ -1 +1 @@
1
- {"version":3,"file":"truncated-cone-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAQ9C,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,qBAAa,qBAAsB,SAAQ,QAAQ;gBACrC,KAAK,GAAE,0BAA0B,GAAG;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,GAAG,CAAA;KAAM;CAgBrF"}
1
+ {"version":3,"file":"truncated-cone-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAS9C,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,qBAAa,qBAAsB,SAAQ,QAAQ;gBACrC,KAAK,GAAE,0BAA0B,GAAG;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,GAAG,CAAA;KAAM;CAgBrF"}
@@ -1,5 +1,8 @@
1
- import { uid } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { Geometry } from "../geometry/geometry.js";
5
+ import { uid } from "../utils/uid.js";
3
6
  const INDEX_OFFSETS = {
4
7
  x: [2, 0, 1],
5
8
  y: [0, 1, 2],
@@ -1,4 +1,5 @@
1
- import type { TypedArray, VertexFormat } from '@luma.gl/core';
1
+ import type { TypedArray } from '@math.gl/core';
2
+ import type { VertexFormat } from '@luma.gl/core';
2
3
  /** Holds one geometry */
3
4
  export type GeometryTable = {
4
5
  length: number;
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-table.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAE5D,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,CAAC"}
1
+ {"version":3,"file":"geometry-table.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEhD,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,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-utils.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry-utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,OA4BlD"}
1
+ {"version":3,"file":"geometry-utils.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,OA4BlD"}
@@ -1,4 +1,6 @@
1
- // import type {Geometry} from './geometry';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  export function unpackIndexedGeometry(geometry) {
3
5
  const { indices, attributes } = geometry;
4
6
  if (!indices) {
@@ -1,11 +1,12 @@
1
- import type { PrimitiveTopology, TypedArray } from '@luma.gl/core';
1
+ import type { TypedArray } from '@math.gl/core';
2
+ import type { PrimitiveTopology } from '@luma.gl/core';
2
3
  export type GeometryProps = {
3
4
  id?: string;
4
5
  /** Determines how vertices are read from the 'vertex' attributes */
5
- topology: 'point-list' | 'line-list' | 'line-strip' | 'line-loop-webgl' | 'triangle-list' | 'triangle-strip' | 'triangle-fan-webgl';
6
+ topology: 'point-list' | 'line-list' | 'line-strip' | 'triangle-list' | 'triangle-strip';
6
7
  /** Auto calculated from attributes if not provided */
7
8
  vertexCount?: number;
8
- attributes?: Record<string, GeometryAttribute | TypedArray>;
9
+ attributes: Record<string, GeometryAttribute | TypedArray>;
9
10
  indices?: GeometryAttribute | TypedArray;
10
11
  };
11
12
  export type GeometryAttributes = {
@@ -57,6 +58,6 @@ export declare class Geometry {
57
58
  * @returns
58
59
  */
59
60
  _setAttributes(attributes: Record<string, GeometryAttribute>, indices: any): this;
60
- _calculateVertexCount(attributes: GeometryAttributes, indices: GeometryAttribute): number;
61
+ _calculateVertexCount(attributes: GeometryAttributes, indices?: GeometryAttribute): number;
61
62
  }
62
63
  //# sourceMappingURL=geometry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,iBAAiB,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGjE,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,QAAQ,EACJ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,gBAAgB,GAChB,oBAAoB,CAAC;IACzB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,UAAU,CAAC,CAAC;IAC5D,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,i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AC,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,EAAE,iBAAiB,CAAC;QAC5B,MAAM,EAAE,iBAAiB,CAAC;QAC1B,UAAU,EAAE,iBAAiB,CAAC;QAC9B,OAAO,CAAC,EAAE,iBAAiB,CAAC;QAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;KAC9C,CAAC;IAEF,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;gBAE3B,KAAK,EAAE,aAAa;IAgDhC,cAAc,IAAI,MAAM;IAIxB;;;OAGG;IACH,aAAa,IAAI,kBAAkB;IAMnC,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAIrC;;;;;;;;;;OAUG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI;IAIjF,qBAAqB,CAAC,UAAU,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM;CAe3F"}
@@ -1,7 +1,7 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { uid, assert } from '@luma.gl/core';
4
+ import { uid } from "../utils/uid.js";
5
5
  export class Geometry {
6
6
  id;
7
7
  /** Determines how vertices are read from the 'vertex' attributes */
@@ -24,13 +24,17 @@ export class Geometry {
24
24
  const attribute = ArrayBuffer.isView(attributeValue)
25
25
  ? { value: attributeValue }
26
26
  : attributeValue;
27
- assert(ArrayBuffer.isView(attribute.value), `${this._print(attributeName)}: must be typed array or object with value as typed array`);
27
+ if (!ArrayBuffer.isView(attribute.value)) {
28
+ throw new Error(`${this._print(attributeName)}: must be typed array or object with value as typed array`);
29
+ }
28
30
  if ((attributeName === 'POSITION' || attributeName === 'positions') && !attribute.size) {
29
31
  attribute.size = 3;
30
32
  }
31
33
  // Move indices to separate field
32
34
  if (attributeName === 'indices') {
33
- assert(!this.indices);
35
+ if (this.indices) {
36
+ throw new Error('Multiple indices detected');
37
+ }
34
38
  this.indices = attribute;
35
39
  }
36
40
  else {
@@ -78,11 +82,11 @@ export class Geometry {
78
82
  let vertexCount = Infinity;
79
83
  for (const attribute of Object.values(attributes)) {
80
84
  const { value, size, constant } = attribute;
81
- if (!constant && value && size >= 1) {
85
+ if (!constant && value && size !== undefined && size >= 1) {
82
86
  vertexCount = Math.min(vertexCount, value.length / size);
83
87
  }
84
88
  }
85
- assert(Number.isFinite(vertexCount));
89
+ // assert(Number.isFinite(vertexCount));
86
90
  return vertexCount;
87
91
  }
88
92
  }
@@ -4,7 +4,7 @@ import type { Geometry } from "../geometry/geometry.js";
4
4
  export type GPUGeometryProps = {
5
5
  id?: string;
6
6
  /** Determines how vertices are read from the 'vertex' attributes */
7
- topology: 'point-list' | 'line-list' | 'line-strip' | 'line-loop-webgl' | 'triangle-list' | 'triangle-strip' | 'triangle-fan-webgl';
7
+ topology: 'point-list' | 'line-list' | 'line-strip' | 'triangle-list' | 'triangle-strip';
8
8
  /** Auto calculated from attributes if not provided */
9
9
  vertexCount: number;
10
10
  bufferLayout: BufferLayout[];
@@ -1 +1 @@
1
- {"version":3,"file":"gpu-geometry.d.ts","sourceRoot":"","sources":["../../src/geometry/gpu-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,MAAM,EAAE,MAAM,EAA4C,MAAM,eAAe,CAAC;AACxF,OAAO,KAAK,EAAC,QAAQ,EAAC,gCAA6B;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,QAAQ,EACJ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,gBAAgB,GAChB,oBAAoB,CAAC;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AC;IAIvC,UAAU,IAAI,MAAM,GAAG,IAAI;IAI3B,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;CAKjD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,CAc7F;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAMjG;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GACjB;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,YAAY,EAAE,YAAY,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,CAmCzF"}
@@ -1,4 +1,8 @@
1
- import { Buffer, uid, assert, getVertexFormatFromAttribute } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { Buffer, getVertexFormatFromAttribute } from '@luma.gl/core';
5
+ import { uid } from "../utils/uid.js";
2
6
  export class GPUGeometry {
3
7
  id;
4
8
  userData = {};
@@ -16,7 +20,9 @@ export class GPUGeometry {
16
20
  this.vertexCount = props.vertexCount;
17
21
  this.bufferLayout = props.bufferLayout || [];
18
22
  if (this.indices) {
19
- assert(this.indices.usage === Buffer.INDEX);
23
+ if (!(this.indices.usage & Buffer.INDEX)) {
24
+ throw new Error('Index buffer must have INDEX usage');
25
+ }
20
26
  }
21
27
  }
22
28
  destroy() {
@@ -32,7 +38,7 @@ export class GPUGeometry {
32
38
  return this.attributes;
33
39
  }
34
40
  getIndexes() {
35
- return this.indices;
41
+ return this.indices || null;
36
42
  }
37
43
  _calculateVertexCount(positions) {
38
44
  // Assume that positions is a fully packed float32x3 buffer
@@ -81,9 +87,15 @@ export function getAttributeBuffersFromGeometry(device, geometry) {
81
87
  name = 'colors';
82
88
  break;
83
89
  }
84
- attributes[name] = device.createBuffer({ data: attribute.value, id: `${attributeName}-buffer` });
85
- const { value, size, normalized } = attribute;
86
- bufferLayout.push({ name, format: getVertexFormatFromAttribute(value, size, normalized) });
90
+ if (attribute) {
91
+ attributes[name] = device.createBuffer({
92
+ data: attribute.value,
93
+ id: `${attributeName}-buffer`
94
+ });
95
+ const { value, size, normalized } = attribute;
96
+ // @ts-expect-error
97
+ bufferLayout.push({ name, format: getVertexFormatFromAttribute(value, size, normalized) });
98
+ }
87
99
  }
88
100
  const vertexCount = geometry._calculateVertexCount(geometry.attributes, geometry.indices);
89
101
  return { attributes, bufferLayout, vertexCount };
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ // luma.gl
3
+ // SPDX-License-Identifier: MIT
4
+ // Copyright (c) vis.gl contributors
2
5
  /*
3
6
  export function getAttributeLayoutsFromGeometry(geometry: Geometry) {
4
7
  const layouts: Record<string, {}> = {};