Jump to content

Getting vessel size


Recommended Posts

Hey all!

I'm wondering if it's possible to get the vessel size (the one you get on the VAB, in the info tab) from the KSP api.

(Calculating it from code should not be hard, but i suppose it's better to use something the KSP API gives you)

Cheers! :)

Link to comment
Share on other sites

Or use:


Vector3 size = ShipConstruction.CalculateCraftSize(EditorLogic.fetch.ship);

In the VAB, size.y represents the height of the vessel and size.x the diameter (you could use size.z too, for the other axis).

In the SPH, size.y represents the length of the vessel, size.x the span and size.z the height. :)

Thanks for sharing

Link to comment
Share on other sites

Or use:


Vector3 size = ShipConstruction.CalculateCraftSize(EditorLogic.fetch.ship);

In the VAB, size.y represents the height of the vessel and size.x the diameter (you could use size.z too, for the other axis).

In the SPH, size.y represents the length of the vessel, size.x the span and size.z the height. :)

Thank you! :)

Link to comment
Share on other sites

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...