I have the following code in C++:
struct vec3d
{
float x, y, z;
};
struct triangle
{
vec3d p[3];
};
struct mesh
{
vector<triangle> tris;
bool LoadFromObjectFile(string sFilename) {
return true;
}
};
How could I translate this into Java?
Would I use classes for that? So in order to group multiple vec3d
in a triangle
:
public class vec3d
{
float x, y, z;
}
public class triangle
{
vec3d[] p = new vec3d[3];
}