public static SimulatedPart Borrow(Part p, ReentrySimulation.SimCurves simCurve) { SimulatedPart part = pool.Borrow(); part.Init(p, simCurve); return(part); }
static public SimulatedPart New(Part p, ReentrySimulation.SimCurves simCurve) { SimulatedPart part = new SimulatedPart(); part.Set(p, simCurve); return(part); }
private static SimulatedPart Create() { SimulatedPart part = new SimulatedPart(); part.cubes.BodyLiftCurve = new PhysicsGlobals.LiftingSurfaceCurve(); part.cubes.SurfaceCurves = new PhysicsGlobals.SurfaceCurvesList(); return(part); }
public Vector3 Lift(Vector3 localVelocity, float dynamicPressurekPa, float mach) { Vector3 lift = Vector3.zero; for (int i = 0; i < count; i++) { SimulatedPart part = parts[i]; lift += part.Lift(localVelocity, dynamicPressurekPa, mach); } return(lift); }
public Vector3 Drag(Vector3 localVelocity, float dynamicPressurekPa, float mach) { Vector3 drag = Vector3.zero; for (int i = 0; i < count; i++) { SimulatedPart part = parts[i]; drag += part.Drag(localVelocity, dynamicPressurekPa, mach); } return(-localVelocity.normalized * drag.magnitude); }
private void Set(Vessel v, ReentrySimulation.SimCurves _simCurves) { totalMass = 0; var oParts = v.Parts; count = oParts.Count; simCurves = _simCurves; if (parts.Capacity < count) { parts.Capacity = count; } for (int i = 0; i < count; i++) { SimulatedPart simulatedPart = SimulatedPart.New(oParts[i], simCurves); parts.Add(simulatedPart); totalMass += simulatedPart.totalMass; } }
private void Init(Vessel v, ReentrySimulation.SimCurves _simCurves, double startTime, int limitChutesStage) { totalMass = 0; var oParts = v.Parts; count = oParts.Count; simCurves = _simCurves; if (parts.Capacity < count) { parts.Capacity = count; } for (int i = 0; i < count; i++) { SimulatedPart simulatedPart = null; bool special = false; for (int j = 0; j < oParts[i].Modules.Count; j++) { ModuleParachute mp = oParts[i].Modules[j] as ModuleParachute; if (mp != null && v.mainBody.atmosphere) { special = true; simulatedPart = SimulatedParachute.Borrow(mp, simCurves, startTime, limitChutesStage); } } if (!special) { simulatedPart = SimulatedPart.Borrow(oParts[i], simCurves); } parts.Add(simulatedPart); totalMass += simulatedPart.totalMass; } }
private void Set(Vessel v, ReentrySimulation.SimCurves _simCurves, double startTime, int limitChutesStage) { totalMass = 0; var oParts = v.Parts; count = oParts.Count; simCurves = _simCurves; if (parts.Capacity < count) { parts.Capacity = count; } for (int i = 0; i < count; i++) { SimulatedPart simulatedPart = null; bool special = false; for (int j = 0; j < oParts[i].Modules.Count; j++) { if (oParts[i].Modules[j] is ModuleParachute) { special = true; simulatedPart = SimulatedParachute.New((ModuleParachute)oParts[i].Modules[j], simCurves, startTime, limitChutesStage); } } if (!special) { simulatedPart = SimulatedPart.New(oParts[i], simCurves); } parts.Add(simulatedPart); totalMass += simulatedPart.totalMass; } }
private static void Reset(SimulatedPart obj) { }
static public SimulatedPart New(Part p, ReentrySimulation.SimCurves simCurve) { SimulatedPart part = new SimulatedPart(); part.Set(p, simCurve); return part; }
private static void Reset(SimulatedVessel obj) { SimulatedPart.Release(obj.parts); obj.parts.Clear(); }