Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to transport BABYLON.Vector2 information for pointer events

Hierarchy

Index

Constructors

  • Creates a new Vector2WithInfo

    Parameters

    • source: Vector2

      defines the vector2 data to transport

    • Optional buttonIndex: number

      defines the current mouse button index

    Returns Vector2WithInfo

Properties

buttonIndex: number

defines the current mouse button index

x: number

defines the first coordinate

y: number

defines the second coordinate

Methods

  • Add another vector with the current one

    Parameters

    Returns Vector2

    a new Vector2 set with the addition of the current Vector2 and the given one coordinates

  • Set the Vector2 coordinates by adding the given Vector2 coordinates

    Parameters

    Returns Vector2

    the current updated Vector2

  • Sets the "result" coordinates with the addition of the current Vector2 and the given one coordinates

    Parameters

    Returns Vector2

    the unmodified current Vector2

  • Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates

    Parameters

    • otherVector: Vector3

      defines the other vector

    Returns Vector2

    a new Vector2

  • asArray(): number[]
  • Copy the current vector to an array

    Returns number[]

    a new array with 2 elements: the Vector2 coordinates.

  • Gets a new Vector2 copied from the Vector2

    Returns Vector2

    a new Vector2

  • Sets the Vector2 coordinates with the given Vector2 coordinates

    Parameters

    Returns Vector2

    the current updated Vector2

  • copyFromFloats(x: number, y: number): Vector2
  • Sets the Vector2 coordinates with the given floats

    Parameters

    • x: number

      defines the first coordinate

    • y: number

      defines the second coordinate

    Returns Vector2

    the current updated Vector2

  • Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates

    Parameters

    • otherVector: Vector2

      defines the other vector

    Returns Vector2

    a new Vector2

  • Sets the "result" coordinates with the Vector2 divided by the given one coordinates

    Parameters

    Returns Vector2

    the unmodified current Vector2

  • Gets a boolean if two vectors are equals

    Parameters

    Returns boolean

    true if the given vector coordinates strictly equal the current Vector2 ones

  • Gets a boolean if two vectors are equals (using an epsilon value)

    Parameters

    • otherVector: DeepImmutableObject<Vector2>

      defines the other vector

    • Optional epsilon: number

      defines the minimal distance to consider equality

    Returns boolean

    true if the given vector coordinates are close to the current ones by a distance of epsilon.

  • Gets a new Vector2 from current Vector2 floored values eg (1.2, 2.31) returns (1, 2)

    Returns Vector2

    a new Vector2

  • Gets a new Vector2 from current Vector2 fractional values eg (1.2, 2.31) returns (0.2, 0.31)

    Returns Vector2

    a new Vector2

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

    the current Vector3

  • getClassName(): string
  • Gets class name

    Returns string

    the string "Vector2"

  • getHashCode(): number
  • Gets current vector hash code

    Returns number

    the Vector2 hash code as a number

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

    Returns number

    the vector length (float)

  • lengthSquared(): number
  • Gets the vector squared length

    Returns number

    the vector squared length (float)

  • Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates

    Parameters

    Returns Vector2

    a new Vector2

  • multiplyByFloats(x: number, y: number): Vector2
  • Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats

    Parameters

    • x: number

      defines the first coordinate

    • y: number

      defines the second coordinate

    Returns Vector2

    a new Vector2

  • Sets "result" coordinates with the multiplication of the current Vector2 and the given one coordinates

    Parameters

    Returns Vector2

    the unmodified current Vector2

  • Gets a new Vector2 with current Vector2 negated coordinates

    Returns Vector2

    a new Vector2

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

    Parameters

    • result: Vector2

      defines the Vector3 object where to store the result

    Returns Vector2

    the current Vector2

  • Normalize the vector

    Returns Vector2

    the current updated Vector2

  • Rotate the current vector into a given result vector

    Parameters

    • angle: number

      defines the rotation angle

    • result: Vector2

      defines the result vector where to store the rotated vector

    Returns Vector2WithInfo

    the current vector

  • Returns a new Vector2 scaled by "scale" from the current Vector2

    Parameters

    • scale: number

      defines the scaling factor

    Returns Vector2

    a new Vector2

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

    Parameters

    • scale: number

      defines the scale factor

    • result: Vector2

      defines the Vector2 object where to store the result

    Returns Vector2

    the unmodified current Vector2

  • scaleInPlace(scale: number): Vector2
  • Multiply the Vector2 coordinates by scale

    Parameters

    • scale: number

      defines the scaling factor

    Returns Vector2

    the current updated Vector2

  • Scale the current Vector2 values by a factor to a given Vector2

    Parameters

    • scale: number

      defines the scale factor

    • result: Vector2

      defines the Vector2 object where to store the result

    Returns Vector2

    the unmodified current Vector2

  • Sets the Vector2 coordinates with the given floats

    Parameters

    • x: number

      defines the first coordinate

    • y: number

      defines the second coordinate

    Returns Vector2

    the current updated Vector2

  • Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2

    Parameters

    • otherVector: Vector2

      defines the other vector

    Returns Vector2

    a new Vector2

  • Sets the current Vector2 coordinates by subtracting from it the given one coordinates

    Parameters

    Returns Vector2

    the current updated Vector2

  • Sets the "result" coordinates with the subtraction of the given one from the current Vector2 coordinates.

    Parameters

    Returns Vector2

    the unmodified current Vector2

  • Sets the Vector2 coordinates in the given array or Float32Array from the given index.

    Parameters

    • array: FloatArray

      defines the source array

    • Optional index: number

      defines the offset in source array

    Returns Vector2

    the current Vector2

  • toString(): string
  • Gets a string with the Vector2 coordinates

    Returns string

    a string with the Vector2 coordinates

  • Returns a new Vector2 set with same the coordinates than "value" ones if the vector "value" is in the square defined by "min" and "max". If a coordinate of "value" is lower than "min" coordinates, the returned Vector2 is given this "min" coordinate. If a coordinate of "value" is greater than "max" coordinates, the returned Vector2 is given this "max" coordinate

    Parameters

    Returns Vector2

    a new Vector2

  • Gets a new Vector2 set from the given index element of the given array

    Parameters

    • array: DeepImmutableObject<ArrayLike<number>>

      defines the data source

    • Optional offset: number

      defines the offset in the data source

    Returns Vector2

    a new Vector2

  • Sets "result" from the given index element of the given array

    Parameters

    • array: DeepImmutableObject<ArrayLike<number>>

      defines the data source

    • offset: number

      defines the offset in the data source

    • result: Vector2

      defines the target vector

    Returns void

  • Returns a new Vector2 located for "amount" (float) on the linear interpolation between the vector "start" adn the vector "end".

    Parameters

    Returns Vector2

    a new Vector2

  • Normalize a given vector into a second one

    Parameters

    Returns void

  • Gets a new Vector2(1, 1)

    Returns Vector2

    a new Vector2

  • Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector "result" coordinates

    Parameters

    Returns void

  • Gets a new Vector2(0, 0)

    Returns Vector2

    a new Vector2

Legend

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

Settings

Theme