Creates a new ObservableVector3d instance.
The x-coordinate of the vector. Default is 0.
The y-coordinate of the vector. Default is 0.
The z-coordinate of the vector. Default is 0.
Optional
callback: (() => void)The callback function to be called when the point changes. Default is undefined.
Gets the x-coordinate of the point.
Sets the x-coordinate of the point.
The new x-coordinate value.
Gets the y-coordinate of the point.
Sets the y-coordinate of the point.
The new y-coordinate value.
Update this vector values to absolute values
Reference to this object for method chaining
Add the passed vector to this vector
other vector
Reference to this object for method chaining
return the angle between this vector and the passed one
other vector
angle in radians
return a clone copy of this vector
Optional
cb: (() => void)callback function to override the clone values
new Vector3d
Copy the components of the given vector into this one
other vector
Reference to this object for method chaining
calculate the cross product of this vector and the passed one
other vector
Reference to this object for method chaining
return the distance between this vector and the passed one
other vector
distance
Divide this vector values by the passed value
the value to divide the vector by
Reference to this object for method chaining
return the dot product of this vector and the passed one
other vector
The dot product.
return true if this vector is equal to the given values or vector
Rest
...args: other vector or vector components
true if both vectors are equal
Linearly interpolate between this vector and the given one.
other vector
distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
Reference to this object for method chaining
Update this vector with the maximum value between this and the passed vector
other vector
Reference to this object for method chaining
Update this vector with the minimum value between this and the passed vector
other vector
Reference to this object for method chaining
interpolate the position of this vector on the x and y axis towards the given one by the given maximum step.
other vector
the maximum step per iteration (Negative values will push the vector away from the target)
Reference to this object for method chaining
project this vector on to another vector.
The vector to project onto.
Reference to this object for method chaining
Project this vector onto a vector of unit length.
This is slightly more efficient than project
when dealing with unit vectors.
The unit vector to project onto.
Reference to this object for method chaining
Rotate this vector (counter-clockwise) by the specified angle (in radians) around the z axis
Reference to this object for method chaining
Multiply this vector values by the given scalar
x component
Optional
y: number = xy component
Optional
z: number = 1z component
Reference to this object for method chaining
Multiply this vector values by the passed vector
other vector
Reference to this object for method chaining
Sets the x and y coordinates of the point.
The new x-coordinate value.
The new y-coordinate value.
The new z-coordinate value.
Reference to this object for method chaining.
Sets the x and y coordinates of the point without triggering the callback.
The new x-coordinate value.
The new y-coordinate value.
Reference to this object for method chaining.
set the Vector x and y properties using the passed vector
other vector
Reference to this object for method chaining
set the Vector x and y properties to 0
Reference to this object for method chaining
Substract the passed vector to this vector
other vector
Reference to this object for method chaining
Convert this vector into 2d coordinate space
Reference to this object for method chaining
Convert this vector into isometric coordinate space
Reference to this object for method chaining
Represents a point in a 3D coordinate vector that can be observed for changes.