I have a class called RenderObject that holds 3 variables: a position, an int that holds the length of an array pointed to, and the pointer to an array of "Faces"
Face is just a class that holds its type (quad or triangle), its colour, and a pointer to an array of vertices (stored as Vector3f).
My RenderObject class has a constructor that requires a position, an array of faces, and and int that is the number of faces in the array.
I also have a class called Cube, it is derived from RenderObject (so I could easily generate a cube of width, height and depth dimensions.
The problem is, Cube's constructor only needs the position and dimensions, so when it comes to calling the default constructor:
Cube::Cube( sf::Vector3f *positionVector, float width, float height, float depth ) : RenderObject( positionVector, /*can't supply this*/, 6 ) {
I can't pass the array of faces because the Cube class runs GenerateFaces(); to automatically create the faces according to the dimensions.
So my question is, how do I pass the generated faces to RenderObject's constructor? Or is there a better way to do this?