How to destroy an SceneGeometry?

zillenjack

13-05-2009 14:51:43

I am using the bloody mess to create a SceneGeometry?
Now i want to destroy it.
How can i do?
My code:
NxOgre::SceneGeometry* sg = m_NxScene->createSceneGeometry(pShapes, NxOgre::Matrix44(NxOgre::Matrix44::T_Identity));
m_NxScene->destroy????

Thank you!

betajaen

13-05-2009 15:02:10

You can't; it's static. PhysX expects static NxActors to never to be moved, rotated or deleted in the life-time of the Scene; You'd have to destroy the Scene to remove them all.

Vectrex

13-05-2009 15:11:04

really? I need that too. When people join a server a pit area appears which is static. So needs to go when they leave.

What about dynamic actors with a mass of zero?
Maybe even make it a Kinematic dynamic to simulate static?
It doesn't have to be a fast operation in my case.

zillenjack

13-05-2009 15:11:48

Oh!
I see
Thank you for telling me

betajaen

13-05-2009 15:25:50

really? I need that too. When people join a server a pit area appears which is static. So needs to go when they leave.

What about dynamic actors with a mass of zero?
Maybe even make it a Kinematic dynamic to simulate static?
It doesn't have to be a fast operation in my case.


I'm not sure if Kinematic Actors and TriangleSceneGeometries will work together. It'll probably compile and actually run, but PhysX will scream out into the log about it; every frame.

Vectrex

13-05-2009 16:39:21

Well I could live with just using convex compound shapes as that's what I'm currently using (by accident). But this seems like it should be possible because think of a streaming world scenario. You'd have to add and remove statics on the fly then.

betajaen

13-05-2009 16:40:52

I believe in that case you would use paging triangle meshes.

zillenjack

14-05-2009 01:11:11

I believe in that case you would use paging triangle meshes.
the bloody mess have this feature?

betajaen

14-05-2009 11:31:26

Afraid not. It's a hardware feature (The PPU and newer NVIDIA GPUs), which I haven't looked to much into yet. The documentation isn't clear if it runs on software or not. But I wouldn't worry to much about stray StaticGeometries. If you plan to re-use a lot of them, just disable and enable them for later.

@Vectrex

I had another thought; You could have a another scene sharing the same scene manager. Your pit area and actual battle arena can be in separate scenes. You can then just delete the pit scene, or just disable the Pit SceneGeometry and hide the pit node - if you need to use it again.



Both of you have given me a few ideas though; Ability to "pause"/disable scenes, and this auto-disable actor based on distance idea I though of a year back.

zillenjack

14-05-2009 12:19:59

Afraid not. It's a hardware feature (The PPU and newer NVIDIA GPUs), which I haven't looked to much into yet. The documentation isn't clear if it runs on software or not. But I wouldn't worry to much about stray StaticGeometries. If you plan to re-use a lot of them, just disable and enable them for later.

@Vectrex

I had another thought; You could have a another scene sharing the same scene manager. Your pit area and actual battle arena can be in separate scenes. You can then just delete the pit scene, or just disable the Pit SceneGeometry and hide the pit node - if you need to use it again.



Both of you have given me a few ideas though; Ability to "pause"/disable scenes, and this auto-disable actor based on distance idea I though of a year back.

But I do not know how to share the two scenes
Can you show me some code?

betajaen

14-05-2009 13:37:55

When you create a RenderSystem for each Scene just give out the same SceneManager for both of them.