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

Accessors

  • Gets a zero Vector2 that must not be updated

    Returns DeepImmutableObject<Vector2>

Methods

  • asArray(): number[]
  • Gets a boolean if two vectors are equals (using an epsilon value) Example Playground https://playground.babylonjs.com/#QYBWV4#32

    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.

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

  • negateToRef<T>(result: T): T
  • Negate the current Vector2 and stores the result in the given vector "result" coordinates Example Playground https://playground.babylonjs.com/#QYBWV4#41

    Type Parameters

    Parameters

    • result: T

      defines the Vector3 object where to store the result

    Returns T

    the result

  • rotateToRef<T>(angle: number, result: T): T
  • Rotate the current vector into a given result vector Example Playground https://playground.babylonjs.com/#QYBWV4#49

    Type Parameters

    Parameters

    • angle: number

      defines the rotation angle

    • result: T

      defines the result vector where to store the rotated vector

    Returns T

    result input

  • scaleAndAddToRef<T>(scale: number, result: T): T
  • Scale the current Vector2 values by a factor and add the result to a given Vector2 Example Playground https://playground.babylonjs.com/#QYBWV4#58

    Type Parameters

    Parameters

    • scale: number

      defines the scale factor

    • result: T

      defines the Vector2 object where to store the result

    Returns T

    result input

  • scaleToRef<T>(scale: number, result: T): T
  • Scale the current Vector2 values by a factor to a given Vector2 Example Playground https://playground.babylonjs.com/#QYBWV4#57

    Type Parameters

    Parameters

    • scale: number

      defines the scale factor

    • result: T

      defines the Vector2 object where to store the result

    Returns T

    result input

  • 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 Example Playground https://playground.babylonjs.com/#QYBWV4#76

    Type Parameters

    Parameters

    Returns T

    a new Vector2

  • Gets a new Vector2(1, 1)

    Returns Vector2

    a new Vector2

  • Random(min?: number, max?: number): Vector2
  • Returns a new Vector2 with random values between min and max

    Parameters

    • Optional min: number

      the minimum random value

    • Optional max: number

      the maximum random value

    Returns Vector2

    a Vector2 with random values between min and max

  • 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