Skip to content

Commit

Permalink
Merge pull request #6469 from mozilla/bitecs-fix-inspect
Browse files Browse the repository at this point in the history
Fix avatar self inspection
  • Loading branch information
keianhzo authored Feb 13, 2024
2 parents a8208fc + 0795abd commit bf6ed63
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/systems/inspect-yourself-system.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { isLockedDownDemoRoom } from "../utils/hub-utils";
import { paths } from "./userinput/paths";
import { shouldUseNewLoader } from "../utils/bit-utils";
import { addComponent } from "bitecs";
import { Inspected, Inspectable } from "../bit-components";
import { INSPECTABLE_FLAGS } from "../bit-systems/inspect-system";
export class InspectYourselfSystem {
tick(scene, userinput, cameraSystem) {
if (!scene.is("entered")) return;
if (userinput.get(paths.actions.startInspectingSelf) && !isLockedDownDemoRoom()) {
const rig = document.getElementById("avatar-rig");
if (shouldUseNewLoader()) {
addComponent(APP.world, Inspected, rig.eid);
Inspectable.flags[rig.eid] |= INSPECTABLE_FLAGS.TARGET_CHANGED;
}
cameraSystem.inspect(rig.object3D, 1.5);
}
}
Expand Down

0 comments on commit bf6ed63

Please sign in to comment.