I want to convert a Vector3f array directly from array to another kind of data. Here is an example:
Vector3f[] vecArray = new Vector3f[10];
float[] floatArray = vecArray.toFloats(); // <<
Is that possible ?
No, there's nothing you can do to make that compile. (There's no equivalent of the extension methods in C# which would allow it, for example.)
The closest you'd be able to come would be to have a static method somewhere - whether within Vector3f
or not - which you could invoke with a static import potentially:
import static ...Vector3f.toFloats;
Vector3f[] vecArray = new Vector3f[10];
float[] floatArray = toFloats(vecArray);
See more on this question at Stackoverflow