Is it always good to use Vec3f / Vec4f class defined by yourself?

I’m currently learning OpenGL with JOGL.
What makes me confused is that when you’re going to reconstruct a virtural scene containing plenty of objects, is it always good to define a Vec3f class and face class representing the vertices, normals, and faces rather than to directly use float[] type. Any ideas?

If you do not intend to do any mesh processing or collision detection, etc…, keeping track of faces or other high level topology data
is completely useless overhead.

As long as you only want to render an object, it is not neccessary to keep around anything more than vertex and index buffers, and
only until you uploaded them to a buffer object.

However, you will most likely have custom vector and matrix data types in your applications with common vector and matrix operations
for other reasons, such as keeping track of positions and orientations of objects in your scene, animations, etc…

I don’t know Java, but in other languages it can add an extra degree of type-safety that may not be there otherwise.

Always? No.

Doing so may add significant overhead, particularly for reference-based languages such as Java. If you have an array of Vec3, you have to copy the date into a float in order to pass it to any OpenGL function. Similarly, you can’t use a multi-dimensional array where a one-dimensional array is required, as each dimension adds an extra level of indirection.

The situation is better in C or C++ as you can typically just cast an array of vector structures to a float array.