API Docs for: 0.0.2
Show:

Atlantis.Vector3 Class

Module: Framework
Parent Module: Atlantis

Create a vector with three coordinates. If you pass a Vector3 in first parameter, its filed are copied to the new vector (work like a copy constructor).

Constructor

Atlantis.Vector3

(
  • The
  • The
)

Parameters:

Methods

add

(
  • vec1
  • vec2
)
Atlantis.Vector3 static

Add two vectors.

Parameters:

Returns:

Atlantis.Vector3:

Return a new Vector3

add

(
  • vector
)

Add a Vector3 to the current vector.

Parameters:

Backward

()

Gets a Vector3 with Z coordinate set to one.

cross

(
  • vec1
  • vec2
)
Atlantis.Vector3 static

Calculates the cross products of two vectors.

Parameters:

Returns:

Atlantis.Vector3:

the cross products of the two vectors.

distance

(
  • vector
)
Number static

Gets the distance between two vectors.

Parameters:

Returns:

Number:

Return the distance between two vectors.

distanceSquared

(
  • vec1
  • vec2
)
Number

Gets the distance squared between to vectors.

Parameters:

Returns:

divide

(
  • vector
)

divide a Vector3 to the current vector.

Parameters:

divide

(
  • vec1
  • vec2
)
Atlantis.Vector3 static

Divide two vectors.

Parameters:

Returns:

Atlantis.Vector3:

Return a new Vector3.

dot

(
  • vec1
  • vec2
)
Number static

Calculates the dot product of two vectors.

Parameters:

Returns:

Number:

Return the dot product of two vectors.

Down

()

Gets a Vector3 with Y coordinate set to -1.

Forward

()

Gets a Vector3 with Z coordinate set to -1.

Left

()

Gets a Vector3 with X coordinate set to -1.

length

() Number

Gets the length of the vector.

Returns:

Number:

Return the length of the vector.

lerp

(
  • vector
  • amount
)

Linear interpolation between this vector and the vector passed in parameter.

Parameters:

  • vector Atlantis.Vector3

    A vector to use for interpolation

  • amount Number

    Value between 0 and 1 indicating the weight of vector.

lerp

(
  • vec1
  • vec2
  • amount
)
Atlantis.Vector3 static

Linearly interpolates between two vectors.

Parameters:

Returns:

Atlantis.Vector3:

Return a interpolated Vector3.

max

(
  • vec1
  • vec2
)
Atlantis.Vector3 static

Gets a vector of the maximum of the two vectors.

Parameters:

Returns:

Atlantis.Vector3:

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

min

(
  • vec1
  • vec2
)
Atlantis.Vector3 static

Gets a vector of the minimum of the two vectors.

Parameters:

Returns:

Atlantis.Vector3:

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

multiply

(
  • A
  • Another
)
Atlantis.Vector3

Multiply a two vectors.

Parameters:

Returns:

Atlantis.Vector3:

Return a new vector.

multiply

(
  • vector
)

multiply a Vector3 to the current vector.

Parameters:

negate

(
  • vector
)
Atlantis.Vector3 static

Negate a vector.

Parameters:

Returns:

Atlantis.Vector3:

Return a negated vector.

negate

()

Negate the vector.

normalize

() static

Normalize vector.

normalize

(
  • vector
)
Atlantis.Vector3

Normalize a vector.

Parameters:

Returns:

Atlantis.Vector3:

result A normalized vector.

One

()

Gets a Vector3 with all coordinates sets to one.

Right

()

Gets a Vector3 with X coordinate set to one.

set

(
  • x
  • y
  • z
)

Changes the 3 coordinates.

Parameters:

  • x Object

    The new X coordinate.

  • y Object

    The new Y coordinate.

  • z Object

    The new Z coordinate.

subtract

(
  • vec1
  • vec2
)
Atlantis.Vector3 static

Subtract two vectors.

Parameters:

Returns:

Atlantis.Vector3:

Return a news Vector3.

subtract

(
  • vector
)

Subtract a Vector3 to the current vector.

Parameters:

toString

() String

Gets a string from this object.

Returns:

tranform

(
  • position
  • matrix
)
Atlantis.Vector3 static

Gets a transformed Vector3 from a position and a matrix.

Parameters:

Returns:

Atlantis.Vector3:

A tranformed vector.

transformCoordinate

(
  • position
  • matrix
)
Atlantis.Vector4 static

Gets an homogeneous transformed vector 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.

UnitZ

()

Gets a Vector3 with Z coordinate set to one.

Up

()

Gets a Vector3 with Y coordinate set to one.

Zero

()

Gets a Vector3 with all coordinates sets to zero.