@woosh/meep-engine 2.92.8 → 2.92.9

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.
@@ -65751,7 +65751,7 @@ function bvh32_from_indexed_geometry(bvh, vertices, indices) {
65751
65751
  */
65752
65752
  function bvh32_from_unindexed_geometry(bvh, vertices) {
65753
65753
 
65754
- const triangle_count = indices.length / 3;
65754
+ const triangle_count = vertices.length / 3;
65755
65755
 
65756
65756
  bvh.setLeafCount(triangle_count);
65757
65757
  bvh.initialize_structure();
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.92.8",
8
+ "version": "2.92.9",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -38,22 +38,22 @@ async function main(engine) {
38
38
  yaw: 3.123185307179593,
39
39
  });
40
40
  //
41
- make_sample('data/models/samples/InterpolationTest.glb',[
42
- 'Step Scale',
43
- 'Linear Scale',
44
- 'CubicSpline Scale',
45
- 'Step Rotation',
46
- 'CubicSpline Rotation',
47
- 'Linear Rotation',
48
- 'Step Translation',
49
- 'CubicSpline Translation',
50
- 'Linear Translation'
51
- ],engine.entityManager.dataset);
52
- //
53
- // make_sample('data/models/samples/BoxAnimated.glb',[
54
- // 'animation_01'
41
+ // make_sample('data/models/samples/InterpolationTest.glb',[
42
+ // 'Step Scale',
43
+ // 'Linear Scale',
44
+ // 'CubicSpline Scale',
45
+ // 'Step Rotation',
46
+ // 'CubicSpline Rotation',
47
+ // 'Linear Rotation',
48
+ // 'Step Translation',
49
+ // 'CubicSpline Translation',
50
+ // 'Linear Translation'
55
51
  // ],engine.entityManager.dataset);
56
52
  //
53
+ make_sample('data/models/samples/BoxAnimated.glb',[
54
+ 'animation_0'
55
+ ],engine.entityManager.dataset);
56
+
57
57
  // make_sample('data/models/samples/animatedbox1.gltf', [
58
58
  // 'All Animations'
59
59
  // ], engine.entityManager.dataset);
@@ -7,7 +7,7 @@ import { bvh32_set_leaf_from_triangle } from "./bvh32_set_leaf_from_triangle.js"
7
7
  */
8
8
  export function bvh32_from_unindexed_geometry(bvh, vertices) {
9
9
 
10
- const triangle_count = indices.length / 3;
10
+ const triangle_count = vertices.length / 3;
11
11
 
12
12
  bvh.setLeafCount(triangle_count);
13
13
  bvh.initialize_structure();
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bvh32_from_unindexed_geometry.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bvh32_from_unindexed_geometry.spec.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/geometry/bvh/buffered/bvh32_from_unindexed_geometry.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { BinaryUint32BVH } from "../../../../../core/bvh2/binary/2/BinaryUint32BVH.js";
2
+ import { bvh32_from_unindexed_geometry } from "./bvh32_from_unindexed_geometry.js";
3
+
4
+ test("1 triangle geometry", () => {
5
+ const bvh = new BinaryUint32BVH();
6
+
7
+ bvh32_from_unindexed_geometry(bvh, new Float32Array([1, 2, 3]));
8
+
9
+ const address = bvh.getNodeAddress(0);
10
+
11
+ const bounds = [];
12
+
13
+ bvh.readBounds(address, bounds, 0);
14
+
15
+ expect(bounds).toEqual([1, 2, 3, 1, 2, 3]);
16
+ });