Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vector3

Class used to store (x,y,z) vector representation A Vector3 is the main object used in 3D geometry It can represent either the coordinates of a point the space, either a direction Reminder: js uses a left handed forward facing system

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new Vector3(x?: number, y?: number, z?: number): Vector3
  • 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

hasAZeroComponent

  • get hasAZeroComponent(): boolean
  • Gets a boolean indicating if the vector contains a zero in one of its components

    Returns boolean

isNonUniform

  • get isNonUniform(): boolean
  • Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same

    Returns boolean

x

  • get x(): number
  • set x(value: number): any
  • Gets or sets the x coordinate

    Returns number

  • Gets or sets the x coordinate

    Parameters

    • value: number

    Returns any

y

  • get y(): number
  • set y(value: number): any
  • Gets or sets the y coordinate

    Returns number

  • Gets or sets the y coordinate

    Parameters

    • value: number

    Returns any

z

  • get z(): number
  • set z(value: number): any
  • Gets or sets the z coordinate

    Returns number

  • Gets or sets the z coordinate

    Parameters

    • value: number

    Returns any

Static LeftHandedForwardReadOnly

  • Gets a forward Vector3 that must not be updated

    Returns DeepImmutable<Vector3>

Static LeftReadOnly

  • Gets a left Vector3 that must not be updated

    Returns DeepImmutable<Vector3>

Static RightHandedForwardReadOnly

  • Gets a forward Vector3 that must not be updated

    Returns DeepImmutable<Vector3>

Static RightReadOnly

  • Gets a right Vector3 that must not be updated

    Returns DeepImmutable<Vector3>

Static UpReadOnly

  • Gets a up Vector3 that must not be updated

    Returns DeepImmutable<Vector3>

Static ZeroReadOnly

  • 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

    Returns Vector3

    the resulting Vector3

addInPlaceSearch playground for addInPlace

  • Adds the given vector to the current Vector3

    Parameters

    Returns Vector3

    the current updated Vector3

addInPlaceFromFloatsSearch playground for addInPlaceFromFloats

  • addInPlaceFromFloats(x: number, y: number, z: number): Vector3
  • 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

addToRefSearch playground for addToRef

  • Adds the current Vector3 to the given one and stores the result in the vector "result"

    Parameters

    Returns Vector3

    the current Vector3

applyRotationQuaternionSearch playground for applyRotationQuaternion

  • Rotates the vector using the given unit quaternion and returns the new vector

    Parameters

    • q: Quaternion

      the unit quaternion representing the rotation

    Returns Vector3

    a new Vector3

applyRotationQuaternionInPlaceSearch playground for applyRotationQuaternionInPlace

  • Rotates the vector in place using the given unit quaternion

    Parameters

    • q: Quaternion

      the unit quaternion representing the rotation

    Returns Vector3

    the current updated Vector3

applyRotationQuaternionToRefSearch playground for applyRotationQuaternionToRef

  • Rotates the vector using the given unit quaternion and stores the new vector in result

    Parameters

    • q: Quaternion

      the unit quaternion representing the rotation

    • result: Vector3

      the output vector

    Returns Vector3

    the current Vector3

asArraySearch playground for asArray

  • asArray(): number[]
  • 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

copyFromSearch playground for copyFrom

  • Copies the given vector coordinates to the current Vector3 ones

    Parameters

    Returns Vector3

    the current updated Vector3

copyFromFloatsSearch playground for copyFromFloats

  • copyFromFloats(x: number, y: number, z: number): Vector3
  • 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

  • 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"

    Parameters

    • other: Vector3

      defines the right operand

    Returns Vector3

    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

    Parameters

    Returns Vector3

    the new Vector3

divideInPlaceSearch playground for divideInPlace

  • Divides the current Vector3 coordinates by the given ones.

    Parameters

    • otherVector: Vector3

      defines the second operand

    Returns Vector3

    the current updated Vector3

divideToRefSearch playground for divideToRef

  • Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"

    Parameters

    Returns Vector3

    the current Vector3

equalsSearch playground for equals

  • Returns true if the current Vector3 and the given vector coordinates are strictly equal

    Parameters

    Returns boolean

    true if both vectors are equals

equalsToFloatsSearch playground for equalsToFloats

  • equalsToFloats(x: number, y: number, z: number): boolean
  • 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

equalsWithEpsilonSearch 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

fromArraySearch 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

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Gets the class name

    Returns string

    the string "Vector3"

getHashCodeSearch playground for getHashCode

  • getHashCode(): number
  • Creates the Vector3 hash code

    Returns number

    a number which tends to be unique between Vector3 instances

isNonUniformWithinEpsilonSearch playground for isNonUniformWithinEpsilon

  • isNonUniformWithinEpsilon(epsilon: number): boolean
  • 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

  • length(): number
  • Gets the length of the Vector3

    Returns number

    the length of the Vector3

lengthSquaredSearch playground for lengthSquared

  • lengthSquared(): number
  • Gets the squared length of the Vector3

    Returns number

    squared length of the Vector3

