@needle-tools/engine 2.53.0-pre → 2.54.2-pre

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 (149) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/needle-engine.d.ts +2417 -2230
  3. package/dist/needle-engine.js +425 -425
  4. package/dist/needle-engine.js.map +4 -4
  5. package/dist/needle-engine.min.js +49 -49
  6. package/dist/needle-engine.min.js.map +4 -4
  7. package/dist/needle-engine.tsbuildinfo +1 -0
  8. package/lib/engine/codegen/register_types.d.ts +1 -0
  9. package/lib/engine/codegen/register_types.js +346 -0
  10. package/lib/engine/codegen/register_types.js.map +1 -0
  11. package/lib/engine/debug/debug.d.ts +1 -0
  12. package/lib/engine/debug/debug.js +4 -0
  13. package/lib/engine/debug/debug.js.map +1 -1
  14. package/lib/engine/debug/debug_console.js +2 -1
  15. package/lib/engine/debug/debug_console.js.map +1 -1
  16. package/lib/engine/debug/debug_overlay.js +3 -1
  17. package/lib/engine/debug/debug_overlay.js.map +1 -1
  18. package/lib/engine/engine_default_parameters.d.ts +2 -2
  19. package/lib/engine/engine_element.js +4 -2
  20. package/lib/engine/engine_element.js.map +1 -1
  21. package/lib/engine/engine_element_loading.d.ts +1 -0
  22. package/lib/engine/engine_element_loading.js +17 -6
  23. package/lib/engine/engine_element_loading.js.map +1 -1
  24. package/lib/engine/engine_element_overlay.js +4 -2
  25. package/lib/engine/engine_element_overlay.js.map +1 -1
  26. package/lib/engine/engine_fileloader.d.ts +3 -0
  27. package/lib/engine/engine_fileloader.js +8 -0
  28. package/lib/engine/engine_fileloader.js.map +1 -0
  29. package/lib/engine/engine_generic_utils.d.ts +1 -0
  30. package/lib/engine/engine_generic_utils.js +14 -0
  31. package/lib/engine/engine_generic_utils.js.map +1 -0
  32. package/lib/engine/engine_input.js +4 -0
  33. package/lib/engine/engine_input.js.map +1 -1
  34. package/lib/engine/engine_networking_websocket.d.ts +1 -0
  35. package/lib/engine/engine_networking_websocket.js +1 -1
  36. package/lib/engine/engine_networking_websocket.js.map +1 -1
  37. package/lib/engine/engine_serialization_builtin_serializer.js +6 -3
  38. package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
  39. package/lib/engine/engine_utils.d.ts +1 -1
  40. package/lib/engine/engine_utils.js +3 -0
  41. package/lib/engine/engine_utils.js.map +1 -1
  42. package/lib/engine/extensions/NEEDLE_components.d.ts +1 -1
  43. package/lib/engine/extensions/NEEDLE_progressive.d.ts +22 -0
  44. package/lib/engine/extensions/NEEDLE_progressive.js +172 -44
  45. package/lib/engine/extensions/NEEDLE_progressive.js.map +1 -1
  46. package/lib/engine-components/GroundProjection.d.ts +2 -1
  47. package/lib/engine-components/GroundProjection.js +19 -12
  48. package/lib/engine-components/GroundProjection.js.map +1 -1
  49. package/lib/engine-components/ParticleSystemModules.d.ts +1 -1
  50. package/lib/engine-components/ParticleSystemModules.js +48 -44
  51. package/lib/engine-components/ParticleSystemModules.js.map +1 -1
  52. package/lib/engine-components/ReflectionProbe.d.ts +1 -1
  53. package/lib/engine-components/Renderer.d.ts +1 -1
  54. package/lib/engine-components/Renderer.js +3 -8
  55. package/lib/engine-components/Renderer.js.map +1 -1
  56. package/lib/engine-components/Volume.js +8 -1
  57. package/lib/engine-components/Volume.js.map +1 -1
  58. package/lib/engine-components/WebXR.d.ts +2 -2
  59. package/lib/engine-components/WebXRAvatar.d.ts +1 -1
  60. package/lib/engine-components/codegen/components.d.ts +99 -99
  61. package/lib/engine-components/codegen/components.js +99 -99
  62. package/lib/engine-components/codegen/components.js.map +1 -1
  63. package/lib/engine-components/export/usdz/USDZExporter.d.ts +1 -0
  64. package/lib/engine-components/export/usdz/USDZExporter.js +17 -1
  65. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  66. package/lib/engine-components/ui/Button.js +30 -0
  67. package/lib/engine-components/ui/Button.js.map +1 -1
  68. package/lib/engine-components/ui/InputField.d.ts +2 -0
  69. package/lib/engine-components/ui/InputField.js +23 -1
  70. package/lib/engine-components/ui/InputField.js.map +1 -1
  71. package/lib/engine-components/ui/Utils.d.ts +2 -0
  72. package/lib/engine-components/ui/Utils.js +10 -9
  73. package/lib/engine-components/ui/Utils.js.map +1 -1
  74. package/lib/engine-components-experimental/Presentation.d.ts +6 -0
  75. package/lib/engine-components-experimental/Presentation.js +11 -0
  76. package/lib/engine-components-experimental/Presentation.js.map +1 -0
  77. package/lib/engine-components-experimental/annotation/LineDrawer.d.ts +18 -0
  78. package/lib/engine-components-experimental/annotation/LineDrawer.js +175 -0
  79. package/lib/engine-components-experimental/annotation/LineDrawer.js.map +1 -0
  80. package/lib/engine-components-experimental/annotation/LinesManager.d.ts +54 -0
  81. package/lib/engine-components-experimental/annotation/LinesManager.js +155 -0
  82. package/lib/engine-components-experimental/annotation/LinesManager.js.map +1 -0
  83. package/lib/engine-components-experimental/networking/PlayerSync.d.ts +26 -0
  84. package/lib/engine-components-experimental/networking/PlayerSync.js +121 -0
  85. package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -0
  86. package/lib/engine-schemes/vec2.d.ts +10 -0
  87. package/lib/engine-schemes/vec2.js +26 -0
  88. package/lib/engine-schemes/vec2.js.map +1 -0
  89. package/lib/include/three/ARButton.d.ts +3 -0
  90. package/lib/include/three/ARButton.js +158 -0
  91. package/lib/include/three/ARButton.js.map +1 -0
  92. package/lib/include/three/EXT_mesh_gpu_instancing_exporter.d.ts +6 -0
  93. package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js +46 -0
  94. package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js.map +1 -0
  95. package/lib/include/three/VRButton.d.ts +5 -0
  96. package/lib/include/three/VRButton.js +122 -0
  97. package/lib/include/three/VRButton.js.map +1 -0
  98. package/lib/tsconfig.tsbuildinfo +1 -0
  99. package/package.json +1 -1
  100. package/src/engine/codegen/register_types.js +214 -214
  101. package/src/engine/debug/debug.ts +5 -0
  102. package/src/engine/debug/debug_console.ts +3 -2
  103. package/src/engine/debug/debug_overlay.ts +3 -1
  104. package/src/engine/engine_element.ts +4 -2
  105. package/src/engine/engine_element_loading.ts +13 -6
  106. package/src/engine/engine_element_overlay.ts +4 -2
  107. package/src/engine/engine_input.ts +4 -0
  108. package/src/engine/engine_networking_websocket.ts +3 -1
  109. package/src/engine/engine_serialization_builtin_serializer.ts +8 -5
  110. package/src/engine/engine_utils.ts +3 -1
  111. package/src/engine/extensions/NEEDLE_progressive.ts +185 -43
  112. package/src/engine-components/GroundProjection.ts +18 -12
  113. package/src/engine-components/ParticleSystemModules.ts +50 -47
  114. package/src/engine-components/Renderer.ts +5 -9
  115. package/src/engine-components/Volume.ts +8 -1
  116. package/src/engine-components/WebXR.ts +2 -2
  117. package/src/engine-components/codegen/components.ts +99 -99
  118. package/src/engine-components/export/usdz/USDZExporter.ts +19 -2
  119. package/src/engine-components/ui/Button.ts +8 -8
  120. package/src/engine-components/ui/InputField.ts +25 -2
  121. package/src/engine-components/ui/Utils.ts +12 -11
  122. package/src/engine-components-experimental/annotation/LineDrawer.ts +10 -7
  123. package/src/engine-components-experimental/annotation/LinesManager.ts +6 -6
  124. package/src/engine-components-experimental/networking/PlayerSync.ts +1 -1
  125. package/lib/engine/engine_caching.d.ts +0 -0
  126. package/lib/engine/engine_caching.js +0 -2
  127. package/lib/engine/engine_caching.js.map +0 -1
  128. package/lib/engine/tests/simulate_avatars.d.ts +0 -0
  129. package/lib/engine/tests/simulate_avatars.js +0 -3
  130. package/lib/engine/tests/simulate_avatars.js.map +0 -1
  131. package/lib/engine-components/NavMesh.d.ts +0 -0
  132. package/lib/engine-components/NavMesh.js +0 -101
  133. package/lib/engine-components/NavMesh.js.map +0 -1
  134. package/lib/engine-components/ParticleSystemBehaviours.d.ts +0 -0
  135. package/lib/engine-components/ParticleSystemBehaviours.js +0 -2
  136. package/lib/engine-components/ParticleSystemBehaviours.js.map +0 -1
  137. package/lib/engine-components/SpringJoint.d.ts +0 -0
  138. package/lib/engine-components/SpringJoint.js +0 -43
  139. package/lib/engine-components/SpringJoint.js.map +0 -1
  140. package/lib/engine-components/ui/CanvasScaler.d.ts +0 -0
  141. package/lib/engine-components/ui/CanvasScaler.js +0 -17
  142. package/lib/engine-components/ui/CanvasScaler.js.map +0 -1
  143. package/src/engine/dist/engine_three_utils.js +0 -279
  144. package/src/engine/engine_caching.ts +0 -0
  145. package/src/engine/tests/simulate_avatars.ts +0 -2
  146. package/src/engine-components/NavMesh.ts +0 -117
  147. package/src/engine-components/ParticleSystemBehaviours.ts +0 -0
  148. package/src/engine-components/SpringJoint.ts +0 -45
  149. package/src/engine-components/ui/CanvasScaler.ts +0 -21
