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

vehicle split z-level support #42

Open
mlangsdorf opened this issue Mar 6, 2019 · 0 comments
Open

vehicle split z-level support #42

mlangsdorf opened this issue Mar 6, 2019 · 0 comments

Comments

@mlangsdorf
Copy link
Owner

mlangsdorf commented Mar 6, 2019

add ramp-up > and ramp-down < tiles.

make vehicle_part::precalc into a tripoint, with z-level default to 0.

in displace_vehicle(), when a vehicle structural tile moves off a ramp, increment or decrement its precalc.z as appropriate. when the pivot point moves off a ramp, increment or decrement it's pos.z and decrement or increment precalc.z.

ie:
0. bike with pivot 0, 0 and frames [0,-1], [0,0], [0,1], wheels [0,-1] and [0,1], and unified control system [0,0].
0a. vehicle global pos is [23,24,0] with the wheel at [0,-1] on a >.

  1. The bike moves north to [23,23,0] the wheel precalc becomes [0,-1,1], the next is still [0,0,0] and the last one is [0,1,0].
  2. The vehicle keeps moving north, so the pivot moves up a z-level to [23,22,1] and the precalcs become [0,-1,0], [0,0,0], and [0,1,-1].
  3. The vehicle keeps moving north, so the pivot becomes [23,21,1] and the precalcs become [0,-1,0], [0,0,0], and [0,1,0].

open questions:
what to do about vehicles that are wider than ramps?

ro-o\
|###|  >
|###|  >
ho-o/

center of a vehicle goes up a 2-wide ramp, including the pivot point but none of the wheels.

ro-o\
|###|  <
|###|  <
ho-o/

center of a vehicle down down a 2-wide ramp, including the pivot point but none of the wheels.

sensible solution:
a vehicle can only be split between z-levels while some part of the vehicle is on a ramp. when no part of the vehicle is on a ramp, relocate the vehicle's global_pos3.z to the average of the wheel's pos3.z and then zero precalc.z for all parts.

which may cause vehicles to phase through walls and then suddenly collide =/

mlangsdorf pushed a commit that referenced this issue Mar 19, 2019
* rebased

* small refresh bug on zoom tiles, with pixelminimap panel
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

No branches or pull requests

1 participant