Implement the following plan: Address PR #22 Review Comments Context PR #22 ("Add…
- User
Implement the following plan:
Address PR #22 Review Comments
Context
PR #22 ("Add ConvexCollider with SAT collision and Blender pipeline") has 8 review comments from
roo-oliv. This plan addresses each one.Changes
1. Redundant world-vertex update pass (Medium)
File:
MonoDreams/System/Collision/TransformCollisionDetectionSystem.csRemove the first pass over
_activeSet(lines 67-74) that updates ConvexCollider world vertices. Keep only the pass over_targets(the superset). The result is a single vertex-update loop before the collision detection loop.2. Remove unused
parallelRunnerparameter (Low)File:
MonoDreams/System/Collision/TransformCollisionDetectionSystem.csRemove
parallelRunnerfrom the constructor signature — it's no longer used since the system moved fromAEntitySetSystem<GameState>toISystem<GameState>. Add a brief comment on the class noting that parallelism was dropped because instance-level polygon buffers (_boxPolyBufA/_boxPolyBufB) are not thread-safe.3. Note on lost passive/enabled query-level filtering (Design note)
File:
MonoDreams/System/Collision/TransformCollisionDetectionSystem.csAdd a comment on the
_activeSetquery explaining that passive/enabled filtering moved to runtime becauseColliderTagunifies two collider types that each have their own passive/enabled semantics.4. Convexity validation in Blender exporter (Medium)
File:
Tools/blender_level_export.pyAfter the angle sort in
get_mesh_vertices, add a cross-product sign consistency check. If the polygon is not convex, print a warning to Blender's console/stdout and returnNone.5. Warn on duplicate
-colliderchildren per parent (Low)File:
MonoDreams/System/Level/BlenderLevelParserSystem.csBefore overwriting
colliderChildMap[obj.Parent], check if the key already exists. If so, log a warning naming both the existing and new collider child.6. Document
BoxToPolygonrotation assumption (Design question)File:
MonoDreams/Extensions/Monogame/SATCollision.csAdd a
<remarks>comment on noting that it treats the box as axis-aligned regardless of , consistent with the swept-AABB model for Box-vs-Box collisions. Assistant
I'll start by reading all the files that need to be modified.
Assistant
Now let me check for other callers of the
TransformCollisionDetectionSystemconstructor.Assistant
Two callers. Let me also check
InfiniteRunnerScreen.csto know the exact line context.Assistant
Good, now I have all the context. Let me implement all 8 changes. I'll start with the edits that don't depend on each other.
Assistant
Now let me add the convexity validation to the Blender exporter (change #4).
Assistant
All edits done. Now let me build and run tests.
Assistant
Build succeeded with 0 errors. Now let me run the tests.
Assistant
All 26 tests passed. Let me also check if the
using DefaultEcs.Threadingimport was removed fromInfiniteRunnerScreen.csif it's no longer needed there (though it may be used by other things).Assistant
Good, the
using DefaultEcs.Threadingwas already removed from the detection system. The callers (InfiniteRunnerScreen.cs,LoadLevelExampleGameScreen.cs) still use_parallelRunnerfor other systems so their imports are fine.Here's a summary of all 8 changes made:
-
Redundant world-vertex update pass — Removed the first loop over
_activeSetinTransformCollisionDetectionSystem.Update(). Only the_targetsloop (the superset) remains. -
Unused
parallelRunnerparameter — Removed from the constructor signature and removed the import. Added a class-level comment explaining why parallelism was dropped. Updated both callers ( and ).
-
- User
git add ., commit and push
Assistant
All looks good. 6 files changed, all addressing the PR review comments.
Assistant
Committed and pushed
044863atoro/convex-collider-sat.