@needle-tools/engine 2.60.3-pre → 2.60.4-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 +5 -0
- package/dist/needle-engine.js +1600 -1596
- package/dist/needle-engine.umd.cjs +48 -48
- package/lib/engine-components/WebXR.d.ts +1 -0
- package/lib/engine-components/WebXR.js +7 -0
- package/lib/engine-components/WebXR.js.map +1 -1
- package/lib/engine-components/ui/BaseUIComponent.js +1 -1
- package/lib/engine-components/ui/BaseUIComponent.js.map +1 -1
- package/lib/engine-components/ui/Canvas.js +2 -0
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/Text.js +1 -1
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/engine-components/WebXR.ts +8 -0
- package/src/engine-components/ui/BaseUIComponent.ts +1 -1
- package/src/engine-components/ui/Canvas.ts +2 -0
- package/src/engine-components/ui/Text.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/engine",
|
|
3
|
-
"version": "2.60.
|
|
3
|
+
"version": "2.60.4-pre",
|
|
4
4
|
"description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible, and collaboration and XR come naturally.",
|
|
5
5
|
"main": "dist/needle-engine.umd.cjs",
|
|
6
6
|
"module": "dist/needle-engine.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@babel/runtime": "^7.16.0",
|
|
58
58
|
"@luncheon/esbuild-plugin-gzip": "^0.1.0",
|
|
59
|
-
"@needle-tools/gltf-transform-extensions": "^0.11.
|
|
59
|
+
"@needle-tools/gltf-transform-extensions": "^0.11.1-pre",
|
|
60
60
|
"@needle-tools/needle-component-compiler": "1.9.3",
|
|
61
61
|
"@needle-tools/helper": "^0.2.1-pre",
|
|
62
62
|
"@types/three": "0.146.0",
|
|
@@ -16,6 +16,7 @@ import { ControllerType, WebXRController } from "./WebXRController";
|
|
|
16
16
|
import { XRRig } from "./WebXRRig";
|
|
17
17
|
import { WebXRSync } from "./WebXRSync";
|
|
18
18
|
import { XRFlag, XRState, XRStateFlag } from "./XRFlag";
|
|
19
|
+
import { showBalloonWarning } from '../engine/debug';
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
export async function detectARSupport() {
|
|
@@ -201,6 +202,13 @@ export class WebXR extends Behaviour {
|
|
|
201
202
|
this.webAR = new WebAR(this);
|
|
202
203
|
}
|
|
203
204
|
|
|
205
|
+
start() {
|
|
206
|
+
if (location.protocol == 'http:' && location.host.indexOf('localhost') < 0) {
|
|
207
|
+
showBalloonWarning("WebXR only works on https");
|
|
208
|
+
console.warn("WebXR only works on https. https://engine.needle.tools/docs/xr.html");
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
204
212
|
onEnable() {
|
|
205
213
|
if (this.isInit) return;
|
|
206
214
|
if (!this.enableAR && !this.enableVR) return;
|
|
@@ -66,7 +66,7 @@ export class BaseUIComponent extends Behaviour {
|
|
|
66
66
|
const searchFrom = this.isRoot() ? this.gameObject : this.gameObject.parent;
|
|
67
67
|
this._parentComponent = GameObject.getComponentInParent(searchFrom!, BaseUIComponent);
|
|
68
68
|
if (!this._parentComponent) {
|
|
69
|
-
console.warn(`Component \"${this.name}\" doesn't have a UI parent anywhere. Do you have
|
|
69
|
+
console.warn(`Component \"${this.name}\" doesn't have a UI parent anywhere. Do you have an UI element outside a Canvas? UI components must be a child of a Canvas component`, this);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -7,6 +7,7 @@ import * as THREE from "three";
|
|
|
7
7
|
import { getComponentsInChildren } from "../../engine/engine_components";
|
|
8
8
|
import { IComponent } from "../../engine/engine_types";
|
|
9
9
|
import { GameObject } from "../Component";
|
|
10
|
+
import { showBalloonMessage, showBalloonWarning } from "../../engine/debug";
|
|
10
11
|
|
|
11
12
|
export enum RenderMode {
|
|
12
13
|
ScreenSpaceOverlay = 0,
|
|
@@ -147,6 +148,7 @@ export class Canvas extends UIRootComponent {
|
|
|
147
148
|
switch (this.renderMode) {
|
|
148
149
|
case RenderMode.ScreenSpaceOverlay:
|
|
149
150
|
case RenderMode.ScreenSpaceCamera:
|
|
151
|
+
showBalloonWarning("Screenspace Canvas is not supported yet. Please use worldspace");
|
|
150
152
|
const camera = this.context.mainCameraComponent;
|
|
151
153
|
if (!camera) return;
|
|
152
154
|
const canvas = this.gameObject;
|