I found that castray doesn't give back the picked node and there are some visibility issue too. It seems that the zero sized bounding box causes these issues for me.
I found that void ModelNode::updateLocalMeshAABBs() computes the meshnode's bounding box.
It is first called when I add the scenegraph resource based node(h3dAddNodes). void ModelNode::setGeometryRes( GeometryResource &geoRes ) calls it, _geometryRes is set, but the _meshList is empty. So the computation fails.
The second time it is called from SceneManager::updateNodes() because _nodeListDirty is true. The geometry is still unloaded. So the bounding box computation fails again.
The updateLocalMeshAABBs() is not called again. Maybe not clearing _nodeListDirty when the updateLocalMeshAABBs fails could solve the problem.
|