@@ -60,6 +60,7 @@
|
|
60
60
|
/**
|
61
61
|
* Animation component to play animations on a GameObject
|
62
62
|
* @category Animation and Sequencing
|
63
|
+
* @group Components
|
63
64
|
*/
|
64
65
|
export class Animation extends Behaviour implements IAnimationComponent {
|
65
66
|
|
@@ -27,6 +27,7 @@
|
|
27
27
|
/** The Animator component is used to play animations on a GameObject. It is used in combination with an AnimatorController (which is a state machine for animations)
|
28
28
|
* A new AnimatorController can be created from code via `AnimatorController.createFromClips`
|
29
29
|
* @category Animation and Sequencing
|
30
|
+
* @group Components
|
30
31
|
*/
|
31
32
|
export class Animator extends Behaviour implements IAnimationComponent {
|
32
33
|
|
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
/**
|
18
18
|
* @category Effects
|
19
|
+
* @group Components
|
19
20
|
*/
|
20
21
|
export class Antialiasing extends PostProcessingEffect {
|
21
22
|
get typeName(): string {
|
@@ -7,6 +7,7 @@
|
|
7
7
|
/**
|
8
8
|
* AudioListener represents a listener that can be attached to a GameObject to listen to audio sources in the scene.
|
9
9
|
* @category Multimedia
|
10
|
+
* @group Components
|
10
11
|
*/
|
11
12
|
export class AudioListener extends Behaviour {
|
12
13
|
|
@@ -34,6 +34,7 @@
|
|
34
34
|
/** The AudioSource can be used to play audio in the scene.
|
35
35
|
* Use `clip` to set the audio file to play.
|
36
36
|
* @category Multimedia
|
37
|
+
* @group Components
|
37
38
|
*/
|
38
39
|
export class AudioSource extends Behaviour {
|
39
40
|
|
@@ -20,6 +20,7 @@
|
|
20
20
|
/**
|
21
21
|
* @category XR
|
22
22
|
* @category Networking
|
23
|
+
* @group Components
|
23
24
|
*/
|
24
25
|
export class Avatar extends Behaviour {
|
25
26
|
|
@@ -7,6 +7,7 @@
|
|
7
7
|
/**
|
8
8
|
* AxesHelper is a component that displays the axes of the object in the scene.
|
9
9
|
* @category Helpers
|
10
|
+
* @group Components
|
10
11
|
*/
|
11
12
|
export class AxesHelper extends Behaviour {
|
12
13
|
@serializable()
|
@@ -30,6 +30,7 @@
|
|
30
30
|
* Derive from this class if you want to implement your own UI components.
|
31
31
|
* It provides utility methods and simplifies managing the underlying three-mesh-ui hierarchy.
|
32
32
|
* @category User Interface
|
33
|
+
* @group Components
|
33
34
|
*/
|
34
35
|
export class BaseUIComponent extends Behaviour {
|
35
36
|
|
@@ -32,6 +32,7 @@
|
|
32
32
|
|
33
33
|
/**
|
34
34
|
* @category Everywhere Actions
|
35
|
+
* @group Components
|
35
36
|
*/
|
36
37
|
export class ChangeTransformOnClick extends Behaviour implements IPointerClickHandler, UsdzBehaviour {
|
37
38
|
|
@@ -169,6 +170,7 @@
|
|
169
170
|
|
170
171
|
/**
|
171
172
|
* @category Everywhere Actions
|
173
|
+
* @group Components
|
172
174
|
*/
|
173
175
|
export class ChangeMaterialOnClick extends Behaviour implements IPointerClickHandler, UsdzBehaviour {
|
174
176
|
|
@@ -355,6 +357,7 @@
|
|
355
357
|
|
356
358
|
/**
|
357
359
|
* @category Everywhere Actions
|
360
|
+
* @group Components
|
358
361
|
*/
|
359
362
|
export class SetActiveOnClick extends Behaviour implements IPointerClickHandler, UsdzBehaviour {
|
360
363
|
|
@@ -588,6 +591,7 @@
|
|
588
591
|
|
589
592
|
/**
|
590
593
|
* @category Everywhere Actions
|
594
|
+
* @group Components
|
591
595
|
*/
|
592
596
|
export class HideOnStart extends Behaviour implements UsdzBehaviour {
|
593
597
|
|
@@ -616,6 +620,7 @@
|
|
616
620
|
|
617
621
|
/**
|
618
622
|
* @category Everywhere Actions
|
623
|
+
* @group Components
|
619
624
|
*/
|
620
625
|
export class EmphasizeOnClick extends Behaviour implements UsdzBehaviour {
|
621
626
|
|
@@ -647,6 +652,7 @@
|
|
647
652
|
|
648
653
|
/**
|
649
654
|
* @category Everywhere Actions
|
655
|
+
* @group Components
|
650
656
|
*/
|
651
657
|
export class PlayAudioOnClick extends Behaviour implements IPointerClickHandler, UsdzBehaviour {
|
652
658
|
|
@@ -764,6 +770,7 @@
|
|
764
770
|
|
765
771
|
/**
|
766
772
|
* @category Everywhere Actions
|
773
|
+
* @group Components
|
767
774
|
*/
|
768
775
|
export class PlayAnimationOnClick extends Behaviour implements IPointerClickHandler, UsdzBehaviour, UsdzAnimation {
|
769
776
|
|
@@ -1164,6 +1171,7 @@
|
|
1164
1171
|
|
1165
1172
|
/**
|
1166
1173
|
* @category Everywhere Actions
|
1174
|
+
* @group Components
|
1167
1175
|
*/
|
1168
1176
|
export class VisibilityAction extends PreliminaryAction {
|
1169
1177
|
|
@@ -1188,6 +1196,7 @@
|
|
1188
1196
|
|
1189
1197
|
/**
|
1190
1198
|
* @category Everywhere Actions
|
1199
|
+
* @group Components
|
1191
1200
|
*/
|
1192
1201
|
export class TapGestureTrigger extends PreliminaryTrigger {
|
1193
1202
|
|
@@ -19,6 +19,7 @@
|
|
19
19
|
* ```
|
20
20
|
*
|
21
21
|
* @category Effects
|
22
|
+
* @group Components
|
22
23
|
*/
|
23
24
|
export class BloomEffect extends PostProcessingEffect {
|
24
25
|
|
@@ -10,6 +10,7 @@
|
|
10
10
|
|
11
11
|
/**
|
12
12
|
* @category Helpers
|
13
|
+
* @group Components
|
13
14
|
*/
|
14
15
|
export class BoxHelperComponent extends Behaviour {
|
15
16
|
|
@@ -62,6 +62,7 @@
|
|
62
62
|
|
63
63
|
/**
|
64
64
|
* @category User Interface
|
65
|
+
* @group Components
|
65
66
|
*/
|
66
67
|
export class Button extends Behaviour implements IPointerEventHandler {
|
67
68
|
|
@@ -29,6 +29,7 @@
|
|
29
29
|
|
30
30
|
/**
|
31
31
|
* @category Camera Controls
|
32
|
+
* @group Components
|
32
33
|
*/
|
33
34
|
export class Camera extends Behaviour implements ICamera {
|
34
35
|
|
@@ -26,6 +26,7 @@
|
|
26
26
|
|
27
27
|
/**
|
28
28
|
* @category User Interface
|
29
|
+
* @group Components
|
29
30
|
*/
|
30
31
|
export class Canvas extends UIRootComponent implements ICanvas {
|
31
32
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
/**
|
10
10
|
* @category User Interface
|
11
|
+
* @group Components
|
11
12
|
*/
|
12
13
|
export class CanvasGroup extends Behaviour implements ICanvasGroup {
|
13
14
|
@serializable()
|
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
/**
|
17
17
|
* @category Camera Controls
|
18
|
+
* @group Components
|
18
19
|
*/
|
19
20
|
export class CharacterController extends Behaviour {
|
20
21
|
|
@@ -108,6 +109,7 @@
|
|
108
109
|
/**
|
109
110
|
* @category Camera Controls
|
110
111
|
* @category Interactivity
|
112
|
+
* @group Components
|
111
113
|
*/
|
112
114
|
export class CharacterControllerInput extends Behaviour {
|
113
115
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
/**
|
10
10
|
* @category Effects
|
11
|
+
* @group Components
|
11
12
|
*/
|
12
13
|
export class ChromaticAberration extends PostProcessingEffect {
|
13
14
|
|
@@ -17,6 +17,7 @@
|
|
17
17
|
* Colliders are used in combination with a Rigidbody to create physical interactions between objects.
|
18
18
|
* Colliders are registered with the physics engine when they are enabled and removed when they are disabled.
|
19
19
|
* @category Physics
|
20
|
+
* @group Components
|
20
21
|
*/
|
21
22
|
export class Collider extends Behaviour implements ICollider {
|
22
23
|
|
@@ -100,6 +101,7 @@
|
|
100
101
|
/**
|
101
102
|
* SphereCollider is a collider that represents a sphere shape.
|
102
103
|
* @category Physics
|
104
|
+
* @group Components
|
103
105
|
*/
|
104
106
|
export class SphereCollider extends Collider implements ISphereCollider {
|
105
107
|
|
@@ -129,6 +131,7 @@
|
|
129
131
|
/**
|
130
132
|
* BoxCollider is a collider that represents a box shape.
|
131
133
|
* @category Physics
|
134
|
+
* @group Components
|
132
135
|
*/
|
133
136
|
export class BoxCollider extends Collider implements IBoxCollider {
|
134
137
|
|
@@ -174,6 +177,7 @@
|
|
174
177
|
* MeshCollider is a collider that represents a mesh shape.
|
175
178
|
* The mesh collider can be used to create a collider from a mesh.
|
176
179
|
* @category Physics
|
180
|
+
* @group Components
|
177
181
|
*/
|
178
182
|
export class MeshCollider extends Collider {
|
179
183
|
|
@@ -242,6 +246,7 @@
|
|
242
246
|
/**
|
243
247
|
* CapsuleCollider is a collider that represents a capsule shape.
|
244
248
|
* @category Physics
|
249
|
+
* @group Components
|
245
250
|
*/
|
246
251
|
export class CapsuleCollider extends Collider {
|
247
252
|
@serializable(Vector3)
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
/**
|
11
11
|
* @category Effects
|
12
|
+
* @group Components
|
12
13
|
*/
|
13
14
|
export class ColorAdjustments extends PostProcessingEffect {
|
14
15
|
|
@@ -33,6 +33,7 @@
|
|
33
33
|
/**
|
34
34
|
* ContactShadows is a component that allows to display contact shadows in the scene.
|
35
35
|
* @category Rendering
|
36
|
+
* @group Components
|
36
37
|
*/
|
37
38
|
export class ContactShadows extends Behaviour {
|
38
39
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
const defaultButtonIcon = "terminal";
|
13
13
|
|
14
14
|
const showConsole = getParam("console");
|
15
|
-
const suppressConsole = getParam("noerrors") || getParam("noconsole");
|
15
|
+
const suppressConsole = getParam("noerrors") || getParam("noconsole") || window.crossOriginIsolated;
|
16
16
|
if (showConsole) {
|
17
17
|
showDebugConsole();
|
18
18
|
}
|
@@ -243,7 +243,7 @@
|
|
243
243
|
|
244
244
|
};
|
245
245
|
script.onerror = () => {
|
246
|
-
console.warn("🌵 Debug console failed to load.");
|
246
|
+
console.warn("🌵 Debug console failed to load." + (window.crossOriginIsolated ? "This page is using cross-origin isolation, so external scripts can't be loaded." : ""));
|
247
247
|
isLoading = false;
|
248
248
|
consoleInstance = null;
|
249
249
|
};
|
@@ -12,6 +12,7 @@
|
|
12
12
|
/**
|
13
13
|
* A box-shaped area that can be used to delete objects that get into it. Useful for sandbox-style builders or physics simulations.
|
14
14
|
* @category Interactivity
|
15
|
+
* @group Components
|
15
16
|
*/
|
16
17
|
export class DeleteBox extends BoxHelperComponent {
|
17
18
|
static _instances: DeleteBox[] = [];
|
@@ -28,6 +29,7 @@
|
|
28
29
|
|
29
30
|
/** Objects with this component can be destroyed by the {@link DeleteBox} component.
|
30
31
|
* @category Interactivity
|
32
|
+
* @group Components
|
31
33
|
*/
|
32
34
|
export class Deletable extends Behaviour {
|
33
35
|
|
@@ -17,6 +17,7 @@
|
|
17
17
|
|
18
18
|
/**
|
19
19
|
* @category Effects
|
20
|
+
* @group Components
|
20
21
|
*/
|
21
22
|
export class DepthOfField extends PostProcessingEffect {
|
22
23
|
|
@@ -12,6 +12,7 @@
|
|
12
12
|
|
13
13
|
/**
|
14
14
|
* @category Utilities
|
15
|
+
* @group Components
|
15
16
|
*/
|
16
17
|
export class DeviceFlag extends Behaviour {
|
17
18
|
|
@@ -43,6 +43,7 @@
|
|
43
43
|
/**
|
44
44
|
* DragControls allows you to drag objects around in the scene. It can be used to move objects in 2D (screen space) or 3D (world space).
|
45
45
|
* @category Interactivity
|
46
|
+
* @group Components
|
46
47
|
*/
|
47
48
|
export class DragControls extends Behaviour implements IPointerEventHandler {
|
48
49
|
|
@@ -119,7 +120,7 @@
|
|
119
120
|
if (this._rigidbody?.[wasKinematicKey] === false) {
|
120
121
|
this._rigidbody.isKinematic = false;
|
121
122
|
this._rigidbody[wasKinematicKey] = undefined;
|
122
|
-
|
123
|
+
|
123
124
|
}
|
124
125
|
|
125
126
|
this._rigidbody = null;
|
@@ -1033,11 +1034,13 @@
|
|
1033
1034
|
const dragTimeSatisfied = this._draggedOverObjectDuration >= dragTimeThreshold;
|
1034
1035
|
const dragDistance = 0.001;
|
1035
1036
|
const dragDistanceSatisfied = this._totalMovement.length() >= dragDistance;
|
1037
|
+
// TODO: if the "hit.normal" is undefined we use the hit.face.normal which is still localspace
|
1038
|
+
const worldNormal = getTempVector(hit.normal || hit.face.normal).applyQuaternion(hit.object.worldQuaternion);
|
1036
1039
|
// Adjust drag plane if we're dragging over a different object (for a certain amount of time)
|
1037
1040
|
// or if the surface normal changed
|
1038
1041
|
if ((dragTimeSatisfied || dragDistanceSatisfied) &&
|
1039
1042
|
(this._draggedOverObjectLastSetUp !== this._draggedOverObject
|
1040
|
-
|| this._draggedOverObjectLastNormal.dot(
|
1043
|
+
|| this._draggedOverObjectLastNormal.dot(worldNormal) < 0.999999
|
1041
1044
|
// if we're dragging on a flat surface with different levels (like the sandbox floor)
|
1042
1045
|
|| this.context.time.frame % 60 === 0
|
1043
1046
|
)
|
@@ -1050,10 +1053,11 @@
|
|
1050
1053
|
|
1051
1054
|
this._bounds.getCenter(center);
|
1052
1055
|
this._bounds.getSize(size);
|
1053
|
-
center.sub(size.multiplyScalar(0.5).multiply(
|
1056
|
+
center.sub(size.multiplyScalar(0.5).multiply(worldNormal));
|
1054
1057
|
this._hitPointInLocalSpace.copy(center);
|
1055
1058
|
this._hitNormalInLocalSpace.copy(hit.face.normal);
|
1056
1059
|
|
1060
|
+
|
1057
1061
|
// ensure plane is far enough up that we don't drag into the surface
|
1058
1062
|
// Which offset we use here depends on the face normal direction we hit
|
1059
1063
|
// If we hit the bottom, we want to use the top, and vice versa
|
@@ -1068,7 +1072,12 @@
|
|
1068
1072
|
// See https://linear.app/needle/issue/NE-5004
|
1069
1073
|
// const offsetWP = this._followObject.worldPosition.sub(offset);
|
1070
1074
|
const point = hit.point;//.sub(offsetWP);
|
1071
|
-
|
1075
|
+
|
1076
|
+
// Gizmos.DrawWireSphere(point, 2, 0xff0000, .3);
|
1077
|
+
// Gizmos.DrawDirection(point, worldNormal, 0xffff00, 1);
|
1078
|
+
// console.log(hit.normal)
|
1079
|
+
|
1080
|
+
this._dragPlane.setFromNormalAndCoplanarPoint(worldNormal, point);
|
1072
1081
|
}
|
1073
1082
|
// If the drag has just started and we're not yet really starting to update the object's position
|
1074
1083
|
// we want to return here and wait until the drag has been going on for a bit
|
@@ -1101,7 +1110,7 @@
|
|
1101
1110
|
this._followObject.updateMatrix();
|
1102
1111
|
this._followObject.updateMatrixWorld(true);
|
1103
1112
|
|
1104
|
-
const newWP = this._hitPointInLocalSpace
|
1113
|
+
const newWP = getTempVector(this._hitPointInLocalSpace)//.clone();
|
1105
1114
|
this._followObject.localToWorld(newWP);
|
1106
1115
|
|
1107
1116
|
if (debug) {
|
@@ -1111,15 +1120,29 @@
|
|
1111
1120
|
this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(newWP);
|
1112
1121
|
this._followObject.updateMatrix();
|
1113
1122
|
|
1114
|
-
/*
|
1115
1123
|
// TODO figure out nicer look rotation here
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1124
|
+
// TODO rotating here will cause the object to intersect again with the surface
|
1125
|
+
// if (!keepRotation) {
|
1126
|
+
// const normal = this._dragPlane.normal;
|
1127
|
+
// // If the surface is perfectly aligned we jiggle the normal slightly in one direction
|
1128
|
+
// // Otherwise lookat will randomly choose a different rotation axis
|
1129
|
+
// const tinyNormalJiggle = 0.00001;
|
1130
|
+
// if (normal.x === 1) {
|
1131
|
+
// normal.add(getTempVector(0, tinyNormalJiggle, 0));
|
1132
|
+
// }
|
1133
|
+
// else if (normal.y === 1) {
|
1134
|
+
// normal.add(getTempVector(tinyNormalJiggle, 0, 0));
|
1135
|
+
// }
|
1136
|
+
// else if (normal.z === 1) {
|
1137
|
+
// normal.add(getTempVector(0, 0, tinyNormalJiggle));
|
1138
|
+
// }
|
1139
|
+
// const lookPoint = getTempVector(normal).multiplyScalar(1000).add(this._tempVec);
|
1140
|
+
// if (lookPoint) {
|
1141
|
+
// this._followObject.lookAt(lookPoint);
|
1142
|
+
// this._followObject.rotateX(Math.PI / 2);
|
1143
|
+
// }
|
1144
|
+
// }
|
1145
|
+
|
1123
1146
|
this._followObject.updateMatrix();
|
1124
1147
|
}
|
1125
1148
|
|
@@ -1142,13 +1165,14 @@
|
|
1142
1165
|
// TODO refactor to a common place
|
1143
1166
|
// TODO should use unscaled time here // some test for lerp speed depending on distance
|
1144
1167
|
const t = Mathf.clamp01(this.context.time.deltaTime * lerpStrength * lerpFactor);// / (currentDist - 1 + 0.01));
|
1168
|
+
const t_rotation = Mathf.clamp01(this.context.time.deltaTime * lerpStrength * .5 * lerpFactor);
|
1145
1169
|
|
1146
1170
|
const wp = draggedObject.worldPosition;
|
1147
1171
|
wp.lerp(this._followObject.worldPosition, t);
|
1148
1172
|
draggedObject.worldPosition = wp;
|
1149
1173
|
|
1150
1174
|
const rot = draggedObject.worldQuaternion;
|
1151
|
-
rot.slerp(this._followObject.worldQuaternion,
|
1175
|
+
rot.slerp(this._followObject.worldQuaternion, t_rotation);
|
1152
1176
|
draggedObject.worldQuaternion = rot;
|
1153
1177
|
|
1154
1178
|
|
@@ -65,6 +65,7 @@
|
|
65
65
|
* ```
|
66
66
|
*
|
67
67
|
* @category Asset Management
|
68
|
+
* @group Components
|
68
69
|
*/
|
69
70
|
export class DropListener extends Behaviour {
|
70
71
|
|
@@ -14,6 +14,7 @@
|
|
14
14
|
* The Duplicatable component is used to duplicate a assigned {@link GameObject} when a pointer event occurs on the GameObject.
|
15
15
|
* It implements the {@link IPointerEventHandler} interface and can be used to expose duplication to the user in the editor without writing code.
|
16
16
|
* @category Interactivity
|
17
|
+
* @group Components
|
17
18
|
*/
|
18
19
|
export class Duplicatable extends Behaviour implements IPointerEventHandler {
|
19
20
|
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
/**
|
6
6
|
* @category Effects
|
7
|
+
* @group Components
|
7
8
|
*/
|
8
9
|
export class EffectWrapper extends PostProcessingEffect {
|
9
10
|
|
@@ -262,11 +262,6 @@
|
|
262
262
|
logo.src = customLogo;
|
263
263
|
}
|
264
264
|
}
|
265
|
-
if (!isUsingCustomLogo) {
|
266
|
-
logo.style.cursor = "pointer";
|
267
|
-
logo.style.pointerEvents = "all";
|
268
|
-
logo.addEventListener("click", () => window.open("https://needle.tools", "_blank"));
|
269
|
-
}
|
270
265
|
content.appendChild(logo);
|
271
266
|
|
272
267
|
const details = document.createElement("div");
|
@@ -286,6 +286,9 @@
|
|
286
286
|
|
287
287
|
|
288
288
|
async function sendUsageMessageToAnalyticsBackend() {
|
289
|
+
// We can't send beacons from cross-origin isolated pages
|
290
|
+
if (window.crossOriginIsolated) return;
|
291
|
+
|
289
292
|
try {
|
290
293
|
const analyticsUrl = "https://needle-engine-analytics-v2-r26roub2hq-lz.a.run.app";
|
291
294
|
if (analyticsUrl) {
|
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
if (header?.ok) {
|
74
74
|
const data = await header.arrayBuffer();
|
75
|
-
const res = tryDetermineFileTypeFromBinary(data);
|
75
|
+
const res = tryDetermineFileTypeFromBinary(data, header);
|
76
76
|
if (debug) console.log("Determined file type from header: " + res);
|
77
77
|
return res;
|
78
78
|
}
|
@@ -84,7 +84,7 @@
|
|
84
84
|
/** Attempts to determine the file type of a binary file by looking at the first few bytes of the file.
|
85
85
|
* @hidden
|
86
86
|
*/
|
87
|
-
export function tryDetermineFileTypeFromBinary(data: ArrayBuffer): FileType {
|
87
|
+
export function tryDetermineFileTypeFromBinary(data: ArrayBuffer, response: Response): FileType {
|
88
88
|
|
89
89
|
if (data.byteLength < 4) {
|
90
90
|
return "unknown";
|
@@ -143,11 +143,31 @@
|
|
143
143
|
return "obj";
|
144
144
|
}
|
145
145
|
// Check if the file starts with "# File exported by ZBrush"
|
146
|
-
else if(bytes[0] == 35 && bytes[1] == 32 && bytes[2] == 70 && bytes[3] == 105 && bytes[4] == 108 && bytes[5] == 101 && bytes[6] == 32 && bytes[7] == 101 && bytes[8] == 120 && bytes[9] == 112 && bytes[10] == 111 && bytes[11] == 114 && bytes[12] == 116 && bytes[13] == 101 && bytes[14] == 100 && bytes[15] == 32 && bytes[16] == 98 && bytes[17] == 121 && bytes[18] == 32 && bytes[19] == 90 && bytes[20] == 66 && bytes[21] == 114 && bytes[22] == 117 && bytes[23] == 115 && bytes[24] == 104) {
|
146
|
+
else if (bytes[0] == 35 && bytes[1] == 32 && bytes[2] == 70 && bytes[3] == 105 && bytes[4] == 108 && bytes[5] == 101 && bytes[6] == 32 && bytes[7] == 101 && bytes[8] == 120 && bytes[9] == 112 && bytes[10] == 111 && bytes[11] == 114 && bytes[12] == 116 && bytes[13] == 101 && bytes[14] == 100 && bytes[15] == 32 && bytes[16] == 98 && bytes[17] == 121 && bytes[18] == 32 && bytes[19] == 90 && bytes[20] == 66 && bytes[21] == 114 && bytes[22] == 117 && bytes[23] == 115 && bytes[24] == 104) {
|
147
147
|
console.debug("OBJ detected (exported by ZBrush)");
|
148
148
|
return "obj";
|
149
149
|
}
|
150
150
|
else {
|
151
|
+
const content_type = response.headers.get("content-type");
|
152
|
+
console.debug("Content-Type: " + content_type);
|
153
|
+
switch (content_type) {
|
154
|
+
case "model/gltf+json":
|
155
|
+
return "gltf";
|
156
|
+
case "model/gltf-binary":
|
157
|
+
return "glb";
|
158
|
+
case "model/vnd.usdz+zip":
|
159
|
+
return "usdz";
|
160
|
+
case "model/vnd.usd+zip":
|
161
|
+
return "usd";
|
162
|
+
case "model/vnd.usda+zip":
|
163
|
+
return "usda";
|
164
|
+
case "model/fbx":
|
165
|
+
return "fbx";
|
166
|
+
case "text/plain":
|
167
|
+
// Should we assume obj here?
|
168
|
+
break;
|
169
|
+
}
|
170
|
+
|
151
171
|
if (isDevEnvironment() || debug) {
|
152
172
|
const text = new TextDecoder().decode(data.slice(0, 16));
|
153
173
|
console.debug("Could not determine file type from binary data: \"" + text + "...\"", bytes);
|
@@ -87,7 +87,7 @@
|
|
87
87
|
`Example: ${exampleUrlStr} will show an onscreen console window.`);
|
88
88
|
const postfix = showHelp === true ? "" : ` (containing "${showHelp}")`;
|
89
89
|
console.group("Available URL parameters:" + postfix);
|
90
|
-
for (const key
|
90
|
+
for (const key of Object.keys(params).sort()) {
|
91
91
|
// If ?help= is a string we only want to show the parameters that contain the string
|
92
92
|
if (typeof showHelp === "string") {
|
93
93
|
if (!key.toLowerCase().includes(showHelp.toLowerCase())) continue;
|
@@ -32,6 +32,7 @@
|
|
32
32
|
|
33
33
|
/**
|
34
34
|
* @category User Interface
|
35
|
+
* @group Components
|
35
36
|
*/
|
36
37
|
export class EventSystem extends Behaviour {
|
37
38
|
private static _eventSystemMap = new Map<Context, EventSystem[]>();
|
@@ -15,6 +15,7 @@
|
|
15
15
|
* The EventTrigger component is used to trigger events when certain pointer events occur on the GameObject.
|
16
16
|
* It implements the {@link IPointerEventHandler} interface and can be used to expose events to the user in the editor without writing code.
|
17
17
|
* @category Interactivity
|
18
|
+
* @group Components
|
18
19
|
*/
|
19
20
|
export class EventTrigger extends Behaviour implements IPointerEventHandler {
|
20
21
|
|
@@ -9,6 +9,7 @@
|
|
9
9
|
/**
|
10
10
|
* BoxGizmo is a component that displays a box around the object in the scene. It can optionally expand to the object's bounds.
|
11
11
|
* @category Helpers
|
12
|
+
* @group Components
|
12
13
|
*/
|
13
14
|
export class BoxGizmo extends Behaviour {
|
14
15
|
@serializable()
|
@@ -28,6 +28,7 @@
|
|
28
28
|
|
29
29
|
/**
|
30
30
|
* @category Asset Management
|
31
|
+
* @group Components
|
31
32
|
*/
|
32
33
|
export class GltfExport extends Behaviour {
|
33
34
|
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
/**
|
25
25
|
* @category User Interface
|
26
|
+
* @group Components
|
26
27
|
*/
|
27
28
|
export class Graphic extends BaseUIComponent implements IGraphic, IRectTransformChangedReceiver {
|
28
29
|
|
@@ -259,6 +260,7 @@
|
|
259
260
|
|
260
261
|
/**
|
261
262
|
* @category User Interface
|
263
|
+
* @group Components
|
262
264
|
*/
|
263
265
|
export class MaskableGraphic extends Graphic {
|
264
266
|
|
@@ -7,6 +7,7 @@
|
|
7
7
|
/**
|
8
8
|
* GridHelper is a component that allows to display a grid in the scene.
|
9
9
|
* @category Helpers
|
10
|
+
* @group Components
|
10
11
|
*/
|
11
12
|
export class GridHelper extends Behaviour {
|
12
13
|
|
@@ -12,6 +12,7 @@
|
|
12
12
|
/**
|
13
13
|
* GroundProjectedEnv creates a ground projection of the current environment map.
|
14
14
|
* @category Rendering
|
15
|
+
* @group Components
|
15
16
|
*/
|
16
17
|
export class GroundProjectedEnv extends Behaviour {
|
17
18
|
|
@@ -13,6 +13,7 @@
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @category User Interface
|
16
|
+
* @group Components
|
16
17
|
*/
|
17
18
|
export class Image extends MaskableGraphic {
|
18
19
|
|
@@ -83,6 +84,7 @@
|
|
83
84
|
|
84
85
|
/**
|
85
86
|
* @category User Interface
|
87
|
+
* @group Components
|
86
88
|
*/
|
87
89
|
export class RawImage extends MaskableGraphic {
|
88
90
|
@serializable(Texture)
|
@@ -11,6 +11,7 @@
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* @category User Interface
|
14
|
+
* @group Components
|
14
15
|
*/
|
15
16
|
export class InputField extends Behaviour implements IPointerEventHandler {
|
16
17
|
|
@@ -302,6 +302,7 @@
|
|
302
302
|
|
303
303
|
/**
|
304
304
|
* @category User Interface
|
305
|
+
* @group Components
|
305
306
|
*/
|
306
307
|
export class VerticalLayoutGroup extends HorizontalOrVerticalLayoutGroup {
|
307
308
|
|
@@ -313,6 +314,7 @@
|
|
313
314
|
|
314
315
|
/**
|
315
316
|
* @category User Interface
|
317
|
+
* @group Components
|
316
318
|
*/
|
317
319
|
export class HorizontalLayoutGroup extends HorizontalOrVerticalLayoutGroup {
|
318
320
|
|
@@ -324,6 +326,7 @@
|
|
324
326
|
|
325
327
|
/**
|
326
328
|
* @category User Interface
|
329
|
+
* @group Components
|
327
330
|
*/
|
328
331
|
export class GridLayoutGroup extends LayoutGroup {
|
329
332
|
protected onCalculateLayout() {
|
@@ -89,6 +89,7 @@
|
|
89
89
|
* The light can be set to be baked or realtime.
|
90
90
|
* The light can be set to be a main light which will be used for the main directional light in the scene.
|
91
91
|
* @category Rendering
|
92
|
+
* @group Components
|
92
93
|
*/
|
93
94
|
export class Light extends Behaviour implements ILight {
|
94
95
|
|
@@ -41,6 +41,7 @@
|
|
41
41
|
/**
|
42
42
|
* LODGroup allows to create a group of LOD levels for an object.
|
43
43
|
* @category Rendering
|
44
|
+
* @group Components
|
44
45
|
*/
|
45
46
|
export class LODGroup extends Behaviour {
|
46
47
|
|
@@ -401,6 +401,9 @@
|
|
401
401
|
:host .options > *:focus, ::slotted(*:focus) {
|
402
402
|
outline: rgba(255,255,255,.5) 1px solid;
|
403
403
|
}
|
404
|
+
:host .options > *:focus-visible, ::slotted(*:focus-visible) {
|
405
|
+
outline: rgba(0,0,0,.5) 1px solid;
|
406
|
+
}
|
404
407
|
|
405
408
|
:host .options > *:disabled, ::slotted(*:disabled) {
|
406
409
|
background: rgba(0,0,0,.05);
|
@@ -481,6 +484,9 @@
|
|
481
484
|
&:focus {
|
482
485
|
outline: 1px solid rgba(255,255,255,.5);
|
483
486
|
}
|
487
|
+
&:focus-visible {
|
488
|
+
outline: 1px solid rgba(0,0,0,.5);
|
489
|
+
}
|
484
490
|
& .expanded-click-area {
|
485
491
|
position: absolute;
|
486
492
|
left: 0;
|
@@ -7,6 +7,7 @@
|
|
7
7
|
* Exposes options to customize the built-in Needle Menu.
|
8
8
|
* From code, you can access the menu via {@link Context.menu}.
|
9
9
|
* @category User Interface
|
10
|
+
* @group Components
|
10
11
|
**/
|
11
12
|
export class NeedleMenu extends Behaviour {
|
12
13
|
|
@@ -9,6 +9,7 @@
|
|
9
9
|
/**
|
10
10
|
* The networking component is used to provide a websocket url to the networking system. It implements the {@link INetworkingWebsocketUrlProvider} interface.
|
11
11
|
* @category Networking
|
12
|
+
* @group Components
|
12
13
|
*/
|
13
14
|
export class Networking extends Behaviour implements INetworkingWebsocketUrlProvider {
|
14
15
|
|
@@ -18,6 +18,7 @@
|
|
18
18
|
/**
|
19
19
|
* OpenURL behaviour opens a URL in a new tab or window.
|
20
20
|
* @category Interactivity
|
21
|
+
* @group Components
|
21
22
|
*/
|
22
23
|
export class OpenURL extends Behaviour implements IPointerClickHandler {
|
23
24
|
|
@@ -46,6 +46,7 @@
|
|
46
46
|
* The three OrbitControls object can be accessed via the `controls` property.
|
47
47
|
* The object being controlled by the OrbitControls (usually the camera) can be accessed via the `controllerObject` property.
|
48
48
|
* @category Camera Controls
|
49
|
+
* @group Components
|
49
50
|
*/
|
50
51
|
export class OrbitControls extends Behaviour implements ICameraController {
|
51
52
|
|
@@ -648,6 +648,7 @@
|
|
648
648
|
* Needle Engine uses [three.quarks](https://github.com/Alchemist0823/three.quarks) under the hood to handle particles.
|
649
649
|
*
|
650
650
|
* @category Rendering
|
651
|
+
* @group Components
|
651
652
|
*/
|
652
653
|
export class ParticleSystem extends Behaviour implements IParticleSystem {
|
653
654
|
|
@@ -7,6 +7,7 @@
|
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @category Effects
|
10
|
+
* @group Components
|
10
11
|
*/
|
11
12
|
export class PixelationEffect extends PostProcessingEffect {
|
12
13
|
get typeName(): string {
|
@@ -57,6 +57,7 @@
|
|
57
57
|
* It is used to play, pause, stop and evaluate timelines.
|
58
58
|
* Assign a TimelineAsset to the `playableAsset` property to start playing a timeline.
|
59
59
|
* @category Animation and Sequencing
|
60
|
+
* @group Components
|
60
61
|
*/
|
61
62
|
export class PlayableDirector extends Behaviour {
|
62
63
|
|
@@ -10,6 +10,7 @@
|
|
10
10
|
* PlayerColor assigns a unique color for each user in the room to the object it is attached to.
|
11
11
|
* The color is generated based on the user's ID.
|
12
12
|
* @category Networking
|
13
|
+
* @group Components
|
13
14
|
*/
|
14
15
|
export class PlayerColor extends Behaviour {
|
15
16
|
|
@@ -49,6 +49,7 @@
|
|
49
49
|
* ```
|
50
50
|
*
|
51
51
|
* @category Effects
|
52
|
+
* @group Components
|
52
53
|
*/
|
53
54
|
export abstract class PostProcessingEffect extends Component implements IEffectProvider, IEditorModification {
|
54
55
|
|
@@ -27,7 +27,7 @@
|
|
27
27
|
button.title = "View this scene in AR. The scene will be exported to USDZ and opened with Apple's QuickLook.";
|
28
28
|
}
|
29
29
|
else {
|
30
|
-
button.innerText = "
|
30
|
+
button.innerText = "View in AR";
|
31
31
|
button.title = "Download this scene for AR. Open the downloaded USDZ file to view it in AR using Apple's QuickLook.";
|
32
32
|
}
|
33
33
|
|
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
/**
|
17
17
|
* @category Rendering
|
18
|
+
* @group Components
|
18
19
|
*/
|
19
20
|
export class ReflectionProbe extends Behaviour {
|
20
21
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
import { TypeStore } from "./../engine_typestore.js"
|
3
|
-
|
3
|
+
|
4
4
|
// Import types
|
5
5
|
import { __Ignore } from "../../engine-components/codegen/components.js";
|
6
6
|
import { ActionBuilder } from "../../engine-components/export/usdz/extensions/behavior/BehavioursBuilder.js";
|
@@ -220,7 +220,7 @@
|
|
220
220
|
import { XRFlag } from "../../engine-components/webxr/XRFlag.js";
|
221
221
|
import { XRRig } from "../../engine-components/webxr/WebXRRig.js";
|
222
222
|
import { XRState } from "../../engine-components/webxr/XRFlag.js";
|
223
|
-
|
223
|
+
|
224
224
|
// Register types
|
225
225
|
TypeStore.add("__Ignore", __Ignore);
|
226
226
|
TypeStore.add("ActionBuilder", ActionBuilder);
|
@@ -199,6 +199,7 @@
|
|
199
199
|
|
200
200
|
/**
|
201
201
|
* @category Rendering
|
202
|
+
* @group Components
|
202
203
|
*/
|
203
204
|
export class Renderer extends Behaviour implements IRenderer {
|
204
205
|
|
@@ -135,6 +135,7 @@
|
|
135
135
|
/**
|
136
136
|
* A Rigidbody is used together with a Collider to create physical interactions between objects in the scene.
|
137
137
|
* @category Physics
|
138
|
+
* @group Components
|
138
139
|
*/
|
139
140
|
export class Rigidbody extends Behaviour implements IRigidbody {
|
140
141
|
|
@@ -105,6 +105,7 @@
|
|
105
105
|
* ```
|
106
106
|
*
|
107
107
|
* @category Asset Management
|
108
|
+
* @group Components
|
108
109
|
*/
|
109
110
|
export class SceneSwitcher extends Behaviour {
|
110
111
|
|
@@ -71,6 +71,7 @@
|
|
71
71
|
* It is also possible to start the stream manually from your code by calling the {@link share} method.
|
72
72
|
*
|
73
73
|
* @category Networking
|
74
|
+
* @group Components
|
74
75
|
*/
|
75
76
|
export class ScreenCapture extends Behaviour implements IPointerClickHandler {
|
76
77
|
|
@@ -9,6 +9,7 @@
|
|
9
9
|
/** Screenspace Ambient Occlusion post-processing effect.
|
10
10
|
* We recommend using ScreenSpaceAmbientOcclusionN8 instead.
|
11
11
|
* @category Effects
|
12
|
+
* @group Components
|
12
13
|
*/
|
13
14
|
export class ScreenSpaceAmbientOcclusion extends PostProcessingEffect {
|
14
15
|
|
@@ -20,6 +20,7 @@
|
|
20
20
|
|
21
21
|
/** Screen Space Ambient Occlusion (SSAO) effect.
|
22
22
|
* @category Effects
|
23
|
+
* @group Components
|
23
24
|
* @link [N8AO documentation](https://github.com/N8python/n8ao)
|
24
25
|
*/
|
25
26
|
export class ScreenSpaceAmbientOcclusionN8 extends PostProcessingEffect {
|
@@ -23,6 +23,7 @@
|
|
23
23
|
*
|
24
24
|
* Note that ShadowCatcher meshes are not raycastable by default; if you want them to be raycastable, change the layers in `onEnable()`.
|
25
25
|
* @category Rendering
|
26
|
+
* @group Components
|
26
27
|
*/
|
27
28
|
export class ShadowCatcher extends Behaviour {
|
28
29
|
|
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
/**
|
8
8
|
* @category Effects
|
9
|
+
* @group Components
|
9
10
|
*/
|
10
11
|
export class SharpeningEffect extends PostProcessingEffect {
|
11
12
|
|
@@ -10,6 +10,7 @@
|
|
10
10
|
* SmoothFollow makes the {@link Object3D} (`GameObject`) smoothly follow another target {@link Object3D}.
|
11
11
|
* It can follow the target's position, rotation, or both.
|
12
12
|
* @category Interactivity
|
13
|
+
* @group Components
|
13
14
|
*/
|
14
15
|
export class SmoothFollow extends Behaviour {
|
15
16
|
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
/**
|
20
20
|
* @category Interactivity
|
21
|
+
* @group Components
|
21
22
|
*/
|
22
23
|
export class SpatialTriggerReceiver extends Behaviour {
|
23
24
|
|
@@ -84,6 +85,7 @@
|
|
84
85
|
/**
|
85
86
|
* A trigger that can be used to detect if an object is inside a box.
|
86
87
|
* @category Interactivity
|
88
|
+
* @group Components
|
87
89
|
*/
|
88
90
|
export class SpatialTrigger extends Behaviour {
|
89
91
|
|
@@ -26,6 +26,7 @@
|
|
26
26
|
|
27
27
|
/**
|
28
28
|
* @category Networking
|
29
|
+
* @group Components
|
29
30
|
*/
|
30
31
|
export class SpectatorCamera extends Behaviour {
|
31
32
|
|
@@ -84,6 +84,7 @@
|
|
84
84
|
/**
|
85
85
|
* A sprite is a mesh that represents a 2D image
|
86
86
|
* @category Rendering
|
87
|
+
* @group Components
|
87
88
|
*/
|
88
89
|
export class Sprite {
|
89
90
|
|
@@ -64,6 +64,7 @@
|
|
64
64
|
* SyncedCamera is a component that syncs the camera position and rotation of all users in the room.
|
65
65
|
* A prefab can be set to represent the remote cameras visually in the scene.
|
66
66
|
* @category Networking
|
67
|
+
* @group Components
|
67
68
|
*/
|
68
69
|
export class SyncedCamera extends Behaviour {
|
69
70
|
|
@@ -34,6 +34,7 @@
|
|
34
34
|
* ```
|
35
35
|
*
|
36
36
|
* @category Networking
|
37
|
+
* @group Components
|
37
38
|
*/
|
38
39
|
export class SyncedRoom extends Behaviour {
|
39
40
|
|
@@ -52,6 +52,7 @@
|
|
52
52
|
/**
|
53
53
|
* SyncedTransform is a behaviour that syncs the transform of a game object over the network.
|
54
54
|
* @category Networking
|
55
|
+
* @group Components
|
55
56
|
*/
|
56
57
|
export class SyncedTransform extends Behaviour {
|
57
58
|
|
@@ -41,6 +41,7 @@
|
|
41
41
|
|
42
42
|
/**
|
43
43
|
* @category User Interface
|
44
|
+
* @group Components
|
44
45
|
*/
|
45
46
|
export class Text extends Graphic implements IHasAlphaFactor, ICanvasEventReceiver {
|
46
47
|
|
@@ -54,6 +54,11 @@
|
|
54
54
|
return str;
|
55
55
|
}
|
56
56
|
|
57
|
+
function makeDisplayNameSafe(str) {
|
58
|
+
str = str.replace("\"", "\\\"");
|
59
|
+
return str;
|
60
|
+
}
|
61
|
+
|
57
62
|
// TODO check if this works when bones in the skeleton are completely unordered
|
58
63
|
function findCommonAncestor(objects: Object3D[]): Object3D | null {
|
59
64
|
if (objects.length === 0) return null;
|
@@ -865,7 +870,7 @@
|
|
865
870
|
|
866
871
|
if ( model ) {
|
867
872
|
|
868
|
-
model.displayName = object.name;
|
873
|
+
model.displayName = object.userData?.name || object.name;
|
869
874
|
model.visibility = object.visible ? undefined : "invisible";
|
870
875
|
|
871
876
|
if ( parentModel ) {
|
@@ -1497,7 +1502,7 @@
|
|
1497
1502
|
}
|
1498
1503
|
|
1499
1504
|
if (model.displayName)
|
1500
|
-
writer.appendLine(`displayName = "${model.displayName}"`);
|
1505
|
+
writer.appendLine(`displayName = "${makeDisplayNameSafe(model.displayName)}"`);
|
1501
1506
|
|
1502
1507
|
if ( camera || model.type === undefined) {
|
1503
1508
|
writer.closeBlock( ")" );
|
@@ -2313,7 +2318,7 @@
|
|
2313
2318
|
return `
|
2314
2319
|
|
2315
2320
|
def Material "${materialName}" ${material.name ?`(
|
2316
|
-
displayName = "${material.name}"
|
2321
|
+
displayName = "${makeDisplayNameSafe(material.name)}"
|
2317
2322
|
)` : ''}
|
2318
2323
|
{
|
2319
2324
|
token outputs:surface.connect = ${materialRoot}/${materialName}/PreviewSurface.outputs:surface>
|
@@ -7,6 +7,7 @@
|
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @category Effects
|
10
|
+
* @group Components
|
10
11
|
*/
|
11
12
|
export class TiltShiftEffect extends PostProcessingEffect {
|
12
13
|
get typeName(): string {
|
@@ -65,6 +65,7 @@
|
|
65
65
|
|
66
66
|
/**
|
67
67
|
* @category Effects
|
68
|
+
* @group Components
|
68
69
|
*/
|
69
70
|
export class ToneMappingEffect extends PostProcessingEffect {
|
70
71
|
|
@@ -10,6 +10,7 @@
|
|
10
10
|
/**
|
11
11
|
* TransformGizmo is a component that displays a gizmo for transforming the object in the scene.
|
12
12
|
* @category Helpers
|
13
|
+
* @group Components
|
13
14
|
*/
|
14
15
|
export class TransformGizmo extends Behaviour {
|
15
16
|
|
@@ -67,6 +67,7 @@
|
|
67
67
|
* usdz.exportAsync();
|
68
68
|
* ```
|
69
69
|
* @category XR
|
70
|
+
* @group Components
|
70
71
|
*/
|
71
72
|
export class USDZExporter extends Behaviour {
|
72
73
|
|
@@ -55,6 +55,7 @@
|
|
55
55
|
* });
|
56
56
|
* ```
|
57
57
|
* @category Multimedia
|
58
|
+
* @group Components
|
58
59
|
*/
|
59
60
|
export class VideoPlayer extends Behaviour {
|
60
61
|
|
@@ -7,6 +7,7 @@
|
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @category Effects
|
10
|
+
* @group Components
|
10
11
|
*/
|
11
12
|
export class Vignette extends PostProcessingEffect {
|
12
13
|
get typeName(): string {
|
@@ -15,6 +15,7 @@
|
|
15
15
|
* The Voice over IP component (VoIP) allows you to send and receive audio streams to other users in the same networked room.
|
16
16
|
* It requires a networking connection to be working (e.g. by having an active SyncedRoom component in the scene or by connecting to a room manually).
|
17
17
|
* @category Networking
|
18
|
+
* @group Components
|
18
19
|
*/
|
19
20
|
export class Voip extends Behaviour {
|
20
21
|
|
@@ -42,6 +42,7 @@
|
|
42
42
|
*
|
43
43
|
* @category Rendering
|
44
44
|
* @category Effects
|
45
|
+
* @group Components
|
45
46
|
*/
|
46
47
|
export class Volume extends Behaviour implements IEditorModificationReceiver, IPostProcessingManager {
|
47
48
|
|
@@ -29,6 +29,7 @@
|
|
29
29
|
* ```
|
30
30
|
*
|
31
31
|
* @category XR
|
32
|
+
* @group Components
|
32
33
|
*/
|
33
34
|
export class WebARSessionRoot extends Behaviour {
|
34
35
|
|
@@ -26,6 +26,7 @@
|
|
26
26
|
* WebXR component to enable VR, AR and Quicklook on iOS in your scene.
|
27
27
|
* It provides a simple wrapper around the {@link NeedleXRSession} API and adds some additional features like creating buttons or enabling default movement behaviour.
|
28
28
|
* @category XR
|
29
|
+
* @group Components
|
29
30
|
*/
|
30
31
|
export class WebXR extends Behaviour {
|
31
32
|
|
@@ -406,7 +407,7 @@
|
|
406
407
|
// If the menu exists and the QRCode option is disabled we dont create it (NE-4919)
|
407
408
|
if (isDevEnvironment()) console.warn("WebXR: QRCode button is disabled in the Needle Menu component")
|
408
409
|
}
|
409
|
-
else {
|
410
|
+
else if (!DeviceUtilities.isMobileDevice()) {
|
410
411
|
const qrCode = ButtonsFactory.getOrCreate().createQRCode();
|
411
412
|
this.addButton(qrCode, xrButtonsPriority);
|
412
413
|
}
|
@@ -62,7 +62,7 @@
|
|
62
62
|
button.innerText = "View in AR";
|
63
63
|
}
|
64
64
|
else {
|
65
|
-
button.innerText = "
|
65
|
+
button.innerText = "View in AR";
|
66
66
|
}
|
67
67
|
button.prepend(getIconElement("view_in_ar"));
|
68
68
|
|
@@ -228,6 +228,7 @@
|
|
228
228
|
|
229
229
|
/**
|
230
230
|
* @category XR
|
231
|
+
* @group Components
|
231
232
|
*/
|
232
233
|
export class WebXRImageTracking extends Behaviour {
|
233
234
|
|
@@ -50,6 +50,7 @@
|
|
50
50
|
/**
|
51
51
|
* Use this component to track planes and meshes in the real world when in immersive-ar (e.g. on Oculus Quest).
|
52
52
|
* @category XR
|
53
|
+
* @group Components
|
53
54
|
*/
|
54
55
|
export class WebXRPlaneTracking extends Behaviour {
|
55
56
|
|
@@ -14,6 +14,7 @@
|
|
14
14
|
* A user in XR (VR or AR) is parented to an XR rig during the session.
|
15
15
|
* When moving through the scene the rig is moved instead of the user.
|
16
16
|
* @category XR
|
17
|
+
* @group Components
|
17
18
|
*/
|
18
19
|
export class XRRig extends Behaviour implements IXRRig {
|
19
20
|
|
@@ -10,6 +10,7 @@
|
|
10
10
|
/**
|
11
11
|
* Add this script to an object and set `side` to make the object follow a specific controller.
|
12
12
|
* @category XR
|
13
|
+
* @group Components
|
13
14
|
* */
|
14
15
|
export class XRControllerFollow extends Behaviour {
|
15
16
|
|
@@ -23,6 +23,7 @@
|
|
23
23
|
/**
|
24
24
|
* XRControllerMovement is a component that allows to move the XR rig using the XR controller input.
|
25
25
|
* @category XR
|
26
|
+
* @group Components
|
26
27
|
*/
|
27
28
|
export class XRControllerMovement extends Behaviour implements XRMovementBehaviour {
|
28
29
|
|
@@ -63,6 +63,7 @@
|
|
63
63
|
/**
|
64
64
|
* @category XR
|
65
65
|
* @category Utilities
|
66
|
+
* @group Components
|
66
67
|
*/
|
67
68
|
export class XRFlag extends Behaviour {
|