Skip to main content

Operators

The operators described below can be used to manipulate data.

Mathematical Operators

The following arithmetic operators are supported:

OperatorExample UseDescription
+p + qAddition
-p - qSubtraction
--pReturns the negative of a variable's value
*p * qMultiplication
/p / qDivision
^p ^ qPower

Vector Operators

When using vectors the following operators apply:

OperatorSyntaxExample useDescription
xV.xfpItem.position.xReturns the 1st component of a vector
yV.yfpItem.position.y Returns the 2nd component of a vector
zV.xfpItem.position.zReturns the 3rd component of a vector
+V+WfpItem.position + Object.positionAddition
-V-WfpItem.position + Object.positionSubtraction
*V*WfpItem.position * Object.positionDot Product
*V*pfpItem.position * 5Scalar Multiplication
/V/pfpItem.position / 2Scalar Division
^V^WfpItem.position^Object.positionCross Product

Comparative Operators

Forest effects includes an If function to allow you to create conditional rules.

This function uses the following syntax:

if(p,q,r)

Where p is a logic test which returns q if it returns true or r if it returns false.

To create the conditional tests for an IF function you use following operators:

OperatorExample UseDescription
==p==qReturn true if p is equal to.
<p<qReturn true if p is less than.
>p>qReturn true if p is greater than.
>=p>=qReturn true if p is greater than or equal to q
<=p<=qReturn true if p is less than or equal to q
|p|qReturn true if p or q are true
&p&qReturns true if p and q are true