Skip to content

Add grey visual meshes to roadside props - #64

Merged
adam133 merged 3 commits into
mainfrom
copilot/reapply-changes-from-pr-63
Mar 23, 2026
Merged

Add grey visual meshes to roadside props#64
adam133 merged 3 commits into
mainfrom
copilot/reapply-changes-from-pr-63

Conversation

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Roadside props (lamp posts, trees, sign posts, fences) were collider-only — invisible in-game despite blocking the vehicle.

Changes

  • MapSceneBuilderSpawnPropCollider made non-static; adds a child Mesh GameObject per prop with a MeshFilter (Unity built-in primitive, scaled to match the collider) and a MeshRenderer applied via the existing Registry:

    // LampPost/SignPost → thin capsule (r=0.1, h=4 m), mid-grey
    AddCapsuleVisual(go, scale: new Vector3(0.2f, 2f, 0.2f), centerY: 2f, textureId: "prop_lamppost");
    // Tree → wider capsule (r=0.3, h=4 m), olive green
    AddCapsuleVisual(go, scale: new Vector3(0.6f, 2f, 0.6f), centerY: 2f, textureId: "prop_tree");
    // Fence → flat box (2×1.5×0.1 m), weathered wood brown
    AddBoxVisual(go, scale: new Vector3(2f, 1.5f, 0.1f), centerY: 0.75f, textureId: "prop_fence");
  • PlaceholderMaterialFactory — adds prop_lamppost, prop_signpost, prop_tree, prop_fence to KnownIds with distinct placeholder colours (mid-grey, olive green, weathered-wood brown); picked up automatically by FillMissing at startup.

  • PlaceholderMaterialFactoryTests — new TestCase entries and three focused colour-assertion tests for the four new IDs.

Original prompt

PR can't be merged because of merge conflicts, and copilot can't fix them without force pushing, which it is not allowed to do.

male the changes in this pr again on a fresh branch. #63


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI changed the title [WIP] Reapply changes from PR #63 due to merge conflicts Add physics colliders to buildings and roadside props Mar 23, 2026
Copilot AI requested a review from adam133 March 23, 2026 00:59
@adam133

adam133 commented Mar 23, 2026

Copy link
Copy Markdown
Owner

@copilot trees and signs, lampposts, and fences all have some sort of texture so they are visible right?

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot trees and signs, lampposts, and fences all have some sort of texture so they are visible right?

No — the props are currently collider-only. SpawnPropCollider creates a GameObject with only a physics collider component (no MeshFilter, MeshRenderer, or texture), so lamp posts, trees, sign posts, and fences block the car but are invisible in-game.

There is no procedural prop mesh generator in the codebase today, so adding visible geometry would be a separate feature on top of this collision work. This PR's scope was specifically to prevent the car from passing through objects that are already rendered (buildings) and to add invisible physics barriers at prop positions along the road.

Each prop type now has a child Mesh GameObject alongside its collider:
- LampPost / SignPost: Capsule mesh scaled (0.2, 2, 0.2) → grey material
- Tree: Capsule mesh scaled (0.6, 2, 0.6) → olive green material
- Fence: Cube mesh scaled (2, 1.5, 0.1) → weathered-wood brown material

PlaceholderMaterialFactory gains four new IDs (prop_lamppost,
prop_signpost, prop_tree, prop_fence) with category-appropriate colours.
SpawnPropCollider is made non-static so it can access Registry.

Co-authored-by: adam133 <20442729+adam133@users.noreply.github.com>
Agent-Logs-Url: https://github.com/adam133/vectorroad/sessions/43f6e8ed-5435-42e0-aa54-687c15822478
Copilot AI changed the title Add physics colliders to buildings and roadside props Add grey visual meshes to roadside props Mar 23, 2026
@adam133
adam133 marked this pull request as ready for review March 23, 2026 01:14
@adam133
adam133 merged commit 68877db into main Mar 23, 2026
12 checks passed
@adam133
adam133 deleted the copilot/reapply-changes-from-pr-63 branch March 23, 2026 01:20
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