Object iterator for an instanced geometry batch instance?


11-06-2009 03:36:13

I have been working on creating instanced geometry for handling a large number of individual moving "people" that all share the same mesh/material. I was using the crowd/instance Ogre code to draw from and while I can get batches of instanced geometry created and built, I have not been able to figure out how to change the position of each individual object of each batch of instanced geometry (as is displayed in the Ogre example).

I followed the example code as closely as possible and go through the motions of creating a single entity, looping through the number of batches I need to make to hold all the entities while entering (up to) the max objects per batch during each loop and followed by building each batch individually as it's created. This does what I want it to and will place all of the objects in the scene (on top of each other of course), which is where I am running into a problem. Looking at the sample code and what the equivalent is in Mogre I am not really sure how to follow through with setting the position of each object in each batch that I created. Is it possible to do and, if so, how exactly is it done in Mogre?

Also, if there are any better suggestions that someone may have for managing a large number of moving objects (tens of thousands at the least) that is equivalent or better to using instanced geometry then I am open to hearing about them. Primarily interested in being able to maintain as high a framerate as is possible, even if it is going to be fairly low, which I already imaging it will be for tens to hundreds of thousands of moving objects.