Skip to content

Commit

Permalink
Add warning for negative scale when creating interactables bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed May 8, 2024
1 parent ae050ee commit c23b7d4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/bit-systems/interactable-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ export function interactableSystem(world: HubsWorld) {
// If it has media frame collision mask, it needs to have content bounds
if (hasMesh && Rigidbody.collisionFilterMask[eid] & COLLISION_LAYERS.MEDIA_FRAMES) {
const box = getBox(obj, obj);
box.getSize(tmpVector);
addComponent(world, MediaContentBounds, eid);
MediaContentBounds.bounds[eid].set(tmpVector.toArray());
if (!box.isEmpty()) {
box.getSize(tmpVector);
addComponent(world, MediaContentBounds, eid);
MediaContentBounds.bounds[eid].set(tmpVector.toArray());
} else {
console.error(`Couldn't create content bounds for entity ${eid}. It seems to be empty or have negative scale.`);
}
}
});
}

0 comments on commit c23b7d4

Please sign in to comment.