Vec3

Defined in: src/math/Vec3.js:12

Vector utilities.

angle( b0, ai, bi, ci ) static Float
src/math/Vec3.js:163

Calculate angle between segments ab and bc

  • b0 Array

    Vec3 buffer

  • ai Int

    Vector index a

  • bi Int

    Vector index b

  • ci Int

    Vector index c

Returns: Float

Angle in radians

copy( b0, ai, out ) static
src/math/Vec3.js:56
  • b0 Array

    Vec3 buffer

  • ai Int

    Vector index

  • out Array

    Destination vector

create( positions ) static Float32Array
src/math/Vec3.js:19
  • positions Int | Array

    Number of vectors or array of initial values

Returns: Float32Array

Vec3 buffer

distance( b0, ai, bi ) static Float
src/math/Vec3.js:124
  • b0 Array

    Vec3 buffer

  • ai Int

    Vector index a

  • bi Int

    Vector index b

Returns: Float

Distance from a to b

distanceSq( b0, ai, bi ) static Float
src/math/Vec3.js:105
  • b0 Array

    Vec3 buffer

  • ai Int

    Vector index a

  • bi Int

    Vector index b

Returns: Float

Squared distance from a to b

length( b0, ai ) static Float
src/math/Vec3.js:89
  • b0 Array

    Vec3 buffer

  • ai Int

    Vector index

Returns: Float

Length of vector

lengthSq( b0, ai ) static Float
src/math/Vec3.js:73
  • b0 Array

    Vec3 buffer

  • ai Int

    Vector index

Returns: Float

Squared length of vector

normalize( b0, ai ) static
src/math/Vec3.js:143

Normalize vector in place

  • b0 Array

    Vec3 buffer

  • ai Int

    Vector index a

set( b0, i, x, [y], [z] ) static
src/math/Vec3.js:31

Set single vector in buffer

  • b0 Array

    Vec3 buffer

  • i Int

    Vector index

  • x Array | Float

    Vector or x component value

  • [y] Float
  • [z] Float