Arithmetic and assignment operators:
=, +=, -=, *=, /= %= - assign modulo +, -, *, /, ^ % - modulo, for integers only * - for two vectors means dot product ^ - for two vectors means cross product; power for integer, float
Comparison operators:
==, !=, <, <=, >, >=
Logical operators:
&&, ||
Dot operator:
// Use dot operator to access component of vector: vector v; v.x = 0; v.y = 1; v.z = 2; v.w = 3; // Field of vert variable: vert p; int p.n; p.n = 1; // Vector component of field: vert p; vector p.color; p.color.x = 0; p.color.y = 0.5; p.color.z = 1; p.color.w = 1;
Transfer operator:
<-
Use transfer operator to copy field values from one point set to another. Mapping is based on pointID value:
vert setA = inPoints[0]; vert setB = inPoints[1]; setB.position <- setA.position; outPoints[0] = setB;
Previous: Flow control | Language reference