x value of the vector
y value of the vector
additional required parameters
the callback to be executed when the vector is changed
the value to use as this when calling onUpdate
x value of the vector
x value of the vector
y value of the vector
y value of the vector
Update this vector values to absolute values
Reference to this object for method chaining
Add the passed vector to this vector
Reference to this object for method chaining
return the angle between this vector and the passed one
angle in radians
Ceil the vector values
new me.ObservableVector2d
Ceil this vector values
Reference to this object for method chaining
Clamp the vector value within the specified value range
new me.ObservableVector2d
Clamp this vector value within the specified value range
Reference to this object for method chaining
return a clone copy of this vector
new me.ObservableVector2d
Copy the x,y values of the passed vector to this one
Reference to this object for method chaining
Divide this vector values by the passed value
the value to divide the vector by
Reference to this object for method chaining
Floor the vector values
new me.ObservableVector2d
Floor this vector values
Reference to this object for method chaining
Linearly interpolate between this vector and the given one.
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
Reference to this object for method chaining
Update this vector with the minimum value between this and the passed vector
Reference to this object for method chaining
interpolate the position of this vector towards the given one while nsure that the distance never exceeds the given step.
the maximum step per iteration (Negative values will push the vector away from the target)
Reference to this object for method chaining
Negate the vector values
new me.ObservableVector2d
Negate this vector values
Reference to this object for method chaining
change this vector to be perpendicular to what it was before.
(Effectively rotates it 90 degrees in a clockwise direction)
Reference to this object for method chaining
Rotate this vector (counter-clockwise) by the specified angle (in radians).
The angle to rotate (in radians)
Optional
v: Vector2d | ObservableVector2dan optional point to rotate around
Reference to this object for method chaining
Multiply this vector values by the given scalar
Optional
y: number = xReference to this object for method chaining
Multiply this vector values by the passed vector
Reference to this object for method chaining
set the callback to be executed when the vector is changed
callback
Optional
scope: Function = nullscope
Reference to this object for method chaining
set the vector value without triggering the callback
x value of the vector
y value of the vector
Reference to this object for method chaining
Substract the passed vector to this vector
Reference to this object for method chaining
A Vector2d object that provide notification by executing the given callback when the vector is changed.