Skip to content

Commit

Permalink
UI Tweaks (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck authored Aug 28, 2024
1 parent be26e60 commit bda57e3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 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
@@ -1,6 +1,6 @@
{
"name": "supersplat",
"version": "1.2.1",
"version": "1.2.2",
"author": "PlayCanvas<[email protected]>",
"homepage": "https://playcanvas.com/supersplat/editor",
"description": "3D Gaussian Splat Editor",
Expand Down
15 changes: 13 additions & 2 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,19 @@ const registerEditorEvents = (events: Events, editHistory: EditHistory, scene: S

// camera.fov

const setCameraFov = (fov: number) => {
if (fov !== scene.camera.fov) {
scene.camera.fov = fov;
events.fire('camera.fov', scene.camera.fov);
}
};

events.function('camera.fov', () => {
return scene.camera.fov;
});

events.on('camera.setFov', (fov: number) => {
scene.camera.fov = fov;
setCameraFov(fov);
});

// camera.bound
Expand Down Expand Up @@ -524,7 +531,7 @@ const registerEditorEvents = (events: Events, editHistory: EditHistory, scene: S

// camera debug

let cameraDebug = true;
let cameraDebug = scene.config.camera.debug;

const setCameraDebug = (enabled: boolean) => {
if (enabled !== cameraDebug) {
Expand Down Expand Up @@ -582,6 +589,10 @@ const registerEditorEvents = (events: Events, editHistory: EditHistory, scene: S
events.on('view.setBands', (value: number) => {
setViewBands(value);
});

// hack: fire events to initialize UI
events.fire('camera.fov', scene.camera.fov);
events.fire('camera.debug', cameraDebug);
}

export { registerEditorEvents };
3 changes: 2 additions & 1 deletion src/scene-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const sceneConfig = {
fov: 50,
exposure: 1.0,
toneMapping: 'linear',
debug_render: ''
debug_render: '',
debug: true
},
shadow: {
intensity: 0.25,
Expand Down
6 changes: 6 additions & 0 deletions src/ui/scene-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
left: 24px;
width: 320px;
}

@media (max-width: 600px) {
#scene-panel {
display: none;
}
}

0 comments on commit bda57e3

Please sign in to comment.