maximizeInPlaceSearch playground for maximizeInPlace

  • Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.

    Parameters

    Returns Vector3

    the current updated Vector3

maximizeInPlaceFromFloatsSearch playground for maximizeInPlaceFromFloats

  • maximizeInPlaceFromFloats(x: number, y: number, z: number): Vector3
  • 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

minimizeInPlaceSearch playground for minimizeInPlace

  • Updates the current Vector3 with the minimal coordinate values between its and the given vector ones

    Parameters

    Returns Vector3

    the current updated Vector3

minimizeInPlaceFromFloatsSearch playground for minimizeInPlaceFromFloats

  • minimizeInPlaceFromFloats(x: number, y: number, z: number): Vector3
  • 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

    Returns Vector3

    the new Vector3

multiplyByFloatsSearch playground for multiplyByFloats

  • multiplyByFloats(x: number, y: number, z: number): Vector3
  • Returns a new Vector3 set with the result of the multiplication 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

multiplyInPlaceSearch playground for multiplyInPlace

  • Multiplies the current Vector3 coordinates by the given ones

    Parameters

    Returns Vector3

    the current updated Vector3

multiplyToRefSearch playground for multiplyToRef

  • Multiplies the current Vector3 by the given one and stores the result in the given vector "result"

    Parameters

    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

negateInPlaceSearch playground for negateInPlace

  • Negate this vector in place

    Returns Vector3

    this

negateToRefSearch playground for negateToRef

  • Negate the current Vector3 and stores the result in the given vector "result" coordinates

    Parameters

    • result: Vector3

      defines the Vector3 object where to store the result

    Returns Vector3

    the current Vector3

normalizeSearch playground for normalize

  • Normalize the current Vector3. Please note that this is an in place operation.

    Returns Vector3

    the current updated Vector3

normalizeFromLengthSearch playground for normalizeFromLength

  • normalizeFromLength(len: number): Vector3
  • 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

normalizeToNewSearch playground for normalizeToNew

  • Normalize the current Vector3 to a new vector

    Returns Vector3

    the new Vector3

normalizeToRefSearch playground for normalizeToRef

  • Normalize the current Vector3 to the reference

    Parameters

    • reference: Vector3

      define the Vector3 to update

    Returns Vector3

    the updated Vector3

projectOnPlaneSearch playground for projectOnPlane

  • 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

    Returns Vector3

    the projected vector3

projectOnPlaneToRefSearch 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

reorderInPlaceSearch playground for reorderInPlace

  • reorderInPlace(order: string): this
  • 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

rotateByQuaternionAroundPointToRefSearch 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

rotateByQuaternionToRefSearch 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

scaleAndAddToRefSearch playground for scaleAndAddToRef

  • Scale the current Vector3 values by a factor and add the result to a given Vector3

    Parameters

    • scale: number

      defines the scale factor

    • result: Vector3

      defines the Vector3 object where to store the result

    Returns Vector3

    the unmodified current Vector3

scaleInPlaceSearch playground for scaleInPlace

  • scaleInPlace(scale: number): Vector3
  • Multiplies the Vector3 coordinates by the float "scale"

    Parameters

    • scale: number

      defines the multiplier factor

    Returns Vector3

    the current updated Vector3

scaleToRefSearch playground for scaleToRef

  • Multiplies the current Vector3 coordinates by the float "scale" and stores the result in the given vector "result" coordinates

    Parameters

    • scale: number

      defines the multiplier factor

    • result: Vector3

      defines the Vector3 object where to store the result

    Returns Vector3

    the current Vector3

setSearch playground for set

  • set(x: number, y: number, z: number): Vector3
  • 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

setAllSearch 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

    Returns Vector3

    the resulting Vector3

subtractFromFloatsSearch playground for subtractFromFloats

  • subtractFromFloats(x: number, y: number, z: number): Vector3
  • 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

subtractFromFloatsToRefSearch playground for subtractFromFloatsToRef

  • subtractFromFloatsToRef(x: number, y: number, z: number, result: Vector3): Vector3
  • 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

subtractInPlaceSearch playground for subtractInPlace

  • Subtract the given vector from the current Vector3

    Parameters

    Returns Vector3

    the current updated Vector3

subtractToRefSearch playground for subtractToRef

  • Subtracts the given vector from the current Vector3 and stores the result in the vector "result".

    Parameters

    Returns Vector3

    the current Vector3

toArraySearch 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

toQuaternionSearch 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

toStringSearch playground for toString

  • toString(): string
  • Creates a string representation of the Vector3

    Returns string

    a string with the Vector3 coordinates.

Static BackwardSearch playground for Backward

  • Backward(rightHandedSystem?: boolean): Vector3
  • 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 CatmullRomSearch playground for CatmullRom

  • Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"

    Parameters

    Returns Vector3

    the new Vector3

Static CenterSearch playground for Center

  • Returns a new Vector3 located at the center between "value1" and "value2"

    Parameters

    Returns Vector3

    the new Vector3

Static CenterToRefSearch playground for CenterToRef

