Original Post
Im making an OGL app. Halfway through the coding (OOP Style), I realised my class structure was not up to it. It went like this..
Scene
| This is toplevel and has 6 SceneObjects(for |FLOOR,WALL,SHELF,TABLE,LIGHT...). Handles rendering and
| colision detection,world loading,texture loading etc..
SceneObject
|This contains a growable vector of ScenePrimitives.
|
ScenePrimitive
|array of 4 SceneVertices .basically a QUAD. also sector ID
SceneVertex
|vertex info u,v etc
The problem is some of the objects are quads and some are milkshape models. I wanted to handle everything uniformly hence the above strucure. However its not very responsive to change and i find myself hacking it too often. Hence am planning to change it. (Thank god for OOP. Wouldnt hv been possible otherwise
The new one goes like this.
SceneNormalPrimitive
Topclass for objects like a floor,roof which are just QUADs
SceneModelPrimitive
Topclass for objects which are models eg:SHELF
Scene
Controls the whole thing
CFloor Croom etc derived from SceneNormalPrimitive
CFloorManager etc for holding a vector of CFloor''s
similarly for models
Am thinking of delegating loading and rendering to the individual classes CFloor etc
Pls comment!Thanks.