Class Vector3
Hierarchy
- Vector3
Index
Constructors
Accessors
Methods
- add
- add
InPlace - add
InPlace From Floats - add
ToRef - as
Array - clone
- copy
From - copy
From Floats - cross
- divide
- divide
InPlace - divide
ToRef - equals
- equals
ToFloats - equals
With Epsilon - floor
- fract
- from
Array - get
Class Name - get
Hash Code - is
Non Uniform Within Epsilon - length
- length
Squared - maximize
InPlace - maximize
InPlace From Floats - minimize
InPlace - minimize
InPlace From Floats - multiply
- multiply
ByFloats - multiply
InPlace - multiply
ToRef - negate
- negate
InPlace - negate
ToRef - normalize
- normalize
From Length - normalize
ToNew - normalize
ToRef - project
OnPlane - project
OnPlane ToRef - reorder
InPlace - rotate
ByQuaternion Around Point ToRef - rotate
ByQuaternion ToRef - scale
- scale
And Add ToRef - scale
InPlace - scale
ToRef - set
- set
All - subtract
- subtract
From Floats - subtract
From Floats ToRef - subtract
InPlace - subtract
ToRef - to
Array - to
Quaternion - to
String - Backward
- Catmull
Rom - Center
- Center
ToRef - Check
Extends - Clamp
- Clamp
ToRef - Cross
- Cross
ToRef - Distance
- Distance
Squared - Dot
- Down
- Forward
- From
Array - From
Array ToRef - From
Float Array - From
Float Array ToRef - From
Floats ToRef - Get
Angle Between Vectors - Get
Clip Factor - Hermite
- Left
- Lerp
- Lerp
ToRef - Maximize
- Minimize
- Normalize
- Normalize
ToRef - One
- Project
- Project
ToRef - Right
- Rotation
From Axis - Rotation
From Axis ToRef - Transform
Coordinates - Transform
Coordinates From Floats ToRef - Transform
Coordinates ToRef - Transform
Normal - Transform
Normal From Floats ToRef - Transform
Normal ToRef - Unproject
- Unproject
Floats ToRef - Unproject
From Transform - Unproject
ToRef - Up
- Zero
Constructors
constructor
-
Creates a new Vector3 object from the given x, y, z (floats) coordinates.
Parameters
-
Optional x: number
defines the first coordinates (on X axis)
-
Optional y: number
defines the second coordinates (on Y axis)
-
Optional z: number
defines the third coordinates (on Z axis)
Returns Vector3
-
Accessors
is Non Uniform
-
Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same
Returns boolean
x
-
Gets or sets the x coordinate
Returns number
-
Gets or sets the x coordinate
Parameters
-
value: number
Returns any
-
y
-
Gets or sets the y coordinate
Returns number
-
Gets or sets the y coordinate
Parameters
-
value: number
Returns any
-
z
-
Gets or sets the z coordinate
Returns number
-
Gets or sets the z coordinate
Parameters
-
value: number
Returns any
-
Static Up Read Only
-
Gets a up Vector3 that must not be updated
Returns DeepImmutable<Vector3>
Static Zero Read Only
-
Gets a zero Vector3 that must not be updated
Returns DeepImmutable<Vector3>
Methods
addSearch playground for add
-
Gets a new Vector3, result of the addition the current Vector3 and the given vector
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the resulting Vector3
-
add InPlaceSearch playground for addInPlace
-
Adds the given vector to the current Vector3
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the current updated Vector3
-
add InPlace From FloatsSearch playground for addInPlaceFromFloats
-
Adds the given coordinates to the current Vector3
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns Vector3
the current updated Vector3
-
add ToRefSearch playground for addToRef
-
Adds the current Vector3 to the given one and stores the result in the vector "result"
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
-
result: Vector3
defines the Vector3 object where to store the result
Returns Vector3
the current Vector3
-
as ArraySearch playground for asArray
-
Creates an array containing three elements : the coordinates of the Vector3
Returns number[]
a new array of numbers
cloneSearch playground for clone
-
Creates a new Vector3 copied from the current Vector3
Returns Vector3
the new Vector3
copy FromSearch playground for copyFrom
-
Copies the given vector coordinates to the current Vector3 ones
Parameters
-
source: DeepImmutable<Vector3>
defines the source Vector3
Returns Vector3
the current updated Vector3
-
copy From FloatsSearch playground for copyFromFloats
-
Copies the given floats to the current Vector3 coordinates
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns Vector3
the current updated Vector3
-
crossSearch playground for cross
divideSearch playground for divide
-
Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the new Vector3
-
divide InPlaceSearch playground for divideInPlace
divide ToRefSearch playground for divideToRef
-
Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
-
result: Vector3
defines the Vector3 object where to store the result
Returns Vector3
the current Vector3
-
equalsSearch playground for equals
-
Returns true if the current Vector3 and the given vector coordinates are strictly equal
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns boolean
true if both vectors are equals
-
equals ToFloatsSearch playground for equalsToFloats
-
Returns true if the current Vector3 coordinates equals the given floats
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns boolean
true if both vectors are equals
-
equals With EpsilonSearch playground for equalsWithEpsilon
-
Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
-
Optional epsilon: number
defines the minimal distance to define values as equals
Returns boolean
true if both vectors are distant less than epsilon
-
floorSearch playground for floor
-
Gets a new Vector3 from current Vector3 floored values
Returns Vector3
a new Vector3
fractSearch playground for fract
-
Gets a new Vector3 from current Vector3 floored values
Returns Vector3
a new Vector3
from ArraySearch playground for fromArray
-
Update the current vector from an array
Parameters
-
array: FloatArray
defines the destination array
-
Optional index: number
defines the offset in the destination array
Returns Vector3
the current Vector3
-
get Class NameSearch playground for getClassName
-
Gets the class name
Returns string
the string "Vector3"
get Hash CodeSearch playground for getHashCode
-
Creates the Vector3 hash code
Returns number
a number which tends to be unique between Vector3 instances
is Non Uniform Within EpsilonSearch playground for isNonUniformWithinEpsilon
-
Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction Check if is non uniform within a certain amount of decimal places to account for this
Parameters
-
epsilon: number
the amount the values can differ
Returns boolean
if the the vector is non uniform to a certain number of decimal places
-
lengthSearch playground for length
-
Gets the length of the Vector3
Returns number
the length of the Vector3
length SquaredSearch playground for lengthSquared
-
Gets the squared length of the Vector3
Returns number
squared length of the Vector3
maximize InPlaceSearch playground for maximizeInPlace
-
Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.
Parameters
-
other: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the current updated Vector3
-
maximize InPlace From FloatsSearch playground for maximizeInPlaceFromFloats
-
Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns Vector3
the current updated Vector3
-
minimize InPlaceSearch playground for minimizeInPlace
-
Updates the current Vector3 with the minimal coordinate values between its and the given vector ones
Parameters
-
other: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the current updated Vector3
-
minimize InPlace From FloatsSearch playground for minimizeInPlaceFromFloats
-
Updates the current Vector3 with the minimal coordinate values between its and the given coordinates
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns Vector3
the current updated Vector3
-
multiplySearch playground for multiply
-
Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the new Vector3
-
multiply ByFloatsSearch playground for multiplyByFloats
-
Returns a new Vector3 set with the result of the mulliplication of the current Vector3 coordinates by the given floats
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns Vector3
the new Vector3
-
multiply InPlaceSearch playground for multiplyInPlace
-
Multiplies the current Vector3 coordinates by the given ones
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the current updated Vector3
-
multiply ToRefSearch playground for multiplyToRef
-
Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
-
result: Vector3
defines the Vector3 object where to store the result
Returns Vector3
the current Vector3
-
negateSearch playground for negate
-
Gets a new Vector3 set with the current Vector3 negated coordinates
Returns Vector3
a new Vector3
negate InPlaceSearch playground for negateInPlace
-
Negate this vector in place
Returns Vector3
this
negate ToRefSearch playground for negateToRef
normalizeSearch playground for normalize
-
Normalize the current Vector3. Please note that this is an in place operation.
Returns Vector3
the current updated Vector3
normalize From LengthSearch playground for normalizeFromLength
-
Normalize the current Vector3 with the given input length. Please note that this is an in place operation.
Parameters
-
len: number
the length of the vector
Returns Vector3
the current updated Vector3
-
normalize ToNewSearch playground for normalizeToNew
-
Normalize the current Vector3 to a new vector
Returns Vector3
the new Vector3
normalize ToRefSearch playground for normalizeToRef
project OnPlaneSearch playground for projectOnPlane
project OnPlane ToRefSearch playground for projectOnPlaneToRef
-
Projects the current vector3 to a plane along a ray starting from a specified origin and directed towards the point.
Parameters
-
plane: Plane
defines the plane to project to
-
origin: Vector3
defines the origin of the projection ray
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
reorder InPlaceSearch playground for reorderInPlace
-
Reorders the x y z properties of the vector in place
Parameters
-
order: string
new ordering of the properties (eg. for vector 1,2,3 with "ZYX" will produce 3,2,1)
Returns this
the current updated vector
-
rotate ByQuaternion Around Point ToRefSearch playground for rotateByQuaternionAroundPointToRef
-
Rotates a vector around a given point
Parameters
-
quaternion: Quaternion
the rotation quaternion
-
point: Vector3
the point to rotate around
-
result: Vector3
vector to store the result
Returns Vector3
the resulting vector
-
rotate ByQuaternion ToRefSearch playground for rotateByQuaternionToRef
-
Rotates the vector around 0,0,0 by a quaternion
Parameters
-
quaternion: Quaternion
the rotation quaternion
-
result: Vector3
vector to store the result
Returns Vector3
the resulting vector
-
scaleSearch playground for scale
-
Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale"
Parameters
-
scale: number
defines the multiplier factor
Returns Vector3
a new Vector3
-
scale And Add ToRefSearch playground for scaleAndAddToRef
scale InPlaceSearch playground for scaleInPlace
-
Multiplies the Vector3 coordinates by the float "scale"
Parameters
-
scale: number
defines the multiplier factor
Returns Vector3
the current updated Vector3
-
scale ToRefSearch playground for scaleToRef
setSearch playground for set
-
Copies the given floats to the current Vector3 coordinates
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns Vector3
the current updated Vector3
-
set AllSearch playground for setAll
-
Copies the given float to the current Vector3 coordinates
Parameters
-
v: number
defines the x, y and z coordinates of the operand
Returns Vector3
the current updated Vector3
-
subtractSearch playground for subtract
-
Returns a new Vector3, result of the subtraction of the given vector from the current Vector3
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the resulting Vector3
-
subtract From FloatsSearch playground for subtractFromFloats
-
Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
Returns Vector3
the resulting Vector3
-
subtract From Floats ToRefSearch playground for subtractFromFloatsToRef
-
Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result
Parameters
-
x: number
defines the x coordinate of the operand
-
y: number
defines the y coordinate of the operand
-
z: number
defines the z coordinate of the operand
-
result: Vector3
defines the Vector3 object where to store the result
Returns Vector3
the current Vector3
-
subtract InPlaceSearch playground for subtractInPlace
-
Subtract the given vector from the current Vector3
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the current updated Vector3
-
subtract ToRefSearch playground for subtractToRef
-
Subtracts the given vector from the current Vector3 and stores the result in the vector "result".
Parameters
-
otherVector: DeepImmutable<Vector3>
defines the second operand
-
result: Vector3
defines the Vector3 object where to store the result
Returns Vector3
the current Vector3
-
to ArraySearch playground for toArray
-
Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3
Parameters
-
array: FloatArray
defines the destination array
-
Optional index: number
defines the offset in the destination array
Returns Vector3
the current Vector3
-
to QuaternionSearch playground for toQuaternion
-
Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)
Returns Quaternion
a new Quaternion object, computed from the Vector3 coordinates
to StringSearch playground for toString
-
Creates a string representation of the Vector3
Returns string
a string with the Vector3 coordinates.
Static BackwardSearch playground for Backward
-
Returns a new Vector3 set to (0.0, 0.0, -1.0)
Parameters
-
Optional rightHandedSystem: boolean
is the scene right-handed (negative-z)
Returns Vector3
a new forward Vector3
-
Static Catmull RomSearch playground for CatmullRom
-
Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
Parameters
-
value1: DeepImmutable<Vector3>
defines the first control point
-
value2: DeepImmutable<Vector3>
defines the second control point
-
value3: DeepImmutable<Vector3>
defines the third control point
-
value4: DeepImmutable<Vector3>
defines the fourth control point
-
amount: number
defines the amount on the spline to use
Returns Vector3
the new Vector3
-
Static CenterSearch playground for Center
-
Returns a new Vector3 located at the center between "value1" and "value2"
Parameters
-
value1: DeepImmutable<Vector3>
defines the first operand
-
value2: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the new Vector3
-
Static Center ToRefSearch playground for CenterToRef
-
Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
Parameters
-
value1: DeepImmutable<Vector3>
defines first vector
-
value2: DeepImmutable<Vector3>
defines second vector
-
ref: DeepImmutable<Vector3>
defines third vector
Returns Vector3
ref
-
Static Check ExtendsSearch playground for CheckExtends
Static ClampSearch playground for Clamp
-
Returns a new Vector3 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max" If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
Parameters
-
value: DeepImmutable<Vector3>
defines the current value
-
min: DeepImmutable<Vector3>
defines the lower range value
-
max: DeepImmutable<Vector3>
defines the upper range value
Returns Vector3
the new Vector3
-
Static Clamp ToRefSearch playground for ClampToRef
-
Sets the given vector "result" with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max" If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
Parameters
-
value: DeepImmutable<Vector3>
defines the current value
-
min: DeepImmutable<Vector3>
defines the lower range value
-
max: DeepImmutable<Vector3>
defines the upper range value
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static CrossSearch playground for Cross
-
Returns a new Vector3 as the cross product of the vectors "left" and "right" The cross product is then orthogonal to both "left" and "right"
Parameters
-
left: DeepImmutable<Vector3>
defines the left operand
-
right: DeepImmutable<Vector3>
defines the right operand
Returns Vector3
the cross product
-
Static Cross ToRefSearch playground for CrossToRef
-
Sets the given vector "result" with the cross product of "left" and "right" The cross product is then orthogonal to both "left" and "right"
Parameters
-
left: DeepImmutable<Vector3>
defines the left operand
-
right: DeepImmutable<Vector3>
defines the right operand
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static DistanceSearch playground for Distance
-
Returns the distance between the vectors "value1" and "value2"
Parameters
-
value1: DeepImmutable<Vector3>
defines the first operand
-
value2: DeepImmutable<Vector3>
defines the second operand
Returns number
the distance
-
Static Distance SquaredSearch playground for DistanceSquared
-
Returns the squared distance between the vectors "value1" and "value2"
Parameters
-
value1: DeepImmutable<Vector3>
defines the first operand
-
value2: DeepImmutable<Vector3>
defines the second operand
Returns number
the squared distance
-
Static DotSearch playground for Dot
-
Returns the dot product (float) between the vectors "left" and "right"
Parameters
-
left: DeepImmutable<Vector3>
defines the left operand
-
right: DeepImmutable<Vector3>
defines the right operand
Returns number
the dot product
-
Static DownSearch playground for Down
-
Returns a new Vector3 set to (0.0, -1.0, 0.0)
Returns Vector3
a new down Vector3
Static ForwardSearch playground for Forward
-
Returns a new Vector3 set to (0.0, 0.0, 1.0)
Parameters
-
Optional rightHandedSystem: boolean
is the scene right-handed (negative z)
Returns Vector3
a new forward Vector3
-
Static From ArraySearch playground for FromArray
-
Returns a new Vector3 set from the index "offset" of the given array
Parameters
-
array: DeepImmutable<ArrayLike<number>>
defines the source array
-
Optional offset: number
defines the offset in the source array
Returns Vector3
the new Vector3
-
Static From Array ToRefSearch playground for FromArrayToRef
-
Sets the given vector "result" with the element values from the index "offset" of the given array
Parameters
-
array: DeepImmutable<ArrayLike<number>>
defines the source array
-
offset: number
defines the offset in the source array
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static From Float ArraySearch playground for FromFloatArray
-
Returns a new Vector3 set from the index "offset" of the given Float32Array
Parameters
-
array: DeepImmutable<Float32Array>
defines the source array
-
Optional offset: number
defines the offset in the source array
Returns Vector3
the new Vector3
-
Static From Float Array ToRefSearch playground for FromFloatArrayToRef
-
Sets the given vector "result" with the element values from the index "offset" of the given Float32Array
Parameters
-
array: DeepImmutable<Float32Array>
defines the source array
-
offset: number
defines the offset in the source array
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static From Floats ToRefSearch playground for FromFloatsToRef
-
Sets the given vector "result" with the given floats.
Parameters
-
x: number
defines the x coordinate of the source
-
y: number
defines the y coordinate of the source
-
z: number
defines the z coordinate of the source
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static Get Angle Between VectorsSearch playground for GetAngleBetweenVectors
-
Get angle between two vectors
Parameters
-
vector0: DeepImmutable<Vector3>
angle between vector0 and vector1
-
vector1: DeepImmutable<Vector3>
angle between vector0 and vector1
-
normal: DeepImmutable<Vector3>
direction of the normal
Returns number
the angle between vector0 and vector1
-
Static Get Clip FactorSearch playground for GetClipFactor
-
Get the clip factor between two vectors
Parameters
-
vector0: DeepImmutable<Vector3>
defines the first operand
-
vector1: DeepImmutable<Vector3>
defines the second operand
-
axis: DeepImmutable<Vector3>
defines the axis to use
-
size: number
defines the size along the axis
Returns number
the clip factor
-
Static HermiteSearch playground for Hermite
-
Returns a new Vector3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
Parameters
-
value1: DeepImmutable<Vector3>
defines the first control point
-
tangent1: DeepImmutable<Vector3>
defines the first tangent vector
-
value2: DeepImmutable<Vector3>
defines the second control point
-
tangent2: DeepImmutable<Vector3>
defines the second tangent vector
-
amount: number
defines the amount on the interpolation spline (between 0 and 1)
Returns Vector3
the new Vector3
-
Static LeftSearch playground for Left
-
Returns a new Vector3 set to (-1.0, 0.0, 0.0)
Returns Vector3
a new left Vector3
Static LerpSearch playground for Lerp
-
Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
Parameters
-
start: DeepImmutable<Vector3>
defines the start value
-
end: DeepImmutable<Vector3>
defines the end value
-
amount: number
max defines amount between both (between 0 and 1)
Returns Vector3
the new Vector3
-
Static Lerp ToRefSearch playground for LerpToRef
-
Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
Parameters
-
start: DeepImmutable<Vector3>
defines the start value
-
end: DeepImmutable<Vector3>
defines the end value
-
amount: number
max defines amount between both (between 0 and 1)
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static MaximizeSearch playground for Maximize
-
Gets the maximal coordinate values between two Vector3
Parameters
-
left: DeepImmutable<Vector3>
defines the first operand
-
right: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the new Vector3
-
Static MinimizeSearch playground for Minimize
-
Gets the minimal coordinate values between two Vector3
Parameters
-
left: DeepImmutable<Vector3>
defines the first operand
-
right: DeepImmutable<Vector3>
defines the second operand
Returns Vector3
the new Vector3
-
Static NormalizeSearch playground for Normalize
-
Returns a new Vector3 as the normalization of the given vector
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to normalize
Returns Vector3
the new Vector3
-
Static Normalize ToRefSearch playground for NormalizeToRef
-
Sets the given vector "result" with the normalization of the given first vector
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to normalize
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static OneSearch playground for One
-
Returns a new Vector3 set to (1.0, 1.0, 1.0)
Returns Vector3
a new unit Vector3
Static ProjectSearch playground for Project
-
Project a Vector3 onto screen space
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to project
-
world: DeepImmutable<Matrix>
defines the world matrix to use
-
transform: DeepImmutable<Matrix>
defines the transform (view x projection) matrix to use
-
viewport: DeepImmutable<Viewport>
defines the screen viewport to use
Returns Vector3
the new Vector3
-
Static Project ToRefSearch playground for ProjectToRef
-
Project a Vector3 onto screen space to reference
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to project
-
world: DeepImmutable<Matrix>
defines the world matrix to use
-
transform: DeepImmutable<Matrix>
defines the transform (view x projection) matrix to use
-
viewport: DeepImmutable<Viewport>
defines the screen viewport to use
-
result: DeepImmutable<Vector3>
the vector in which the screen space will be stored
Returns Vector3
the new Vector3
-
Static RightSearch playground for Right
-
Returns a new Vector3 set to (1.0, 0.0, 0.0)
Returns Vector3
a new right Vector3
Static Rotation From AxisSearch playground for RotationFromAxis
-
Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system), RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply to something in order to rotate it from its local system to the given target system Note: axis1, axis2 and axis3 are normalized during this operation
Parameters
-
axis1: DeepImmutable<Vector3>
defines the first axis
-
axis2: DeepImmutable<Vector3>
defines the second axis
-
axis3: DeepImmutable<Vector3>
defines the third axis
Returns Vector3
a new Vector3
-
Static Rotation From Axis ToRefSearch playground for RotationFromAxisToRef
-
The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
Parameters
-
axis1: DeepImmutable<Vector3>
defines the first axis
-
axis2: DeepImmutable<Vector3>
defines the second axis
-
axis3: DeepImmutable<Vector3>
defines the third axis
-
ref: Vector3
defines the Vector3 where to store the result
Returns void
-
Static Transform CoordinatesSearch playground for TransformCoordinates
-
Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector. This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to transform
-
transformation: DeepImmutable<Matrix>
defines the transformation matrix
Returns Vector3
the transformed Vector3
-
Static Transform Coordinates From Floats ToRefSearch playground for TransformCoordinatesFromFloatsToRef
-
Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z) This method computes tranformed coordinates only, not transformed direction vectors
Parameters
-
x: number
define the x coordinate of the source vector
-
y: number
define the y coordinate of the source vector
-
z: number
define the z coordinate of the source vector
-
transformation: DeepImmutable<Matrix>
defines the transformation matrix
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static Transform Coordinates ToRefSearch playground for TransformCoordinatesToRef
-
Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to transform
-
transformation: DeepImmutable<Matrix>
defines the transformation matrix
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static Transform NormalSearch playground for TransformNormal
-
Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to transform
-
transformation: DeepImmutable<Matrix>
defines the transformation matrix
Returns Vector3
the new Vector3
-
Static Transform Normal From Floats ToRefSearch playground for TransformNormalFromFloatsToRef
-
Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z) This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
Parameters
-
x: number
define the x coordinate of the source vector
-
y: number
define the y coordinate of the source vector
-
z: number
define the z coordinate of the source vector
-
transformation: DeepImmutable<Matrix>
defines the transformation matrix
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static Transform Normal ToRefSearch playground for TransformNormalToRef
-
Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
Parameters
-
vector: DeepImmutable<Vector3>
defines the Vector3 to transform
-
transformation: DeepImmutable<Matrix>
defines the transformation matrix
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static UnprojectSearch playground for Unproject
-
Unproject from screen space to object space
Parameters
-
source: DeepImmutable<Vector3>
defines the screen space Vector3 to use
-
viewportWidth: number
defines the current width of the viewport
-
viewportHeight: number
defines the current height of the viewport
-
world: DeepImmutable<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
-
view: DeepImmutable<Matrix>
defines the view matrix to use
-
projection: DeepImmutable<Matrix>
defines the projection matrix to use
Returns Vector3
the new Vector3
-
Static Unproject Floats ToRefSearch playground for UnprojectFloatsToRef
-
Unproject from screen space to object space
Parameters
-
sourceX: float
defines the screen space x coordinate to use
-
sourceY: float
defines the screen space y coordinate to use
-
sourceZ: float
defines the screen space z coordinate to use
-
viewportWidth: number
defines the current width of the viewport
-
viewportHeight: number
defines the current height of the viewport
-
world: DeepImmutable<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
-
view: DeepImmutable<Matrix>
defines the view matrix to use
-
projection: DeepImmutable<Matrix>
defines the projection matrix to use
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static Unproject From TransformSearch playground for UnprojectFromTransform
-
Unproject from screen space to object space
Parameters
-
source: Vector3
defines the screen space Vector3 to use
-
viewportWidth: number
defines the current width of the viewport
-
viewportHeight: number
defines the current height of the viewport
-
world: DeepImmutable<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
-
transform: DeepImmutable<Matrix>
defines the transform (view x projection) matrix to use
Returns Vector3
the new Vector3
-
Static Unproject ToRefSearch playground for UnprojectToRef
-
Unproject from screen space to object space
Parameters
-
source: DeepImmutable<Vector3>
defines the screen space Vector3 to use
-
viewportWidth: number
defines the current width of the viewport
-
viewportHeight: number
defines the current height of the viewport
-
world: DeepImmutable<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
-
view: DeepImmutable<Matrix>
defines the view matrix to use
-
projection: DeepImmutable<Matrix>
defines the projection matrix to use
-
result: Vector3
defines the Vector3 where to store the result
Returns void
-
Static UpSearch playground for Up
-
Returns a new Vector3 set to (0.0, 1.0, 0.0)
Returns Vector3
a new up Vector3
Static ZeroSearch playground for Zero
-
Returns a new Vector3 set to (0.0, 0.0, 0.0)
Returns Vector3
a new empty Vector3
Class used to store (x,y,z) vector representation A Vector3 is the main object used in 3D geometry It can represent etiher the coordinates of a point the space, either a direction Reminder: js uses a left handed forward facing system