Constructor
4D vector
Arguments: |
|
---|
Attributes
float - default 0
float - default 0
float - default 0
float - default 1
Methods
Sets value of this vector
Arguments: |
|
---|---|
Returns: | This vector |
Rtype : |
Copies value of v to this vector
Sets w to 1 if v.w is undefined
Arguments: |
|
---|---|
Returns: | This vector |
Rtype : |
Sets this vector to v1 + v2
Arguments: | |
---|---|
Returns: | This vector |
Rtype : |
Adds v to this vector
Arguments: |
|
---|---|
Returns: | This vector |
Rtype : |
Sets this vector to v1 - v2
Arguments: |
---|
Subtracts v from this vector
Arguments: |
|
---|---|
Returns: | This vector |
Rtype : |
Multiplies this vector by scalar s
Arguments: |
|
---|---|
Returns: | This vector |
Rtype : |
Divides this vector by scalar s
Set vector to ( 0, 0, 0, 1 ) if s == 0
Arguments: |
|
---|---|
Returns: | This vector |
Rtype : |
Computes dot product of this vector and v
Arguments: |
|
---|---|
Returns: | dot product |
Rtype : | float |
Computes squared length of this vector
Returns: | squared length |
---|---|
Rtype : | float |
Computes length of this vector
Returns: | length |
---|---|
Rtype : | float |
Normalizes this vector and multiplies it by l
Returns: | This vector |
---|---|
Rtype : | Vector4() |
Linearly interpolate between this vector and v with alpha factor
Arguments: |
|
---|---|
Returns: | This vector |
Rtype : |
Example
var a = new THREE.Vector4( 1, 0, 0, 0 );