Skip to content

Add basic support for rotation mech#337

Merged
freezy merged 29 commits into
masterfrom
fix/teleporter
Oct 31, 2021
Merged

Add basic support for rotation mech#337
freezy merged 29 commits into
masterfrom
fix/teleporter

Conversation

@freezy
Copy link
Copy Markdown
Owner

@freezy freezy commented Oct 30, 2021

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

  • A StepRotatorMechComponent, which simulates the mech
  • A RotatorComponent which applies rotation on the playfield, inclusively balls.

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.

cannontest.mp4

Other Changes

  • Fixed a bug in teleporter
  • Bumped Unity to 2021.2
  • Removed obsolete angle/speed from kicker (it's handled by the coils array)
  • Don't spam console when using ball roller with no ball
  • Fixed a bug when an object sits on a ramp

TODO

  • Icons for rotation and step rotation components
  • Documentation for RotatorComponent

@freezy freezy requested a review from jsm174 October 30, 2021 19:30
@freezy freezy self-assigned this Oct 30, 2021
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 30, 2021

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%) ⬆️
...isualPinball.Engine/VPT/Primitive/PrimitiveData.cs 81.18% <0.00%> (+1.48%) ⬆️
VisualPinball.Engine/VPT/Surface/SurfaceData.cs 88.00% <0.00%> (+6.00%) ⬆️
VisualPinball.Engine/VPT/Bumper/BumperData.cs 87.23% <0.00%> (+6.38%) ⬆️
VisualPinball.Engine/IO/BiffData.cs 94.85% <0.00%> (+14.70%) ⬆️

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.

Copy link
Copy Markdown
Collaborator

@jsm174 jsm174 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome stuff! Looks good.

rhythmerc and others added 4 commits October 31, 2021 20:28
@freezy freezy merged commit f2e1a8c into master Oct 31, 2021
@freezy freezy deleted the fix/teleporter branch October 31, 2021 20:13
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.

3 participants