Implement the following plan: PR #22 Review Plan — ConvexCollider with SAT Collision and…
- User
Implement the following plan:
PR #22 Review Plan — ConvexCollider with SAT Collision and Blender Pipeline
Context
PR #22 adds ConvexCollider with SAT collision detection, Blender pipeline integration for mesh vertices, ColliderTag marker, YSortOffset, and 19 unit tests. This plan outlines the review comments to submit via
gh pr review 22 --comment.Review Comments
1. Detection system: world vertex update pass is redundant (Medium)
File:
MonoDreams/System/Collision/TransformCollisionDetectionSystem.cs, lines 66-83 Comment: The first pass iterates_activeSetto update ConvexCollider world vertices, then a second pass iterates_targetsdoing the same thing. Since_activeSetand_targetsuse the same query (With<ColliderTag>().With<Transform>()), every entity in_activeSetis also in_targets— vertices get updated twice for active entities. Consider consolidating into a single pass over_targetsonly (which is the superset).2.
parallelRunnerparameter accepted but unused (Low)File:
MonoDreams/System/Collision/TransformCollisionDetectionSystem.cs, constructor Comment: The system changed fromAEntitySetSystem<GameState>(which usesparallelRunner) toISystem<GameState>(sequential). TheparallelRunnerparameter is still accepted in the constructor but never used — dead parameter. Either remove it or document why parallelism was dropped (likely because the instance-level_boxPolyBufA/_boxPolyBufBbuffers aren't thread-safe).3.
_activeSetquery lost passive/enabled filtering (Design)File:
MonoDreams/System/Collision/TransformCollisionDetectionSystem.cs, lines 42-45 Comment: The old query was.With((in BoxCollider c) => !c.Passive && c.Enabled), which filtered at the ECS query level. The new query.With<ColliderTag>().With<Transform>()returns all entities with either collider type, and passive/enabled filtering happens at runtime (line 89). This is understandable given the two-collider-type design, but worth noting as a performance trade-off for worlds with many passive/disabled colliders.4. No convexity validation in Blender exporter (Medium)
File:
Tools/blender_level_export.py,get_mesh_verticesfunction The exporter sorts vertices by angle from centroid (which only produces correct perimeter ordering for convex shapes) but never validates that the result is actually convex. If an artist accidentally creates a concave mesh, SAT will silently produce incorrect collision results. Consider adding a convexity check with a warning in Blender's console/output. Assistant
I'll gather the PR details and confirm the exact line positions for the inline comments.
Assistant
Now I need to get the diff positions for each file. The GitHub review API requires diff-relative positions.
Assistant
Let me read the actual files to confirm exact line numbers for comments.
Assistant
Now I have all the exact line numbers. Let me submit the review with inline comments via the GitHub API.
Assistant
Review submitted successfully. All 8 inline comments are now posted on PR #22:
- Redundant world-vertex update pass —
TransformCollisionDetectionSystem.cs:66-83 parallelRunneraccepted but unused —TransformCollisionDetectionSystem.cs:31_activeSetlost passive/enabled filtering —TransformCollisionDetectionSystem.cs:41-45- No convexity validation in Blender exporter —
blender_level_export.py:92-97 - Multiple
-colliderchildren: last one silently wins —BlenderLevelParserSystem.cs:116 BoxToPolygonignores transform rotation —SATCollision.cs:126-139- Redundant
ColliderTagset —BlenderLevelParserSystem.cs:641 - Commented-out debug system —
LoadLevelExampleGameScreen.cs:283-285
You can view them at: https://github.com/roo-oliv/monodreams/pull/22#pullrequestreview-3864362763
- Redundant world-vertex update pass —