Implement the following plan: PR #22 Code Review Plan Context PR #22 adds ConvexCollider…
- User
Implement the following plan:
PR #22 Code Review Plan
Context
PR #22 adds ConvexCollider with SAT (Separating Axis Theorem) collision detection alongside the existing BoxCollider swept-AABB path. It integrates with the Blender exporter pipeline, adds debug visualization, Y-sort offset support, and 19 unit tests.
Review Action
Post a PR review comment via
gh pr review 22 --commentwith findings organized by severity. Cannot approve/request-changes since the author account is the same.Review Findings
High-priority
ConvexCollider.UpdateWorldVertices()usestransform.Position(local), notWorldPosition— consistent with BoxCollider but collision would be incorrect for child entities with colliders. Safe if convention is enforced (parser does enforce it), but worth documenting.NormalToSide()returns null for exact 45-degree normals — noRigidBodyTouchMessagefor diagonal collisions, could silently break grounded-state detection on angled surfaces.- SAT contact point is centroid-midpoint approximation (detection line 175) — reasonable but imprecise. Should document it's an approximation since game code may use
ContactPoint.
Medium-priority
_activeSetnaming misleading — contains ALL collider entities, active filtering happens at runtime (line 82). Minor readability issue.- World vertex update every frame for all ConvexColliders (detection lines 68-76) — no dirty-flag optimization. Fine for current scale, but scales O(N) per frame for static entities.
ColliderDebugSystemGC pressure when enabled — creates arrays withToArray()and entities every frame. Fine for debug but worth noting.CullingSystem.DebugEnabledchanged from instance property to static field — subtle breaking change for external callers.SpriteDebugSystem.Enableddefault changed fromtruetofalse— behavior change.
Low-priority / Nitpicks
global::System.Collections.IEnumerablein DebugInspector — works but unusual, suggests namespace conflict.- Blender
-collidernaming convention undocumented in exporter script — only in C# comments.
Assistant
I'll post the PR review comment now.
Assistant
The PR review comment has been posted on PR #22. It covers all 10 findings organized by severity:
- 3 high-priority items (world vs local position, null-returning
NormalToSide, approximate contact point) - 5 medium-priority items (naming, per-frame updates, GC pressure, static field change, default flip)
- 2 low-priority nitpicks (global:: prefix, Blender docs)
- 3 high-priority items (world vs local position, null-returning