omega-game-engine
    Preparing search index...

    Class Vector2

    A class representing a 2D vector, backed by a gl-matrix vec2. *

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index

    Constructors

    Properties

    _className: string
    _serializationIgnoreKeys: string[]
    _uuid: string
    _vec: vec2

    The internal gl-matrix vector. * *

    name: string = ''

    Accessors

    • get vector(): vec2

      Gets the internal gl-matrix vector. *

      Returns vec2

      • The internal vector instance.
    • get x(): number

      Gets the x-component of the vector. *

      Returns number

    • set x(value: number): void

      Sets the x-component of the vector. *

      Parameters

      • value: number

        The new value for the x-component.

      Returns void

    • get y(): number

      Gets the y-component of the vector. *

      Returns number

    • set y(value: number): void

      Sets the y-component of the vector. *

      Parameters

      • value: number

        The new value for the y-component.

      Returns void

    Methods

    • Sets the components of the vector. *

      Parameters

      • Optionalx: number = 0

        The new x-component. *

      • Optionaly: number = 0

        The new y-component. *

      Returns void