Atlantis.Vector3 Class
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:
-
The
Number | Atlantis.Vector3X value or a Vector3 object * @param {Number} The Y value.
-
The
NumberZ value.
Item Index
Methods
- add static
- add
- Backward
- cross static
- distance static
- distanceSquared
- divide
- divide static
- dot static
- Down
- Forward
- Left
- length
- lerp
- lerp static
- max static
- min static
- multiply
- multiply
- negate static
- negate
- normalize static
- normalize
- One
- Right
- set
- subtract static
- subtract
- toString
- tranform static
- transformCoordinate static
- UnitX
- UnitY
- UnitZ
- Up
- Zero
Methods
add
-
vec1
-
vec2
Add two vectors.
Parameters:
-
vec1
Atlantis.Vector3 -
vec2
Atlantis.Vector3
Returns:
Return a new Vector3
add
-
vector
Add a Vector3 to the current vector.
Parameters:
-
vector
Number | Atlantis.Vector3The Vector3 to add.
Backward
()
Gets a Vector3 with Z coordinate set to one.
cross
-
vec1
-
vec2
Calculates the cross products of two vectors.
Parameters:
-
vec1
Atlantis.Vector3Fist vector to use.
-
vec2
Atlantis.Vector3Second vector to use.
Returns:
the cross products of the two vectors.
distance
-
vector
Gets the distance between two vectors.
Parameters:
-
vector
Atlantis.Vector3
Returns:
Return the distance between two vectors.
distanceSquared
-
vec1
-
vec2
Gets the distance squared between to vectors.
Parameters:
-
vec1
Atlantis.Vector3 -
vec2
Atlantis.Vector3
Returns:
divide
-
vector
divide a Vector3 to the current vector.
Parameters:
-
vector
Atlantis.Vector3The Vector3 to divide.
divide
-
vec1
-
vec2
Divide two vectors.
Parameters:
-
vec1
Atlantis.Vector3 -
vec2
Atlantis.Vector3
Returns:
Return a new Vector3.
dot
-
vec1
-
vec2
Calculates the dot product of two vectors.
Parameters:
-
vec1
Atlantis.Vector3First vector to use.
-
vec2
Atlantis.Vector3Second vector to use.
Returns:
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.
lerp
-
vector
-
amount
Linear interpolation between this vector and the vector passed in parameter.
Parameters:
-
vector
Atlantis.Vector3A vector to use for interpolation
-
amount
NumberValue between 0 and 1 indicating the weight of vector.
lerp
-
vec1
-
vec2
-
amount
Linearly interpolates between two vectors.
Parameters:
-
vec1
Atlantis.Vector3First vector
-
vec2
Atlantis.Vector3Second vector
-
amount
ObjectValue between 0 and 1 indicating the weight of vec2.
Returns:
Return a interpolated Vector3.
max
-
vec1
-
vec2
Gets a vector of the maximum of the two vectors.
Parameters:
-
vec1
Atlantis.Vector3 -
vec2
Atlantis.Vector3
Returns:
Return a vector that correspond of the maximum of the two vectors.
min
-
vec1
-
vec2
Gets a vector of the minimum of the two vectors.
Parameters:
-
vec1
Atlantis.Vector3 -
vec2
Atlantis.Vector3
Returns:
Return a vector that correspond of the minimum of the two vectors.
multiply
-
A
-
Another
Multiply a two vectors.
Parameters:
-
A
Atlantis.Vector3vector.
-
Another
Atlantis.Vector3vector.
Returns:
Return a new vector.
multiply
-
vector
multiply a Vector3 to the current vector.
Parameters:
-
vector
Number | Atlantis.Vector3The Vector3 to multiply.
negate
-
vector
Negate a vector.
Parameters:
-
vector
Atlantis.Vector3The vector to negate.
Returns:
Return a negated vector.
negate
()
Negate the vector.
normalize
()
static
Normalize vector.
normalize
-
vector
Normalize a vector.
Parameters:
-
vector
Atlantis.Vector3A vector to normalize.
Returns:
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.
subtract
-
vec1
-
vec2
Subtract two vectors.
Parameters:
-
vec1
Atlantis.Vector3 -
vec2
Atlantis.Vector3
Returns:
Return a news Vector3.
subtract
-
vector
Subtract a Vector3 to the current vector.
Parameters:
-
vector
Number | Atlantis.Vector3The Vector3 to Subtract.
tranform
-
position
-
matrix
Gets a transformed Vector3 from a position and a matrix.
Parameters:
-
position
Atlantis.Vector3 -
matrix
Atlantis.Matrix
Returns:
A tranformed vector.
transformCoordinate
-
position
-
matrix
Gets an homogeneous transformed vector from a position and a matrix.
Parameters:
-
position
Atlantis.Vector3 -
matrix
Atlantis.Matrix
Returns:
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.