crash when using createManualLodLevel


05-09-2007 06:38:51

I've got multiple LODs of terrain mesh, and I can load any one of them individually through createEntity and they work fine. When I try and set up multiple LODs something like this:

floor = sceneManager.createEntity( "terrain_0000_0000", "terrain_0000_0000_L0.mesh")
mesh0 = floor.getMesh()
mesh0.createManualLodLevel( 50.0, "terrain_0000_0000_L1.mesh" )
floornode = sceneManager.getRootSceneNode().createChildSceneNode( "terrain_0000_0000_node" )
floornode.attachObject( floor )

I get a crash. Interestingly, according to the log, it's loaded the L0 LOD and moved on to loading other resources before the crash, but never mentions the L1 LOD in the log. Am I doing something blindingly obviously wrong?


05-09-2007 10:09:37

Create the manual LODs before creating the entity: ... allodlevel

mesh1 = ogre.MeshManager.getSingleton().load( "robot.mesh", "General" )
mesh2 = ogre.MeshManager.getSingleton().load("ogrehead.mesh", "General")
mesh3 = ogre.MeshManager.getSingleton().load("knot.mesh", "General")

mesh1.createManualLodLevel(450, mesh2.getName())
mesh1.createManualLodLevel(700, mesh3.getName())

headNode = sceneManager.getRootSceneNode().createChildSceneNode()
entity = sceneManager.createEntity('robot', mesh1.getName())


05-09-2007 16:05:38

That did the trick -- thanks!

I think I had seen that thread and tried it previously, but screwed up the mesh names, so it didn't work. My bad.