30-11-2017, 06:13 PM
(30-11-2017, 05:06 PM)josemendez Wrote: 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().
Hi,
In the ObiEmitterShapeEdge script which I need to use, there is a definition for velocity:
Vector3 vel = Quaternion.AngleAxis(i*radialVelocity,Vector3.right) * Vector3.forward;
I am trying to change it to:
Vector3 vel = velRef * Mathf.Pow (height2 / heightRef, alpha);
height2 = height of a particle from ground (actually all of the particles should change accordingly)
heightRef = reference height
velRef = reference velocity (it gives error, since its a float value, not a Vector)
alpha= roughness coefficient
However, this script don't have a definition for ApplyForcesToActor() method Actually, as I suppose it uses distribution.