A little background as to why I chose to use COLLADA as a data interchange format between DCC tools and Ogre. For the past year I have been using my own scene format between Blender and my engine and it has worked well but during two recent demonstrations to potential clients it was strongly hinted that they would prefer to use another DCC tool other than Blender as a world editor. Yes, I was shocked too . So I needed a data format that all the big DCC tools have agreed to use that was not proprietory, supported physics, and the programmable GPU. I had looked at COLLADA about a year ago but there was no agreement on how the physics format should be handled and there was very little talk at the time about GPU shader support. Ageia and NVidia joined the ranks of companies supporting COLLADA many months ago and the soon to be released COLLADA 1.4 specification which contains the COLLADA FX specification shows their commitment to supporting this format.
I have started work on the plugin which allows you to load scenes and all the attached resources into Ogre directly from a COLLADA compliant xml file which usually has the extension .dae. This means that you don't have to use a special Ogre mesh and scene exporter in your favourite DCC tool if it supports COLLADA export. Alias, lightwave, 3ds Max, and XSI currently have COLLADA import/exporters. I have made a basic COLLADA exporter for Blender using Reimpell's Blender dotscene exporter.
The Ogre COLLADA plugin acts as an interface between an Ogre App and the COLLADA DOM API. Currently the COLLADA DOM API is in beta testing and available only to selected delevelopers so I've sent an email requesting to be a beta tester. I haven't had much luck in the past with big organizations recognizing me as a qualified developer so in the interm I have setup my own COLLADA DOM API which uses Xerces/tinyXML until the official COLLADA DOM API is made public. For initial development I am using Xerces so I can validate incoming xml.
The purpose of the plugin is to allow the app to query for ogre resources ie meshes, materials, skeletons, animations, lights, cameras etc within a COLLADA file (.dae). The app can also query scene info so that info can be passed to a scenemanager for constructing a scene or the plugin can be instructed to build a scene automatically.
The plugin will not be tied to a specific scenemanger so maximum flexibility is maintained. To minimize app overhead you can pass a scenemanager pointer to the buildScene() method of the plugin and the plugin will instruct the scenemanager to create the required elements to build a specific scene loaded from the COLLADA file. For Physics info in the scene it will be up to your app to query the plugin for this info or if the buildScene() method is called with a physics handler callback supplied then all physics info is automatically forwarded to your callback during the scene build process. Its up to your callback to handle this physics info as required ie setting up collision objects, dynamic bodies, joints etc.
The basic structure of the parties involved:
- Code: Select all
Ogre COLLADA Plugin
COLLADA DOM API
COLLADA file (.dae)
Currently the COLLADA specification is at 1.3.1. I will concentrate on basic support for 1.3.1 for now which includes meshes, fixed pipeline materials, skeletons, skinning, animation, lights, cameras and of course scenes. 1.4 is supposed to come out near the end of October 2005 which is supposed to have gpu shader support ie Cg, HLSL, GLSL support along with physics(ala Novodex).
This plugin will not initially be part of the Ogre core but could be placed in OgreAddons in cvs if there is enough interest from other developers wanting to contribute. Once I get the initial ground work done and have a little demo working I will release the source/plugin/demo through a link on my website. After the plugin matures and is "usefull" we can then talk about making it an official Ogre plugin. For now its a personal project for my own needs but I am making it generic enough so it could be used in any project.
I still have some work to do on Ogre Dagon so I won't be doing full time development on the plugin until around the end of October. For now I will just devote a few hours a week to getting the frame work setup, building some tests, and a small demo.