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);
toArray()but you usually have to use the wrapperFloat(orDouble, etc). You can write a method to do it but the syntax would look different from what you posted. Also an array ofVector3f(s)? Start with how you might represent oneVector3fas a single float.