I am trying to render a bsp map with Material Type EMT_NORMAL_MAP_SOLID, therefor my bsp Mesh has to contain Tangents. It works when i use AddMeshSceneNode and CreateTriangleSelector, but thats quite too much effort for the collision and render computing(halves the FPS), so I tried to use AddOctTreeSceneNode and CreateOctTreeTriangleSelector, but that just wont work
Here is my code
Code: Select all
bool MapManager::InitSelector(void)
{
//Interesting: using Mesh instead of AniMesh->getMesh(0) does not work
MapSelector = HardwareManager::Get()->GetScene()->createTriangleSelector(AniMesh->getMesh(0), Node);
if (!MapSelector) return false;
return true;
}
bool MapManager::InitNode(void)
{
//creating an octreescene out of the map
Node = HardwareManager::Get()->GetScene()->addMeshSceneNode(Mesh);
Node->setPosition(core::vector3df(
Ini->GetValue(SECTIONGENERAL, KEYPOSITIONX, DEFAULTPOSITIONX),
Ini->GetValue(SECTIONGENERAL, KEYPOSITIONY, DEFAULTPOSITIONY),
Ini->GetValue(SECTIONGENERAL, KEYPOSITIONZ, DEFAULTPOSITIONZ)));
if (!Node) return false;
return true;
}
bool MapManager::InitMesh(void)
{
//Create the mesh for the map
AniMesh = HardwareManager::Get()->GetScene()->getMesh(
Ini->GetValue(SECTIONMATERIALS, KEYMAPBSPFILE, DEFAULTMAPBSPFILE).c_str());
if (!AniMesh) return false;
Mesh = HardwareManager::Get()->GetScene()->getMeshManipulator()->createMeshWithTangents(AniMesh->getMesh(0));
if (!Mesh) return false;
return true;
}