Fixed displaying of debug spheres in GLSL pipeline.

This commit is contained in:
hiker 2015-08-18 23:50:55 +10:00
parent f8f0c4e4e4
commit 8aeb16221a
2 changed files with 19 additions and 6 deletions

View File

@ -1088,16 +1088,29 @@ scene::IMeshSceneNode *IrrDriver::addOctTree(scene::IMesh *mesh)
scene::IMeshSceneNode *IrrDriver::addSphere(float radius,
const video::SColor &color)
{
scene::IMeshSceneNode *node = m_scene_manager->addSphereSceneNode(radius);
node->setMaterialType(video::EMT_SOLID);
scene::IMesh *mesh = node->getMesh();
scene::IMesh *mesh = m_scene_manager->getGeometryCreator()
->createSphereMesh(radius);
mesh->setMaterialFlag(video::EMF_COLOR_MATERIAL, true);
video::SMaterial m;
video::SMaterial &m = mesh->getMeshBuffer(0)->getMaterial();
m.AmbientColor = color;
m.DiffuseColor = color;
m.EmissiveColor = color;
m.BackfaceCulling = false;
mesh->getMeshBuffer(0)->getMaterial() = m;
m.MaterialType = video::EMT_SOLID;
m.setTexture(0, getUnicolorTexture(video::SColor(128, 255, 105, 180)));
m.setTexture(1, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
if (CVS->isGLSL())
{
STKMeshSceneNode *node =
new STKMeshSceneNode(mesh,
m_scene_manager->getRootSceneNode(),
NULL, -1, "sphere");
return node;
}
scene::IMeshSceneNode *node = m_scene_manager->addMeshSceneNode(mesh);
return node;
} // addSphere

View File

@ -97,7 +97,7 @@ SkiddingAI::SkiddingAI(AbstractKart *kart)
m_debug_sphere[i] = irr_driver->addSphere(1.0f, col_debug);
m_debug_sphere[i]->setVisible(false);
m_debug_sphere[i]->setMaterialTexture(0, getUnicolorTexture(video::SColor(128, 255, 105, 180)));
m_debug_sphere[i]->setMaterialTexture(1, getUnicolorTexture(video::SColor(128, 255, 105, 180)));
m_debug_sphere[i]->setMaterialTexture(1, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
}
m_debug_sphere[m_point_selection_algorithm]->setVisible(true);
m_item_sphere = irr_driver->addSphere(1.0f);