Static CheckExtendsSearch playground for CheckExtends

  • Checks if a given vector is inside a specific range

    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

    Parameters

    Returns Vector3

    the new Vector3

Static ClampToRefSearch 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

    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

    Returns Vector3

    the cross product

Static CrossToRefSearch 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

    Returns void

Static DistanceSearch playground for Distance

  • Returns the distance between the vectors "value1" and "value2"

    Parameters

    Returns number

    the distance

Static DistanceSquaredSearch playground for DistanceSquared

  • Returns the squared distance between the vectors "value1" and "value2"

    Parameters

    Returns number

    the squared distance

Static DotSearch playground for Dot

  • Returns the dot product (float) between the vectors "left" and "right"

    Parameters

    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

  • Forward(rightHandedSystem?: boolean): Vector3
  • 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 FromArraySearch 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 FromArrayToRefSearch 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 FromFloatArraySearch playground for FromFloatArray

  • Returns a new Vector3 set from the index "offset" of the given Float32Array

    deprecated

    Please use FromArray instead.

    Parameters

    • array: DeepImmutable<Float32Array>

      defines the source array

    • Optional offset: number

      defines the offset in the source array

    Returns Vector3

    the new Vector3

Static FromFloatArrayToRefSearch playground for FromFloatArrayToRef

  • Sets the given vector "result" with the element values from the index "offset" of the given Float32Array

    deprecated

    Please use FromArrayToRef instead.

    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 FromFloatsToRefSearch playground for FromFloatsToRef

  • FromFloatsToRef(x: number, y: number, z: number, result: Vector3): void
  • 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 GetAngleBetweenVectorsSearch playground for GetAngleBetweenVectors

  • Get angle between two vectors

    Parameters

    Returns number

    the angle between vector0 and vector1

Static GetAngleBetweenVectorsOnPlaneSearch playground for GetAngleBetweenVectorsOnPlane

  • Get angle between two vectors projected on a plane

    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 between vector0 and vector1 projected on the plane with the specified normal

Static GetClipFactorSearch playground for GetClipFactor

  • Get the clip factor between two vectors

    Parameters

    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

    Returns Vector3

    the new Vector3

Static Hermite1stDerivativeSearch playground for Hermite1stDerivative

  • Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".

    Parameters

    Returns Vector3

    1st derivative

Static Hermite1stDerivativeToRefSearch playground for Hermite1stDerivativeToRef

  • Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".

    Parameters

    Returns void

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

    Returns Vector3

    the new Vector3

Static LerpToRefSearch 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

    Returns void

Static MaximizeSearch playground for Maximize

  • Gets the maximal coordinate values between two Vector3

    Parameters

    Returns Vector3

    the new Vector3

Static MinimizeSearch playground for Minimize

  • Gets the minimal coordinate values between two Vector3

    Parameters

    Returns Vector3

    the new Vector3

Static NormalizeSearch playground for Normalize

  • Returns a new Vector3 as the normalization of the given vector

    Parameters

    Returns Vector3

    the new Vector3

Static NormalizeToRefSearch playground for NormalizeToRef

  • Sets the given vector "result" with the normalization of the given first vector

    Parameters

    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

Static ProjectOnTriangleToRefSearch playground for ProjectOnTriangleToRef

Static ProjectToRefSearch playground for ProjectToRef

Static RightSearch playground for Right

  • Returns a new Vector3 set to (1.0, 0.0, 0.0)

    Returns Vector3

    a new right Vector3

Static RotationFromAxisSearch playground for RotationFromAxis

Static RotationFromAxisToRefSearch playground for RotationFromAxisToRef

  • The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3

    Parameters

    Returns void

Static SlerpToRefSearch playground for SlerpToRef

  • Slerp between two vectors. See also SmoothToRef

    Parameters

    • vector0: Vector3

      Start vector

    • vector1: Vector3

      End vector

    • slerp: number

      amount (will be clamped between 0 and 1)

    • result: Vector3

      The slerped vector

    Returns void

Static SmoothToRefSearch playground for SmoothToRef

  • SmoothToRef(source: Vector3, goal: Vector3, deltaTime: number, lerpTime: number, result: Vector3): void
  • Smooth interpolation between two vectors using Slerp

    Parameters

    • source: Vector3

      source vector

    • goal: Vector3

      goal vector

    • deltaTime: number

      current interpolation frame

    • lerpTime: number

      total interpolation time

    • result: Vector3

      the smoothed vector

    Returns void

Static TransformCoordinatesSearch 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)

    Parameters

    Returns Vector3

    the transformed Vector3

Static TransformCoordinatesFromFloatsToRefSearch playground for TransformCoordinatesFromFloatsToRef

  • TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: Vector3): void
  • 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

    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 TransformCoordinatesToRefSearch 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)

    Parameters

    Returns void

Static TransformNormalSearch 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

    Returns Vector3

    the new Vector3

Static TransformNormalFromFloatsToRefSearch 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 TransformNormalToRefSearch 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

    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 UnprojectFloatsToRefSearch 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 UnprojectFromTransformSearch 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 UnprojectToRefSearch 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

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method