for 0.0.1
Show:

# Vector3 Class

Represents a 3 dimensionnal Euclidean Vector, to be used as positions, directions or Euler angles (rotation).

This class extends the one from Three.js, API available here : http://threejs.org/docs/#Reference/Math/Vector3

## Methods

(
• `v`
)

Vector3

### `addScalar`

()

Adds a s to this vector.

Vector3

### `addScaledVector`

(
• `v`
• `s`
)

#### Parameters:

• `v` Vector3
• `s` Float

Vector3

(
• `a`
• `b`
)

Vector3

### `angleTo`

(
• `v`
)

Returns the angle between this vector and vector v in radians.

Float

### `applyAxisAngle`

(
• `axis`
• `angle`
)

Applies a rotation specified by an axis and an angle to this vector.

#### Parameters:

• `axis` Vector3
• `angle` Float

Vector3

### `applyEuler`

(
• `euler`
)

Applies euler transform to this vector by converting the Euler obect to a [page:Quaternion] and applying.

#### Parameters:

• `euler` Euler

Vector3

### `applyMatrix3`

(
• `m`
)

Multiplies this vector times a 3 x 3 matrix.

Vector3

### `applyMatrix4`

(
• `m`
)

Multiplies this vector by 4 x 3 subset of a Matrix4.

Vector3

### `applyProjection`

(
• `m`
)

Multiplies this vector and m, and divides by perspective.

Vector3

### `applyQuaternion`

(
• `quaternion`
)

Applies a Quaternion transform to this vector.

Vector3

()

Vector3

### `clamp`

(
• `min`
• `max`
)

If this vector's x, y or z value is greater than the max vector's x, y or z value, it is replaced by the corresponding value. If this vector's x, y or z value is less than the min vector's x, y or z value, it is replaced by the corresponding value.

Vector3

### `clampScalar`

(
• `min`
• `max`
)

If this vector's x, y or z values are greater than the max value, they are replaced by the max value. If this vector's x, y or z values are less than the min value, they are replaced by the min value.

#### Parameters:

• `min` Float
• `max` Float

Vector3

()

Vector3

(
• `v`
)

Vector3

(
• `v`
)

Vector3

(
• `a`
• `b`
)

Vector3

(
• `v`
)

Float

(
• `v`
)

Float

### `divide`

(
• `v`
)

Divides this vector by vector v.

Vector3

### `divideScalar`

(
• `s`
)

#### Parameters:

• `s` Float

Vector3

(
• `v`
)

Float

(
• `v`
)

Boolean

()

Vector3

### `fromArray`

(
• `array`
)

Sets the vector's components based on an array formatted like [x, y, z

#### Parameters:

• `array` Array

Vector3

### `getComponent`

(
• `index`
)

Returns the value of the vector component x, y, or z by an index. Index 0: x Index 1: y Index 2: z

#### Parameters:

• `index` Integer

Float

()

Float

()

Float

()

Float

### `lerp`

(
• `v`
• `alpha`
)

Linear Interpolation between this vector and vector v, where alpha is the percent along the line.

#### Parameters:

• `v` Vector3
• `alpha` Float

Vector3

### `lerpVectors`

(
• `v1`
• `v2`
• `alpha`
)

Sets this vector to be the vector linearly interpolated between v1 and v2 with alpha factor.

#### Parameters:

• `v1` Vector3
• `v2` Vector3
• `alpha` Float

Vector3

### `max`

(
• `v`
)

If this vector's x, y, or z value is less than vector v's x, y, or z value, that value is replaced by the corresponding vector v value.

Vector3

### `min`

(
• `v`
)

If this vector's x, y, or z value is greater than vector v's x, y, or z value, that value is replaced by the corresponding vector v value.

Vector3

### `multiply`

(
• `v`
)

Multipies this vector by vector v.

Vector3

### `multiplyScalar`

(
• `s`
)

#### Parameters:

• `s` Float

Vector3

### `multiplyVectors`

(
• `a`
• `b`
)

Sets this vector equal to the result of multiplying vector a by vector b.

Vector3

()

Vector3

()

Vector3

### `project`

(
• `camera`
)

Projects the vector with the camera.

Vector3

### `projectOnPlane`

(
• `planeNormal`
)

Projects this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector.

#### Parameters:

• `planeNormal` Vector3

Vector3

### `projectOnVector`

()

Projects this vector onto another vector.

Vector3

### `reflect`

(
• `normal`
)

Reflect incident vector off of plane orthogonal to normal. normal is assumed to have unit length.

Vector3

()

Vector3

()

Vector3

### `set`

(
• `x`
• `y`
• `z`
)

#### Parameters:

• `x` Float
• `y` Float
• `z` Float

Vector3

### `setComponent`

(
• `index`
• `value`
)

If index equals 0 the method sets this vector's x value to value If index equals 1 the method sets this vector's y value to value If index equals 2 the method sets this vector's z value to value

#### Parameters:

• `index` Integer
• `value` Float

Vector3

### `setFromMatrixColumn`

(
• `index`
• `matrix`
)

Sets this vector's x, y, and z equal to the column of the matrix specified by the index.

#### Parameters:

• `index` Integer
• `matrix` Matrix4

Vector3

(
• `m`
)

Vector3

(
• `m`
)

Vector3

### `setLength`

(
• `l`
)

#### Parameters:

• `l` Float

Vector3

### `setX`

(
• `x`
)

#### Parameters:

• `x` Float

Vector3

### `setY`

(
• `y`
)

#### Parameters:

• `y` Float

Vector3

### `setZ`

(
• `z`
)

#### Parameters:

• `z` Float

Vector3

(
• `v`
)

Vector3

(
• `a`
• `b`
)

Vector3

### `toArray`

(
• `array`
)

Assigns this vector's x value to array[0. Assigns this vector's y value to array[1]. Assigns this vector's z value to array[2]. Returns the created array.

#### Parameters:

• `array` Array

Array

### `transformDirection`

(
• `m`
)

Transforms the direction of this vector by a matrix (a 3 x 3 subset of a Matrix4) and then normalizes the result.

Vector3

## Properties

### `one`

Unknown static

Vector3.one returns new Mobilizing.Vector2(1, 1, 1)

### `zero`

Unknown static

Vector3.one returns new Mobilizing.Vector2(0, 0, 0)