Skip to content

Commit

Permalink
chore(docs): add precisions about the 3D House
Browse files Browse the repository at this point in the history
  • Loading branch information
ReidyT authored Dec 23, 2024
1 parent 3cddee7 commit 465d20f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,16 @@ Three.js and MUI can encounter conflicts when using the `Box` component from MUI
- **Upgrade to MUI 6**: This may resolve the conflict, so it's worth testing.
- **Use the `Box` component with a `div`**: Replace Box with `<Box component="div">...</Box>` to mitigate the issue.
- **Avoid using `Box` altogether**: Instead, opt for the `Stack` component, which may provide a suitable alternative without conflicts.

### Simulation doesn't work without the 3D House

To simplify the code, I moved the responsibility of registering house components (walls and windows) directly to the 3D models. This aimed to avoid duplicating logic for handling both the 3D representation and the definition of house components.

However, this introduced a problem. When hiding the house to display graphics, the unmounting of its components (walls and windows) removes them from the simulation. Also, changes like modifying the number of floors aren't applied until the house is displayed again.

Two solutions exist:

- Prevent unmounting by using visibility: hidden in CSS.
- Decouple the logic and 3D representation.

Due to time constraints, I chose the first solution. The second solution, while ideal, would be preferable given more time.

0 comments on commit 465d20f

Please sign in to comment.