@woosh/meep-engine 2.48.17 → 2.48.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.
- package/package.json +1 -1
- package/src/core/binary/dec2hex.spec.js +13 -0
- package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.d.ts +18 -0
- package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.js +18 -0
- package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.spec.js +56 -0
- package/src/core/cache/Cache.d.ts +5 -0
- package/src/core/cache/Cache.js +8 -1
- package/src/core/cache/Cache.spec.js +47 -3
- package/src/core/codegen/LineBuilder.js +117 -106
- package/src/core/collection/HashMap.spec.js +32 -0
- package/src/core/collection/list/List.js +6 -4
- package/src/core/geom/Matrix4.js +4 -1
- package/src/core/geom/Quaternion.js +4 -0
- package/src/core/geom/Vector3.js +9 -31
- package/src/core/graph/Edge.js +11 -2
- package/src/core/graph/v2/Graph.js +36 -31
- package/src/core/graph/v2/Graph.spec.js +309 -1
- package/src/core/math/fract.spec.js +11 -0
- package/src/core/math/isPowerOfTwo.spec.js +9 -0
- package/src/core/math/isPowerOrTwo.js +5 -0
- package/src/core/math/newton_solver_1d.js +1 -1
- package/src/core/math/newton_solver_1d.spec.js +9 -0
- package/src/core/math/pingpong.spec.js +11 -0
- package/src/core/math/random/randomBytes.js +16 -0
- package/src/core/math/random/randomFloatBetween.spec.js +8 -0
- package/src/core/math/random/randomFromArray.js +3 -3
- package/src/core/math/random/randomIntegerBetween.js +5 -0
- package/src/core/math/random/randomIntegerBetween.spec.js +7 -0
- package/src/core/math/statistics/halton_sequence.spec.js +17 -0
- package/src/engine/asset/AssetManager.d.ts +11 -1
- package/src/engine/asset/AssetManager.spec.js +2 -2
- package/src/engine/control/ControlContext.js +2 -1
- package/src/engine/ecs/EntityBuilder.d.ts +6 -0
- package/src/engine/ecs/EntityBuilder.js +2 -22
- package/src/engine/ecs/EntityBuilder.spec.js +71 -1
- package/src/engine/ecs/EntityBuilderFlags.js +20 -0
- package/src/engine/ecs/EntityComponentDataset.js +3 -6
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +2 -1
- package/src/engine/ecs/gui/menu/radial/RadialContextMenu.js +2 -1
- package/src/engine/ecs/guid/GUID.js +48 -26
- package/src/engine/ecs/guid/GUID.spec.js +56 -10
- package/src/engine/ecs/speaker/VoiceSystem.js +2 -1
- package/src/engine/ecs/transform/Transform.d.ts +11 -1
- package/src/engine/ecs/transform/Transform.js +6 -3
- package/src/engine/ecs/transform/Transform.spec.js +67 -1
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +2 -1
- package/src/engine/physics/fluid/Fluid.js +3 -0
- /package/src/core/geom/{Matrix3.js → m3_determinant.js} +0 -0
|
@@ -2,6 +2,7 @@ import { Transform } from "./Transform.js";
|
|
|
2
2
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
3
3
|
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
4
4
|
import { MATRIX_4_IDENTITY } from "../../../core/geom/3d/matrix/MATRIX_4_IDENTITY.js";
|
|
5
|
+
import { TransformFlags } from "./TransformFlags.js";
|
|
5
6
|
|
|
6
7
|
test("constructor does not throw", () => {
|
|
7
8
|
|
|
@@ -18,5 +19,70 @@ test("new transform has identity transform", () => {
|
|
|
18
19
|
expect(t.rotation.equals(Quaternion.identity)).toBe(true);
|
|
19
20
|
expect(t.scale.equals(Vector3.one)).toBe(true);
|
|
20
21
|
|
|
21
|
-
expect(t.matrix).toEqual(MATRIX_4_IDENTITY);
|
|
22
|
+
expect(Array.from(t.matrix)).toEqual(MATRIX_4_IDENTITY);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("makeIdentity", () => {
|
|
26
|
+
|
|
27
|
+
const t = new Transform();
|
|
28
|
+
|
|
29
|
+
t.position.set(1, 2, 3);
|
|
30
|
+
|
|
31
|
+
t.makeIdentity();
|
|
32
|
+
|
|
33
|
+
expect(t.position.toJSON()).toEqual({ x: 0, y: 0, z: 0 })
|
|
34
|
+
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("position changes propagate to matrix", () => {
|
|
38
|
+
const t = new Transform();
|
|
39
|
+
|
|
40
|
+
t.setFlag(TransformFlags.AutomaticChangeDetection);
|
|
41
|
+
|
|
42
|
+
t.position.set(-1, 3, -7);
|
|
43
|
+
|
|
44
|
+
expect(t.matrix[12]).toBe(-1);
|
|
45
|
+
expect(t.matrix[13]).toBe(3);
|
|
46
|
+
expect(t.matrix[14]).toBe(-7);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @return {Transform}
|
|
52
|
+
*/
|
|
53
|
+
function sample_a() {
|
|
54
|
+
const a = new Transform();
|
|
55
|
+
|
|
56
|
+
a.position.set(1, 2, 3);
|
|
57
|
+
a.rotation.set(5, -7, 11, -13);
|
|
58
|
+
a.scale.set(17, -23, 29);
|
|
59
|
+
|
|
60
|
+
return a;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
test("to/fromJSON consistency", () => {
|
|
64
|
+
const a = sample_a();
|
|
65
|
+
|
|
66
|
+
const b = new Transform();
|
|
67
|
+
|
|
68
|
+
b.fromJSON(a.toJSON());
|
|
69
|
+
|
|
70
|
+
expect(a.equals(b)).toBe(true);
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
test("equality", () => {
|
|
74
|
+
const a = sample_a();
|
|
75
|
+
const b = sample_a();
|
|
76
|
+
|
|
77
|
+
expect(a.equals(b)).toBe(true);
|
|
78
|
+
|
|
79
|
+
b.position._add(1, 0, 0);
|
|
80
|
+
|
|
81
|
+
expect(a.equals(b)).toBe(false);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test("toString produces a valid string", () => {
|
|
85
|
+
const t = new Transform();
|
|
86
|
+
|
|
87
|
+
expect(typeof t.toString()).toBe("string");
|
|
22
88
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EngineHarness } from "../../../../EngineHarness.js";
|
|
2
2
|
import { FPDecalSystem } from "./FPDecalSystem.js";
|
|
3
|
-
import EntityBuilder
|
|
3
|
+
import EntityBuilder from "../../../../ecs/EntityBuilder.js";
|
|
4
4
|
import { Decal } from "./Decal.js";
|
|
5
5
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
6
6
|
import { randomFloatBetween } from "../../../../../core/math/random/randomFloatBetween.js";
|
|
@@ -31,6 +31,7 @@ import { GizmoRenderingPlugin } from "../../../render/gizmo/GizmoRenderingPlugin
|
|
|
31
31
|
import { Gizmo } from "../../../render/gizmo/Gizmo.js";
|
|
32
32
|
import { ForwardPlusRenderingPlugin } from "../../../render/forward_plus/plugin/ForwardPlusRenderingPlugin.js";
|
|
33
33
|
import { TaskLoadingScreen } from "../../../../../view/task/TaskLoadingScreen.js";
|
|
34
|
+
import { EntityBuilderFlags } from "../../../../ecs/EntityBuilderFlags.js";
|
|
34
35
|
|
|
35
36
|
const decal_urls = `data/textures/icons/FantasyIconsMegaPack/MagicItems/MagicItems_png/transparent/x64/staff_13_t.png
|
|
36
37
|
data/textures/icons/FantasyIconsMegaPack/MagicItems/MagicItems_png/transparent/x64/artifact_01_t.png
|
|
File without changes
|