I am working on a 3d game engine for the iPhone and Im currently working out how Im going to be handling all of my 3D objects. I have a class that holds information pertaining to each 3D object such as vertexdata, texture information, etc.
I also have a method that is called once every x milleseconds that handles rendering the 3d scene.
Inside of this method, I would like to loop through all of my 3D objects to get access to their render data.
I realize I could store pointers to all of my 3D objects in an array and iterate through this array, but before venturing down this possibly unnecessary road I was wondering if there was away to simply iterate through all instances of a given class (ie my 3d object class), as this would solve my problem.
Pseduo:
For (obj in AEobject3D){
render obj
}
Is something like this possible? If so please excuse the ignorance, I cant seem to find information in the docs / internet, and Im still learning my way through Objective C.
Thanks, - Adam Eisfeld