Skip to content
Open
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async initializeWebGPU() {
if (!this.gpu) {
this.gpu = navigator.gpu;
if (!this.gpu) {
const message = "WebGPU is not supported in your browser. Please use/update Chrome or Edge.";
const message = "WebGPU is not supported in your browser.";
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to change in the tasks/task*.js as well

alert(message);
throw new Error(message);
}
Expand Down Expand Up @@ -1435,3 +1435,4 @@ async initializeGUI() {

That concludes the tutorial `:)`


16 changes: 8 additions & 8 deletions tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ class TreeProxy {
return this.#treeStore.getCoordinatesLatLonBuffer()[this.#index * 2];
}

getLongitude() {
return this.#treeStore.getCoordinatesLatLonBuffer()[this.#index * 2 + 1];
}

/**
* @deprecated
* It's actually not deprecated :)
Expand All @@ -130,24 +134,20 @@ class TreeProxy {
return (this.getLongitude() - mapLongitudeMin) / (mapLongitudeMax - mapLongitudeMin) * mapHeight;
}

getLongitude() {
return this.#treeStore.getCoordinatesLatLonBuffer()[this.#index * 2 + 1];
}

getTotalHeightCategory() {
return this.#treeStore.getInfoBuffer()[this.#index * 4];
}

getTotalHeightRange() {
return this.#getSizeCategoryRange(this.getTotalHeightCategory());
return TreeProxy.#getSizeCategoryRange(this.getTotalHeightCategory());
}

getCrownDiameterCategory() {
return this.#treeStore.getInfoBuffer()[this.#index * 4 + 1];
}

getCrownDiameterRange() {
return this.#getSizeCategoryRange(this.getCrownDiameterCategory());
return TreeProxy.#getSizeCategoryRange(this.getCrownDiameterCategory());
}

getDistrictNumber() {
Expand Down Expand Up @@ -203,8 +203,8 @@ class TreeProxy {
* @param {number} category
* @returns {null | [number, number]} The min and max height in meters or null if unknown
*/
#getSizeCategoryRange(category) {
switch (this.getTotalHeightCategory()) {
static #getSizeCategoryRange(category) {
switch (category) {
case 0: return null; // Unbekannt
case 1: return [0, 5]; // 0-5 Meter
case 2: return [6, 10]; // 6-10 Meter
Expand Down