Class Vector3WithInfo
Hierarchy
- Vector3
- Vector3WithInfo
Index
Constructors
Properties
Accessors
Methods
- add
- add
In Place - add
In Place From Floats - add
To Ref - apply
Rotation Quaternion - apply
Rotation Quaternion In Place - apply
Rotation Quaternion To Ref - as
Array - clone
- copy
From - copy
From Floats - cross
- divide
- divide
In Place - divide
To Ref - dot
- equals
- equals
To Floats - equals
With Epsilon - floor
- fract
- from
Array - get
Class Name - get
Hash Code - get
Normal To Ref - is
Non Uniform Within Epsilon - length
- length
Squared - maximize
In Place - maximize
In Place From Floats - minimize
In Place - minimize
In Place From Floats - multiply
- multiply
By Floats - multiply
In Place - multiply
To Ref - negate
- negate
In Place - negate
To Ref - normalize
- normalize
From Length - normalize
To New - normalize
To Ref - project
On Plane - project
On Plane To Ref - reorder
In Place - rotate
By Quaternion Around Point To Ref - rotate
By Quaternion To Ref - scale
- scale
And Add To Ref - scale
In Place - scale
To Ref - set
- set
All - subtract
- subtract
From Floats - subtract
From Floats To Ref - subtract
In Place - subtract
To Ref - to
Array - to
Quaternion - to
String - Backward
- Catmull
Rom - Center
- Center
To Ref - Check
Extends - Clamp
- Clamp
To Ref - Cross
- Cross
To Ref - Distance
- Distance
Squared - Dot
- Down
- Forward
- From
Array - From
Array To Ref - From
Float Array - From
Float Array To Ref - From
Floats To Ref - Get
Angle Between Vectors - Get
Angle Between Vectors On Plane - Get
Clip Factor - Hermite
- Hermite1st
Derivative - Hermite1st
Derivative To Ref - Left
- Lerp
- Lerp
To Ref - Maximize
- Minimize
- Normalize
- Normalize
To Ref - One
- Pitch
Yaw Roll To Move Between Points - Pitch
Yaw Roll To Move Between Points To Ref - Project
- Project
On Triangle To Ref - Project
To Ref - Random
- Reflect
- Reflect
To Ref - Right
- Rotation
From Axis - Rotation
From Axis To Ref - Slerp
To Ref - Smooth
To Ref - Transform
Coordinates - Transform
Coordinates From Floats To Ref - Transform
Coordinates To Ref - Transform
Normal - Transform
Normal From Floats To Ref - Transform
Normal To Ref - Unproject
- Unproject
Floats To Ref - Unproject
From Transform - Unproject
To Ref - Up
- Zero
Constructors
constructor
Creates a new Vector3WithInfo
Parameters
source: Vector3
defines the vector3 data to transport
Optional buttonIndex: number
defines the current mouse button index
Returns Vector3WithInfo
Properties
button IndexSearch playground for buttonIndex
defines the current mouse button index
Accessors
hasAZero Component
Gets a boolean indicating if the vector contains a zero in one of its components Example Playground https://playground.babylonjs.com/#R1F8YU#1
Returns boolean
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 void
y
Gets or sets the y coordinate
Returns number
Gets or sets the y coordinate
Parameters
value: number
Returns void
z
Gets or sets the z coordinate
Returns number
Gets or sets the z coordinate
Parameters
value: number
Returns void
Static Down Read Only
Gets a down Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Left Handed Backward Read Only
Gets a backward Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Left Handed Forward Read Only
Gets a forward Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Left Read Only
Gets a left Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static One Read Only
Gets a one Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Right Handed Backward Read Only
Gets a backward Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Right Handed Forward Read Only
Gets a forward Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Right Read Only
Gets a right Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Up Read Only
Gets an up Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Static Zero Read Only
Gets a zero Vector3 that must not be updated
Returns DeepImmutableObject<Vector3>
Methods
addSearch playground for add
Gets a new Vector3, result of the addition the current Vector3 and the given vector Example Playground https://playground.babylonjs.com/#R1F8YU#3
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the resulting Vector3
add In PlaceSearch playground for addInPlace
Adds the given vector to the current Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#4
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the current updated Vector3
add In Place From FloatsSearch playground for addInPlaceFromFloats
Adds the given coordinates to the current Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#5
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 Vector3WithInfo
the current updated Vector3
add To RefSearch playground for addToRef
Adds the current Vector3 to the given one and stores the result in the vector "result" Example Playground https://playground.babylonjs.com/#R1F8YU#6
Type Parameters
T extends Vector3<T>
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
result: T
defines the Vector3 object where to store the result
Returns T
the result
apply Rotation QuaternionSearch playground for applyRotationQuaternion
Rotates the vector using the given unit quaternion and returns the new vector Example Playground https://playground.babylonjs.com/#R1F8YU#7
Parameters
q: Quaternion
the unit quaternion representing the rotation
Returns Vector3WithInfo
a new Vector3
apply Rotation Quaternion In PlaceSearch playground for applyRotationQuaternionInPlace
Rotates the vector in place using the given unit quaternion Example Playground https://playground.babylonjs.com/#R1F8YU#8
Parameters
q: Quaternion
the unit quaternion representing the rotation
Returns Vector3WithInfo
the current updated Vector3
apply Rotation Quaternion To RefSearch playground for applyRotationQuaternionToRef
Rotates the vector using the given unit quaternion and stores the new vector in result Example Playground https://playground.babylonjs.com/#R1F8YU#9
Type Parameters
T extends Vector3<T>
Parameters
q: Quaternion
the unit quaternion representing the rotation
result: T
the output vector
Returns T
the result
as ArraySearch playground for asArray
Creates an array containing three elements : the coordinates of the Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#10
Returns number[]
a new array of numbers
cloneSearch playground for clone
Creates a new Vector3 copied from the current Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#11
Returns Vector3WithInfo
the new Vector3
copy FromSearch playground for copyFrom
Copies the given vector coordinates to the current Vector3 ones Example Playground https://playground.babylonjs.com/#R1F8YU#12
Parameters
source: DeepImmutableObject<Vector3>
defines the source Vector3
Returns Vector3WithInfo
the current updated Vector3
copy From FloatsSearch playground for copyFromFloats
Copies the given floats to the current Vector3 coordinates Example Playground https://playground.babylonjs.com/#R1F8YU#13
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 Vector3WithInfo
the current updated Vector3
crossSearch playground for cross
Returns a new Vector3 as the cross product of the current vector and the "other" one The cross product is then orthogonal to both current and "other" Example Playground https://playground.babylonjs.com/#R1F8YU#14
Parameters
other: Vector3
defines the right operand
Returns Vector3WithInfo
the cross product
divideSearch playground for divide
Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones Example Playground https://playground.babylonjs.com/#R1F8YU#16
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the new Vector3
divide In PlaceSearch playground for divideInPlace
Divides the current Vector3 coordinates by the given ones. Example Playground https://playground.babylonjs.com/#R1F8YU#17
Parameters
otherVector: Vector3
defines the second operand
Returns Vector3WithInfo
the current updated Vector3
divide To RefSearch playground for divideToRef
Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result" Example Playground https://playground.babylonjs.com/#R1F8YU#18
Type Parameters
T extends Vector3<T>
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
result: T
defines the Vector3 object where to store the result
Returns T
the result
dotSearch playground for dot
Returns the dot product (float) between the current vectors and "otherVector"
Parameters
otherVector: DeepImmutableObject<Vector3WithInfo>
defines the right operand
Returns number
the dot product
equalsSearch playground for equals
Returns true if the current Vector3 and the given vector coordinates are strictly equal Example Playground https://playground.babylonjs.com/#R1F8YU#19
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns boolean
true if both vectors are equals
equals To FloatsSearch playground for equalsToFloats
Returns true if the current Vector3 coordinates equals the given floats Example Playground https://playground.babylonjs.com/#R1F8YU#20
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 equal
equals With EpsilonSearch playground for equalsWithEpsilon
Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon Example Playground https://playground.babylonjs.com/#R1F8YU#21
Parameters
otherVector: DeepImmutableObject<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 Example Playground https://playground.babylonjs.com/#R1F8YU#22
Returns Vector3WithInfo
a new Vector3
fractSearch playground for fract
Gets a new Vector3 from current Vector3 fractional values Example Playground https://playground.babylonjs.com/#R1F8YU#23
Returns Vector3WithInfo
a new Vector3
from ArraySearch playground for fromArray
Update the current vector from an array Example Playground https://playground.babylonjs.com/#R1F8YU#24
Parameters
array: FloatArray
defines the destination array
Optional index: number
defines the offset in the destination array
Returns Vector3WithInfo
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
get Normal To RefSearch playground for getNormalToRef
Creates a vector normal (perpendicular) to the current Vector3 and stores the result in the given vector Out of the infinite possibilities the normal chosen is the one formed by rotating the current vector 90 degrees about an axis which lies perpendicular to the current vector and its projection on the xz plane. In the case of a current vector in the xz plane the normal is calculated to be along the y axis. Example Playground https://playground.babylonjs.com/#R1F8YU#230 Example Playground https://playground.babylonjs.com/#R1F8YU#231
Parameters
result: DeepImmutableObject<Vector3>
defines the Vector3 object where to store the resultant normal returns the result
Returns Vector3
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 vector is non uniform to a certain number of decimal places
lengthSearch playground for length
Gets the length of the Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#25
Returns number
the length of the Vector3
length SquaredSearch playground for lengthSquared
Gets the squared length of the Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#26
Returns number
squared length of the Vector3
maximize In PlaceSearch playground for maximizeInPlace
Updates the current Vector3 with the maximal coordinate values between its and the given vector ones. Example Playground https://playground.babylonjs.com/#R1F8YU#27
Parameters
other: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the current updated Vector3
maximize In Place From FloatsSearch playground for maximizeInPlaceFromFloats
Updates the current Vector3 with the maximal coordinate values between its and the given coordinates. Example Playground https://playground.babylonjs.com/#R1F8YU#28
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 Vector3WithInfo
the current updated Vector3
minimize In PlaceSearch playground for minimizeInPlace
Updates the current Vector3 with the minimal coordinate values between its and the given vector ones Example Playground https://playground.babylonjs.com/#R1F8YU#29
Parameters
other: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the current updated Vector3
minimize In Place From FloatsSearch playground for minimizeInPlaceFromFloats
Updates the current Vector3 with the minimal coordinate values between its and the given coordinates Example Playground https://playground.babylonjs.com/#R1F8YU#30
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 Vector3WithInfo
the current updated Vector3
multiplySearch playground for multiply
Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector Example Playground https://playground.babylonjs.com/#R1F8YU#31
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the new Vector3
multiply By FloatsSearch playground for multiplyByFloats
Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats Example Playground https://playground.babylonjs.com/#R1F8YU#34
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 Vector3WithInfo
the new Vector3
multiply In PlaceSearch playground for multiplyInPlace
Multiplies the current Vector3 coordinates by the given ones Example Playground https://playground.babylonjs.com/#R1F8YU#32
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the current updated Vector3
multiply To RefSearch playground for multiplyToRef
Multiplies the current Vector3 by the given one and stores the result in the given vector "result" Example Playground https://playground.babylonjs.com/#R1F8YU#33
Type Parameters
T extends Vector3<T>
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
result: T
defines the Vector3 object where to store the result
Returns T
the result
negateSearch playground for negate
Gets a new Vector3 set with the current Vector3 negated coordinates Example Playground https://playground.babylonjs.com/#R1F8YU#35
Returns Vector3WithInfo
a new Vector3
negate In PlaceSearch playground for negateInPlace
Negate this vector in place Example Playground https://playground.babylonjs.com/#R1F8YU#36
Returns Vector3WithInfo
this
negate To RefSearch playground for negateToRef
Negate the current Vector3 and stores the result in the given vector "result" coordinates Example Playground https://playground.babylonjs.com/#R1F8YU#37
Type Parameters
Parameters
result: T
defines the Vector3 object where to store the result
Returns T
the result
normalizeSearch playground for normalize
Normalize the current Vector3. Please note that this is an in place operation. Example Playground https://playground.babylonjs.com/#R1F8YU#122
Returns Vector3WithInfo
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. Example Playground https://playground.babylonjs.com/#R1F8YU#123
Parameters
len: number
the length of the vector
Returns Vector3WithInfo
the current updated Vector3
normalize To NewSearch playground for normalizeToNew
Normalize the current Vector3 to a new vector Example Playground https://playground.babylonjs.com/#R1F8YU#124
Returns Vector3WithInfo
the new Vector3
normalize To RefSearch playground for normalizeToRef
Normalize the current Vector3 to the reference Example Playground https://playground.babylonjs.com/#R1F8YU#125
Type Parameters
T extends Vector3<T>
Parameters
reference: T
define the Vector3 to update
Returns T
the updated Vector3
project On PlaneSearch playground for projectOnPlane
Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3. Example Playground https://playground.babylonjs.com/#R1F8YU#48
Type Parameters
T extends Vector3<T>
Parameters
plane: Plane
defines the plane to project to
origin: Vector3
defines the origin of the projection ray
Returns T
the projected vector3
project On Plane To RefSearch playground for projectOnPlaneToRef
Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3. Example Playground https://playground.babylonjs.com/#R1F8YU#49
Type Parameters
T extends Vector3<T>
Parameters
plane: Plane
defines the plane to project to
origin: Vector3
defines the origin of the projection ray
result: T
defines the Vector3 where to store the result
Returns T
result input
reorder In PlaceSearch playground for reorderInPlace
Reorders the x y z properties of the vector in place Example Playground https://playground.babylonjs.com/#R1F8YU#44
Parameters
order: string
new ordering of the properties (eg. for vector 1,2,3 with "ZYX" will produce 3,2,1)
Returns Vector3WithInfo
the current updated vector
rotate By Quaternion Around Point To RefSearch playground for rotateByQuaternionAroundPointToRef
Rotates a vector around a given point Example Playground https://playground.babylonjs.com/#R1F8YU#46
Type Parameters
T extends Vector3<T>
Parameters
quaternion: Quaternion
the rotation quaternion
point: Vector3
the point to rotate around
result: T
vector to store the result
Returns T
the resulting vector
rotate By Quaternion To RefSearch playground for rotateByQuaternionToRef
Rotates the vector around 0,0,0 by a quaternion Example Playground https://playground.babylonjs.com/#R1F8YU#47
Type Parameters
T extends Vector3<T>
Parameters
quaternion: Quaternion
the rotation quaternion
result: T
vector to store the result
Returns T
the resulting vector
scaleSearch playground for scale
Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale" Example Playground https://playground.babylonjs.com/#R1F8YU#53
Parameters
scale: number
defines the multiplier factor
Returns Vector3WithInfo
a new Vector3
scale And Add To RefSearch playground for scaleAndAddToRef
Scale the current Vector3 values by a factor and add the result to a given Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#55
Type Parameters
T extends Vector3<T>
Parameters
scale: number
defines the scale factor
result: T
defines the Vector3 object where to store the result
Returns T
result input
scale In PlaceSearch playground for scaleInPlace
Multiplies the Vector3 coordinates by the float "scale" Example Playground https://playground.babylonjs.com/#R1F8YU#56
Parameters
scale: number
defines the multiplier factor
Returns Vector3WithInfo
the current updated Vector3
scale To RefSearch playground for scaleToRef
Multiplies the current Vector3 coordinates by the float "scale" and stores the result in the given vector "result" coordinates Example Playground https://playground.babylonjs.com/#R1F8YU#57
Type Parameters
T extends Vector3<T>
Parameters
scale: number
defines the multiplier factor
result: T
defines the Vector3 object where to store the result
Returns T
the result
setSearch playground for set
Copies the given floats to the current Vector3 coordinates Example Playground https://playground.babylonjs.com/#R1F8YU#58
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 Vector3WithInfo
the current updated Vector3
set AllSearch playground for setAll
Copies the given float to the current Vector3 coordinates Example Playground https://playground.babylonjs.com/#R1F8YU#59
Parameters
v: number
defines the x, y and z coordinates of the operand
Returns Vector3WithInfo
the current updated Vector3
subtractSearch playground for subtract
Returns a new Vector3, result of the subtraction of the given vector from the current Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#60
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
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 Example Playground https://playground.babylonjs.com/#R1F8YU#62
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 Vector3WithInfo
the resulting Vector3
subtract From Floats To RefSearch playground for subtractFromFloatsToRef
Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result Example Playground https://playground.babylonjs.com/#R1F8YU#64
Type Parameters
T extends Vector3<T>
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: T
defines the Vector3 object where to store the result
Returns T
the result
subtract In PlaceSearch playground for subtractInPlace
Subtract the given vector from the current Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#61
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3WithInfo
the current updated Vector3
subtract To RefSearch playground for subtractToRef
Subtracts the given vector from the current Vector3 and stores the result in the vector "result". Example Playground https://playground.babylonjs.com/#R1F8YU#63
Type Parameters
T extends Vector3<T>
Parameters
otherVector: DeepImmutableObject<Vector3>
defines the second operand
result: T
defines the Vector3 object where to store the result
Returns T
the result
to ArraySearch playground for toArray
Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#65
Parameters
array: FloatArray
defines the destination array
Optional index: number
defines the offset in the destination array
Returns Vector3WithInfo
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) Example Playground https://playground.babylonjs.com/#R1F8YU#66
Returns Quaternion
a new Quaternion object, computed from the Vector3 coordinates
to StringSearch playground for toString
Creates a string representation of the Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#67
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) Example Playground https://playground.babylonjs.com/#R1F8YU#71
Parameters
Optional rightHandedSystem: boolean
is the scene right-handed (negative-z)
Returns Vector3
a new Backward 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" Example Playground https://playground.babylonjs.com/#R1F8YU#69
Type Parameters
T extends Vector3<T>
Parameters
value1: DeepImmutable<T>
defines the first control point
value2: DeepImmutableObject<Vector3>
defines the second control point
value3: DeepImmutableObject<Vector3>
defines the third control point
value4: DeepImmutableObject<Vector3>
defines the fourth control point
amount: number
defines the amount on the spline to use
Returns T
the new Vector3
Static CenterSearch playground for Center
Returns a new Vector3 located at the center between "value1" and "value2" Example Playground https://playground.babylonjs.com/#R1F8YU#72
Parameters
value1: DeepImmutableObject<Vector3>
defines the first operand
value2: DeepImmutableObject<Vector3>
defines the second operand
Returns Vector3
the new Vector3
Static Center To RefSearch playground for CenterToRef
Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref" Example Playground https://playground.babylonjs.com/#R1F8YU#73
Type Parameters
T extends Vector3<T>
Parameters
value1: DeepImmutableObject<Vector3>
defines first vector
value2: DeepImmutableObject<Vector3>
defines second vector
ref: T
defines third vector
Returns T
ref
Static Check ExtendsSearch playground for CheckExtends
Checks if a given vector is inside a specific range Example Playground https://playground.babylonjs.com/#R1F8YU#75
Parameters
v: Vector3
defines the vector to test
min: Vector3
defines the minimum range
max: Vector3
defines the maximum range
Returns void
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 Example Playground https://playground.babylonjs.com/#R1F8YU#76
Type Parameters
T extends Vector3<T>
Parameters
value: DeepImmutable<T>
defines the current value
min: DeepImmutableObject<Vector3>
defines the lower range value
max: DeepImmutableObject<Vector3>
defines the upper range value
Returns T
the new Vector3
Static Clamp To RefSearch 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 Example Playground https://playground.babylonjs.com/#R1F8YU#77
Type Parameters
T extends Vector3<T>
Parameters
value: DeepImmutableObject<Vector3>
defines the current value
min: DeepImmutableObject<Vector3>
defines the lower range value
max: DeepImmutableObject<Vector3>
defines the upper range value
result: T
defines the Vector3 where to store the result
Returns T
result input
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" Example Playground https://playground.babylonjs.com/#R1F8YU#15
Type Parameters
T extends Vector3<T>
Parameters
left: DeepImmutable<T>
defines the left operand
right: DeepImmutableObject<Vector3>
defines the right operand
Returns T
the cross product
Static Cross To RefSearch 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" Example Playground https://playground.babylonjs.com/#R1F8YU#78
Type Parameters
T extends Vector3<T>
Parameters
left: DeepImmutableObject<Vector3>
defines the left operand
right: DeepImmutableObject<Vector3>
defines the right operand
result: T
defines the Vector3 where to store the result
Returns T
result input
Static DistanceSearch playground for Distance
Returns the distance between the vectors "value1" and "value2" Example Playground https://playground.babylonjs.com/#R1F8YU#81
Parameters
value1: DeepImmutableObject<Vector3>
defines the first operand
value2: DeepImmutableObject<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" Example Playground https://playground.babylonjs.com/#R1F8YU#80
Parameters
value1: DeepImmutableObject<Vector3>
defines the first operand
value2: DeepImmutableObject<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" Example Playground https://playground.babylonjs.com/#R1F8YU#82
Parameters
left: DeepImmutableObject<Vector3>
defines the left operand
right: DeepImmutableObject<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) Example Playground https://playground.babylonjs.com/#R1F8YU#71
Returns Vector3
a new down Vector3
Static ForwardSearch playground for Forward
Returns a new Vector3 set to (0.0, 0.0, 1.0) Example Playground https://playground.babylonjs.com/#R1F8YU#71
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 Example Playground https://playground.babylonjs.com/#R1F8YU#83
Parameters
array: DeepImmutableObject<ArrayLike<number>>
defines the source array
Optional offset: number
defines the offset in the source array
Returns Vector3
the new Vector3
Static From Array To RefSearch playground for FromArrayToRef
Sets the given vector "result" with the element values from the index "offset" of the given array Example Playground https://playground.babylonjs.com/#R1F8YU#84
Type Parameters
T extends Vector3<T>
Parameters
array: DeepImmutableObject<ArrayLike<number>>
defines the source array
offset: number
defines the offset in the source array
result: T
defines the Vector3 where to store the result
Returns T
result input
Static From Float ArraySearch playground for FromFloatArray
Returns a new Vector3 set from the index "offset" of the given Float32Array
Parameters
array: DeepImmutableObject<Float32Array>
defines the source array
Optional offset: number
defines the offset in the source array
Returns Vector3
the new Vector3
Static From Float Array To RefSearch playground for FromFloatArrayToRef
Sets the given vector "result" with the element values from the index "offset" of the given Float32Array
Type Parameters
T extends Vector3<T>
Parameters
array: DeepImmutableObject<Float32Array>
defines the source array
offset: number
defines the offset in the source array
result: T
defines the Vector3 where to store the result
Returns T
Static From Floats To RefSearch playground for FromFloatsToRef
Sets the given vector "result" with the given floats. Example Playground https://playground.babylonjs.com/#R1F8YU#85
Type Parameters
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: T
defines the Vector3 where to store the result
Returns T
Static Get Angle Between VectorsSearch playground for GetAngleBetweenVectors
Get angle between two vectors Example Playground https://playground.babylonjs.com/#R1F8YU#86
Parameters
vector0: DeepImmutableObject<Vector3>
the starting point
vector1: DeepImmutableObject<Vector3>
the ending point
normal: DeepImmutableObject<Vector3>
direction of the normal
Returns number
the angle between vector0 and vector1
Static Get Angle Between Vectors On PlaneSearch playground for GetAngleBetweenVectorsOnPlane
Get angle between two vectors projected on a plane Example Playground https://playground.babylonjs.com/#R1F8YU#87 Expectation compute time: 0.01 ms (median) and 0.02 ms (percentile 95%)
Parameters
vector0: Vector3
angle between vector0 and vector1
vector1: Vector3
angle between vector0 and vector1
normal: Vector3
Normal of the projection plane
Returns number
the angle in radians (float) between vector0 and vector1 projected on the plane with the specified normal
Static Get Clip FactorSearch playground for GetClipFactor
Get the clip factor between two vectors Example Playground https://playground.babylonjs.com/#R1F8YU#126
Parameters
vector0: DeepImmutableObject<Vector3>
defines the first operand
vector1: DeepImmutableObject<Vector3>
defines the second operand
axis: DeepImmutableObject<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" Example Playground https://playground.babylonjs.com/#R1F8YU#89
Type Parameters
T extends Vector3<T>
Parameters
value1: DeepImmutable<T>
defines the first control point
tangent1: DeepImmutableObject<Vector3>
defines the first tangent vector
value2: DeepImmutableObject<Vector3>
defines the second control point
tangent2: DeepImmutableObject<Vector3>
defines the second tangent vector
amount: number
defines the amount on the interpolation spline (between 0 and 1)
Returns T
the new Vector3
Static Hermite1st DerivativeSearch playground for Hermite1stDerivative
Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2". Example Playground https://playground.babylonjs.com/#R1F8YU#90
Type Parameters
T extends Vector3<T>
Parameters
value1: DeepImmutable<T>
defines the first control point
tangent1: DeepImmutableObject<Vector3>
defines the first tangent
value2: DeepImmutableObject<Vector3>
defines the second control point
tangent2: DeepImmutableObject<Vector3>
defines the second tangent
time: number
define where the derivative must be done
Returns T
1st derivative
Static Hermite1st Derivative To RefSearch playground for Hermite1stDerivativeToRef
Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2". Example Playground https://playground.babylonjs.com/#R1F8YU#91
Type Parameters
T extends Vector3<T>
Parameters
value1: DeepImmutableObject<Vector3>
defines the first control point
tangent1: DeepImmutableObject<Vector3>
defines the first tangent
value2: DeepImmutableObject<Vector3>
defines the second control point
tangent2: DeepImmutableObject<Vector3>
defines the second tangent
time: number
define where the derivative must be done
result: T
define where to store the derivative
Returns T
result input
Static LeftSearch playground for Left
Returns a new Vector3 set to (-1.0, 0.0, 0.0) Example Playground https://playground.babylonjs.com/#R1F8YU#71
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" Example Playground https://playground.babylonjs.com/#R1F8YU#95
Type Parameters
T extends Vector3<T>
Parameters
start: DeepImmutable<T>
defines the start value
end: DeepImmutableObject<Vector3>
defines the end value
amount: number
max defines amount between both (between 0 and 1)
Returns T
the new Vector3
Static Lerp To RefSearch 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" Example Playground https://playground.babylonjs.com/#R1F8YU#93
Type Parameters
T extends Vector3<T>
Parameters
start: DeepImmutableObject<Vector3>
defines the start value
end: DeepImmutableObject<Vector3>
defines the end value
amount: number
max defines amount between both (between 0 and 1)
result: T
defines the Vector3 where to store the result
Returns T
result input
Static MaximizeSearch playground for Maximize
Gets the maximal coordinate values between two Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#96
Type Parameters
T extends Vector3<T>
Parameters
left: DeepImmutable<T>
defines the first operand
right: DeepImmutableObject<Vector3>
defines the second operand
Returns T
the new Vector3
Static MinimizeSearch playground for Minimize
Gets the minimal coordinate values between two Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#97
Type Parameters
T extends Vector3<T>
Parameters
left: DeepImmutable<T>
defines the first operand
right: DeepImmutableObject<Vector3>
defines the second operand
Returns T
the new Vector3
Static NormalizeSearch playground for Normalize
Returns a new Vector3 as the normalization of the given vector Example Playground https://playground.babylonjs.com/#R1F8YU#98
Parameters
vector: DeepImmutableObject<Vector3>
defines the Vector3 to normalize
Returns Vector3
the new Vector3
Static Normalize To RefSearch playground for NormalizeToRef
Sets the given vector "result" with the normalization of the given first vector Example Playground https://playground.babylonjs.com/#R1F8YU#98
Type Parameters
T extends Vector3<T>
Parameters
vector: DeepImmutableObject<Vector3>
defines the Vector3 to normalize
result: T
defines the Vector3 where to store the result
Returns T
result input
Static OneSearch playground for One
Returns a new Vector3 set to (1.0, 1.0, 1.0)
Returns Vector3
a new Vector3
Static Pitch Yaw Roll To Move Between PointsSearch playground for PitchYawRollToMoveBetweenPoints
Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point Example PG https://playground.babylonjs.com/#R1F8YU#188
Parameters
Returns Vector3
the rotation in the form (pitch, yaw, 0)
Static Pitch Yaw Roll To Move Between Points To RefSearch playground for PitchYawRollToMoveBetweenPointsToRef
Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point and stores it in the ref Vector3 Example PG https://playground.babylonjs.com/#R1F8YU#189
Type Parameters
T extends Vector3<T>
Parameters
start: Vector3
the starting point
target: Vector3
the target point
ref: T
the vector3 to store the result
Returns T
ref in the form (pitch, yaw, 0)
Static ProjectSearch playground for Project
Project a Vector3 onto screen space Example Playground https://playground.babylonjs.com/#R1F8YU#101
Type Parameters
T extends Vector3<T>
Parameters
vector: DeepImmutable<T>
defines the Vector3 to project
world: DeepImmutableObject<Matrix>
defines the world matrix to use
transform: DeepImmutableObject<Matrix>
defines the transform (view x projection) matrix to use
viewport: DeepImmutableObject<Viewport>
defines the screen viewport to use
Returns T
the new Vector3
Static Project On Triangle To RefSearch playground for ProjectOnTriangleToRef
Projects "vector" on the triangle determined by its extremities "p0", "p1" and "p2", stores the result in "ref" and returns the distance to the projected point. Example Playground https://playground.babylonjs.com/#R1F8YU#104 From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf
Parameters
vector: DeepImmutableObject<Vector3>
the vector to get distance from
p0: DeepImmutableObject<Vector3>
extremity of the triangle
p1: DeepImmutableObject<Vector3>
extremity of the triangle
p2: DeepImmutableObject<Vector3>
extremity of the triangle
ref: Vector3
variable to store the result to
Returns number
The distance between "ref" and "vector"
Static Project To RefSearch playground for ProjectToRef
Project a Vector3 onto screen space to reference Example Playground https://playground.babylonjs.com/#R1F8YU#102
Type Parameters
T extends Vector3<T>
Parameters
vector: DeepImmutableObject<Vector3>
defines the Vector3 to project
world: DeepImmutableObject<Matrix>
defines the world matrix to use
transform: DeepImmutableObject<Matrix>
defines the transform (view x projection) matrix to use
viewport: DeepImmutableObject<Viewport>
defines the screen viewport to use
result: T
the vector in which the screen space will be stored
Returns T
result input
Static RandomSearch playground for Random
Returns a new Vector3 with random values between min and max
Parameters
Optional min: number
the minimum random value
Optional max: number
the maximum random value
Returns Vector3
a Vector3 with random values between min and max
Static ReflectSearch playground for Reflect
Reflects a vector off the plane defined by a normalized normal
Type Parameters
T extends Vector3<T>
Parameters
inDirection: DeepImmutableObject<Vector3>
defines the vector direction
normal: DeepImmutableObject<Vector3>
defines the normal - Must be normalized
Returns Vector3
the resulting vector
Static Reflect To RefSearch playground for ReflectToRef
Reflects a vector off the plane defined by a normalized normal to reference
Type Parameters
T extends Vector3<T>
Parameters
inDirection: DeepImmutableObject<Vector3>
defines the vector direction
normal: DeepImmutableObject<Vector3>
defines the normal - Must be normalized
ref: T
Returns T
the resulting vector
Static RightSearch playground for Right
Returns a new Vector3 set to (1.0, 0.0, 0.0) Example Playground https://playground.babylonjs.com/#R1F8YU#71
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 Example Playground https://playground.babylonjs.com/#R1F8YU#106
Type Parameters
T extends Vector3<T>
Parameters
axis1: DeepImmutable<T>
defines the first axis
axis2: DeepImmutableObject<Vector3>
defines the second axis
axis3: DeepImmutableObject<Vector3>
defines the third axis
Returns T
a new Vector3
Static Rotation From Axis To RefSearch playground for RotationFromAxisToRef
The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3 Example Playground https://playground.babylonjs.com/#R1F8YU#107
Type Parameters
T extends Vector3<T>
Parameters
axis1: DeepImmutableObject<Vector3>
defines the first axis
axis2: DeepImmutableObject<Vector3>
defines the second axis
axis3: DeepImmutableObject<Vector3>
defines the third axis
ref: T
defines the Vector3 where to store the result
Returns T
result input
Static Slerp To RefSearch playground for SlerpToRef
Slerp between two vectors. See also
SmoothToRef
Slerp is a spherical linear interpolation giving a slow in and out effect Example Playground 1 https://playground.babylonjs.com/#R1F8YU#108 Example Playground 2 https://playground.babylonjs.com/#R1F8YU#109Type Parameters
Parameters
vector0: Vector3
Start vector
vector1: Vector3
End vector
slerp: number
amount (will be clamped between 0 and 1)
result: T
The slerped vector
Returns T
Static Smooth To RefSearch playground for SmoothToRef
Smooth interpolation between two vectors using Slerp Example Playground https://playground.babylonjs.com/#R1F8YU#110
Type Parameters
Parameters
source: Vector3
source vector
goal: Vector3
goal vector
deltaTime: number
current interpolation frame
lerpTime: number
total interpolation time
result: T
the smoothed vector
Returns T
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 transformed coordinates only, not transformed direction vectors (ie. it takes translation in account) Example Playground https://playground.babylonjs.com/#R1F8YU#111
Type Parameters
T extends Vector3<T>
Parameters
vector: DeepImmutableObject<Vector3>
defines the Vector3 to transform
transformation: DeepImmutableObject<Matrix>
defines the transformation matrix
Returns Vector3
the transformed Vector3
Static Transform Coordinates From Floats To RefSearch 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 transformed coordinates only, not transformed direction vectors Example Playground https://playground.babylonjs.com/#R1F8YU#115
Type Parameters
T extends Vector3<T>
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: DeepImmutableObject<Matrix>
defines the transformation matrix
result: T
defines the Vector3 where to store the result
Returns T
result input
Static Transform Coordinates To RefSearch 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 transformed coordinates only, not transformed direction vectors (ie. it takes translation in account) Example Playground https://playground.babylonjs.com/#R1F8YU#113
Type Parameters
T extends Vector3<T>
Parameters
vector: DeepImmutableObject<Vector3>
defines the Vector3 to transform
transformation: DeepImmutableObject<Matrix>
defines the transformation matrix
result: T
defines the Vector3 where to store the result
Returns T
result input
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) Example Playground https://playground.babylonjs.com/#R1F8YU#112
Parameters
vector: DeepImmutableObject<Vector3>
defines the Vector3 to transform
transformation: DeepImmutableObject<Matrix>
defines the transformation matrix
Returns Vector3
the new Vector3
Static Transform Normal From Floats To RefSearch 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) Example Playground https://playground.babylonjs.com/#R1F8YU#116
Type Parameters
T extends Vector3<T>
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: DeepImmutableObject<Matrix>
defines the transformation matrix
result: T
defines the Vector3 where to store the result
Returns T
result input
Static Transform Normal To RefSearch 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) Example Playground https://playground.babylonjs.com/#R1F8YU#114
Type Parameters
T extends Vector3<T>
Parameters
vector: DeepImmutableObject<Vector3>
defines the Vector3 to transform
transformation: DeepImmutableObject<Matrix>
defines the transformation matrix
result: T
defines the Vector3 where to store the result
Returns T
result input
Static UnprojectSearch playground for Unproject
Unproject from screen space to object space Example Playground https://playground.babylonjs.com/#R1F8YU#117
Type Parameters
T extends Vector3<T>
Parameters
source: DeepImmutable<T>
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: DeepImmutableObject<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
view: DeepImmutableObject<Matrix>
defines the view matrix to use
projection: DeepImmutableObject<Matrix>
defines the projection matrix to use
Returns T
the new Vector3
Static Unproject Floats To RefSearch playground for UnprojectFloatsToRef
Unproject from screen space to object space Example Playground https://playground.babylonjs.com/#R1F8YU#120
Type Parameters
T extends Vector3<T>
Parameters
sourceX: number
defines the screen space x coordinate to use
sourceY: number
defines the screen space y coordinate to use
sourceZ: number
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: DeepImmutableObject<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
view: DeepImmutableObject<Matrix>
defines the view matrix to use
projection: DeepImmutableObject<Matrix>
defines the projection matrix to use
result: T
defines the Vector3 where to store the result
Returns T
result input
Static Unproject From TransformSearch playground for UnprojectFromTransform
Unproject from screen space to object space Example Playground https://playground.babylonjs.com/#R1F8YU#121
Type Parameters
T extends Vector3<T>
Parameters
source: DeepImmutable<T>
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: DeepImmutableObject<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
transform: DeepImmutableObject<Matrix>
defines the transform (view x projection) matrix to use
Returns T
the new Vector3
Static Unproject To RefSearch playground for UnprojectToRef
Unproject from screen space to object space Example Playground https://playground.babylonjs.com/#R1F8YU#119
Type Parameters
T extends Vector3<T>
Parameters
source: DeepImmutableObject<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: DeepImmutableObject<Matrix>
defines the world matrix to use (can be set to Identity to go to world space)
view: DeepImmutableObject<Matrix>
defines the view matrix to use
projection: DeepImmutableObject<Matrix>
defines the projection matrix to use
result: T
defines the Vector3 where to store the result
Returns T
result input
Static UpSearch playground for Up
Returns a new Vector3 set to (0.0, 1.0, 0.0) Example Playground https://playground.babylonjs.com/#R1F8YU#71
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 transport BABYLON.Vector3 information for pointer events