Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Camera Script usage #308

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading