Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Velocity profile
#5
(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 Triste Actually, as I suppose it uses distribution.
Reply


Messages In This Thread
Velocity profile - by mimarilker - 30-11-2017, 10:56 AM
RE: Velocity profile - by josemendez - 30-11-2017, 03:48 PM
RE: Velocity profile - by mimarilker - 30-11-2017, 03:58 PM
RE: Velocity profile - by josemendez - 30-11-2017, 05:06 PM
RE: Velocity profile - by mimarilker - 30-11-2017, 06:13 PM
RE: Velocity profile - by josemendez - 01-12-2017, 02:26 PM