Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vehicles: enable functional boats phase 1 #27225

Merged
merged 1 commit into from
Jan 2, 2019

Conversation

mlangsdorf
Copy link
Contributor

@mlangsdorf mlangsdorf commented Dec 21, 2018

Summary

SUMMARY: Infrastructure "vehicles: enable functional boats phase 1"

Purpose of change

Fixes #27223
Do a minimal update of the vehicle code to successfully handle boats.

Describe the solution

add a function vehicle::is_in_water() and an underlying variable is_floating to replace ad-hoc calls to !floating.empty (with the long term plan of dynamically determining if a vehicle is in water to allow
amphibious vehicles).

rework the boat movement equations to use the same kind of math as the ground vehicle movement equations. Approximate boat draft and freeboard based on vehicle weight and percentage of structure that have boat boards.

Add two more lines to the stats pane in the vehicle interaction menu and use the extra space to display water speed and acceleration and draft.

Describe alternatives you've considered

Setting all the boat code on fire was tempting, but I will work within the existing framework.

Additional Content

Goals/phases
-[x] - Re-enable existing boats in some kind of sensible fashion
-[x] - Add proper support for amphibious vehicles and get rid of the "board boards are wheels" hack
-[ ] - Fix collisions
-[ ] - Migrate mods/Boats content into mainline and obsolete Boats

@mlangsdorf mlangsdorf added <Enhancement / Feature> New features, or enhancements on existing Vehicles Vehicles, parts, mechanics & interactions [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Dec 21, 2018
@mlangsdorf mlangsdorf changed the title vehicles: enable functional boats phase 1 [WIP] vehicles: enable functional boats phase 1 Dec 21, 2018
@mlangsdorf mlangsdorf force-pushed the boats_rework branch 2 times, most recently from 1407a16 to a77429d Compare December 22, 2018 16:43
@mlangsdorf mlangsdorf changed the title [WIP] vehicles: enable functional boats phase 1 vehicles: enable functional boats phase 1 Dec 23, 2018
@mlangsdorf
Copy link
Contributor Author

mlangsdorf commented Dec 23, 2018

I don't know what's up with AppVeyor here - the failure makes no sense to me. AppVeyor was whining about legal C++ code but whatever, I've changed it.

@mlangsdorf mlangsdorf force-pushed the boats_rework branch 4 times, most recently from b5519a6 to a74ca84 Compare December 26, 2018 14:21
@ZhilkinSerg ZhilkinSerg self-assigned this Dec 28, 2018
add a function vehicle::is_in_water() and an underlying variable
is_floating to replace ad-hoc calls to !floating.empty (with the long
term plan of dynamically determining if a vehicle is in water to allow
amphibious vehicles).

rework the boat movement equations to use the same kind of math as the
ground vehicle movement equations.  Approximate boat draft and freeboard
based on vehicle weight and percentage of structure that have boat boards.

Add two more lines to the stats pane in the vehicle interaction menu and
use the extra space to display water speed and acceleration and draft.
Rework that section of the code to be more C++ and less C.
@Rivet-the-Zombie Rivet-the-Zombie merged commit ae8e456 into CleverRaven:master Jan 2, 2019
@mlangsdorf mlangsdorf deleted the boats_rework branch January 2, 2019 14:19
@ZhilkinSerg ZhilkinSerg removed their assignment Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Enhancement / Feature> New features, or enhancements on existing Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants