API Docs for: 0.0.2
Show:

Atlantis.Vector2 Class

Module: Framework
Parent Module: Atlantis

Create a new Vector2

Constructor

Atlantis.Vector2

()

Item Index

Methods

add

(
  • value
)

Add this vector by another vector or value.

Parameters:

add

(
  • A
  • Another
)
static

Add two vectors.

Parameters:

distance

(
  • A
  • Another
)
static

Gets the distance between two vectors.

Parameters:

divide

(
  • value
)

Divide this vector by another vector

Parameters:

divide

(
  • A
  • Another
)
static

Divide two vectors.

Parameters:

dot

(
  • First
  • Second
)
Number static

Calculate the dot product of two vectors.

Parameters:

Returns:

Number:

Return the dot product of the two vectors.

getDistance

(
  • vector2
)
Number

Gets distance between this vector and the vector passed in parameter.

Parameters:

Returns:

Number:

The distance between this vector and the vector passed in parameter.

getDistance

(
  • vector2
)
Number

Gets distance between this vector and the vector passed in parameter.

Parameters:

Returns:

Number:

The distance between this vector and the vector passed in parameter.

lerp

(
  • First
  • Second
  • amount
)
static

Performs a linear interpolation between to vectors.

Parameters:

Returns:

max

(
  • vec1
  • vec2
)
static

Gets a vector of the maximum of the two vectors.

Parameters:

Returns:

Return a vector that correspond of the maximum of the two vectors.

min

(
  • vec1
  • vec2
)
static

Gets a vector of the minimum of the two vectors.

Parameters:

Returns:

Return a vector that correspond of the minimum of the two vectors.

multiply

(
  • value
)

Multiply this vector by another vector or a value.

Parameters:

multiply

(
  • A
  • Another
)
static

Multiply two vectors.

Parameters:

negate

()

Negate this vector

negate

(
  • A
)
Atlantis.Vector2 static

Negate a vector.

Parameters:

Returns:

Atlantis.Vector2:

Return the negated vector.

normalize

(
  • A
)
static

Parameters:

normalize

()

Normalize this vector.

One

()

Gets a Vector3 with all coordinates sets to one.

set

(
  • X
  • Y
)

Sets the coordinates.

Parameters:

subtract

(
  • A
  • Another
)
static

Subtract two vectors.

Parameters:

subtract

(
  • value
)

Substract this vector by another vector or value.

Parameters:

toString

() String

Gets a string from this object.

Returns:

transform

(
  • position
  • matrix
)
Atlantis.Matrix

Gets a transformed Vector3 from a position and a matrix.

Parameters:

Returns:

Atlantis.Matrix:

A tranformed vector.

transformCoordinate

(
  • position
  • matrix
)
Atlantis.Vector4

Gets a transformed Vector3 from a position and a matrix.

Parameters:

Returns:

Atlantis.Vector4:

A tranformed vector.

UnitX

()

Gets a Vector3 with X coordinate set to one.

UnitY

()

Gets a Vector3 with Y coordinate set to one.

Zero

()

Gets a Vector3 with all coordinates sets to zero.