@virtualscenery/greenscreenstream
    Preparing search index...

    Class Vector2

    Represents a 2-dimensional vector with x and y coordinates.

    Provides utility methods for string representation, conversion to media constraints, and validation of vector-like objects.

    const v = new Vector2(1920, 1080);
    console.log(v.toString()); // "1920 : 1080"
    Index

    Constructors

    Properties

    x y

    Methods

    Constructors

    Properties

    x: number = 0
    y: number = 0

    Methods

    • Converts the current vector's x and y values into a MediaTrackConstraints object, setting the width and height constraints with min and ideal properties.

      Returns MediaTrackConstraints

      An object specifying the minimum and ideal width and height for media track constraints, based on the vector's x (width) and y (height) values.

    • Returns a string representation of the vector in the format "x : y".

      Returns string

      The string representation of the vector.

    • Determines whether the provided input is a valid Vector2 object.

      A valid Vector2 object must have numeric x and y properties.

      Parameters

      • input: any

        The value to check for Vector2 validity.

      Returns boolean

      true if the input has numeric x and y properties, otherwise false.