Vector in Anark Studio 2.5
X/Y/Z location.
Inherits from:
Instance Properties
| name | type | description |
|---|---|---|
| prototype | Object | The prototype for a class. [from Object] |
| constructor | Object | A reference to the constructor class for the current object instance. [from Object] |
| x | Number | X location. |
| y | Number | Y location. |
| z | Number | Z location. |
Instance Methods
| name | returns | description |
|---|---|---|
| toLocaleString() | String |
For most objects, the same as toString() unless explicitly overridden.
[from Object]
|
| valueOf() | String |
Returns the internal this value of the object.
[from Object]
|
| hasOwnProperty() | Boolean | Determines if the object/instance itself has the named property or method. [from Object] |
| isPrototypeOf() | Boolean | Determines if the calling object prototype is in the inheritance chain for the supplied argument. [from Object] |
| propertyIsEnumerable() | Boolean |
Determines if the object/instance itself has a property or method of the supplied name which will appear in a for (prop in obj) enumeration.
[from Object]
|
| copy() | Vector | Return a copy of the vector. |
| add() | (none) | Add on a vector. |
| subtract() | (none) | Subtract a vector. |
| dot() | Vector | Calculate the dot product. |
| scale() | (none) | Scale the vector by a factor. |
| cross() | (none) | Perform a cross-product on the vector. |
| equals() | Boolean | Compare two vectors for equivalence. |
| length() | Number | Length of the vector. |
| lengthSquared() | Number | Length of the vector, squared. |
| normalize() | (none) | Normalize the vector. |
| distance() | Number | Calculate the distance to another vector. |
| distanceSquared() | Number | Calculate the squared distance to another vector. |
| maxVector() | (none) | Calculate the maximum vector. |
| minVector() | (none) | Calculate the minimum vector. |
| linear() | (none) | Move the vector towards another vector. |
| transform() | (none) | Transform the vector by a matrix. |
| toString() | String | Returns a string representation of the object. [from Object] |
Description
A vector is a utility object encapsulating the three floating point components X, Y and Z.
Constructor syntax
var vector = new Vector( x, y, z );
x- optional — The floating point value representing the X position.
y- optional — The floating point value representing the Y position.
z- optional — The floating point value representing the Z position.
Properties that are a Vector
| name | object | description |
|---|---|---|
| position | Node | Location of the object. |
| scale | Node | Scale of the object. |
| pivot | Node | Pivot point location. |
| lookAtPoint | Camera | Location for the camera to look at. |
| boxMax | Model | (read only) Maximum bounding-box point. |
| boxMin | Model | (read only) Minimum bounding-box point. |
Methods that return a Vector
| name | of object | description |
|---|---|---|
| copy() | Vector | Return a copy of the vector. |
| dot() | Vector | Calculate the dot product. |
Arguments that are a Vector
| name | in method | of object | description |
|---|---|---|---|
| globalOrigin | intersect() | Model | The vector in global 3D space< |
| globalDirection | intersect() | Model | Vector specifying the ray dire |
| intersection | intersect() | Model | Returns the positional vector< |
| normal | intersect() | Model | Returns a directional vector t |
| otherVector | add() | Vector | The Vector to add. |
| otherVector | subtract() | Vector | The Vector to subtract. |
| otherVector | dot() | Vector | Vector to use for calculating< |
| otherVector | cross() | Vector | Vector to use for calculating< |
| otherVector | equals() | Vector | The vector to compare to. |
| otherVector | distance() | Vector | The vector to calculate the di |
| otherVector | distanceSquared() | Vector | The vector to calculate the di |
| otherVector | maxVector() | Vector | The vector to compare to. |
| otherVector | minVector() | Vector | The vector to compare to. |
| targetVector | linear() | Vector | The vector to weight towards.< |
| targetVector | linear() | Rotation | The rotation to weight towards |