ihsoft / KIS

Kerbal Inventory System
Other
110 stars 51 forks source link

Raycast attach node to check for colliders #369

Closed taniwha closed 3 years ago

taniwha commented 4 years ago

The ray cast is used to check whether then attach node is inside a collider on the part to be dropped, and if so find the offset needed to avoid dropping the part with the collider inside another collider, thus preventing the part from flying off in low gravity. Of course, the offset will not be sufficient of the collider surface is not perpendicular to the attach node, or if the overall part collider setup is concave around the attach node.

The computed offset works as a default value for the user-adjustable offset.

taniwha commented 4 years ago

I've taken care of those issues but not pushed yet. Last night, I noticed that dropping RCS ports was behaving strangely (offset probably 1m from the surface, but attaching worked properly). I suspect the ray cast is failing to hit anything and thus the offset is getting set to 1 instead of 0 (though I think RCS ports have trouble with being dropped, so I need to investigate further than just that). I'll push an update as soon as I can.

taniwha commented 4 years ago

I have also found out why small parts explode when placed on the ground. It's actually due to the lack of colliders. Ie, the part origin (and thus vessel origin since part origin -> part CoM (default) -> vessel CoM) is outside of any collider and thus can pass into the ground. Vessel does not like this. Placing the part upside down works around this, but is annoying. I am investigating a potential fix.

taniwha commented 4 years ago

Actually, that transform patch worked only on the launch pad, not out in the wild. Still working on it.

ihsoft commented 4 years ago

Please, let me know when it's OK to merge.

taniwha commented 4 years ago

Yeah, I'll do so. I hope to have something soon.

taniwha commented 4 years ago

@ihsoft All done. That surface attach node issue was a nightmare.