Under TorqueScript position, vector, matrix, and color variables are all very similar. They are made up of a string with space-delimited components (or fields). For example, a position variable may be defined as follows:
// A position is of the form "x y z" %position = "1.2 0.34 13.22";
TorqueScript provides a set of special accessors to work with these common types of variables. This allows us to access each individual component and manipulate it.
We will be adding a new TorqueScript function to a project based on the Torque 3D
Full template and try it out using the
Empty Terrain level. If you haven't already, use the Torque Project Manager (
Project Manager.exe) to create a new project ...