vector and Vector(float, float,float)
Note: Mediawiki doesn't allow both this to exist as lowercase (data type) and uppercase (function) variants so both are on this page at once.
vector Data Type
A vector is a structure of three floats, useful for defining positions and orientation vectors. To access the components of the vector, you can use the dot operator to get the x, y, and z components of the vector. The default value of a vector is [ 0.0, 0.0, 0.0 ] (or x = 0.0, y = 0.0, z = 0.0).
You define a vector by using the Vector command (see below for full details):
You can alter individual parts of the vector later using the Dot Operator with x, y and z as parameters:
If you have a function declaration needing a default vector value you can use it in this way:
Vector(float, float, float)
Creates a vector (position) from three points.
- x point of a triangle. (Default: 0.0f)
- y point of a triangle. (Default: 0.0f)
- z point of a triangle. (Default: 0.0f)
Returns a vector with the specified point values of fX, fY, and fZ.
A common use for this command is when creating a new location based on an objects location.
You can change the values of a set vector by using the dot operator.
author: Charles Feduke, editor: Lilac Soul