Options
All
  • Public
  • Public/Protected
  • All
Menu

Module vec4

Index

Functions

add

clone

  • Creates a new vec4 initialized with values from an existing vector

    Parameters

    Returns IArray

    a new 4D vector

copy

create

dist

  • Calculates the euclidian distance between two vec4's

    Parameters

    Returns number

    distance between a and b

distance

  • Calculates the euclidian distance between two vec4's

    Parameters

    Returns number

    distance between a and b

div

divide

dot

  • Calculates the dot product of two vec4's

    Parameters

    Returns number

    dot product of a and b

forEach

  • forEach(out: IArray, string: number, offset: number, count: number, callback: function, arg: any): IArray
  • forEach(out: IArray, string: number, offset: number, count: number, callback: function): IArray
  • Perform some operation over an array of vec4s.

    function

    Parameters

    • out: IArray
    • string: number
    • offset: number

      Number of elements to skip at the beginning of the array

    • count: number

      Number of vec4s to iterate over. If 0 iterates over entire array

    • callback: function
    • arg: any

    Returns IArray

    a

  • Perform some operation over an array of vec4s.

    function

    Parameters

    • out: IArray
    • string: number
    • offset: number

      Number of elements to skip at the beginning of the array

    • count: number

      Number of vec4s to iterate over. If 0 iterates over entire array

    • callback: function

    Returns IArray

    a

fromValues

  • fromValues(x: number, y: number, z: number, w: number): IArray
  • Creates a new vec4 initialized with the given values

    Parameters

    • x: number

      X component

    • y: number

      Y component

    • z: number

      Z component

    • w: number

      W component

    Returns IArray

    a new 4D vector

inverse

len

  • Calculates the length of a vec4

    Parameters

    • a: IArray

      vector to calculate length of

    Returns number

    length of a

length

  • Calculates the length of a vec4

    Parameters

    • a: IArray

      vector to calculate length of

    Returns number

    length of a

lerp

  • Performs a linear interpolation between two vec4's

    Parameters

    • out: IArray

      the receiving vector

    • a: IArray

      the first operand

    • b: IArray

      the second operand

    • t: number

      interpolation amount between the two inputs

    Returns IArray

    out

max

min

mul

multiply

negate

normalize

random

scale

  • Scales a vec4 by a scalar number

    Parameters

    • out: IArray

      the receiving vector

    • a: IArray

      the vector to scale

    • b: number

      amount to scale the vector by

    Returns IArray

    out

scaleAndAdd

  • Adds two vec4's after scaling the second operand by a scalar value

    Parameters

    • out: IArray

      the receiving vector

    • a: IArray

      the first operand

    • b: IArray

      the second operand

    • scale: number

      the amount to scale b by before adding

    Returns IArray

    out

set

  • set(out: IArray, x: number, y: number, z: number, w: number): IArray
  • Set the components of a vec4 to the given values

    Parameters

    • out: IArray

      the receiving vector

    • x: number

      X component

    • y: number

      Y component

    • z: number

      Z component

    • w: number

      W component

    Returns IArray

    out

sqrDist

  • Calculates the squared euclidian distance between two vec4's

    Parameters

    Returns number

    squared distance between a and b

sqrLen

  • Calculates the squared length of a vec4

    Parameters

    • a: IArray

      vector to calculate squared length of

    Returns number

    squared length of a

squaredDistance

  • Calculates the squared euclidian distance between two vec4's

    Parameters

    Returns number

    squared distance between a and b

squaredLength

  • squaredLength(a: IArray): number
  • Calculates the squared length of a vec4

    Parameters

    • a: IArray

      vector to calculate squared length of

    Returns number

    squared length of a

str

  • Returns a string representation of a vector

    Parameters

    Returns string

    string representation of the vector

sub

subtract

transformMat4

transformQuat

Generated using TypeDoc