Skip to content

Touch tolerance in the collision contract; float32 DetMathF - #3

Merged
OctoAlgo merged 2 commits into
mainfrom
claude/youthful-allen-lou30t
Nov 1, 2026
Merged

OctoAlgo merged 2 commits into
mainfrom
claude/youthful-allen-lou30t

Conversation

@OctoAlgo

@OctoAlgo OctoAlgo commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Two commits.

1. Touch tolerance

  • SPEC.md section 4: a lib states <P>_TOUCH_TOLERANCE. A shape that starts within the tolerance (just apart, or overlapping by less) is touching. It blocks only when the move goes into the surface (dot(move, normal) < 0), with a hit at t 0. A deeper start overlap is a real hit. Otherwise the first contact along the move is the hit.
  • Template: TPL_TOUCH_TOLERANCE / CollisionRules.TouchTolerance (0.5 cm, checked by HeaderTests). The test world gets a box sweep (TestWorld.SweepBox) that follows the rule. New CollisionTests:
    • sliding along the floor and along a wall while touching (exactly touching, 0.3 apart, 0.3 sunk in);
    • moving away is free;
    • moving into the floor or wall is blocked;
    • a deep overlap is a hit;
    • first contact when apart.
  • COMPLIANCE.md: a touch tolerance row for each lib. libray3's ICollisionWorld uses the literal start-overlap rule, so it is ❌; libfc is unknown.

2. Float32 DetMathF (CLAUDE.md Next item 4)

  • TEMPLATE/src/Tpl.Core/DetMathF.cs: the same functions as DetMath (Sin, Cos, Atan, Atan2, Sqrt), computed in float only.
  • Tests: closeness to Math, plus golden bits that must match on Linux, Windows and macOS arm64 in CI.
  • SPEC mentions it, and the CLAUDE.md "Next" list is updated.

Local: dotnet test 71/71.

🤖 Generated with Claude Code

https://claude.ai/code/session_011dFkrWqBVAw1kojJ7PN58H

SPEC section 4: shapes that start within the lib's touch tolerance count as
touching and block only a move into them (dot(move, normal) < 0).
Template: TPL_TOUCH_TOLERANCE / CollisionRules.TouchTolerance, a box sweep
in the test world that follows the rule, CollisionTests (slide along floor
and wall, blocked moving in, deep overlap, first contact). COMPLIANCE rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dFkrWqBVAw1kojJ7PN58H
Same functions as DetMath (Sin, Cos, Atan, Atan2, Sqrt), computed in float
only, for float32 sims (TPL_SIM_BITS = 32). Tests: closeness to Math and
golden bits, run on Linux, Windows and macOS arm64 in CI. SPEC mentions it;
CLAUDE.md Next item done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dFkrWqBVAw1kojJ7PN58H
@OctoAlgo OctoAlgo changed the title Touch tolerance in the collision contract Touch tolerance in the collision contract; float32 DetMathF Nov 1, 2026
@OctoAlgo
OctoAlgo merged commit 60568ca into main Nov 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants