Class: ObservableVector3d

me. ObservableVector3d

new ObservableVector3d(x, y, z, settings)

A Vector3d object that provide notification by executing the given callback when the vector is changed.
Parameters:
Name Type Argument 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
Source:
observable_vector3.js, line 19

Extends

Classes

Error

Members

<static> x :Number

x value of the vector
Type:
  • Number
Source:
observable_vector3.js, line 26

<static> y :Number

y value of the vector
Type:
  • Number
Source:
observable_vector3.js, line 53

<static> z :Number

z value of the vector
Type:
  • Number
Source:
observable_vector3.js, line 80

Methods

<static> abs() → {me.ObservableVector3d}

Update this vector values to absolute values
Source:
observable_vector3.js, line 234
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 170
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> ceil() → {me.ObservableVector3d}

Ceil the vector values
Source:
observable_vector3.js, line 345
Returns:
new me.ObservableVector3d
Type
me.ObservableVector3d

<static> ceilSelf() → {me.ObservableVector3d}

Ceil this vector values
Source:
observable_vector3.js, line 361
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

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

Clamp the vector value within the specified value range
Parameters:
Name Type Description
low Number
high Number
Source:
observable_vector3.js, line 249
Returns:
new me.ObservableVector3d
Type
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
Source:
observable_vector3.js, line 267
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> clone() → {me.ObservableVector3d}

return a clone copy of this vector
Source:
observable_vector3.js, line 509
Returns:
new me.ObservableVector3d
Type
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
Source:
observable_vector3.js, line 399
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 496
Returns:
Type
Number

<static> div(value) → {me.ObservableVector3d}

Divide this vector values by the passed value
Parameters:
Name Type Description
value Number
Source:
observable_vector3.js, line 222
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 468
Returns:
The dot product.
Type
Number

<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
Source:
observable_vector3.js, line 411
Returns:
Type
Boolean

<static> floor() → {me.ObservableVector3d}

Floor the vector values
Source:
observable_vector3.js, line 318
Returns:
new me.ObservableVector3d
Type
me.ObservableVector3d

<static> floorSelf() → {me.ObservableVector3d}

Floor this vector values
Source:
observable_vector3.js, line 334
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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).
Source:
observable_vector3.js, line 480
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 301
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 284
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> negate() → {me.ObservableVector3d}

Negate the vector values
Source:
observable_vector3.js, line 372
Returns:
new me.ObservableVector3d
Type
me.ObservableVector3d

<static> negateSelf() → {me.ObservableVector3d}

Negate this vector values
Source:
observable_vector3.js, line 388
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> normalize() → {me.ObservableVector3d}

normalize this vector (scale the vector so that its magnitude is 1)
Source:
observable_vector3.js, line 423
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> perp() → {me.ObservableVector3d}

change this vector to be perpendicular to what it was before.
(Effectively rotates it 90 degrees in a clockwise direction)
Source:
observable_vector3.js, line 438
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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)
Source:
observable_vector3.js, line 450
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> scale(x, y, z) → {me.ObservableVector3d}

Multiply this vector values by the given scalar
Parameters:
Name Type Argument Default Description
x Number
y Number <optional>
x
z Number <optional>
x
Source:
observable_vector3.js, line 194
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 210
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> setCallback(onUpdate) → {me.ObservableVector3d}

set the callback to be executed when the vector is changed
Parameters:
Name Type Description
onUpdate function callback
Source:
observable_vector3.js, line 152
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 135
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<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
Source:
observable_vector3.js, line 182
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

<static> toString() → {String}

convert the object to a string representation
Source:
observable_vector3.js, line 537
Returns:
Type
String

<static> toVector3d() → {me.Vector3d}

return a `me.Vector3d` copy of this `me.ObservableVector3d` object
Source:
observable_vector3.js, line 526
Returns:
new me.Vector3d
Type
me.Vector3d