Skip to content

Commit

Permalink
Add explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Sep 27, 2023
1 parent 0608b05 commit e05c9a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/react-components/room/object-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ function isObjectPinned(world, eid) {
if (hasComponent(world, AEntity, eid)) {
return isAEntityPinned(APP.world, eid);
} else {
// This hooks is making decisions based on components attached to the root MediaLoader entity
// and the child media entity. ie. The MediaInfo component lives in the child media but the
// networked state lives in the root. This is not great, there is a lot of places where we need to
// do component searches to find either the media root or the actual media. It's not even reasonable
// to look for a component name MediaContentBounds just to get the MediaLoader (as we remove that
// after loading the media).
// We should probably find a better way of dealing with spawned media entity hierarchies.
const mediaRootEid = findAncestorWithComponent(APP.world, MediaContentBounds, eid);
return getPinnedState(mediaRootEid);
}
Expand Down

0 comments on commit e05c9a6

Please sign in to comment.