Function create

  • Creates a Vec2; may be called with x, y, z to set initial values.

    Note: Since passing in a raw JavaScript array is valid in all circumstances, if you want to force a JavaScript array into a Vec2's specified type it would be faster to use

    const v = vec2.clone(someJSArray);
    

    Parameters

    • x: number = 0

      Initial x value.

    • y: number = 0

      Initial y value.

    Returns Float64Array

    the created vector