Skip to content

Commit

Permalink
Replaced multi-camera with engine script
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd committed Oct 31, 2024
1 parent 8904505 commit 94ae1aa
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 522 deletions.
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"concurrently": "^9.0.1",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"playcanvas": "^2.1.0",
"playcanvas": "^2.2.1",
"qrious": "^4.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
26 changes: 14 additions & 12 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// official rollup plugins
import path from 'path';

import alias from '@rollup/plugin-alias';
import commonjs from '@rollup/plugin-commonjs';
import image from '@rollup/plugin-image';
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import path from 'path';
import resolve from "@rollup/plugin-node-resolve";
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import sass from 'rollup-plugin-sass';
import terser from '@rollup/plugin-terser';
import typescript from "@rollup/plugin-typescript";
import typescript from '@rollup/plugin-typescript';
import sass from 'rollup-plugin-sass';

// custom plugins
import { copyAndWatch } from "./plugins/copy-and-watch.mjs";
import { copyAndWatch } from './plugins/copy-and-watch.mjs';

// debug, profile, release
const BUILD_TYPE = process.env.BUILD_TYPE || 'release';
Expand All @@ -22,16 +23,16 @@ const ENGINE_PATH = path.resolve(ENGINE_DIR, 'build', ENGINE_NAME);
const PCUI_DIR = path.resolve(process.env.PCUI_PATH || 'node_modules/@playcanvas/pcui');

const BLUE_OUT = '\x1b[34m';
const BOLD_OUT = `\x1b[1m`;
const REGULAR_OUT = `\x1b[22m`;
const RESET_OUT = `\x1b[0m`;
const BOLD_OUT = '\x1b[1m';
const REGULAR_OUT = '\x1b[22m';
const RESET_OUT = '\x1b[0m';

const title = [
`Building PlayCanvas Model Viewer`,
'Building PlayCanvas Model Viewer',
`type ${BOLD_OUT}${BUILD_TYPE}${REGULAR_OUT}`,
`engine ${BOLD_OUT}${ENGINE_DIR}${REGULAR_OUT}`,
`pcui ${BOLD_OUT}${PCUI_DIR}${REGULAR_OUT}`
].map(l => `${BLUE_OUT}${l}`).join(`\n`);
].map(l => `${BLUE_OUT}${l}`).join('\n');
console.log(`${BLUE_OUT}${title}${RESET_OUT}\n`);

const TARGETS = [
Expand Down Expand Up @@ -73,6 +74,7 @@ export default {
image({ dom: true }),
alias({
entries: {
'playcanvas/scripts': path.resolve(ENGINE_DIR, 'scripts'),
'playcanvas': ENGINE_PATH,
'@playcanvas/pcui': PCUI_DIR
}
Expand Down
16 changes: 4 additions & 12 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
TextureHandler,
XrManager,
GSplatComponentSystem,
GSplatHandler
GSplatHandler,
ScriptComponentSystem
} from 'playcanvas';

class App extends AppBase {
Expand All @@ -38,9 +39,7 @@ class App extends AppBase {
appOptions.assetPrefix = options.assetPrefix;
appOptions.scriptsOrder = options.scriptsOrder;

// @ts-ignore
appOptions.lightmapper = Lightmapper;
// @ts-ignore
appOptions.xr = XrManager;

this.init(appOptions);
Expand All @@ -52,27 +51,20 @@ class App extends AppBase {
RenderComponentSystem,
CameraComponentSystem,
LightComponentSystem,
GSplatComponentSystem
GSplatComponentSystem,
ScriptComponentSystem
];
}

addResourceHandles(appOptions: AppOptions) {
appOptions.resourceHandlers = [
// @ts-ignore
RenderHandler,
// @ts-ignore
AnimClipHandler,
// @ts-ignore
AnimStateGraphHandler,
// @ts-ignore
TextureHandler,
// @ts-ignore
CubemapHandler,
// @ts-ignore
BinaryHandler,
// @ts-ignore
ContainerHandler,
// @ts-ignore
GSplatHandler
];
}
Expand Down
118 changes: 0 additions & 118 deletions src/cameras/base-camera.ts

This file was deleted.

Loading

0 comments on commit 94ae1aa

Please sign in to comment.