Skip to content

Commit

Permalink
Fix snow example settings loading
Browse files Browse the repository at this point in the history
  • Loading branch information
DrA1ex committed Sep 30, 2023
1 parent 6528a77 commit 4c7f33e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/snow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@ import {SnowCloud, SnowDrift} from "./objects/snow.js";
import Settings, {SunMode} from "./settings.js";
import {ThemeManager} from "./theme.js";
import * as GeoUtils from "./utils/geo.js";
import {DefaultBootstrapSettings} from "../common/settings/default.js";

CommonUtils.installGlobalErrorHook();
document.body.classList.add(Settings.Sun.Theme);

const loaderState = document.getElementById("loader-state");
loaderState.innerText = "Initialize engine...";

const options = Params.parse({
restitution: 0, friction: 0.8, overlap: 0.5, beta: 1, bias: 0.1, stats: false, tree_cnt: 13, dpr: Settings.Preset.dpr
});
const options = Params.parse();

const BootstrapInstance = new Bootstrap(new CanvasRenderer(document.getElementById("canvas"), options), options);
const EngineSettings = DefaultBootstrapSettings.fromQueryParams({
restitution: 0, friction: 0.8, overlap: 0.5, beta: 1, bias: 0.1, treeMaxCount: 13,
statistics: false, useDpr: Settings.Preset.dpr
})

const BootstrapInstance = new Bootstrap(
new CanvasRenderer(document.getElementById("canvas"), EngineSettings.renderer), EngineSettings);
BootstrapInstance.statsExtra["Preset"] = Settings.Preset.name;

BootstrapInstance.addForce(new GravityForce(options.gravity));
Expand Down

0 comments on commit 4c7f33e

Please sign in to comment.