Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 832-Remove-vpMatrix…
Browse files Browse the repository at this point in the history
…-from-model-unifroms
  • Loading branch information
jespertheend committed Apr 11, 2024
2 parents 76386b8 + 5a1b966 commit 7eb08f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 35 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ jobs:
run: deno task test test/unit --coverage

- name: Codecov
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed
with:
files: .coverage/cov.lcov
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}

e2e-tests:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,6 @@ export class PropertiesWindowContentEntity extends PropertiesWindowContent {

const entitySection = this.treeView.addCollapsable("Entity");

this.editingModeGui = entitySection.addItem({
type: "buttonSelector",
guiOpts: {
label: "Editing mode",
items: ["global", "instance"],
},
});
this.editingModeGui.onValueChange(() => {
this.updateTransformationValues();
});

this.positionProperty = entitySection.addItem({
type: "vec3",
guiOpts: {
Expand All @@ -47,11 +36,7 @@ export class PropertiesWindowContentEntity extends PropertiesWindowContent {
if (changeEvent.trigger != "user") return;
if (!this.currentSelection) return;
for (const { entity } of this.currentSelection) {
if (this.editingModeGui.value == "global") {
entity.pos = changeEvent.value;
} else if (this.editingModeGui.value == "instance") {
throw new Error("Not implemented");
}
entity.pos = changeEvent.value;
this.studioInstance.projectManager.assetManager?.entityAssetManager.updateEntityTransform(entity, this);
}
});
Expand All @@ -66,11 +51,7 @@ export class PropertiesWindowContentEntity extends PropertiesWindowContent {
if (changeEvent.trigger != "user") return;
if (!this.currentSelection) return;
for (const { entity } of this.currentSelection) {
if (this.editingModeGui.value == "global") {
entity.rot.setFromAxisAngle(changeEvent.value);
} else if (this.editingModeGui.value == "instance") {
throw new Error("Not implemented");
}
entity.rot.setFromAxisAngle(changeEvent.value);
this.studioInstance.projectManager.assetManager?.entityAssetManager.updateEntityTransform(entity, this);
}
});
Expand All @@ -85,11 +66,7 @@ export class PropertiesWindowContentEntity extends PropertiesWindowContent {
if (changeEvent.trigger != "user") return;
if (!this.currentSelection) return;
for (const { entity } of this.currentSelection) {
if (this.editingModeGui.value == "global") {
entity.scale = changeEvent.value;
} else if (this.editingModeGui.value == "instance") {
throw new Error("Not implemented");
}
entity.scale = changeEvent.value;
this.studioInstance.projectManager.assetManager?.entityAssetManager.updateEntityTransform(entity, this);
}
});
Expand Down Expand Up @@ -178,14 +155,10 @@ export class PropertiesWindowContentEntity extends PropertiesWindowContent {
if (!this.currentSelection) return;

// todo: support multiple selections
if (this.editingModeGui.value == "global") {
const entity = this.currentSelection[0].entity;
this.positionProperty.setValue(entity.pos);
this.rotationProperty.setValue(entity.rot.toAxisAngle());
this.scaleProperty.setValue(entity.scale);
} else if (this.editingModeGui.value == "instance") {
throw new Error("Not implemented");
}
const entity = this.currentSelection[0].entity;
this.positionProperty.setValue(entity.pos);
this.rotationProperty.setValue(entity.rot.toAxisAngle());
this.scaleProperty.setValue(entity.scale);
}

refreshComponents() {
Expand Down

0 comments on commit 7eb08f5

Please sign in to comment.