@@ -1,117 +0,0 @@
1
-
2
- // import { Behaviour, GameObject } from "./Component";
3
- // /*
4
- // import { Pathfinding, PathfindingHelper } from 'three-pathfinding';
5
- // import * as THREE from 'three';
6
- // import { mergeBufferGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils'
7
- // */
8
- // export class NavMesh extends Behaviour {
9
- // /*
10
- // public meshes: THREE.Object3D[] = [];
11
-
12
- // private pathfinding: Pathfinding | null = null;
13
- // private zones: string[] = [];
14
-
15
- // onEnable(): void {
16
-
17
- // this.pathfinding = new Pathfinding();
18
- // const ZONE = 'zone';
19
- // const geometries : THREE.BufferGeometry[] = [];
20
- // if (this.meshes && this.meshes.length > 0) {
21
- // for (let i = 0; i < this.meshes.length; i++) {
22
- // const obj = this.meshes[i] as THREE.Mesh;
23
- // if (!obj) continue;
24
- // const geo = obj.geometry;
25
- // if (!geo) continue;
26
- // const copy : THREE.BufferGeometry = {...geo};
27
- // // const copy = geo;
28
- // const attributesCopy = {...copy.attributes};
29
- // copy.attributes = attributesCopy;
30
- // if(attributesCopy.uv2) delete attributesCopy.uv2;
31
- // // copy.applyMatrix4(obj.matrixWorld);
32
- // geometries.push(copy);
33
- // // obj.updateMatrixWorld();
34
- // // singleGeometry.merge(geo);
35
- // // console.log(singleGeometry, geo);
36
- // }
37
- // }
38
- // const mesh = mergeBufferGeometries(geometries);
39
- // const zone = Pathfinding.createZone(mesh);
40
- // const name = ZONE;
41
- // this.zones.push(name);
42
- // this.pathfinding.setZoneData(name, zone);
43
-
44
- // // const target = new THREE.Vector3(2, 0, 2);
45
- // // const groupID = this.pathfinding.getGroup(ZONE, target);
46
- // // const path = this.pathfinding.findPath(this.worldPosition, target, ZONE, groupID);
47
- // // console.log(path, this.pathfinding);
48
- // }
49
-
50
- // public tryFindPath(from: THREE.Vector3, to: THREE.Vector3): THREE.Vector3[] | null {
51
- // const zone = this.zones[0];
52
- // const groupId = this.pathfinding.getGroup(zone, to);
53
- // const path = this.pathfinding.findPath(from, to, zone, groupId);
54
- // return path;
55
- // }
56
- // */
57
- // }
58
-
59
- // // import { input } from "../engine/engine_input";
60
- // import { Physics, RaycastOptions } from "../engine/engine_physics"
61
- // // import { time } from "../engine/engine_time";
62
- // // import { scene } from "../engine/engine_setup";
63
- // import {SyncedTransform} from "./SyncedTransform";
64
-
65
- // export class NavMeshAgent extends Behaviour {
66
- // /*
67
- // public navMesh: NavMesh | null = null;
68
-
69
- // private currentPath: THREE.Vector3[] | null = null;
70
- // private helper : PathfindingHelper | null = null;
71
-
72
- // onEnable(): void {
73
- // this.helper = new PathfindingHelper();
74
- // scene.add(this.helper);
75
- // }
76
-
77
- // update(): void {
78
- // if (input.mouseClick) {
79
- // if (this.navMesh) {
80
- // const from = this.worldPosition;
81
- // const opts = new RaycastOptions();
82
- // opts.setMask(RaycastOptions.AllLayers);
83
- // const hits = Physics.raycast(opts);
84
- // if (hits.length > 0) {
85
- // const to = hits[0].point;
86
- // this.helper.setPlayerPosition(from);
87
- // this.helper.setTargetPosition(to);
88
- // this.currentPath = this.navMesh.tryFindPath(from, to);
89
- // this.helper.setPath(this.currentPath);
90
- // // console.log(...this.currentPath);
91
-
92
- // const sync = GameObject.getComponent(this.gameObject, SyncedTransform);
93
- // if(sync) sync.requestOwnership();
94
- // }
95
- // }
96
- // }
97
-
98
- // if (this.currentPath && this.currentPath.length > 0) {
99
-
100
- // const wp = this.worldPosition;
101
- // const target = this.currentPath[0];
102
- // this.worldPosition = wp.lerp(target, time.deltaTime*2);
103
-
104
- // this.gameObject.lookAt(target);
105
- // // const vec = target.clone().sub(wp);
106
- // // const wr = this.worldQuaternion;
107
- // // wr.slerp(rot, time.deltaTime*5);
108
- // // this.worldQuaternion = wr;
109
-
110
- // if (wp.distanceTo(this.currentPath[0]) < 0.1)
111
- // this.currentPath.shift();
112
-
113
-
114
- // }
115
- // }
116
- // */
117
- // }
File without changes
@@ -1,45 +0,0 @@
1
- // import { Behaviour, GameObject } from "./Component";
2
- // import { Rigidbody } from "./RigidBody";
3
- // import * as CANNON from 'cannon-es'
4
- // import { Vector3 } from "three";
5
-
6
- // export class SpringJoint extends Behaviour {
7
- // anchor: Vector3 | null = null;
8
- // connectedBody: Rigidbody | null = null;
9
- // connectedAnchor: Vector3 | null = null;
10
- // spring: number = 10;
11
- // damper: number = .2;
12
-
13
- // private rb : Rigidbody | null = null;
14
-
15
- // awake(): void {
16
- // this.rb = GameObject.getComponent(this.gameObject, Rigidbody);
17
- // if(!this.connectedBody || !this.connectedBody.body || !this.rb || !this.rb.body) return;
18
- // this.connectedBody.body.mass = Math.min(this.rb.body.mass*.99, this.connectedBody.body.mass);
19
- // const spring = new CANNON.Spring(this.rb.body, this.connectedBody.body, {
20
- // // localAnchorA: new CANNON.Vec3(-1, 1, 0),
21
- // // localAnchorB: new CANNON.Vec3(0, 0, 0),
22
- // // restLength: -.1,
23
- // // stiffness: 10,
24
- // // damping: .2,
25
- // restLength: 0.01,
26
- // stiffness: this.spring*.5,
27
- // damping: this.damper,
28
- // // localAnchorA: new CANNON.Vec3(this.anchor.x, this.anchor.y, this.anchor.z),
29
- // // localAnchorB: new CANNON.Vec3(
30
- // // this.connectedAnchor.x,
31
- // // this.connectedAnchor.y,
32
- // // this.connectedAnchor.z
33
- // // ),
34
- // });
35
- // this.context.physics.addPostStepListener(_ => {
36
- // // const wp = this.connectedBody.worldPosition;
37
- // // console.log(wp.y, this.connectedBody.body.position.y, this.rb.body.position.y);
38
- // spring.applyForce();
39
- // });
40
- // }
41
-
42
- // update(): void {
43
- // // console.log(this.worldPosition.y)
44
- // }
45
- // }
@@ -1,21 +0,0 @@
1
- // import { serializable } from "../../engine/engine_serialization";
2
- // import { Behaviour } from "../Component";
3
-
4
-
5
- // export class CanvasScaler extends Behaviour {
6
-
7
- // private _dynamicPixelsPerUnit: number = 1;
8
-
9
- // @serializable()
10
- // get dynamicPixelsPerUnit(): number {
11
- // return this._dynamicPixelsPerUnit;
12
- // }
13
-
14
- // private set dynamicPixelsPerUnit(val: number) {
15
- // this._dynamicPixelsPerUnit = val;
16
- // }
17
-
18
- // awake() {
19
- // console.log(this);
20
- // }
21
- // }