Skip to content

Commit

Permalink
Updated engine to v1.70.2 (#292)
Browse files Browse the repository at this point in the history
* Updated engine to v1.70.2

* removed unnecessary tsignore

* fixed syntax for arrayBuffer in VertexBuffer
  • Loading branch information
kpal81xd authored May 2, 2024
1 parent 1e4a1e2 commit ecbc921
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 28 deletions.
22 changes: 11 additions & 11 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 @@ -67,7 +67,7 @@
"eslint": "^8.56.0",
"fflate": "^0.8.2",
"handlebars": "^4.7.8",
"playcanvas": "^1.69.2",
"playcanvas": "^1.70.2",
"prop-types": "^15.8.1",
"qrious": "^4.0.2",
"react": "^18.2.0",
Expand Down
3 changes: 0 additions & 3 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ if (process.env.BUILD_TYPE === 'prod') {
// debug, profile, release
const BUILD_TYPE = process.env.BUILD_TYPE || 'release';
const ENGINE_DIR = process.env.ENGINE_PATH || 'node_modules/playcanvas';
const EXTRAS_DIR = path.resolve(ENGINE_DIR, 'build', 'playcanvas-extras.mjs');
const PCUI_DIR = path.resolve(process.env.PCUI_PATH || 'node_modules/@playcanvas/pcui', 'react');

const ENGINE_NAME = (BUILD_TYPE === 'debug') ? 'playcanvas.dbg.mjs' : 'playcanvas.mjs';
Expand Down Expand Up @@ -71,7 +70,6 @@ export default {
alias({
entries: {
'playcanvas': ENGINE_PATH,
'playcanvas-extras': EXTRAS_DIR,
'pcui': PCUI_DIR
}
}),
Expand All @@ -82,7 +80,6 @@ export default {
baseUrl: '.',
paths: {
'playcanvas': [ENGINE_DIR],
'playcanvas-extras': [EXTRAS_DIR],
'pcui': [PCUI_DIR]
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/debug-lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class DebugLines {

// construct the mesh
const mesh = new Mesh(device);
mesh.vertexBuffer = new VertexBuffer(device, vertexFormat, 8192, BUFFER_DYNAMIC);
mesh.vertexBuffer = new VertexBuffer(device, vertexFormat, 8192, { usage: BUFFER_DYNAMIC });
mesh.primitive[0].type = PRIMITIVE_LINES;
mesh.primitive[0].base = 0;
mesh.primitive[0].indexed = false;
Expand Down Expand Up @@ -224,8 +224,7 @@ class DebugLines {
this.app.graphicsDevice,
oldVBuffer.getFormat(),
oldVBuffer.getNumVertices() * 2,
BUFFER_DYNAMIC,
arrayBuffer
{ usage: BUFFER_DYNAMIC, data: arrayBuffer }
);
this.vertexData = new Float32Array(arrayBuffer);
this.colorData = new Uint32Array(arrayBuffer);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/popup-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SetProperty, ObserverData } from '../../types';
import AnimationControls from './animation-controls';
import { CameraPanel, SkyboxPanel, LightPanel, DebugPanel, ViewPanel } from './panels';
// @ts-ignore no type defs included
import { UsdzExporter } from 'playcanvas-extras';
import { UsdzExporter } from 'playcanvas';
import { addEventListenerOnClickOnly } from '../../helpers';

const PopupPanelControls = (props: { observerData: ObserverData, setProperty: SetProperty }) => {
Expand Down
8 changes: 1 addition & 7 deletions src/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
MorphInstance,
MorphTarget,
Mouse,
MiniStats,
Quat,
RenderComponent,
RenderTarget,
Expand All @@ -59,10 +60,6 @@ import {
import { App } from './app';

import { Observer } from '@playcanvas/observer';
// @ts-ignore: library file import
import { MiniStats } from 'playcanvas-extras';
// @ts-ignore: library file import
// import * as VoxParser from 'playcanvas/scripts/parsers/vox-parser.js';
import { MeshoptDecoder } from '../lib/meshopt_decoder.module.js';
import { CreateDropHandler } from './drop-handler';
import { MorphTargetData, File, HierarchyNode } from './types';
Expand Down Expand Up @@ -195,9 +192,6 @@ class Viewer {
observer.set('camera.multisampleSupported', multisampleSupported);
observer.set('camera.multisample', multisampleSupported && observer.get('camera.multisample'));

// register vox support
// VoxParser.registerVoxParser(app);

// create the exporter
this.pngExporter = new PngExporter();

Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"noEmit": true,
"baseUrl": ".",
"paths": {
"pcui": ["node_modules/@playcanvas/pcui/react"],
"playcanvas-extras": ["node_modules/playcanvas/build/playcanvas-extras.mjs"]
"pcui": ["node_modules/@playcanvas/pcui/react"]
}
},
"include": ["**/*.ts", "**/*.tsx"],
Expand Down

0 comments on commit ecbc921

Please sign in to comment.