Skip to content

Commit

Permalink
Let the user use his pifomètre.
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Mar 13, 2014
1 parent e7d4158 commit 3b385ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ModelMultiParticlePersistFX.cs
Expand Up @@ -52,6 +52,9 @@ public class ModelMultiParticlePersistFX : EffectBehaviour
// Whether to apply Archimedes' force, gravity and other things to the particle.
[Persistent]
public bool physical = true;

[Persistent]
public double dragCoefficient = 0.1;

public FXCurve emission = new FXCurve("emission", 1f);

Expand Down Expand Up @@ -247,9 +250,8 @@ public void FixedUpdate()
double estimatedInitialVolume = 0.75 * Math.PI * rMin * rMin * rMin;
double currentVolume = 0.75 * Math.PI * r * r * r;
double volumeChange = currentVolume - estimatedInitialVolume;
double density = (estimatedInitialVolume * initialDensity + volumeChange) / currentVolume;
double atmosphericDensity = FlightGlobals.getAtmDensity(FlightGlobals.getStaticPressure(pPos));
double dragCoefficient = .4; // Computed by Pifomètre. Make it a setting?
double density = (estimatedInitialVolume * initialDensity + volumeChange * atmosphericDensity) / currentVolume;
double mass = density * currentVolume;
// Weight and buoyancy.
Vector3d acceleration = (1 - (atmosphericDensity / density)) * FlightGlobals.getGeeForceAtPosition(pPos);
Expand Down

0 comments on commit 3b385ed

Please sign in to comment.