From 3b385ed436979a7f695567b7c3ab553264b76823 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Thu, 13 Mar 2014 04:07:44 +0100 Subject: [PATCH] =?UTF-8?q?Let=20the=20user=20use=20his=20pifom=C3=A8tre.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ModelMultiParticlePersistFX.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ModelMultiParticlePersistFX.cs b/ModelMultiParticlePersistFX.cs index 774cf9e..f100d1a 100644 --- a/ModelMultiParticlePersistFX.cs +++ b/ModelMultiParticlePersistFX.cs @@ -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); @@ -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);