From 0f5a4722ec59d2a939902d44d159ed67f0817b1b Mon Sep 17 00:00:00 2001 From: bhvgt Date: Tue, 26 Apr 2022 15:58:31 +0530 Subject: [PATCH] Initial Commit. --- README.md | 39 +++- package.json | 53 ++++- pnpm-lock.yaml | 417 ++++++++++++++++++++++++++++++++++++- src/app.html | 4 +- src/lib/AssetCreator.ts | 4 +- src/lib/xrScene.ts | 15 +- src/routes/__layout.svelte | 19 ++ src/routes/index.svelte | 11 +- svelte.config.js | 11 +- tsconfig.json | 12 +- unocss.config.ts | 9 - 11 files changed, 550 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 8637016..374efec 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,38 @@ -# better-babylonjs-playground-1rrivh +# create-svelte -[Edit on StackBlitz ⚡️](https://stackblitz.com/edit/better-babylonjs-playground-1rrivh) \ No newline at end of file +Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). + +## Creating a project + +If you're seeing this, you've probably already done this step. Congrats! + +```bash +# create a new project in the current directory +npm init svelte + +# create a new project in my-app +npm init svelte my-app +``` + +## Developing + +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: + +```bash +npm run dev + +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +To create a production version of your app: + +```bash +npm run build +``` + +You can preview the production build with `npm run preview`. + +> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. diff --git a/package.json b/package.json index e3c3c2b..fe6bfff 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,46 @@ { - "name": "better-babylonjs-playground", - "version": "0.0.0", - "private": true, - "type": "module", + "name": "babylonjs-playground", + "version": "0.0.1", + "scripts": { + "dev": "svelte-kit dev", + "build": "svelte-kit build", + "package": "svelte-kit package", + "preview": "svelte-kit preview", + "prepare": "svelte-kit sync", + "check": "svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", + "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ." + }, "dependencies": { "@babylonjs/core": "^5.3.0", - "@babylonjs/gui": "5.3.0", - "@babylonjs/loaders": "5.3.0", - "@babylonjs/materials": "5.3.0", - "babylonjs-loaders": "5.3.0" - } -} + "@babylonjs/gui": "^5.3.0", + "@babylonjs/loaders": "^5.3.0", + "@babylonjs/materials": "^5.3.0", + "babylonjs-loaders": "^5.3.0", + "lodash-es": "^4.17.21" + }, + "devDependencies": { + "@sveltejs/adapter-auto": "next", + "@sveltejs/kit": "next", + "@types/lodash-es": "^4.17.6", + "@typescript-eslint/eslint-plugin": "^5.10.1", + "@typescript-eslint/parser": "^5.10.1", + "eslint": "^7.32.0", + "vite": "^2.9.5", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-svelte3": "^3.2.1", + "prettier": "^2.5.1", + "prettier-plugin-svelte": "^2.5.0", + "svelte": "^3.44.0", + "svelte-check": "^2.2.6", + "svelte-preprocess": "^4.10.1", + "tslib": "^2.3.1", + "typescript": "~4.6.2", + "unocss": "^0.31.5", + "@unocss/reset": "^0.31.5", + "@unocss/transformer-directives": "^0.31.5", + "@unocss/transformer-variant-group": "^0.31.5" + }, + "type": "module" +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d1cbb8e..d8afd11 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,17 +2,22 @@ lockfileVersion: 5.3 specifiers: '@babylonjs/core': ^5.3.0 - '@babylonjs/gui': 5.3.0 - '@babylonjs/loaders': 5.3.0 - '@babylonjs/materials': 5.3.0 + '@babylonjs/gui': ^5.3.0 + '@babylonjs/loaders': ^5.3.0 + '@babylonjs/materials': ^5.3.0 '@sveltejs/adapter-auto': next '@sveltejs/kit': next + '@types/lodash-es': ^4.17.6 '@typescript-eslint/eslint-plugin': ^5.10.1 '@typescript-eslint/parser': ^5.10.1 - babylonjs-loaders: 5.3.0 + '@unocss/reset': ^0.31.5 + '@unocss/transformer-directives': ^0.31.5 + '@unocss/transformer-variant-group': ^0.31.5 + babylonjs-loaders: ^5.3.0 eslint: ^7.32.0 eslint-config-prettier: ^8.3.0 eslint-plugin-svelte3: ^3.2.1 + lodash-es: ^4.17.21 prettier: ^2.5.1 prettier-plugin-svelte: ^2.5.0 svelte: ^3.44.0 @@ -20,6 +25,8 @@ specifiers: svelte-preprocess: ^4.10.1 tslib: ^2.3.1 typescript: ~4.6.2 + unocss: ^0.31.5 + vite: ^2.9.5 dependencies: '@babylonjs/core': 5.3.0 @@ -27,12 +34,17 @@ dependencies: '@babylonjs/loaders': 5.3.0 '@babylonjs/materials': 5.3.0 babylonjs-loaders: 5.3.0 + lodash-es: 4.17.21 devDependencies: '@sveltejs/adapter-auto': 1.0.0-next.39 '@sveltejs/kit': 1.0.0-next.321_svelte@3.47.0 + '@types/lodash-es': 4.17.6 '@typescript-eslint/eslint-plugin': 5.21.0_bb9518338a760ece3e1b033a5f6af62e '@typescript-eslint/parser': 5.21.0_eslint@7.32.0+typescript@4.6.3 + '@unocss/reset': 0.31.16 + '@unocss/transformer-directives': 0.31.16 + '@unocss/transformer-variant-group': 0.31.16 eslint: 7.32.0 eslint-config-prettier: 8.5.0_eslint@7.32.0 eslint-plugin-svelte3: 3.4.1_eslint@7.32.0+svelte@3.47.0 @@ -43,9 +55,22 @@ devDependencies: svelte-preprocess: 4.10.6_svelte@3.47.0+typescript@4.6.3 tslib: 2.4.0 typescript: 4.6.3 + unocss: 0.31.16_vite@2.9.5 + vite: 2.9.5 packages: + /@antfu/install-pkg/0.1.0: + resolution: {integrity: sha512-VaIJd3d1o7irZfK1U0nvBsHMyjkuyMP3HKYVV53z8DKyulkHKmjhhtccXO51WSPeeSHIeoJEoNOKavYpS7jkZw==} + dependencies: + execa: 5.1.1 + find-up: 5.0.0 + dev: true + + /@antfu/utils/0.5.1: + resolution: {integrity: sha512-8Afo0+xvYe1K8Wm4xHTymfTkpzy36aaqDvhXIayUwl+mecMG9Xzl3XjXa6swG6Bk8FBeQ646RyvmsYt6+2Be9g==} + dev: true + /@babel/code-frame/7.12.11: resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} dependencies: @@ -130,6 +155,23 @@ packages: resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} dev: true + /@iconify/types/1.1.0: + resolution: {integrity: sha512-Jh0llaK2LRXQoYsorIH8maClebsnzTcve+7U3rQUSnC11X4jtPnFuyatqFLvMxZ8MLG8dB4zfHsbPfuvxluONw==} + dev: true + + /@iconify/utils/1.0.32: + resolution: {integrity: sha512-m+rnw7qKHq/XF7DAi4BcFoEAcXBfqqMgQJh8brGEHeqE/RUvgDMjmxsHgWnVpFsG+VmjGyAiI7nwXdliCwEU0Q==} + dependencies: + '@antfu/install-pkg': 0.1.0 + '@antfu/utils': 0.5.1 + '@iconify/types': 1.1.0 + debug: 4.3.4 + kolorist: 1.5.1 + local-pkg: 0.4.1 + transitivePeerDependencies: + - supports-color + dev: true + /@nodelib/fs.scandir/2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -151,6 +193,10 @@ packages: fastq: 1.13.0 dev: true + /@polka/url/1.0.0-next.21: + resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} + dev: true + /@rollup/pluginutils/4.2.1: resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} engines: {node: '>= 8.0.0'} @@ -234,6 +280,16 @@ packages: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true + /@types/lodash-es/4.17.6: + resolution: {integrity: sha512-R+zTeVUKDdfoRxpAryaQNRKk3105Rrgx2CFRClIgRGaqDTdjsm8h6IYA8ir584W3ePzkZfst5xIgDwYrlh9HLg==} + dependencies: + '@types/lodash': 4.14.182 + dev: true + + /@types/lodash/4.14.182: + resolution: {integrity: sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==} + dev: true + /@types/node/17.0.27: resolution: {integrity: sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg==} dev: true @@ -374,6 +430,129 @@ packages: eslint-visitor-keys: 3.3.0 dev: true + /@unocss/cli/0.31.16: + resolution: {integrity: sha512-thko2GNPbY63ADSbrLQEXkP7wnt3I9HmKlx65sJi4ZvgxGl+XRAiU3O9JRjpTorSRiWH0Aew2ZEYAzrGv4effg==} + engines: {node: '>=14'} + hasBin: true + dependencies: + '@unocss/config': 0.31.16 + '@unocss/core': 0.31.16 + '@unocss/preset-uno': 0.31.16 + cac: 6.7.12 + chokidar: 3.5.3 + colorette: 2.0.16 + consola: 2.15.3 + fast-glob: 3.2.11 + pathe: 0.2.0 + perfect-debounce: 0.1.3 + dev: true + + /@unocss/config/0.31.16: + resolution: {integrity: sha512-M2qXYzXxvX5L2Tg76hZW4Mc1qg+dqNH5X0dONxOR94Wyoc+cdefv2WAEhfK1N1NV1KR/BUwgMkFOsmAAzD51MA==} + engines: {node: '>=14'} + dependencies: + '@unocss/core': 0.31.16 + unconfig: 0.3.3 + dev: true + + /@unocss/core/0.31.16: + resolution: {integrity: sha512-WJJppy8xzmjmbxfNPQIrVkSa0ir0xV9nNbP5MebEt0CTz8AraBthdHr3/vpkjb/uQked53vz/IskwgtAJlZhQA==} + dev: true + + /@unocss/inspector/0.31.16: + resolution: {integrity: sha512-Uzf+qstDkY7Ll9JCFF2RXmavdYz7q3mhdCgLQiMT3+vlnPqCm+nxyGYznEuVYpsMxxUnTECiV+cKIDXdbsb+Ww==} + dependencies: + gzip-size: 6.0.0 + sirv: 2.0.2 + dev: true + + /@unocss/preset-attributify/0.31.16: + resolution: {integrity: sha512-oH4k6EjaTNIEcvmMvVAiKtVam5bU93/fGV10CqtzPWbLt9JYqDYhoKGTic7sXxrt/SAce8y30g3HgfJhwGBUsg==} + dependencies: + '@unocss/core': 0.31.16 + dev: true + + /@unocss/preset-icons/0.31.16: + resolution: {integrity: sha512-4NbkE5hjm4ILew63oLTcUfxKn+dBHTQO8MmODF3n2+8kWjL7BShXC+scYGtr5M/Bkq9DBNpolwmCEGAt2xyg5g==} + dependencies: + '@iconify/utils': 1.0.32 + '@unocss/core': 0.31.16 + transitivePeerDependencies: + - supports-color + dev: true + + /@unocss/preset-mini/0.31.16: + resolution: {integrity: sha512-ThSf0QirWBvosbEJj57FqFTHERRky5Nh6VbDklxOwUIciEzUlMxuSGCRdcmipMXLllCFitqE4TYYJirCUoB5+A==} + dependencies: + '@unocss/core': 0.31.16 + dev: true + + /@unocss/preset-typography/0.31.16: + resolution: {integrity: sha512-eVspfV8cVoxeyE6FOPboiFFaM8ArSqOHNdPxpE+Ggm1fQSMatMVTEcNkw+rPvxeY1EgUivBLRcKr20wZeaH7dg==} + dependencies: + '@unocss/core': 0.31.16 + dev: true + + /@unocss/preset-uno/0.31.16: + resolution: {integrity: sha512-Q8d3o4lfqXwap0VlpFH7vJ6L6+n/B9ptlgp227DVNHjH1c/MkbfHad1dYalNhI9IJMVRr0H+G+sdIA8SfwmaQg==} + dependencies: + '@unocss/core': 0.31.16 + '@unocss/preset-mini': 0.31.16 + '@unocss/preset-wind': 0.31.16 + dev: true + + /@unocss/preset-web-fonts/0.31.16: + resolution: {integrity: sha512-cmBMC2oONSsVx51OpEcQwe/hqvdRwNo/PWz5cB9+HPCryDczm7lgXtRj7qvAfC4klnWQwXe04Kqmaou+jzaMAQ==} + dependencies: + '@unocss/core': 0.31.16 + axios: 0.26.1 + transitivePeerDependencies: + - debug + dev: true + + /@unocss/preset-wind/0.31.16: + resolution: {integrity: sha512-xwkstGfOgl53crGO81j9ry+/Zn3tFXVMxq2G/fxnUB4Vy0EUgChZBZjNGyEiSvpK9Ktvc3NfZ4KcDeG58DkqiQ==} + dependencies: + '@unocss/core': 0.31.16 + '@unocss/preset-mini': 0.31.16 + dev: true + + /@unocss/reset/0.31.16: + resolution: {integrity: sha512-zwvtjqcte7FyXW4W5dx9RgdD6KkiztSj9B4eY5EwxCw6B11FO5aaURHe8oFXlYaFHiOthirXLejCPrXIMDOWRA==} + dev: true + + /@unocss/scope/0.31.16: + resolution: {integrity: sha512-lAUl6Benxb206Zoc58F2rRGUlmwQ8qTTtPVOPrFSTMewVZajmQfhrucxGbJbVx49fhK/WDBtmQrrmP0KBn6K5w==} + dev: true + + /@unocss/transformer-directives/0.31.16: + resolution: {integrity: sha512-QF4xOOzg/gxC7yKRrz19ZJ4sz1mXWIZ+pvx7ml8ZTX/fO7NOVIx+yASzoU6fcSEeDXwc4OCCnt+/9Nyj2Pc5RA==} + dependencies: + '@unocss/core': 0.31.16 + css-tree: 2.1.0 + dev: true + + /@unocss/transformer-variant-group/0.31.16: + resolution: {integrity: sha512-BYlHXD/xKaFDjCoDISMBVTaF6m2iGpKpM368B0hd+6bkeBnqjwG3j8YtypG6j4phJhcoGfwxWlGjK0PSIeXM/Q==} + dependencies: + '@unocss/core': 0.31.16 + dev: true + + /@unocss/vite/0.31.16_vite@2.9.5: + resolution: {integrity: sha512-iFJC0xjaSWt1+li9Eurs/SG06RQFwprUG/Z3JkJf5ugooshTS42fUHcOn/q5VJvItHziAcPPOmugfhddjchBYw==} + peerDependencies: + vite: ^2.9.0 + dependencies: + '@rollup/pluginutils': 4.2.1 + '@unocss/config': 0.31.16 + '@unocss/core': 0.31.16 + '@unocss/inspector': 0.31.16 + '@unocss/scope': 0.31.16 + '@unocss/transformer-directives': 0.31.16 + magic-string: 0.26.1 + vite: 2.9.5 + dev: true + /acorn-jsx/5.3.2_acorn@7.4.1: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -454,6 +633,14 @@ packages: engines: {node: '>=8'} dev: true + /axios/0.26.1: + resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==} + dependencies: + follow-redirects: 1.14.9 + transitivePeerDependencies: + - debug + dev: true + /babylonjs-gltf2interface/5.3.0: resolution: {integrity: sha512-XUVUVw7iFJG84hM6+PFa6gPKevG4T4OT4h2mfw+y3rDUHhmTsan41dlczUIMAkwF636oipPQOEzatLCYHKs5bw==} dev: false @@ -496,6 +683,11 @@ packages: resolution: {integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=} dev: true + /cac/6.7.12: + resolution: {integrity: sha512-rM7E2ygtMkJqD9c7WnFU6fruFcN3xe4FM5yUmgxhZzIKJk4uHl9U/fhwdajGFQbQuv43FAUo1Fe8gX/oIKDeSA==} + engines: {node: '>=8'} + dev: true + /callsites/3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -554,10 +746,18 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /colorette/2.0.16: + resolution: {integrity: sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==} + dev: true + /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} dev: true + /consola/2.15.3: + resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} + dev: true + /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -567,6 +767,14 @@ packages: which: 2.0.2 dev: true + /css-tree/2.1.0: + resolution: {integrity: sha512-PcysZRzToBbrpoUrZ9qfblRIRf8zbEAkU0AIpQFtgkFK0vSbzOmBCvdSAx2Zg7Xx5wiYJKUKk0NMP7kxevie/A==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + dependencies: + mdn-data: 2.0.27 + source-map-js: 1.0.2 + dev: true + /debug/4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -583,6 +791,10 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true + /defu/6.0.0: + resolution: {integrity: sha512-t2MZGLf1V2rV4VBZbWIaXKdX/mUcYW0n2znQZoADBkGGxYL8EWqCuCZBmJPJ/Yy9fofJkyuuSuo5GSwo0XdEgw==} + dev: true + /detect-indent/6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} @@ -602,6 +814,10 @@ packages: esutils: 2.0.3 dev: true + /duplexer/0.1.2: + resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} + dev: true + /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true @@ -992,6 +1208,21 @@ packages: engines: {node: '>=0.10.0'} dev: true + /execa/5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + /fast-deep-equal/3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -1035,6 +1266,14 @@ packages: to-regex-range: 5.0.1 dev: true + /find-up/5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + /flat-cache/3.0.4: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -1047,6 +1286,16 @@ packages: resolution: {integrity: sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==} dev: true + /follow-redirects/1.14.9: + resolution: {integrity: sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + /fs.realpath/1.0.0: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} dev: true @@ -1067,6 +1316,11 @@ packages: resolution: {integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=} dev: true + /get-stream/6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + /glob-parent/5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1116,6 +1370,13 @@ packages: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true + /gzip-size/6.0.0: + resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} + engines: {node: '>=10'} + dependencies: + duplexer: 0.1.2 + dev: true + /has-flag/3.0.0: resolution: {integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0=} engines: {node: '>=4'} @@ -1133,6 +1394,11 @@ packages: function-bind: 1.1.1 dev: true + /human-signals/2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + /ignore/4.0.6: resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} engines: {node: '>= 4'} @@ -1202,10 +1468,20 @@ packages: engines: {node: '>=0.12.0'} dev: true + /is-stream/2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + /isexe/2.0.0: resolution: {integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=} dev: true + /jiti/1.13.0: + resolution: {integrity: sha512-/n9mNxZj/HDSrincJ6RP+L+yXbpnB8FybySBa+IjIaoH9FIxBbrbRT5XUbe8R7zuVM2AQqNMNDDqz0bzx3znOQ==} + hasBin: true + dev: true + /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -1235,6 +1511,10 @@ packages: engines: {node: '>=6'} dev: true + /kolorist/1.5.1: + resolution: {integrity: sha512-lxpCM3HTvquGxKGzHeknB/sUjuVoUElLlfYnXZT73K8geR9jQbroGlSCFBax9/0mpGoD3kzcMLnOlGQPJJNyqQ==} + dev: true + /levn/0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} @@ -1243,6 +1523,22 @@ packages: type-check: 0.4.0 dev: true + /local-pkg/0.4.1: + resolution: {integrity: sha512-lL87ytIGP2FU5PWwNDo0w3WhIo2gopIAxPg9RxDYF7m4rr5ahuZxP22xnJHIvaLTe4Z9P6uKKY2UHiwyB4pcrw==} + engines: {node: '>=14'} + dev: true + + /locate-path/6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash-es/4.17.21: + resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + dev: false + /lodash.merge/4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true @@ -1271,6 +1567,14 @@ packages: sourcemap-codec: 1.4.8 dev: true + /mdn-data/2.0.27: + resolution: {integrity: sha512-kwqO0I0jtWr25KcfLm9pia8vLZ8qoAKhWZuZMbneJq3jjBD3gl5nZs8l8Tu3ZBlBAHVQtDur9rdDGyvtfVraHQ==} + dev: true + + /merge-stream/2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -1284,6 +1588,11 @@ packages: picomatch: 2.3.1 dev: true + /mimic-fn/2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + /min-indent/1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -1335,12 +1644,26 @@ packages: engines: {node: '>=0.10.0'} dev: true + /npm-run-path/4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: true + /once/1.4.0: resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=} dependencies: wrappy: 1.0.2 dev: true + /onetime/5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + /optionator/0.9.1: resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} engines: {node: '>= 0.8.0'} @@ -1353,6 +1676,20 @@ packages: word-wrap: 1.2.3 dev: true + /p-limit/3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate/5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + /parent-module/1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -1360,6 +1697,11 @@ packages: callsites: 3.1.0 dev: true + /path-exists/4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + /path-is-absolute/1.0.1: resolution: {integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=} engines: {node: '>=0.10.0'} @@ -1379,6 +1721,14 @@ packages: engines: {node: '>=8'} dev: true + /pathe/0.2.0: + resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==} + dev: true + + /perfect-debounce/0.1.3: + resolution: {integrity: sha512-NOT9AcKiDGpnV/HBhI22Str++XWcErO/bALvHCuhv33owZW/CjH8KAFLZDCmu3727sihe0wTxpDhyGc6M8qacQ==} + dev: true + /picocolors/1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true @@ -1537,6 +1887,19 @@ packages: engines: {node: '>=8'} dev: true + /signal-exit/3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /sirv/2.0.2: + resolution: {integrity: sha512-4Qog6aE29nIjAOKe/wowFTxOdmbEZKb+3tsLljaBRzJwtqto0BChD2zzH0LhgCSXiI+V7X+Y45v14wBZQ1TK3w==} + engines: {node: '>= 10'} + dependencies: + '@polka/url': 1.0.0-next.21 + mrmime: 1.0.0 + totalist: 3.0.0 + dev: true + /slash/3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -1595,6 +1958,11 @@ packages: ansi-regex: 5.0.1 dev: true + /strip-final-newline/2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: true + /strip-indent/3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -1748,6 +2116,11 @@ packages: is-number: 7.0.0 dev: true + /totalist/3.0.0: + resolution: {integrity: sha512-eM+pCBxXO/njtF7vdFsHuqb+ElbxqtI4r5EAvk6grfAFyJ6IvWlSkfZ5T9ozC6xWw3Fj1fGoSmrl0gUs46JVIw==} + engines: {node: '>=6'} + dev: true + /tslib/1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true @@ -1783,6 +2156,37 @@ packages: hasBin: true dev: true + /unconfig/0.3.3: + resolution: {integrity: sha512-BavyYUbMTk5s7jypXdcS5ZkoqFAzzVt1AT7T9xFjNDCizqdb0YI6yRYRCGBeNp8tK7xnLl2vo7enG+2GxN0+2Q==} + dependencies: + '@antfu/utils': 0.5.1 + defu: 6.0.0 + jiti: 1.13.0 + dev: true + + /unocss/0.31.16_vite@2.9.5: + resolution: {integrity: sha512-RKJsaYNH4zifcRBe7maQbmQi0muvOgUCZNC02nbAXiaLKQ2DtwEuzsETzkkLSVssbwf03D3OtM5W0W3sVBcK2A==} + engines: {node: '>=14'} + dependencies: + '@unocss/cli': 0.31.16 + '@unocss/core': 0.31.16 + '@unocss/preset-attributify': 0.31.16 + '@unocss/preset-icons': 0.31.16 + '@unocss/preset-mini': 0.31.16 + '@unocss/preset-typography': 0.31.16 + '@unocss/preset-uno': 0.31.16 + '@unocss/preset-web-fonts': 0.31.16 + '@unocss/preset-wind': 0.31.16 + '@unocss/reset': 0.31.16 + '@unocss/transformer-directives': 0.31.16 + '@unocss/transformer-variant-group': 0.31.16 + '@unocss/vite': 0.31.16_vite@2.9.5 + transitivePeerDependencies: + - debug + - supports-color + - vite + dev: true + /uri-js/4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: @@ -1845,3 +2249,8 @@ packages: /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true + + /yocto-queue/0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true diff --git a/src/app.html b/src/app.html index 9702742..50e995f 100644 --- a/src/app.html +++ b/src/app.html @@ -6,7 +6,5 @@ %svelte.head% - -
%svelte.body%
- + %svelte.body% diff --git a/src/lib/AssetCreator.ts b/src/lib/AssetCreator.ts index e1791c9..36791ec 100644 --- a/src/lib/AssetCreator.ts +++ b/src/lib/AssetCreator.ts @@ -15,7 +15,7 @@ type ProgressHandlerParams = Partial<{ }>; export const loadingProgress: Writable = writable({ total: 0, loaded: 0, loaders: {} }); -function onProgress(loaderId: string): (ISceneLoaderProgressEvent) => void { +function onProgress(loaderId: string): (evt: ISceneLoaderProgressEvent) => void { return (progressEvt: ISceneLoaderProgressEvent) => { const updateProgress = (prevData: ProgressHandlerParams) => { const loaders = { ...prevData.loaders, [loaderId]: progressEvt }; @@ -42,7 +42,7 @@ export default class AssetCreator { public static async create(scene: Scene, characterFileUrl: string, animationPathMap: Record): Promise { const assetCreator = new AssetCreator(scene) const assetPathMap = { char: characterFileUrl, ...animationPathMap }; - const assetLoaders = Object.entries(assetPathMap).map(([name, fileUrl]) => SceneLoader.LoadAssetContainerAsync(fileUrl, null, scene, onProgress(name))); + const assetLoaders = Object.entries(assetPathMap).map(([name, fileUrl]) => SceneLoader.LoadAssetContainerAsync(fileUrl, undefined, scene, onProgress(name))); assetCreator.#assetContainers = await Promise.all(assetLoaders).then(assetContainers => zipObject(Object.keys(assetPathMap), assetContainers)) return assetCreator; } diff --git a/src/lib/xrScene.ts b/src/lib/xrScene.ts index 4c0e28f..7c13680 100644 --- a/src/lib/xrScene.ts +++ b/src/lib/xrScene.ts @@ -4,6 +4,7 @@ import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera'; import { Color3, Vector3 } from '@babylonjs/core/Maths/math'; import { HemisphericLight } from '@babylonjs/core/Lights/hemisphericLight'; import type { Camera } from '@babylonjs/core/Cameras'; +import "@babylonjs/core/Helpers/sceneHelpers"; export default class XrScene { readonly #engine: Engine; @@ -13,9 +14,10 @@ export default class XrScene { public constructor(app: HTMLElement) { const canvas = document.createElement('canvas'); canvas.id = 'renderCanvas'; + canvas.style.width = "90vw"; + canvas.style.height = "90vh"; this.#engine = new Engine(canvas, true); - this.#engine.displayLoadingUI(); this.#scene = this.#createScene(); this.#camera = this.#createCamera(canvas); this.#createLights(); @@ -63,12 +65,11 @@ export default class XrScene { } #createEnvironment(): void { - const helper = this.scene.createDefaultEnvironment({ - enableGroundShadow: true, - }); - helper.groundMaterial.primaryColor.set(0.5, 0.5, 0.5); - helper.ground.receiveShadows = true; - Engine.audioEngine.useCustomUnlockedButton = true; + const helper = this.scene.createDefaultEnvironment({enableGroundShadow: true}); + if (helper && helper.groundMaterial && helper.ground) { + helper.groundMaterial.primaryColor.set(0.5, 0.5, 0.5); + helper.ground.receiveShadows = true; + } } public get engine(): Engine { diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index e69de29..4ce58d1 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -0,0 +1,19 @@ + + +
+ +
+ + \ No newline at end of file diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 5982b0a..0471e11 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -1,2 +1,9 @@ -

Welcome to SvelteKit

-

Visit kit.svelte.dev to read the documentation

+ + +
\ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index 892f0c4..ad45572 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,7 @@ import adapter from '@sveltejs/adapter-auto'; -import preprocess from 'svelte-preprocess'; +import UnoCss from "unocss/vite"; +import { extractorSvelte } from "unocss"; +import preprocess from "svelte-preprocess"; /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -8,7 +10,12 @@ const config = { preprocess: preprocess(), kit: { - adapter: adapter() + adapter: adapter(), + vite: { + plugins: [ + UnoCss({extractors: [extractorSvelte]}), + ] + } } }; diff --git a/tsconfig.json b/tsconfig.json index 232d647..f11e71c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,23 @@ { "extends": "./.svelte-kit/tsconfig.json", + "include": [ + "./src/**/*", + "./src/**/*.svelte", + "./unocss.config.ts" + ], "compilerOptions": { "allowJs": true, "checkJs": true, "esModuleInterop": true, + "strictPropertyInitialization": false, "forceConsistentCasingInFileNames": true, - "lib": ["es2020", "DOM"], + "lib": ["ESNext", "DOM"], "moduleResolution": "node", - "module": "es2020", + "module": "esnext", "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, "strict": true, - "target": "es2020" + "target": "esnext" } } diff --git a/unocss.config.ts b/unocss.config.ts index d834733..7dbf092 100644 --- a/unocss.config.ts +++ b/unocss.config.ts @@ -1,21 +1,12 @@ import { defineConfig, presetAttributify, presetUno, type UserConfig } from "unocss"; -import { presetTypography } from "@unocss/preset-typography"; -import presetIcons from "@unocss/preset-icons"; import transformerVariantGroup from "@unocss/transformer-variant-group"; import transformerDirective from "@unocss/transformer-directives"; export default defineConfig({ include: ["{test,src}/**/*.{html,ts,svelte}", "../../libs/ui/package/**/*.{ts,svelte}"], presets: [ - presetIcons({ - prefix: "i-", - extraProperties: { - display: "inline-block" - } - }), presetAttributify({ prefix: "uno-" }), presetUno(), - presetTypography() ], transformers: [transformerDirective({ enforce: "pre" }), transformerVariantGroup()], shortcuts: [