Changed Node Image for Coolify
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
ARG NEEDLE_APP=MenuScene
|
||||
|
||||
FROM node:22-alpine AS builder
|
||||
FROM node:22 AS builder
|
||||
ARG NEEDLE_APP
|
||||
WORKDIR /src
|
||||
|
||||
|
||||
BIN
Needle/MenuScene/dist/assets/MenuScene.glb
vendored
BIN
Needle/MenuScene/dist/assets/MenuScene.glb
vendored
Binary file not shown.
BIN
Needle/MenuScene/dist/include/poster.webp
vendored
BIN
Needle/MenuScene/dist/include/poster.webp
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Binary file not shown.
@@ -19,7 +19,7 @@ function initAssetPicker(): void {
|
||||
const labelEl = document.querySelector("#asset-picker-label");
|
||||
const indexEl = document.querySelector("#asset-picker-index");
|
||||
|
||||
if (!needle || !prev || !next || !arBtn || !labelEl || !indexEl) return;
|
||||
if (!needle || !prev || !next || !labelEl || !indexEl) return;
|
||||
|
||||
let menuController: MenuController | null = null;
|
||||
let immersiveSessionActive = false;
|
||||
@@ -43,10 +43,12 @@ function initAssetPicker(): void {
|
||||
prev.disabled = !canNav;
|
||||
next.disabled = !canNav;
|
||||
|
||||
arBtn.disabled =
|
||||
!arSupported ||
|
||||
arStarting ||
|
||||
immersiveSessionActive;
|
||||
if (arBtn) {
|
||||
arBtn.disabled =
|
||||
!arSupported ||
|
||||
arStarting ||
|
||||
immersiveSessionActive;
|
||||
}
|
||||
};
|
||||
|
||||
const bindMenuController = async (): Promise<void> => {
|
||||
@@ -88,7 +90,7 @@ function initAssetPicker(): void {
|
||||
|
||||
prev.addEventListener("click", () => requestNavigate(-1));
|
||||
next.addEventListener("click", () => requestNavigate(1));
|
||||
arBtn.addEventListener("click", () => void startAr());
|
||||
arBtn?.addEventListener("click", () => void startAr());
|
||||
|
||||
needle.addEventListener("enter-ar", () => {
|
||||
immersiveSessionActive = true;
|
||||
|
||||
27
Needle/MenuScene/src/disableCameraControls.ts
Normal file
27
Needle/MenuScene/src/disableCameraControls.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { onStart, OrbitControls } from "@needle-tools/engine";
|
||||
|
||||
/**
|
||||
* Turn off orbit / pan / zoom from the exported scene (Main Camera often has {@link OrbitControls}).
|
||||
* `<needle-engine camera-controls="false">` only skips auto-injected controls; Unity-serialized ones
|
||||
* must be disabled in code.
|
||||
*/
|
||||
onStart((context) => {
|
||||
const oc = context.scene.getComponentInChildren(OrbitControls);
|
||||
if (!oc) return;
|
||||
|
||||
oc.enableRotate = false;
|
||||
oc.enablePan = false;
|
||||
oc.enableZoom = false;
|
||||
oc.enableKeys = false;
|
||||
oc.autoRotate = false;
|
||||
oc.middleClickToFocus = false;
|
||||
oc.doubleClickToFocus = false;
|
||||
oc.clickBackgroundToFitScene = 0;
|
||||
|
||||
const three = oc.controls;
|
||||
if (three) {
|
||||
three.enabled = false;
|
||||
}
|
||||
|
||||
oc.enabled = false;
|
||||
});
|
||||
@@ -19,7 +19,7 @@ document.addEventListener("DOMContentLoaded", () =>
|
||||
const needleEngine = document.querySelector("needle-engine");
|
||||
if(needleEngine && needleEngine.getAttribute("src") === null)
|
||||
{
|
||||
needleEngine.setAttribute("hash", "1776659726595");
|
||||
needleEngine.setAttribute("hash", "1776799769658");
|
||||
needleEngine.setAttribute("src", JSON.stringify(needle_exported_files));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import("@needle-tools/engine") /* async import of needle engine */;
|
||||
import "./disableCameraControls";
|
||||
import "./dishMeshFallback";
|
||||
import "./enableXR";
|
||||
import "./assetPicker";
|
||||
@@ -26,13 +26,16 @@ export class MenuController extends Behaviour {
|
||||
@serializable(Object3D)
|
||||
webXROrigin?: Object3D;
|
||||
|
||||
/** Local-space vertical bob amplitude (meters). Set to 0 to disable. */
|
||||
/**
|
||||
* Local-space vertical bob amplitude (meters). Set to 0 to disable.
|
||||
* Peak-to-peak motion is 2× this value; 0.004 ≈ 8 mm total — subtle but visible.
|
||||
*/
|
||||
@serializable()
|
||||
dishBobAmplitude = 0.05;
|
||||
dishBobAmplitude = 0.004;
|
||||
|
||||
/** Bob angular speed (radians per second). */
|
||||
@serializable()
|
||||
dishBobSpeed = 2.5;
|
||||
dishBobSpeed = 1.0;
|
||||
|
||||
private usdzExporter?: USDZExporter;
|
||||
|
||||
|
||||
@@ -63,16 +63,6 @@ needle-engine {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
#asset-picker #asset-picker-ar {
|
||||
background: #34c759;
|
||||
color: #0a0a0c;
|
||||
}
|
||||
|
||||
#asset-picker #asset-picker-ar:disabled {
|
||||
background: #3a3a3e;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
#asset-picker .asset-picker__label {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
@@ -20,14 +20,13 @@
|
||||
<body>
|
||||
<script type="module" src="./src/generated/gen.js"></script>
|
||||
<script type="module" src="./src/main.ts"></script>
|
||||
<needle-engine>
|
||||
<needle-engine camera-controls="false">
|
||||
<div id="asset-picker" class="ar desktop">
|
||||
<div class="asset-picker__inner">
|
||||
<button type="button" id="asset-picker-prev" aria-label="Previous model">Previous</button>
|
||||
<span id="asset-picker-label" class="asset-picker__label"></span>
|
||||
<span id="asset-picker-index" class="asset-picker__index" aria-live="polite"></span>
|
||||
<button type="button" id="asset-picker-next" aria-label="Next model">Next</button>
|
||||
<button type="button" id="asset-picker-ar" aria-label="Start augmented reality">View in AR</button>
|
||||
</div>
|
||||
</div>
|
||||
</needle-engine>
|
||||
|
||||
@@ -19,7 +19,7 @@ function initAssetPicker(): void {
|
||||
const labelEl = document.querySelector("#asset-picker-label");
|
||||
const indexEl = document.querySelector("#asset-picker-index");
|
||||
|
||||
if (!needle || !prev || !next || !arBtn || !labelEl || !indexEl) return;
|
||||
if (!needle || !prev || !next || !labelEl || !indexEl) return;
|
||||
|
||||
let menuController: MenuController | null = null;
|
||||
let immersiveSessionActive = false;
|
||||
@@ -43,10 +43,12 @@ function initAssetPicker(): void {
|
||||
prev.disabled = !canNav;
|
||||
next.disabled = !canNav;
|
||||
|
||||
arBtn.disabled =
|
||||
!arSupported ||
|
||||
arStarting ||
|
||||
immersiveSessionActive;
|
||||
if (arBtn) {
|
||||
arBtn.disabled =
|
||||
!arSupported ||
|
||||
arStarting ||
|
||||
immersiveSessionActive;
|
||||
}
|
||||
};
|
||||
|
||||
const bindMenuController = async (): Promise<void> => {
|
||||
@@ -88,7 +90,7 @@ function initAssetPicker(): void {
|
||||
|
||||
prev.addEventListener("click", () => requestNavigate(-1));
|
||||
next.addEventListener("click", () => requestNavigate(1));
|
||||
arBtn.addEventListener("click", () => void startAr());
|
||||
arBtn?.addEventListener("click", () => void startAr());
|
||||
|
||||
needle.addEventListener("enter-ar", () => {
|
||||
immersiveSessionActive = true;
|
||||
|
||||
27
Needle/SampleScene/src/disableCameraControls.ts
Normal file
27
Needle/SampleScene/src/disableCameraControls.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { onStart, OrbitControls } from "@needle-tools/engine";
|
||||
|
||||
/**
|
||||
* Turn off orbit / pan / zoom from the exported scene.
|
||||
* `<needle-engine camera-controls="false">` only skips auto-injected controls; Unity-serialized ones
|
||||
* must be disabled in code.
|
||||
*/
|
||||
onStart((context) => {
|
||||
const oc = context.scene.getComponentInChildren(OrbitControls);
|
||||
if (!oc) return;
|
||||
|
||||
oc.enableRotate = false;
|
||||
oc.enablePan = false;
|
||||
oc.enableZoom = false;
|
||||
oc.enableKeys = false;
|
||||
oc.autoRotate = false;
|
||||
oc.middleClickToFocus = false;
|
||||
oc.doubleClickToFocus = false;
|
||||
oc.clickBackgroundToFitScene = 0;
|
||||
|
||||
const three = oc.controls;
|
||||
if (three) {
|
||||
three.enabled = false;
|
||||
}
|
||||
|
||||
oc.enabled = false;
|
||||
});
|
||||
27
Needle/SampleScene/src/generated/gen.js
Normal file
27
Needle/SampleScene/src/generated/gen.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Developer Information:
|
||||
* This file was generated using Unity 6000.4.3f1.
|
||||
* Do not modify this file manually.
|
||||
|
||||
* Instead of using generated code you can also load the 3D scene like this: <needle-engine src="/assets/your_glTF_name.glb"></needle-engine>
|
||||
* (When you're working with Unity the glTF file name will always match your scene or prefab's name)
|
||||
*/
|
||||
|
||||
globalThis["needle:dependencies:ready"] = import("./register_types.ts")
|
||||
|
||||
/** @type {string[]} */
|
||||
export const needle_exported_files = new Array();
|
||||
globalThis["needle:codegen_files"] = needle_exported_files;
|
||||
import "../../assets/SampleScene.glb?url";
|
||||
needle_exported_files.push("./assets/SampleScene.glb");
|
||||
document.addEventListener("DOMContentLoaded", () =>
|
||||
{
|
||||
const needleEngine = document.querySelector("needle-engine");
|
||||
if(needleEngine && needleEngine.getAttribute("src") === null)
|
||||
{
|
||||
needleEngine.setAttribute("hash", "1776607707382");
|
||||
needleEngine.setAttribute("src", JSON.stringify(needle_exported_files));
|
||||
}
|
||||
});
|
||||
|
||||
console.log("Made\ with\ ♥\ by\ 🌵\ Needle\ -\ https://needle\.tools\ —\ Version\ 5\.0\.3");
|
||||
16
Needle/SampleScene/src/generated/meta.json
Normal file
16
Needle/SampleScene/src/generated/meta.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"sceneName": "Sample Scene",
|
||||
"meta": null,
|
||||
"absolutePath": "https://localhost:3000",
|
||||
"deployOnly": false,
|
||||
"needleEditor": null,
|
||||
"gzip": true,
|
||||
"generator": "Unity 6000.4.3f1, Needle Engine Integration @5.0.3",
|
||||
"license": {
|
||||
"team": "org_vl8u9dsjhx6b"
|
||||
},
|
||||
"allowHotReload": true,
|
||||
"developmentBuild": false,
|
||||
"facebookInstantGames": null,
|
||||
"useRapier": true
|
||||
}
|
||||
10
Needle/SampleScene/src/generated/register_types.ts
Normal file
10
Needle/SampleScene/src/generated/register_types.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/* eslint-disable */
|
||||
import { TypeStore } from "@needle-tools/engine";
|
||||
|
||||
import { ARObjectController } from "../scripts/ARObjectController.js";
|
||||
import { MenuController } from "../scripts/MenuController.js";
|
||||
import { PostProcessingVolumeController } from "../scripts/PostProcessingVolumeController.js";
|
||||
|
||||
TypeStore.add("ARObjectController", ARObjectController);
|
||||
TypeStore.add("MenuController", MenuController);
|
||||
TypeStore.add("PostProcessingVolumeController", PostProcessingVolumeController);
|
||||
@@ -1,3 +1,4 @@
|
||||
import("@needle-tools/engine") /* async import of needle engine */;
|
||||
import "./disableCameraControls";
|
||||
import "./enableXR";
|
||||
import "./assetPicker";
|
||||
@@ -26,13 +26,16 @@ export class MenuController extends Behaviour {
|
||||
@serializable(Object3D)
|
||||
webXROrigin?: Object3D;
|
||||
|
||||
/** Local-space vertical bob amplitude (meters). Set to 0 to disable. */
|
||||
/**
|
||||
* Local-space vertical bob amplitude (meters). Set to 0 to disable.
|
||||
* Peak-to-peak motion is 2× this value; 0.004 ≈ 8 mm total — subtle but visible.
|
||||
*/
|
||||
@serializable()
|
||||
dishBobAmplitude = 0.05;
|
||||
dishBobAmplitude = 0.004;
|
||||
|
||||
/** Bob angular speed (radians per second). */
|
||||
@serializable()
|
||||
dishBobSpeed = 2.5;
|
||||
dishBobSpeed = 1.0;
|
||||
|
||||
private usdzExporter?: USDZExporter;
|
||||
|
||||
|
||||
@@ -63,16 +63,6 @@ needle-engine {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
#asset-picker #asset-picker-ar {
|
||||
background: #34c759;
|
||||
color: #0a0a0c;
|
||||
}
|
||||
|
||||
#asset-picker #asset-picker-ar:disabled {
|
||||
background: #3a3a3e;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
#asset-picker .asset-picker__label {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
Reference in New Issue
Block a user