How to add an existing entity into NxOgre ?

jams

19-07-2007 22:53:40

Hi
I'm totally new to NxOgre and PhysX which seems to be great as everythings betajean does ! Though I have some questions :
1) I have a scene imported from oFusion, so I'd like to add physics to some of my entities. I first thought I had to use Actors instead of bodies, but I can't get it work :(. So I create a body, with no mesh and use setNode method. It seems to work at first sight ... But I wonder if it's right and if there's not a better way to do it ?? Using setEntity for exemple !
2) When I set no floor and no gravity, my nodes are moving and rotating away ?? I wonder why ?
3) If I set no framelistener I can get it works but I wonder why I have to call render() method in addition to simulate() ??
Thanks for helping !

betajaen

19-07-2007 22:57:57

1. There is a recent thread around here with using oFusion and NxOgre, you should join in there.

2. With no gravity or floor, it's pretty much space. Do you see things standing still in space? I think not!

3. Simulate just works out what happens since the time since. Render modifies the Ogre scene to reflect those changes. Most of the time they work together; Simulate and Render. But some times, you may not to render.

jams

19-07-2007 23:25:41

Thanks for fast answer, I've red the thread about oFusion, but the aproach is not really efficient, doing everything twice is really a hack ! But I'll post my question on that thread which is the right place, you're right ;)
Ok for second and third points ...

betajaen

19-07-2007 23:28:11

You could use it just once and then re-save it using the NxOgre serialiser.

jams

19-07-2007 23:55:39

Yes, That's a good idea, I could write a small tool using NxOgre serialisation ... but I cannot see anything related in the library ? I've red a bit the thread about COLLADA, XML and binary export, even see that NxOgre::World should have a method named getSerialiser() but could not find it on latest SVN version :?