Add size limits and clamping for counters and screens#10
Add size limits and clamping for counters and screens#10sundsoffice-tech wants to merge 3 commits into
Conversation
…k-in-rule-engine Add collision-aware transforms and playground
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const rawD = ctr.size?.d ?? (variant === "premium" ? 0.6 : 0.5); | ||
| const rawH = ctr.size?.h ?? 1.1; | ||
| const w = clampDimension(rawW, COUNTER_SIZE_LIMITS.min.w, COUNTER_SIZE_LIMITS.max.w); | ||
| const d = clampDimension(rawD, COUNTER_SIZE_LIMITS.min.d, COUNTER_SIZE_LIMITS.max.d); | ||
| const h = clampDimension(rawH, COUNTER_SIZE_LIMITS.min.h, COUNTER_SIZE_LIMITS.max.h); |
There was a problem hiding this comment.
Align clamped counter sizes with collision AABBs
Counter sizes are now clamped to COUNTER_SIZE_LIMITS before rendering (width/depth/height are forced through clampDimension on these lines), but buildSceneAabbs still constructs the global collision boxes from the raw ctr.size values with no clamping. When a saved configuration contains counters outside the new bounds, the mesh and local collision candidate here use the reduced clamped size while the scene-wide collision map still reflects the oversized raw dimensions, so moving or placing objects will register collisions with counters that visually appear smaller. Apply the same size limits before building sceneAabbs or normalize the stored sizes to keep collision detection consistent with what is rendered.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const rawD = ctr.size?.d ?? (variant === "premium" ? 0.6 : 0.5); | ||
| const rawH = ctr.size?.h ?? 1.1; | ||
| const w = clampDimension(rawW, COUNTER_SIZE_LIMITS.min.w, COUNTER_SIZE_LIMITS.max.w); | ||
| const d = clampDimension(rawD, COUNTER_SIZE_LIMITS.min.d, COUNTER_SIZE_LIMITS.max.d); | ||
| const h = clampDimension(rawH, COUNTER_SIZE_LIMITS.min.h, COUNTER_SIZE_LIMITS.max.h); |
There was a problem hiding this comment.
Align clamped counter sizes with collision AABBs
Counter sizes are now clamped to COUNTER_SIZE_LIMITS before rendering (width/depth/height are forced through clampDimension on these lines), but buildSceneAabbs still constructs the global collision boxes from the raw ctr.size values with no clamping. When a saved configuration contains counters outside the new bounds, the mesh and local collision candidate here use the reduced clamped size while the scene-wide collision map still reflects the oversized raw dimensions, so moving or placing objects will register collisions with counters that visually appear smaller. Apply the same size limits before building sceneAabbs or normalize the stored sizes to keep collision detection consistent with what is rendered.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const rawD = ctr.size?.d ?? (variant === "premium" ? 0.6 : 0.5); | ||
| const rawH = ctr.size?.h ?? 1.1; | ||
| const w = clampDimension(rawW, COUNTER_SIZE_LIMITS.min.w, COUNTER_SIZE_LIMITS.max.w); | ||
| const d = clampDimension(rawD, COUNTER_SIZE_LIMITS.min.d, COUNTER_SIZE_LIMITS.max.d); | ||
| const h = clampDimension(rawH, COUNTER_SIZE_LIMITS.min.h, COUNTER_SIZE_LIMITS.max.h); |
There was a problem hiding this comment.
Align clamped counter sizes with collision AABBs
Counter sizes are now clamped to COUNTER_SIZE_LIMITS before rendering (width/depth/height are forced through clampDimension on these lines), but buildSceneAabbs still constructs the global collision boxes from the raw ctr.size values with no clamping. When a saved configuration contains counters outside the new bounds, the mesh and local collision candidate here use the reduced clamped size while the scene-wide collision map still reflects the oversized raw dimensions, so moving or placing objects will register collisions with counters that visually appear smaller. Apply the same size limits before building sceneAabbs or normalize the stored sizes to keep collision detection consistent with what is rendered.
Useful? React with 👍 / 👎.
2ffcd93 to
3945a8c
Compare
Summary
Testing
Codex Task