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 49

<static> z :Number

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

Methods

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

Update this vector values to absolute values
Source:
observable_vector3.js, line 215
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 151
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

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

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

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

Ceil this vector values
Source:
observable_vector3.js, line 342
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 230
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 248
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 474
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 380
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 461
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 203
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 449
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 392
Returns:
Type
Boolean

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

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

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

Floor this vector values
Source:
observable_vector3.js, line 315
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 282
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 265
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

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

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

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

Negate this vector values
Source:
observable_vector3.js, line 369
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 404
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 419
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 431
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 175
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 191
Returns:
Reference to this object for method chaining
Type
me.ObservableVector3d

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

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

<static> setMuted(x, y, z) → {me.ObservableVector2d}

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 116
Returns:
Reference to this object for method chaining
Type
me.ObservableVector2d

<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 163
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 502
Returns:
Type
String

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

return a `me.Vector3d` copy of this `me.ObservableVector3d` object
Source:
observable_vector3.js, line 491
Returns:
new me.Vector3d
Type
me.Vector3d
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.