Chalkboard - v3.0.1
    Preparing search index...

    Function toTypedArray

    • Converts a quaternion to a typed array.

      Parameters

      • quat: ChalkboardQuaternion

        The quaternion

      • Optionaltype: "int8" | "int16" | "int32" | "float32" | "float64" | "bigint64" = "float32"

        The type of the typed array, which can be "int8", "int16", "int32", "float32", "float64", or "bigint64" (optional, defaults to "float32")

      Returns
          | Float32Array<ArrayBufferLike>
          | Float64Array<ArrayBufferLike>
          | Int8Array<ArrayBufferLike>
          | Int16Array<ArrayBufferLike>
          | Int32Array<ArrayBufferLike>
          | BigInt64Array<ArrayBufferLike>

      // Returns a Float32Array [1, 2, 3, 4]
      const q = Chalkboard.quat.init(1, 2, 3, 4);
      const qf32 = Chalkboard.quat.toTypedArray(q);