Creating an NxOgre World using oFusions oSceneLoader?

mr_burns

01-02-2008 03:20:45

Hi all,

We are trying to do the following:

We have exported a scene from 3DS Max 9.0 using oFusion.

The result is one *.osm and many *.mesh files.

We are then using the oSceneLoader *.h and *.cpp files to load the scene into Ogre3D (1.4.5).

Our understanding is that the *.osm loader iterates through the xml file (*.osm), grabs each mesh reference and creates a node for each in the Ogre Scene Graph.

(correct us if we are wrong.)

Next we wish to take the scene (collection of *.mesh files) that has been loaded into Ogre's scene graph/nodes and create a NxOgre world (collection of actors) using the meshes already in Ogre's scene.

First question. Is there a way to load the *.osm scene directly into NxOgre? Or do we have to iterate through the scene graph, creating the physics actors one at a time?

Second question. If the art team were to create approximated physics geometry in 3DS Max, and using Feeling and/or the Ageia PhysX plugins, we export out a NXStream (xml, binary, or collada), could we populate the NxOgre world/scene using the PhsyX stream?

Third question. If we do manage to populate the NxOgre world/scene using the NxStream data (*.xml, *.nxb, *.xml), how will the two systems reference each? E.g. will I have to sync each game rendering mesh

Any help is much appreciated.

Here is the current pipeline. The red question mark is where we are unsure.



Many thanks.
B.

betajaen

01-02-2008 10:03:50

1. You would have to iterate through each created node/mesh work out what it is, and construct an Actor from it. You can tell the Actor to use that node instead of creating it's own.

2. DAE has worked really well in the past with NxOgre, I got pretty far with it. Collada (XML) and Binary(nxb) are next to useless in my experience; no support for custom data so no support for things you need; references to meshes, node hierarchy, etc.

3. DAE is/was supported by NxOgre, infact the files are there to read and write to them normally. They are temporary disabled because I want to write use a better file format (JSON), but in 0.9 you should be able to include them back into the solution, uncomment a few things, and you may be able to get it running again. (It's the Blueprint system). Unfortantly I won't be able to give help except for advice on this one.



I'll be starting my own editor/pipeline thingy soon (this month) called Dance. It's designed to import your meshes, and you arrange them in Dance; even test them out, see how they play with the physics then they can be imported into your Application (with a provided code), the file format is JSON so it's a little different to OSM and DAE. Just think of it as Hammer for NxOgre/Ogre.

mr_burns

04-02-2008 02:24:52

Hi Betajaen,

Thanks for the help.

Current roadmap is as follows, with most of the work happening in the CGame::Initialise() method.

Plan to new up the game objects in the CGame::Initialise() method, and when they are each being created and added to the scene manager, corresponding PhysX actors will be created and inserted into the NxOgre scene, referencing the newly created CGameObject instance.

On the CGameObject::Update() the game can update, and NxOgre can "step" and modify the corresponding node's position, rotation, etc.



Thoughts?

Regards,
B.

KevinMulder

11-09-2008 16:17:11

What about this project?

Prophet

11-09-2008 18:52:51

I might add that oFusion has Callbacks you can use. They have a function that will be called when, say, an entity is created. Then all you need to do is give the callback a NxOgre::Scene and create whatever you need. That's what our team is planning on doing (but with Ogre Max).

mcaden

12-09-2008 03:23:31

I took the "new dotScene Loader" from the ogre wiki and as I parse userdata I use it to decide which objects have physics and which don't. I then break it down further and figure out which objects have what properties and create an actor accordingly.

Once I finish it I was thinking about releasing it to the NxOgre community, but I'm afraid it will be too specific to my project. I basically plan on using Blender as a complete level editor.