Jump to content

KSPUtil gone in 1.2.1?


Recommended Posts

6 hours ago, JPLRepo said:

Second bullet point, and a bunch of other info that might help you:

 

Thanks!  I also found this tidbit:

Quote

Vessel.obt_velocity and .srf_velocity and the spd versions are not valid in FixedUpdate unless on rails. This is because they are based off what the orbit is estimated to be after PhysX integration runs (i.e. after all FixedUpdates run). 

Is there any way to get them between physics updates?  That is, if FixedUpdate() is called 3 times between calls to Update(), is there any way to get srf_velocity and/or obt_velocity after each one?  I guess I'll need to compute them myself...

Link to comment
Share on other sites

52 minutes ago, martincmartin said:

Thanks!  I also found this tidbit:

Is there any way to get them between physics updates?  That is, if FixedUpdate() is called 3 times between calls to Update(), is there any way to get srf_velocity and/or obt_velocity after each one?  I guess I'll need to compute them myself...

?? You should be doing physics in FixedUpdate in your module. Not in Update

Link to comment
Share on other sites

6 minutes ago, JPLRepo said:

?? You should be doing physics in FixedUpdate in your module. Not in Update

I am!  And I want to use srf_velocity in my physics calculations, e.g. to know which direction is prograde (relative to surface, not orbit).  But it seems srf_velocity is only valid in Update(), not FixedUpdate().

Link to comment
Share on other sites

Ah yes it is. Sorry. So in Update store it. Then reference it in FixedUpdate?
EDIT: Actually it's updated in Update and FixedUpdate. so when you say it's not available you mean you can't reference it?

 

Edited by JPLRepo
Link to comment
Share on other sites

I'm just quoting the "Modders Notes for KSP 1.2" that you linked to (thanks again for linking to that!).  It contains the line:

Quote

Vessel.obt_velocity and .srf_velocity and the spd versions are not valid in FixedUpdate unless on rails. This is because they are based off what the orbit is estimated to be after PhysX integration runs (i.e. after all FixedUpdates run). 

What does it mean by "not valid"?  Is it just the value from the last physics update, or garbage numbers?  I've been assuming its the value from the last physics update.  Of course, the first frame after you switch to it, it could be a very old & essentially garbage number.  But after that, hopefully it will be ok.

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