This return below is defined as a gaussian falloff. I am not seeing e or powers of 2, so I am not sure how this is related to the Gaussian falloff, or if it is the wrong kind of fallout for me to use to get a nice smooth deformation on my mesh:
Mathf.Clamp01 (Mathf.Pow (360.0, -Mathf.Pow (distance / inRadius, 2.5) - 0.01))
where Mathf.Clamp01
returns a value between 0 and 1.
inRadius
is the size of the distortion and distance
is determined by:
sqrMagnitude = (vertices[i] - position).sqrMagnitude; // Early out if too far away if (sqrMagnitude > sqrRadius) continue; distance = Mathf.Sqrt(sqrMagnitude);
vertices
is a list of mesh vertices, and position
is the point of mesh manipulation/deformation.
My question is two parts:
1) Is the above actually a Gaussian falloff? It is expontential, but there does not seem to be the crucial e or power of 2... (Updated - I see how the graph seems to decrease smoothly in a Gaussian-like way. Perhaps this function is not the cause for problem 2 below)
2) My mesh is not deforming smoothly enough - given the above parameters, would you recommend a different Gaussian falloff?