What are typed arrays?
From the MDN docs:
The typed array used extensively through JamJar is the Float32Array, this provides an acceptable level of precision, while also integrating easily and nicely with WebGL2.
These typed arrays allow more control over the memory of arrays, allowing for performance improvements with the cost of a loss of flexibility.
Why typed arrays?
Typed arrays such as Float32Array provide some nice benefits over storing simply as
number or a normal JS array:
- Better control over memory.
- Fast indexing, opportunity for performance improvements.
- Integrates with WebGL(2) with no need for (slow) conversions.
How does this affect how geometry objects are used?
This ultimately doesn't affect the geometry objects, the typed arrays are wrapped in class definitions and surrounded by a more intuiative API, rather than direct array access.