Needle Engine

Changes between version 3.34.1-alpha.1 and 3.34.2-alpha
Files changed (4) hide show
  1. plugins/vite/alias.js +4 -1
  2. src/engine-components/Animation.ts +4 -1
  3. src/engine/webcomponents/needle menu/needle-menu.ts +1 -0
  4. src/engine-components/webxr/WebARCameraBackground.ts +1 -1
plugins/vite/alias.js CHANGED
@@ -11,7 +11,10 @@
11
11
  const packages_to_resolve = {
12
12
  // Handle all previous imports where users did import using @needle-engine/src
13
13
  '@needle-tools/engine/src': (res, packageName, index, path) => {
14
- return res + "/../lib";
14
+ // resolve old engine/src imports UNLESS it's the asap plugin (the asap plugin currently only exists in the src folder)
15
+ if (!path.startsWith("@needle-tools/engine/src/asap")) {
16
+ return res + "/../lib";
17
+ }
15
18
  },
16
19
  '@needle-tools/engine': (res, packageName, index, path) => {
17
20
  // Check if the import is something like @needle-tools/engine/engine/engine_utils
src/engine-components/Animation.ts CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { Mathf } from "../engine/engine_math.js";
4
4
  import { serializable } from "../engine/engine_serialization_decorator.js";
5
- import type { Vec2 } from "../engine/engine_types.js";
6
5
  import { getParam } from "../engine/engine_utils.js";
7
6
  import { MixerEvent } from "./Animator.js";
8
7
  import { Behaviour } from "./Component.js";
@@ -20,6 +19,8 @@
20
19
  minMaxOffsetNormalized?: Vec2;
21
20
  }
22
21
 
22
+ class Vec2 { x!: number; y!: number }
23
+
23
24
  export class Animation extends Behaviour {
24
25
 
25
26
  @serializable()
@@ -27,7 +28,9 @@
27
28
  @serializable()
28
29
  randomStartTime: boolean = true;
29
30
 
31
+ @serializable(Vec2)
30
32
  minMaxSpeed?: Vec2;
33
+ @serializable(Vec2)
31
34
  minMaxOffsetNormalized?: Vec2;
32
35
 
33
36
  @serializable()
src/engine/webcomponents/needle menu/needle-menu.ts CHANGED
@@ -202,6 +202,7 @@
202
202
  box-shadow: 0px 7px 0.5rem 0px rgb(0 0 0 / 6%), inset 0px 0px 1.3rem rgba(0,0,0,.05);
203
203
  backdrop-filter: blur(16px);
204
204
  pointer-events: all;
205
+ z-index: 1000;
205
206
  }
206
207
 
207
208
  /** using a div here because then we can change the class for placement **/
src/engine-components/webxr/WebARCameraBackground.ts CHANGED
@@ -44,7 +44,7 @@
44
44
  this.context.pre_render_callbacks.splice(i, 1);
45
45
  }
46
46
 
47
- @serializable()
47
+ @serializable(RGBAColor)
48
48
  public backgroundTint: RGBAColor = new RGBAColor(1,1,1,1);
49
49
 
50
50
  public get background() {