@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.
- package/CHANGELOG.md +27 -0
- package/dist/needle-engine.d.ts +2417 -2230
- package/dist/needle-engine.js +425 -425
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +49 -49
- package/dist/needle-engine.min.js.map +4 -4
- package/dist/needle-engine.tsbuildinfo +1 -0
- package/lib/engine/codegen/register_types.d.ts +1 -0
- package/lib/engine/codegen/register_types.js +346 -0
- package/lib/engine/codegen/register_types.js.map +1 -0
- package/lib/engine/debug/debug.d.ts +1 -0
- package/lib/engine/debug/debug.js +4 -0
- package/lib/engine/debug/debug.js.map +1 -1
- package/lib/engine/debug/debug_console.js +2 -1
- package/lib/engine/debug/debug_console.js.map +1 -1
- package/lib/engine/debug/debug_overlay.js +3 -1
- package/lib/engine/debug/debug_overlay.js.map +1 -1
- package/lib/engine/engine_default_parameters.d.ts +2 -2
- package/lib/engine/engine_element.js +4 -2
- package/lib/engine/engine_element.js.map +1 -1
- package/lib/engine/engine_element_loading.d.ts +1 -0
- package/lib/engine/engine_element_loading.js +17 -6
- package/lib/engine/engine_element_loading.js.map +1 -1
- package/lib/engine/engine_element_overlay.js +4 -2
- package/lib/engine/engine_element_overlay.js.map +1 -1
- package/lib/engine/engine_fileloader.d.ts +3 -0
- package/lib/engine/engine_fileloader.js +8 -0
- package/lib/engine/engine_fileloader.js.map +1 -0
- package/lib/engine/engine_generic_utils.d.ts +1 -0
- package/lib/engine/engine_generic_utils.js +14 -0
- package/lib/engine/engine_generic_utils.js.map +1 -0
- package/lib/engine/engine_input.js +4 -0
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_networking_websocket.d.ts +1 -0
- package/lib/engine/engine_networking_websocket.js +1 -1
- package/lib/engine/engine_networking_websocket.js.map +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js +6 -3
- package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
- package/lib/engine/engine_utils.d.ts +1 -1
- package/lib/engine/engine_utils.js +3 -0
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_components.d.ts +1 -1
- package/lib/engine/extensions/NEEDLE_progressive.d.ts +22 -0
- package/lib/engine/extensions/NEEDLE_progressive.js +172 -44
- package/lib/engine/extensions/NEEDLE_progressive.js.map +1 -1
- package/lib/engine-components/GroundProjection.d.ts +2 -1
- package/lib/engine-components/GroundProjection.js +19 -12
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/ParticleSystemModules.d.ts +1 -1
- package/lib/engine-components/ParticleSystemModules.js +48 -44
- package/lib/engine-components/ParticleSystemModules.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +1 -1
- package/lib/engine-components/Renderer.d.ts +1 -1
- package/lib/engine-components/Renderer.js +3 -8
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/Volume.js +8 -1
- package/lib/engine-components/Volume.js.map +1 -1
- package/lib/engine-components/WebXR.d.ts +2 -2
- package/lib/engine-components/WebXRAvatar.d.ts +1 -1
- package/lib/engine-components/codegen/components.d.ts +99 -99
- package/lib/engine-components/codegen/components.js +99 -99
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +1 -0
- package/lib/engine-components/export/usdz/USDZExporter.js +17 -1
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/ui/Button.js +30 -0
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/InputField.d.ts +2 -0
- package/lib/engine-components/ui/InputField.js +23 -1
- package/lib/engine-components/ui/InputField.js.map +1 -1
- package/lib/engine-components/ui/Utils.d.ts +2 -0
- package/lib/engine-components/ui/Utils.js +10 -9
- package/lib/engine-components/ui/Utils.js.map +1 -1
- package/lib/engine-components-experimental/Presentation.d.ts +6 -0
- package/lib/engine-components-experimental/Presentation.js +11 -0
- package/lib/engine-components-experimental/Presentation.js.map +1 -0
- package/lib/engine-components-experimental/annotation/LineDrawer.d.ts +18 -0
- package/lib/engine-components-experimental/annotation/LineDrawer.js +175 -0
- package/lib/engine-components-experimental/annotation/LineDrawer.js.map +1 -0
- package/lib/engine-components-experimental/annotation/LinesManager.d.ts +54 -0
- package/lib/engine-components-experimental/annotation/LinesManager.js +155 -0
- package/lib/engine-components-experimental/annotation/LinesManager.js.map +1 -0
- package/lib/engine-components-experimental/networking/PlayerSync.d.ts +26 -0
- package/lib/engine-components-experimental/networking/PlayerSync.js +121 -0
- package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -0
- package/lib/engine-schemes/vec2.d.ts +10 -0
- package/lib/engine-schemes/vec2.js +26 -0
- package/lib/engine-schemes/vec2.js.map +1 -0
- package/lib/include/three/ARButton.d.ts +3 -0
- package/lib/include/three/ARButton.js +158 -0
- package/lib/include/three/ARButton.js.map +1 -0
- package/lib/include/three/EXT_mesh_gpu_instancing_exporter.d.ts +6 -0
- package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js +46 -0
- package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js.map +1 -0
- package/lib/include/three/VRButton.d.ts +5 -0
- package/lib/include/three/VRButton.js +122 -0
- package/lib/include/three/VRButton.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/src/engine/codegen/register_types.js +214 -214
- package/src/engine/debug/debug.ts +5 -0
- package/src/engine/debug/debug_console.ts +3 -2
- package/src/engine/debug/debug_overlay.ts +3 -1
- package/src/engine/engine_element.ts +4 -2
- package/src/engine/engine_element_loading.ts +13 -6
- package/src/engine/engine_element_overlay.ts +4 -2
- package/src/engine/engine_input.ts +4 -0
- package/src/engine/engine_networking_websocket.ts +3 -1
- package/src/engine/engine_serialization_builtin_serializer.ts +8 -5
- package/src/engine/engine_utils.ts +3 -1
- package/src/engine/extensions/NEEDLE_progressive.ts +185 -43
- package/src/engine-components/GroundProjection.ts +18 -12
- package/src/engine-components/ParticleSystemModules.ts +50 -47
- package/src/engine-components/Renderer.ts +5 -9
- package/src/engine-components/Volume.ts +8 -1
- package/src/engine-components/WebXR.ts +2 -2
- package/src/engine-components/codegen/components.ts +99 -99
- package/src/engine-components/export/usdz/USDZExporter.ts +19 -2
- package/src/engine-components/ui/Button.ts +8 -8
- package/src/engine-components/ui/InputField.ts +25 -2
- package/src/engine-components/ui/Utils.ts +12 -11
- package/src/engine-components-experimental/annotation/LineDrawer.ts +10 -7
- package/src/engine-components-experimental/annotation/LinesManager.ts +6 -6
- package/src/engine-components-experimental/networking/PlayerSync.ts +1 -1
- package/lib/engine/engine_caching.d.ts +0 -0
- package/lib/engine/engine_caching.js +0 -2
- package/lib/engine/engine_caching.js.map +0 -1
- package/lib/engine/tests/simulate_avatars.d.ts +0 -0
- package/lib/engine/tests/simulate_avatars.js +0 -3
- package/lib/engine/tests/simulate_avatars.js.map +0 -1
- package/lib/engine-components/NavMesh.d.ts +0 -0
- package/lib/engine-components/NavMesh.js +0 -101
- package/lib/engine-components/NavMesh.js.map +0 -1
- package/lib/engine-components/ParticleSystemBehaviours.d.ts +0 -0
- package/lib/engine-components/ParticleSystemBehaviours.js +0 -2
- package/lib/engine-components/ParticleSystemBehaviours.js.map +0 -1
- package/lib/engine-components/SpringJoint.d.ts +0 -0
- package/lib/engine-components/SpringJoint.js +0 -43
- package/lib/engine-components/SpringJoint.js.map +0 -1
- package/lib/engine-components/ui/CanvasScaler.d.ts +0 -0
- package/lib/engine-components/ui/CanvasScaler.js +0 -17
- package/lib/engine-components/ui/CanvasScaler.js.map +0 -1
- package/src/engine/dist/engine_three_utils.js +0 -279
- package/src/engine/engine_caching.ts +0 -0
- package/src/engine/tests/simulate_avatars.ts +0 -2
- package/src/engine-components/NavMesh.ts +0 -117
- package/src/engine-components/ParticleSystemBehaviours.ts +0 -0
- package/src/engine-components/SpringJoint.ts +0 -45
- 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
|
-
// }
|