Inline Code

Declaring your own global variables in VEX

It's able to set variable as just word but it's better to set $ at initial.

example:

Ripple

float $h = sin(length(P));

$ripple = P + set(0, $h, 0);

XZ Position to Angle

float dis = length($P*set(1,0,1));

float s = $P[2]/dis;

float as = asin(s);

float ang = as*180/3.14159265359;

if ($P[0]<0){

ang = ang * -1 + 180;

}

if($P[0]>0 && $P[2]<0){

ang += 360;

}

$angle = ang;

$distance = dis;