Use tag_landing instead of Aabb for determining AI docking position #3915

merged 1 commit into from Jan 31, 2017


None yet

2 participants

jaj22 commented Jan 27, 2017 edited

Combined with #3912, removes the need to put the pad collision geometry far above the visible pad and associated non-obvious docking dependencies on ship geometry. Should remove any issues with specific ships having difficulty docking or suffering damage. Note that without #3912, most ships will not dock when this patch is used.

All new ships will need a tag_landing, with some static collision geometry extending down to the same height or below. If a ship doesn't have a tag_landing, 0.0 is used instead for the landing position, which should dock but be clearly incorrect. The Aabb is not used as a backup because it may disguise incorrect behaviour.

The 0.1m offset in ShipAICmd.cpp is a somewhat arbitrary epsilon value to ensure that the edge vs tri intersections are reliably detected, and that the autopilot doesn't waste frames repositioning the ship at high time accel values.

There's a potential outstanding issue with the terrain collision. This still uses aabb.min.y, which could cause problems if a pad is very close to the terrain (terrain impact might happen before docking impact). That won't happen with the current station models as they're so far from the ground. The complicating factor for fixing this is that the landing tag only exists for ships, while terrain collision is checked for all dynamic bodies, for example cargo containers.

Supersedes #3911.

@impaktor impaktor merged commit eeaf81a into pioneerspacesim:master Jan 31, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment