Vector
Syntax¶
Vectors are created using the vec
constructor. Like all constructors in Terracotta, the values passed into the constructor are Expressions and can take full advantage of their features.
Operations¶
+ (Addition)¶
vec
+ vec
: vec
¶
Adds the XYZ coordinates of the Vectors together.
loc
+ vec
: loc
¶
Adds the XYZ coordinates of the right Vector to the XYZ coordinates of the left Location, leaving Pitch and Yaw untouched.
vec
+ txt
: txt
¶
Converts the left Vector into a String then adds it at the beginning of the right Styled Text.
txt
+ loc
: txt
¶
Converts the right Vector into a String then adds it at the end of the left Styled Text.
- (Subtraction)¶
vec
- vec
: vec
¶
Subtracts the XYZ coordinates of the right Vector from the XYZ coordinates of the left Vector.
loc
- vec
: loc
¶
Subtracts the XYZ coordinates of the right Vector from the XYZ coordinates of the left Location, leaving Pitch and Yaw untouched.
* (Multiplication)¶
vec
* num
: vec
¶
Multiplies the length of the left Vector by the right Number.
/ (Division)¶
vec
/ num
: vec
¶
Divides the length of the left Vector by the right Number.