Advertisement
yashpolke

VEX density mult by prox to point

Aug 4th, 2017
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. float dm      = chf( 'density_mult' );
  2. float maxDist = chf( 'max_dist' );
  3. float minDist = chf( 'min_dist' );
  4. float radius  = 9999;
  5. int maxpoints = chi( 'max_pts' );
  6.  
  7. float fade    = chf( 'fade' );
  8. float exp_padding = chf( 'exp_padding' );
  9. float exp     = chf( 'exp' );
  10.  
  11. float cMin    = chf( 'clamp_min' );
  12. float cMax    = chf( 'clamp_max' );
  13. vector center = point( 1, 'P', 0 );
  14. float dist    = distance( v@P, center );
  15. float fDist   = fit( dist, minDist, maxDist, 1, 0 );
  16.  
  17. int handle   = pcopen( 0, 'P', v@P, radius, maxpoints );
  18. float pcDist = pcimportbyidxf( handle, 'point.distance', 0 );
  19.  
  20. int arg = ( pcDist <= fDist );
  21.  
  22. float condition = ( arg ) ? ( f@density *= dm / ( fDist * (pow( clamp( f@density, cMin, cMax ) + pow( fade, exp_padding ), exp )))  ) : ( f@density = f@density );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement