Skip to content

Add size limits and clamping for counters and screens#10

Open
sundsoffice-tech wants to merge 3 commits into
mainfrom
codex/define-min/max-constants-for-dimensions
Open

Add size limits and clamping for counters and screens#10
sundsoffice-tech wants to merge 3 commits into
mainfrom
codex/define-min/max-constants-for-dimensions

Conversation

@sundsoffice-tech

Copy link
Copy Markdown
Owner

Summary

  • introduce shared size limit constants and clamp counter and screen dimensions before geometry and collision handling
  • guard transform scale updates for counters and screens to respect size bounds

Testing

  • npm run build

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +861 to +865
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +861 to +865
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +861 to +865
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant