Destroying a Critter::Body

Fr0stY

18-07-2010 01:58:19

How can I safely destroy an object created with the render system and make sure all memory is released correctly?

I'm making my character shoot KinematicBody's and I need to destroy them after a while... What function do I call?
I tried RenderSystem::destroyKinematicBody() and I'm still getting memory leaks so I need to make sure the problem is not on my side.

Thanks!

Tibo6

20-07-2010 13:55:25

Personnally I do that :

m_physicRenderSystem->destroyBody(m_body);

physicRenderSystem is NxOgre::RenderSystem and m_body is NxOgre::Body
I don't think Critter::Body exists.

betajaen

20-07-2010 14:25:33

Critter::Body exists, NxOgre::Body doesn't...Remember Bodies are my word for "rendered" things. NxOgre doesn't do rendering, Critter does.

Tibo6

20-07-2010 15:50:12

Oh yeah right.
Correction : physicRenderSystem is Critter::RenderSystem and m_body is Critter::Body :D