I'm working with WebGL, so I need Float32Arrays all the time. Is there a way to force an array to be a Float32Array? I tried this:
var cubeVertices = new Float32Array(3 * 4 * 6);
cubeVertices = [
/* Vertices */
];
But this appears to change the type to a Float64Array, since I can't use it with WebGL, but it works when I do a new Float32Array(cubeVertices). I don't really want to use the new Float32Array command all the time, since it allocates memory that is of no use, because I don't need several copies of my data.
So is there a way of creating a Float32Array without having two arrays, where one is never used again?