30-11-2017, 05:06 PM
(This post was last modified: 30-11-2017, 05:11 PM by josemendez.)
(30-11-2017, 03:58 PM)mimarilker Wrote: Hi,
I am not sure if I explain it correctly, actually I need this wind speed profile at the emitter location. So I dont need any increasing or decreasing wind speed with distance based on a function.
Wind speed should change in the emitter with respect to the particles' locations (height from the ground or zero). Let's assume a vertical edge emitter, the particles at the lower levels will have low speeds gradually. This is exactly "atmospheric boundary layer". In reality wind speed at higher altitudes has high velocity due to the lower roughness height (since number of obstacles decrease). The attached file includes wind speed power law equation which is very easy to use. Btw, I have alpha values which changes according to the different roughness heights.
Thanks for your response.
Oh, ok. So you didn't mean changing the wind/speed response curve, but the distance/wind response.
You can implement your own wind emitter if you wish to (by inheriting ObiExternalForce and implementing your own ApplyForcesToActor() method), or modify the existing ones.
Take for instance the ObiSphericalForceZone component. The wind decay is linear with respect to distance to its center: (line 44 of ObiSphericalForceZone.cs)
Code:
float falloff = Mathf.Clamp01((sqrRadius - sqrMag) / sqrRadius);
But you can use any custom method to control it. For instance, quadratic decay:
Code:
float falloff = Mathf.Pow(Mathf.Clamp01((sqrRadius - sqrMag) / sqrRadius),2.0f);
If you just want wind speed to change depending on particle height (distance to the floor), your best bet is to create your own ObiExternalForce component and implement it in ApplyForcesToActor().