me.ObservableVector3d(xopt, yopt, zopt, settings)

new ObservableVector3d(xopt, yopt, zopt, settings)

A Vector3d object that provide notification by executing the given callback when the vector is changed.

Parameters:
Name Type Attributes Default Description
x Number <optional>
0

x value of the vector

y Number <optional>
0

y value of the vector

z Number <optional>
0

z value of the vector

settings Object

additional required parameters

Properties
Name Type Description
onUpdate function

the callback to be executed when the vector is changed

Extends

Members

static x :Number

x value of the vector

static y :Number

y value of the vector

static z :Number

z value of the vector

Methods

static abs() → {me.ObservableVector3d}

Update this vector values to absolute values

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static add(v) → {me.ObservableVector3d}

Add the passed vector to this vector

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static ceil() → {me.ObservableVector3d}

Ceil the vector values

Returns:
me.ObservableVector3d -

new me.ObservableVector3d

static ceilSelf() → {me.ObservableVector3d}

Ceil this vector values

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static clamp(low, high) → {me.ObservableVector3d}

Clamp the vector value within the specified value range

Parameters:
Name Type Description
low Number
high Number
Returns:
me.ObservableVector3d -

new me.ObservableVector3d

static clampSelf(low, high) → {me.ObservableVector3d}

Clamp this vector value within the specified value range

Parameters:
Name Type Description
low Number
high Number
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static clone() → {me.ObservableVector3d}

return a clone copy of this vector

Returns:
me.ObservableVector3d -

new me.ObservableVector3d

static copy(v) → {me.ObservableVector3d}

Copy the x,y,z values of the passed vector to this one

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static distance(v) → {Number}

return the distance between this vector and the passed one

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
Number

static div(value) → {me.ObservableVector3d}

Divide this vector values by the passed value

Parameters:
Name Type Description
value Number
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static dotProduct(v) → {Number}

return the dot product of this vector and the passed one

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
Number -

The dot product.

static equals(v) → {Boolean}

return true if the two vectors are the same

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
Boolean

static floor() → {me.ObservableVector3d}

Floor the vector values

Returns:
me.ObservableVector3d -

new me.ObservableVector3d

static floorSelf() → {me.ObservableVector3d}

Floor this vector values

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static lerp(v, alpha) → {me.ObservableVector3d}

Linearly interpolate between this vector and the given one.

Parameters:
Name Type Description
v me.Vector3d | me.ObservableVector3d
alpha Number

distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static maxV(v) → {me.ObservableVector3d}

Update this vector with the maximum value between this and the passed vector

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static minV(v) → {me.ObservableVector3d}

Update this vector with the minimum value between this and the passed vector

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static negate() → {me.ObservableVector3d}

Negate the vector values

Returns:
me.ObservableVector3d -

new me.ObservableVector3d

static negateSelf() → {me.ObservableVector3d}

Negate this vector values

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static normalize() → {me.ObservableVector3d}

normalize this vector (scale the vector so that its magnitude is 1)

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static perp() → {me.ObservableVector3d}

change this vector to be perpendicular to what it was before.
(Effectively rotates it 90 degrees in a clockwise direction)

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static rotate(angle) → {me.ObservableVector3d}

Rotate this vector (counter-clockwise) by the specified angle (in radians).

Parameters:
Name Type Description
angle number

The angle to rotate (in radians)

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static scale(x, yopt, zopt) → {me.ObservableVector3d}

Multiply this vector values by the given scalar

Parameters:
Name Type Attributes Default Description
x Number
y Number <optional>
x
z Number <optional>
x
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static scaleV(v) → {me.ObservableVector3d}

Multiply this vector values by the passed vector

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static setCallback(onUpdate) → {me.ObservableVector3d}

set the callback to be executed when the vector is changed

Parameters:
Name Type Description
onUpdate function

callback

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static setMuted(x, y, z) → {me.ObservableVector3d}

set the vector value without triggering the callback

Parameters:
Name Type Description
x Number

x value of the vector

y Number

y value of the vector

z Number

z value of the vector

Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static sub(v) → {me.ObservableVector3d}

Substract the passed vector to this vector

Parameters:
Name Type Description
v me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d
Returns:
me.ObservableVector3d -

Reference to this object for method chaining

static toString() → {String}

convert the object to a string representation

Returns:
String

static toVector3d() → {me.Vector3d}

return a me.Vector3d copy of this me.ObservableVector3d object

Returns:
me.Vector3d -

new me.Vector3d