Vector
The Vector library is used to represent points and directions in 3D space. It is used heavily in MMM for giving orders, placing objects and many other operations.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| x | Number | RW | X component of the Vector |
| y | Number | RW | Y component of the Vector |
| z | Number | RW | Z component of the Vector |
| length | Number | R | The magnitude |
| lengthSquared | Number | R | The square magnitude |
Functions
- Constructors
Constructors for the Vector class.
- Vector( )
Create a new Vector with default (zero) values
- Vector( x, y, z )
Create a vector with the specified x, y and z values
- Vector( )
- Instance Functions
Functions that are used with a Vector instance.
- cross( other )
Cross product
- dot( other )
Dot product
- lerp( other, scalar )
Interpolate between this vector and another
- normalize( )
Calculate the unit length version of this Vector
- cross( other )
- Operators
Operators that are used with a Vector instance.
- operator + ( other )
Add a Vector to this one
- operator - ( other )
Subtract a Vector from this one
- operator / ( scalar )
Divide this Vector by a scalar
- operator * ( scalar )
Multiply this Vector by a scalar
- operator + ( other )
