I've replaced the 3 fairies in the example with just one "prop" that i exported from Maya into a .x format. And I was hoping for the same behavior that I was getting with the Fairies...
ie: The Prop should be dark when it's not being detected and Lit up when it IS detected. Yet it stays dark regardless, why is this not working...The Fairies work fine.
Please look at my .exe and code here: http://www.3drobert.com/cgtalk/CollisionTESTS.zip
Code: Select all
//
//
//Add Prop
material.Texture1 = driver->getTexture("../../media/JanaCASTLEtex.png");
material.Lighting = true;
scene::IAnimatedMeshSceneNode* propNode = 0;
scene::IAnimatedMesh* Prop = smgr->getMesh("../../media/prop.x");
if (Prop)
{
propNode = smgr->addAnimatedMeshSceneNode(Prop);
propNode->getMaterial(0) = material;
}
material.Texture1 = 0;
material.Lighting = false;
Code: Select all
selectedSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera);
if (lastSelectedSceneNode)
lastSelectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true);
if (selectedSceneNode == floorNode || selectedSceneNode == bill)
selectedSceneNode = 0;
if (selectedSceneNode == propNode)
selectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false);
lastSelectedSceneNode = selectedSceneNode;