freezy / VisualPinball.Engine

:video_game: Visual Pinball Engine for Unity
https://docs.visualpinball.org
GNU General Public License v3.0
415 stars 62 forks source link

Add basic support for rotation mech #337

Closed freezy closed 3 years ago

freezy commented 3 years ago

Mechs are a complex topic and this PR starts by splitting the former cannon component in two:

The rotator component (documentation) works by introducing a new IRotatableComponent interface, which allows setting a z-rotation and retrieving the position on the playfield. One of those is the defined as the "target", and other objects can be added which will rotate around the target. Rotation is applied to the mesh, but also to other relevant attributes like the eject angle for kickers (however, colliders still cannot be moved). Balls in the kickers are correctly rotated as well.

It somewhat works now with a cannon, although there are many more changes needed in order to support more generic mechs.

https://user-images.githubusercontent.com/70426/139556198-e9eed966-0c88-4cf9-874f-f33de4137144.mp4

Other Changes

TODO

codecov[bot] commented 3 years ago

Codecov Report

Merging #337 (00b8a23) into master (e400379) will increase coverage by 0.47%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #337      +/-   ##
==========================================
+ Coverage   83.43%   83.90%   +0.47%     
==========================================
  Files         125      125              
  Lines        6736     6734       -2     
==========================================
+ Hits         5620     5650      +30     
+ Misses       1116     1084      -32     
Impacted Files Coverage Δ
VisualPinball.Engine/VPT/Kicker/KickerData.cs 82.85% <ø> (+7.18%) :arrow_up:
...isualPinball.Engine/VPT/Primitive/PrimitiveData.cs 81.18% <0.00%> (+1.48%) :arrow_up:
VisualPinball.Engine/VPT/Surface/SurfaceData.cs 88.00% <0.00%> (+6.00%) :arrow_up:
VisualPinball.Engine/VPT/Bumper/BumperData.cs 87.23% <0.00%> (+6.38%) :arrow_up:
VisualPinball.Engine/IO/BiffData.cs 94.85% <0.00%> (+14.70%) :arrow_up:

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 e400379...00b8a23. Read the comment docs.