public override Oni.FluidMaterial GetEquivalentOniMaterial(Oni.SolverParameters.Mode mode) { Oni.FluidMaterial material = new Oni.FluidMaterial(); material.smoothingRadius = GetParticleSize(mode); material.restDensity = restDensity; material.viscosity = 0; material.surfaceTension = 0; material.buoyancy = -1; material.atmosphericDrag = 0; material.atmosphericPressure = 0; material.vorticity = 0; return(material); }
public override Oni.FluidMaterial GetEquivalentOniMaterial(Oni.SolverParameters.Mode mode) { Oni.FluidMaterial material = new Oni.FluidMaterial(); // smoothing radius must be at least twice the particle radius, so that particle centers can reach each other. That's why the size is not multiplied by 0.5f. material.smoothingRadius = GetParticleSize(mode) * smoothing; material.restDensity = restDensity; material.viscosity = viscosity; material.surfaceTension = surfaceTension; material.buoyancy = buoyancy; material.atmosphericDrag = atmosphericDrag; material.atmosphericPressure = atmosphericPressure; material.vorticity = vorticity; return(material); }
/** * Returns the mass (in kilograms) of a single particle of this material. */ public float GetParticleMass(Oni.SolverParameters.Mode mode) { return(restDensity * Mathf.Pow(GetParticleSize(mode), mode == Oni.SolverParameters.Mode.Mode3D ? 3 : 2)); }
/** * Returns the diameter (2 * radius) of a single particle of this material. */ public float GetParticleSize(Oni.SolverParameters.Mode mode) { return(1f / (10 * Mathf.Pow(resolution, 1 / (mode == Oni.SolverParameters.Mode.Mode3D ? 3.0f : 2.0f)))); }
public abstract Oni.FluidMaterial GetEquivalentOniMaterial(Oni.SolverParameters.Mode mode);
public float GetSmoothingRadius(Oni.SolverParameters.Mode mode) { return(GetParticleSize(mode) * smoothing); }