Jump to content

Positioning and Orienting a Vessel


Recommended Posts

I'm working on my first mod--a sci-fi teleportation device that is less magic and more science (meaning, it's got lots of constraints, and isn't a panacea for lifting things into orbit). I've got the basics of it working (thanks to HyperEdit for showing me how to drop a vessel into an orbit), but there are a few things that I've not been able to figure out.

Specifically: I need to take one vessel and position it adjacent to another vessel, and then orient it so that the docking ports on the two vessels can be safely coupled.

Using the HyperEdit method, I can drop a vessel into the same orbit as another vessel. But even though their positions are identical (vessel.GetWorldPos3D() reports identical coordinates for both ships) they are not overlapping as I would expect.

(Obviously, I don't want them to overlap, but I'd like to understand why they don't, even with identical coordinates.)

From there, I then need to figure out how to determine the relative coordinates of two parts on two different ships, orient the two vessels appropriately, and then move them together. I think I've got the orientation bit figured out (reverse the direction of the orientation of the part's topNode, and then use Quaternion.LookRotation to find a transform to apply to the vessel), but the positioning bit is baffling me.

Any tips?

Link to comment
Share on other sites

  • 4 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...