Nowec
04-03-2006 23:55:03
I might just have missed something, but shouldn't there be support for static objects in the oSceneLoaderLib?
I added some code and got it working, not the most beautiful code maybe, but I'm also pretty new to both Ogre and the StaticGeometry.
This is what I did:
- Added a new property to the <entity>-element called "Static" which I set to yes/no
- Also added a "StaticGroup" as a property to <entity>
- Added a new method (addSceneNodeToStaticGeometry) that took care of adding the SceneNode to the static geometry group specified in "StaticGroup"
- Added a check in createNode() and called on addSceneNodeToStaticGeometry if "Static" was set to "yes"
- Did a build() on all StaticGeometrys for the sceneManager we created when loading the osm-file
I'm sure there's a lot left to do... don't even know if this is a good solution.
But I thought it was important enough to make a post about it.
You would of course need to add the possibility to set objects as static in 3dsmax before you export.
I added some code and got it working, not the most beautiful code maybe, but I'm also pretty new to both Ogre and the StaticGeometry.
This is what I did:
- Added a new property to the <entity>-element called "Static" which I set to yes/no
- Also added a "StaticGroup" as a property to <entity>
- Added a new method (addSceneNodeToStaticGeometry) that took care of adding the SceneNode to the static geometry group specified in "StaticGroup"
- Added a check in createNode() and called on addSceneNodeToStaticGeometry if "Static" was set to "yes"
- Did a build() on all StaticGeometrys for the sceneManager we created when loading the osm-file
I'm sure there's a lot left to do... don't even know if this is a good solution.
But I thought it was important enough to make a post about it.
You would of course need to add the possibility to set objects as static in 3dsmax before you export.