Skip to content

Generate meshes for playfield inserts#320

Merged
freezy merged 7 commits into
masterfrom
feature/insert-meshes
Sep 15, 2021
Merged

Generate meshes for playfield inserts#320
freezy merged 7 commits into
masterfrom
feature/insert-meshes

Conversation

@freezy
Copy link
Copy Markdown
Owner

@freezy freezy commented Sep 14, 2021

This PR generates meshes for the playfield inserts. Since inserts are not a VPX feature per SE, we assume a light is an insert if:

  1. Light bulb mesh is disabled
  2. The texture is the same as the playfield.

The mesh is only generated if both of these apply.

You can set the Z-position as well as the height of the created mesh in the inspector. The following shot shows the generated meshes for T2:

image

TODO:

  • Add drag point support
  • Test surface height realtime updates for ramps

In order to support drag point editing (since we're on a non-main component containing the drag points), there was some refactoring necessary. DragPointItemInspector<> is gone now and replaced by a DragPointInspectorHelper that is instantiated instead. Bonus: Everything is typed correctly and all editor-related logic is in the inspector and not the component.

This PR closes #281.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 14, 2021

Codecov Report

Merging #320 (35e994e) into master (a5cc12e) will decrease coverage by 0.07%.
The diff coverage is 64.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #320      +/-   ##
==========================================
- Coverage   82.86%   82.79%   -0.08%     
==========================================
  Files         126      126              
  Lines        6841     6846       +5     
==========================================
- Hits         5669     5668       -1     
- Misses       1172     1178       +6     
Impacted Files Coverage Δ
VisualPinball.Engine/VPT/Light/LightData.cs 76.78% <0.00%> (-14.71%) ⬇️
VisualPinball.Engine/VPT/Surface/Surface.cs 75.00% <100.00%> (+11.84%) ⬆️
VisualPinball.Engine/VPT/Surface/SurfaceData.cs 81.25% <100.00%> (+0.39%) ⬆️
...Pinball.Engine/VPT/Surface/SurfaceMeshGenerator.cs 93.97% <100.00%> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8db8e8a...35e994e. Read the comment docs.

@freezy freezy self-assigned this Sep 15, 2021
@freezy freezy merged commit 54032f7 into master Sep 15, 2021
@freezy freezy deleted the feature/insert-meshes branch September 15, 2021 18:26
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.

Handle inserts

1 participant