Variable ARRAY_TYPEConst

ARRAY_TYPE: (new (n) => Float32Array | number[]) = ...

Type declaration

    • new (n): Float32Array | number[]
    • The array type to use for internal numeric computations throughout the library. Float32Array is used if it is available, but falls back on Array. If you want to set array type manually, inject it via the global variable P2_ARRAY_TYPE. See example below.

      Parameters

      • n: number

      Returns Float32Array | number[]

      Example

      <script>
      <!-- Inject your preferred array type before loading p2-es -->
      P2_ARRAY_TYPE = Array;
      </script>
      <script src="p2-es.js"></script>