API Documentation

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

add

(
  • v
)

Parameters:

Returns:

Vector3

addScalar

()

Adds a s to this vector.

Returns:

Vector3

addScaledVector

(
  • v
  • s
)

Parameters:

Returns:

Vector3

addVectors

(
  • a
  • b
)

Parameters:

Returns:

Vector3

angleTo

(
  • v
)

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

Parameters:

Returns:

Float

applyAxisAngle

(
  • axis
  • angle
)

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

Parameters:

Returns:

Vector3

applyEuler

(
  • euler
)

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

Parameters:

Returns:

Vector3

applyMatrix3

(
  • m
)

Multiplies this vector times a 3 x 3 matrix.

Parameters:

Returns:

Vector3

applyMatrix4

(
  • m
)

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

Parameters:

Returns:

Vector3

applyProjection

(
  • m
)

Multiplies this vector and m, and divides by perspective.

Parameters:

Returns:

Vector3

applyQuaternion

(
  • quaternion
)

Applies a Quaternion transform to this vector.

Parameters:

Returns:

Vector3

ceil

()

Returns:

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.

Parameters:

Returns:

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

Returns:

Vector3

clone

()

Returns:

Vector3

copy

(
  • v
)

Parameters:

Returns:

Vector3

cross

(
  • v
)

Parameters:

Returns:

Vector3

crossVectors

(
  • a
  • b
)

Parameters:

Returns:

Vector3

distanceTo

(
  • v
)

Parameters:

Returns:

Float

distanceToSquared

(
  • v
)

Parameters:

Returns:

Float

divide

(
  • v
)

Divides this vector by vector v.

Parameters:

Returns:

Vector3

divideScalar

(
  • s
)

Parameters:

  • s Float

Returns:

Vector3

dot

(
  • v
)

Parameters:

Returns:

Float

equals

(
  • v
)

Parameters:

Returns:

Boolean

floor

()

Returns:

Vector3

fromArray

(
  • array
)

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

Parameters:

  • array Array

Returns:

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

Returns:

Float

length

()

Returns:

Float

lengthManhattan

()

Returns:

Float

lengthSq

()

Returns:

Float

lerp

(
  • v
  • alpha
)

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

Parameters:

Returns:

Vector3

lerpVectors

(
  • v1
  • v2
  • alpha
)

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

Parameters:

Returns:

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.

Parameters:

Returns:

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.

Parameters:

Returns:

Vector3

multiply

(
  • v
)

Multipies this vector by vector v.

Parameters:

Returns:

Vector3

multiplyScalar

(
  • s
)

Parameters:

  • s Float

Returns:

Vector3

multiplyVectors

(
  • a
  • b
)

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

Parameters:

Returns:

Vector3

negate

()

Returns:

Vector3

normalize

()

Returns:

Vector3

project

(
  • camera
)

Projects the vector with the camera.

Parameters:

Returns:

Vector3

projectOnPlane

(
  • planeNormal
)

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

Parameters:

Returns:

Vector3

projectOnVector

()

Projects this vector onto another vector.

Returns:

Vector3

reflect

(
  • normal
)

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

Parameters:

Returns:

Vector3

round

()

Returns:

Vector3

roundToZero

()

Returns:

Vector3

set

(
  • x
  • y
  • z
)

Parameters:

  • x Float
  • y Float
  • z Float

Returns:

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

Returns:

Vector3

setFromMatrixColumn

(
  • index
  • matrix
)

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

Parameters:

Returns:

Vector3

setFromMatrixPosition

(
  • m
)

Parameters:

Returns:

Vector3

setFromMatrixScale

(
  • m
)

Parameters:

Returns:

Vector3

setLength

(
  • l
)

Parameters:

  • l Float

Returns:

Vector3

setX

(
  • x
)

Parameters:

  • x Float

Returns:

Vector3

setY

(
  • y
)

Parameters:

  • y Float

Returns:

Vector3

setZ

(
  • z
)

Parameters:

  • z Float

Returns:

Vector3

sub

(
  • v
)

Parameters:

Returns:

Vector3

subVectors

(
  • a
  • b
)

Parameters:

Returns:

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

Returns:

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.

Parameters:

Returns:

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)