Skip to content

Commit

Permalink
Added version number
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreenheck committed Oct 10, 2024
1 parent aab32c9 commit c0e4f5a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/app/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Pane } from 'tweakpane';
import { BarkType, Billboard, LeafType, TreePreset, Tree, TreeType } from '@dgreenheck/ez-tree';
import { Environment } from './environment';
import { OrbitControls } from 'three/examples/jsm/Addons.js';
import { version } from '../../package.json';

const exporter = new GLTFExporter();
let pane = null;
Expand Down Expand Up @@ -160,22 +161,29 @@ export function setupUI(tree, environment, renderer, scene, camera, controls, in
environmentFolder.addBinding(environment.skybox, 'sunAzimuth', { label: 'sunAngle', min: 0, max: 360 });
environmentFolder.addBinding(environment.grass, 'instanceCount', { label: 'grassCount', min: 0, max: 25000, step: 1 });

/** STATISTICS */
/** INFO */

const statsFolder = tab.pages[0].addFolder({ title: 'Info', expanded: false });
const infoFolder = tab.pages[0].addFolder({ title: 'Info', expanded: false });

statsFolder.addBinding(tree, 'vertexCount', {
infoFolder.addBinding(tree, 'vertexCount', {
label: 'vertices',
format: (v) => v.toFixed(0),
readonly: true,
});

statsFolder.addBinding(tree, 'triangleCount', {
infoFolder.addBinding(tree, 'triangleCount', {
label: 'triangles',
format: (v) => v.toFixed(0),
readonly: true,
});

infoFolder.addBlade({
view: 'text',
label: 'version',
parse: (v) => String(v),
value: version,
});

/** Export **/

tab.pages[1].addButton({ title: 'Save Preset' }).on('click', () => {
Expand Down

0 comments on commit c0e4f5a

Please sign in to comment.