Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions RasterPropMonitor/Core/RPMVCEvaluators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ internal double FallbackEvaluateDragForce()
Vector3 bodyLift = p.transform.rotation * (p.bodyLiftScalar * p.DragCubes.LiftForce);
bodyLift = Vector3.ProjectOnPlane(bodyLift, -p.dragVectorDir);
pureLiftV += bodyLift;
}

for (int m = 0; m < p.Modules.Count; m++)
for (int m = 0; m < p.Modules.Count; m++)
{
PartModule pm = p.Modules[m];
if (pm.isEnabled && pm is ModuleLiftingSurface)
{
PartModule pm = p.Modules[m];
if (pm.isEnabled && pm is ModuleLiftingSurface)
ModuleLiftingSurface liftingSurface = pm as ModuleLiftingSurface;
if (!p.ShieldedFromAirstream)
{
ModuleLiftingSurface liftingSurface = pm as ModuleLiftingSurface;
if (!p.ShieldedFromAirstream)
{
pureLiftV += liftingSurface.liftForce;
pureDragV += liftingSurface.dragForce;
}
pureLiftV += liftingSurface.liftForce;
pureDragV += liftingSurface.dragForce;
}
}
}
Expand Down Expand Up @@ -129,18 +129,18 @@ internal double FallbackEvaluateLiftForce()
Vector3 bodyLift = p.transform.rotation * (p.bodyLiftScalar * p.DragCubes.LiftForce);
bodyLift = Vector3.ProjectOnPlane(bodyLift, -p.dragVectorDir);
pureLiftV += bodyLift;
}

for (int m = 0; m < p.Modules.Count; m++)
for (int m = 0; m < p.Modules.Count; m++)
{
PartModule pm = p.Modules[m];
if (pm.isEnabled && pm is ModuleLiftingSurface)
{
PartModule pm = p.Modules[m];
if (pm.isEnabled && pm is ModuleLiftingSurface)
ModuleLiftingSurface liftingSurface = pm as ModuleLiftingSurface;
if (!p.ShieldedFromAirstream)
{
ModuleLiftingSurface liftingSurface = pm as ModuleLiftingSurface;
if (!p.ShieldedFromAirstream)
{
pureLiftV += liftingSurface.liftForce;
pureDragV += liftingSurface.dragForce;
}
pureLiftV += liftingSurface.liftForce;
pureDragV += liftingSurface.dragForce;
}
}
}
Expand Down Expand Up @@ -175,23 +175,23 @@ internal double FallbackEvaluateTerminalVelocity()
Vector3 bodyLift = p.transform.rotation * (p.bodyLiftScalar * p.DragCubes.LiftForce);
bodyLift = Vector3.ProjectOnPlane(bodyLift, -p.dragVectorDir);
pureLiftV += bodyLift;
}

for (int m = 0; m < p.Modules.Count; m++)
for (int m = 0; m < p.Modules.Count; m++)
{
PartModule pm = p.Modules[m];
if (!pm.isEnabled)
{
PartModule pm = p.Modules[m];
if (!pm.isEnabled)
{
continue;
}
continue;
}

if (pm is ModuleLiftingSurface)
{
ModuleLiftingSurface liftingSurface = (ModuleLiftingSurface)pm;
if (p.ShieldedFromAirstream)
continue;
pureLiftV += liftingSurface.liftForce;
pureDragV += liftingSurface.dragForce;
}
if (pm is ModuleLiftingSurface)
{
ModuleLiftingSurface liftingSurface = (ModuleLiftingSurface)pm;
if (p.ShieldedFromAirstream)
continue;
pureLiftV += liftingSurface.liftForce;
pureDragV += liftingSurface.dragForce;
}
}
}
Expand Down
Loading