Jump to content

How to disable patched conics for a vessel


Recommended Posts

How can I disable rendering patched conics for a vessel? I want it to look like before you upgrade the tracking station, with just the grey orbit lines. Examples:

(I got the images by taking a screenshot without/with the tracking station upgraded.)

I need to be able to switch back and forth between the two modes, so nothing permanent. 

How can I do this via code?

 

Edited by pydude
Link to comment
Share on other sites

I did find one thing in the Vessel class, https://kerbalspaceprogram.com/api/class_vessel.html#a69e1ba66ab9de6f946adc75b46dbfb19

Vessel.PatchedConicsUnlocked miht help you out a little bit. 

Edit: if you need to find something in the api, just do a search with relevant search terms. I looked up Patched and this was the last result. 

Edited by Benjamin Kerman
Link to comment
Share on other sites

@Benjamin Kerman Vessel.PatchedConicsUnlocked apparently doesn't exist :huh:. It's listed in the documentation, but doesn't seem to actually be there. 

'Vessel' does not contain a definition for 'PatchedConicsUnlocked' and no extension method 'PatchedConicsUnlocked' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an assembly reference?)

Seems odd. I tried patchedConicsUnlocked, too, with a lowercase p. Still no luck. 

Link to comment
Share on other sites

12 minutes ago, pydude said:

@Benjamin Kerman Vessel.PatchedConicsUnlocked apparently doesn't exist :huh:. It's listed in the documentation, but doesn't seem to actually be there. 


'Vessel' does not contain a definition for 'PatchedConicsUnlocked' and no extension method 'PatchedConicsUnlocked' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an assembly reference?)

Seems odd. I tried patchedConicsUnlocked, too, with a lowercase p. Still no luck. 

That member is marked as private. That means that members of the Vessel class can use it, but no one else can. It's one of the ways object-oriented programmers protect internal functionality from external dependencies (SQUAD can change or remove private class members, and no mods will break since no mod can use them).

However, Vessel.patchedConicRenderer is public. What happens if you set vessel.patchedConicRenderer.renderEnabled = false, or mess with the other properties of that object?

https://kerbalspaceprogram.com/api/class_patched_conic_renderer.html

Link to comment
Share on other sites

5 minutes ago, HebaruSan said:

That member is marked as private. That means that members of the Vessel class can use it, but no one else can. It's one of the ways object-oriented programmers protect internal functionality from external dependencies

Oh. I'm such a noob at c#.

6 minutes ago, HebaruSan said:

What happens if you set vessel.patchedConicRenderer.renderEnabled = false

Setting renderEnabled to false doesn't work. It seems to change back to true by itself every frame. I had actually already tried that before starting this thread. I'll have look at some of the other properties, though.

Link to comment
Share on other sites

13 hours ago, Benjamin Kerman said:

Yeah, that would make sense becuase it looks like it is set as a constant in the program... 

?????????????????????????????

Sorry but do you throw dart on a board to generate your replies ?

Link to comment
Share on other sites

Okay, so I've made a little bit of progress. Using this code

for (var i = 0; i < vessel.patchedConicRenderer.patchRenders.Count(); i++)
                {
                    vessel.patchedConicRenderer.patchRenders[i].visible = false;

                }

, I have stopped the conics from rendering. However, there are some problems.

First, the conics sometimes flicker in if you zoom in and out in the map view. They only show up for a split second, but for my intended use, this would be a problem. How do I stop this from happening?

Second, the orbit lines are not rendering. I don't know how to draw the orbit, but not the encounters. How can do this?

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