phaser - v4.0.0-rc.4
    Preparing search index...

    A representation of a vector in 4D space.

    A four-component vector.

    Index

    Constructors

    • Parameters

      • Optionalx: number

        The x component.

      • Optionaly: number

        The y component.

      • Optionalz: number

        The z component.

      • Optionalw: number

        The w component.

      Returns Vector4

    Properties

    w: number

    The w component of this Vector.

    x: number

    The x component of this Vector.

    y: number

    The y component of this Vector.

    z: number

    The z component of this Vector.

    Methods

    • Calculate the dot product of this Vector and the given Vector.

      Parameters

      • v: Vector4

        The Vector4 to dot product with this Vector4.

      Returns number

    • Check whether this Vector is equal to a given Vector.

      Performs a strict quality check against each Vector's components.

      Parameters

      • v: Vector4

        The vector to check equality with.

      Returns boolean

    • Calculate the length (or magnitude) of this Vector.

      Returns number

    • Linearly interpolate between this Vector and the given Vector.

      Interpolates this Vector towards the given Vector.

      Parameters

      • v: Vector4

        The Vector4 to interpolate towards.

      • Optionalt: number

        The interpolation percentage, between 0 and 1. Default 0.

      Returns Vector4

    • Set the x, y, z and w components of the this Vector to the given x, y, z and w values.

      Parameters

      • x: number | object

        The x value to set for this Vector, or an object containing x, y, z and w components.

      • y: number

        The y value to set for this Vector.

      • z: number

        The z value to set for this Vector.

      • w: number

        The z value to set for this Vector.

      Returns Vector4