Skip to content

Commit

Permalink
Fallback evaluators fixed (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
KlyithSA authored Nov 28, 2024
1 parent db27acb commit 6a40b20
Showing 1 changed file with 32 additions and 32 deletions.
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

0 comments on commit 6a40b20

Please sign in to comment.