A question regarding the Asteroids example

In the Asteroids example provided with Panda (with reference to 1.5.2, that is), the model and texture files used for bullets appear to be loaded from file for each bullet.

Admittedly, I seem to have a vague memory, supported by the model-loading syntax - loadModelCopy (emphasis mine) - that the model, at least, is only loaded once on such calls, and a copy is used thereafter. Unfortunately, I don’t seem to be finding a reference for this. Is this the case, or does the Asteroids sample actually reload the model and texture each frame?

If the model and texture are not actually reloaded from file, is there advantage to using this loading system, as opposed to keeping a “template” object and copying it as desired?

loadModelCopy() is deprecated. loadModel() does the same thing now. There’s no particular advantage to doing the copying yourself; loadModel() does it as efficiently as you will.

Keep in mind, however, that the example programs, like Asteroids, were written to emphasize simplicity of code design, and are not necessarily marvels of efficient code.

David

Aah, thank you. :slight_smile:

Hmm… A good point. In that case, where might one look to learn efficient Panda coding? I realise that I’m still new with both Python and Panda, but I’m a little concerned about ending up with inefficient coding practices should I end up attempting more complex projects later…

Yes i feel a bit lost too about the documentation
The manual is like a labyrinth :confused: and i didn’t found any alternative website with examples or structured tutorials
but anyway the learning curve is being geometrical in the beggining :slight_smile:
good luck
c