Add nose cone drag effect.

Increases drag on things in a stack that do not have a filled stack node. This means nose cones with only one stack node, will have less drag. The flip side of this is that engines will have more drag, as they have a missing node (where the fire comes out), Meaning this should also help stabilize vessels, as the engines will want to face backwards (as they have more drag).
GetResourceMass() is probably not too terribly resource intensive but
you're right in that it doesn't need to be called twice. I should have
cached it.

However, re: minimum_drag vs maximum_drag: In the stock DEFAULT drag mode,
minimum_drag is not used at all, it's totally ignored.

The reason I set it here though is that there are two additional drag modes
(CONIC and CYLINDRICAL) that are not currently used. However, KSP does
check to see if a part's drag model is set to either of them and they do
make use of the minimum_drag field. What it does it, depending on part
orientation it interpolates between the minimum_drag model  and
maximum_drag depending on orientation. I put in some preliminary code to
try to force it but I don't think it was doing it right. It will be an
optional mode when it goes in. (it has to be forced via plugin because as
best as I can tell, KSP doesn't actually check the drag model even though
there is a field for it in the part config)

What I should have done is check in that code to see if we were using
default drag mode or one of the other two, and leave minimum_drag alone if
default.


On Sat, Aug 30, 2014 at 4:12 AM, Robert Maupin <notifications@github.com>
wrote:

> In StockDragFix/SDFPartModule.cs:
>
> > -		{
> > -			part.minimum_drag = maximum_drag * part.mass / (part.mass + part.GetResourceMass ());
> > -			part.maximum_drag = maximum_drag * part.mass / (part.mass + part.GetResourceMass ());
> > -			part.minimum_drag *= Mathf.Abs(StockDragFix.dragScale);
> > -			part.maximum_drag *= Mathf.Abs( StockDragFix.dragScale);
> > +		public void FixedUpdate() {
> > +			part.maximum_drag = maximum_drag * part.mass / (part.mass + part.GetResourceMass());
> > +			part.minimum_drag = minimum_drag * part.mass / (part.mass + part.GetResourceMass());
> > +
> > +			part.maximum_drag *= drag_multiplier;
> > +			part.minimum_drag *= drag_multiplier;
> > +
> > +			//IF part.minimum_drag = minimum_drag IS NOT A bug THEN
> > +			//part.maximum_drag = maximum_drag * part.mass / (part.mass + part.GetResourceMass());
> > +			//part.maximum_drag *= drag_multiplier;
> > +			//part.minimum_drag = part.maximum_drag;
>
> This here, after you calculate the maximum drag, you can just assign that
> to the minimum drag. Since they are the same anyway. To avoid an extra set
> of calculations (I am not sure how expensive GetResourceMass() is after
> all).
>
> --
> Reply to this email directly or view it on GitHub
> <https://github.com/Starwaster/StockDragFix/pull/1/files#r16928708>.
>