Function create

  • Create a Mat4 from values

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

    const m = mat4.clone(someJSArray);
    

    Note: a consequence of the implementation is if your Mat4Type = Array instead of Float32Array or Float64Array then any values you don't pass in will be undefined. Usually this is not an issue since (a) using Array is rare and (b) using mat4.create is usually used to create a Mat4 to be filled out as in

    const m = mat4.create();
    mat4.perspective(fov, aspect, near, far, m);

    Parameters

    • Optional v0: number

      value for element 0

    • Optional v1: number

      value for element 1

    • Optional v2: number

      value for element 2

    • Optional v3: number

      value for element 3

    • Optional v4: number

      value for element 4

    • Optional v5: number

      value for element 5

    • Optional v6: number

      value for element 6

    • Optional v7: number

      value for element 7

    • Optional v8: number

      value for element 8

    • Optional v9: number

      value for element 9

    • Optional v10: number

      value for element 10

    • Optional v11: number

      value for element 11

    • Optional v12: number

      value for element 12

    • Optional v13: number

      value for element 13

    • Optional v14: number

      value for element 14

    • Optional v15: number

      value for element 15

    Returns Mat4

    created from values.