Hi Conor,
I'm trying to use this approach, but I'm confused because the default fluid zone collides with the aero object sphere and is unable to react to the normal physical wind direction and velocity .
as this screenshot.
Rewritten VelocityFunction
public override Vector3 VelocityFunction(Vector3 position)
{
Vector3 uniformFluidVelocity = windVelocity.GetVelocity();
if (!enableTurbulence)
{
return uniformFluidVelocity;
}
position *= turbulenceLengthScale / referenceLength;
float time = Time.time * turbulenceTimeScale;
return new Vector3(uniformFluidVelocity.x + 2f * windVelocity.speed * turbulenceMagnitude * (Mathf.PerlinNoise(position.y + time, position.z + time) - 0.5f),
uniformFluidVelocity.y + 2f * windVelocity.speed * turbulenceMagnitude * (Mathf.PerlinNoise(position.x + time, position.z + time) - 0.5f),
uniformFluidVelocity.z + 2f * windVelocity.speed * turbulenceMagnitude * (Mathf.PerlinNoise(position.x + time, position.y + time) - 0.5f));
}
And in the LateUpdate method of FlowPointParticles.cs, the particle positions are used as input to the VelocityFunction."
particle.velocity+=fluidZones[j].VelocityFunction(particle.position);
Sorry, I'm a beginner with Unity. I'm not sure where I'm making mistakes or if there's something I've overlooked. Please let me know.
Thank you very much!