Projectiles / Temporary Objects?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
DoritoX
Posts: 16
Joined: Fri Mar 11, 2011 2:16 pm
Location: 144

Projectiles / Temporary Objects?

Post by DoritoX »

Hi there,

My idea was to well, "Shoot objects" in my game, however...i have no clue on how to do that, I mean, i can create meshes and i can delete them
but it would be heavy on the system to load meshes from the drive and deleting them again everytime a button is pressed.

So i was wondering...what would be the best way to handle this?

Thanks alot!
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Projectiles / Temporary Objects?

Post by serengeor »

DoritoX wrote:Hi there,

My idea was to well, "Shoot objects" in my game, however...i have no clue on how to do that, I mean, i can create meshes and i can delete them
but it would be heavy on the system to load meshes from the drive and deleting them again everytime a button is pressed.

So i was wondering...what would be the best way to handle this?

Thanks alot!
well if you load a mesh and add a scene node to scene and you remove it, you don't actually remove the mesh from the memory, so if you would add again a scene node with that mesh it would grab it from the memory, unless you have removed it by yourself from the memory.
Working on game: Marrbles (Currently stopped).
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Projectiles / Temporary Objects?

Post by Radikalizm »

serengeor wrote:well if you load a mesh and add a scene node to scene and you remove it, you don't actually remove the mesh from the memory, so if you would add again a scene node with that mesh it would grab it from the memory, unless you have removed it by yourself from the memory.
This would be the way to go for deleting a single object, but you should probably try to implement a clean up routine every so many frames (or maybe every frame if you don't have to delete too many nodes)

You could implement something yourself, or use the deletion queue provided by the scene manager
DoritoX
Posts: 16
Joined: Fri Mar 11, 2011 2:16 pm
Location: 144

Post by DoritoX »

I see, but....how do i even remove stuff from both scene (and RAM) anyways?
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

DoritoX wrote:I see, but....how do i even remove stuff from both scene (and RAM) anyways?
...he just told you..
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
Grumpy
Posts: 77
Joined: Wed Dec 30, 2009 7:17 pm
Location: Montana, Usa

Post by Grumpy »

If you take a look at Irrbullet demos, it may shed some light...
code happens
Post Reply