Hi there
I am currently working on a simulation environment and would like to introduce a very simple custom object model. It is a component-based architecture like follows:
The root class is called “GameObject” and it can contain a set of other (standard and custom) objects, for example a “RenderableComponent” which tells the system that this type of object should be rendered on screen.
Each renderable component I use in the system is a child of class “RenderableComponent”
Here is what I would like to do:
- Iterate through a collection of GameObjects
- See whether they contain a “RenderableComponent” and
- If yes, render it.
The iteration and rendering should take place in the “draw()” function of the ofApp main loop.
My question is how to implement “RenderableComponent” within the oF framework to be able to render all children that inherit from it.
Currently, it is simply a stub like:
#pragma once
#include “ofMain.h”
class a7RenderableObject
{
protected:
public:
a7RenderableObject()
{
}
~a7RenderableObject()
{
}
};
Thanks,
Michael