Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to transport BABYLON.Vector3 information for pointer events

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

  • 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

buttonIndex: number

defines the current mouse button index

Accessors

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

    Returns boolean

  • 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

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

    Returns number

  • Gets or sets the x coordinate

    Parameters

    • value: number

    Returns void

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

    Returns number

  • Gets or sets the y coordinate

    Parameters

    • value: number

    Returns void

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

    Returns number

  • Gets or sets the z coordinate

    Parameters

    • value: number

    Returns void

  • Gets a forward Vector3 that must not be updated

    Returns DeepImmutableObject<Vector3>

  • Gets a left Vector3 that must not be updated

    Returns DeepImmutableObject<Vector3>

  • Gets a forward Vector3 that must not be updated

    Returns DeepImmutableObject<Vector3>

  • Gets a right Vector3 that must not be updated

    Returns DeepImmutableObject<Vector3>

  • Gets a up Vector3 that must not be updated

    Returns DeepImmutableObject<Vector3>

  • Gets a zero Vector3 that must not be updated

    Returns DeepImmutableObject<Vector3>

Methods

  • Gets a new Vector3, result of the addition the current Vector3 and the given vector

    Parameters

    Returns Vector3

    the resulting Vector3

  • 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

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

    Parameters

    Returns Vector3

    the current Vector3

  • 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

  • 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

  • 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

  • asArray(): number[]
  • Creates an array containing three elements : the coordinates of the Vector3

    Returns number[]

    a new array of numbers

  • Creates a new Vector3 copied from the current Vector3

    Returns Vector3

    the new Vector3

  • Copies the given vector coordinates to the current Vector3 ones

    Parameters

    Returns Vector3

    the current updated Vector3

  • 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

  • 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

  • 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

  • Divides the current Vector3 coordinates by the given ones.

    Parameters

    • otherVector: Vector3

      defines the second operand

    Returns Vector3

    the current updated Vector3

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

    Parameters

    Returns Vector3

    the current Vector3

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

    Parameters

    Returns boolean

    true if both vectors are equals

  • 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

  • Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon

    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

  • Gets a new Vector3 from current Vector3 floored values

    Returns Vector3

    a new Vector3

  • Gets a new Vector3 from current Vector3 floored values

    Returns Vector3

    a new Vector3

  • 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

  • getClassName(): string
  • Gets the class name

    Returns string

    the string "Vector3"

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

    Returns number

    a number which tends to be unique between Vector3 instances

  • 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

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

    Returns number

    the length of the Vector3

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

    Returns number

    squared length of the Vector3

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

    Parameters

    Returns Vector3

    the current updated Vector3

  • 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

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

    Parameters

    Returns Vector3

    the current updated Vector3

  • 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

  • Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector

    Parameters

    Returns Vector3

    the new Vector3

  • 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

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

    Parameters

    Returns Vector3

    the current Vector3

  • Gets a new Vector3 set with the current Vector3 negated coordinates

    Returns Vector3

    a new Vector3

  • 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

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

    Returns Vector3

    the current updated Vector3

  • 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

  • Normalize the current Vector3 to a new vector

    Returns Vector3

    the new Vector3

  • Normalize the current Vector3 to the reference

    Parameters

    • reference: Vector3

      define the Vector3 to update

    Returns Vector3

    the updated Vector3

  • 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

  • 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

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

    the current updated vector

  • 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

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

  • 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

  • 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

  • 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

  • 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

  • Returns a new Vector3, result of the subtraction of the given vector from the current Vector3

    Parameters

    Returns Vector3

    the resulting Vector3

  • 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

  • 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

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

    Parameters

    Returns Vector3

    the current Vector3

  • 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

  • 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

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

    Returns string

    a string with the Vector3 coordinates.

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

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

    Returns Vector3

    a new down Vector3

  • 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

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

    Parameters

    • array: DeepImmutableObject<ArrayLike<number>>

      defines the source array

    • Optional offset: number

      defines the offset in the source array

    Returns Vector3

    the new Vector3

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

    Parameters

    • array: DeepImmutableObject<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

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

    deprecated

    Please use FromArray instead.

    Parameters

    • array: DeepImmutableObject<Float32Array>

      defines the source array

    • Optional offset: number

      defines the offset in the source array

    Returns Vector3

    the new Vector3

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

    deprecated

    Please use FromArrayToRef instead.

    Parameters

    • array: DeepImmutableObject<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

  • 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

  • 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

  • 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

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

    Returns Vector3

    a new left Vector3

  • Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"

    Parameters

    Returns Vector3

    the new Vector3

  • 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

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

    Parameters

    Returns Vector3

    the new Vector3

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

    Parameters

    Returns void

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

    Returns Vector3

    a new unit Vector3

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

    Returns Vector3

    a new right Vector3

  • 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

  • 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

  • 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

  • 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: DeepImmutableObject<Matrix>

      defines the transformation matrix

    • result: Vector3

      defines the Vector3 where to store the result

    Returns void

  • 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

  • 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

  • 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: DeepImmutableObject<Matrix>

      defines the transformation matrix

    • result: Vector3

      defines the Vector3 where to store the result

    Returns void

  • 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

  • Unproject from screen space to object space

    Parameters

    Returns Vector3

    the new Vector3

  • Unproject from screen space to object space

    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: Vector3

      defines the Vector3 where to store the result

    Returns void

  • 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: 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 Vector3

    the new Vector3

  • Unproject from screen space to object space

    Parameters

    Returns void

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

    Returns Vector3

    a new up Vector3

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

    Returns Vector3

    a new empty Vector3

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static method

Settings

Theme