void ColladaNode::readInstanceLight(domInstance_light *instLight) { if(getGlobal()->getOptions()->getLoadLights() == false) return; ColladaInstanceLightRefPtr colInstLight = getUserDataAs<ColladaInstanceLight>(instLight); if(colInstLight == NULL) { colInstLight = dynamic_pointer_cast<ColladaInstanceLight>( ColladaElementFactory::the()->create(instLight, getGlobal())); colInstLight->read(this); } }
void ColladaNode::handleInstanceLight(domInstance_light *instLight) { ColladaInstanceLightRefPtr colInstLight = getUserDataAs<ColladaInstanceLight>(instLight); if(colInstLight == NULL) { colInstLight = dynamic_pointer_cast<ColladaInstanceLight>( ColladaElementFactory::the()->create(instLight, getGlobal())); colInstLight->read(); } //push the Light onto the root LightUnrecPtr light = colInstLight->process(this); if(light != NULL) { //Append the lights beacon node GroupUnrecPtr lightBeacon = Group::create(); NodeRecPtr lightBeaconN = Node::create(); lightBeaconN->setCore(lightBeacon); /*std::string BeaconNodeName(instLight->getName()); BeaconNodeName += "_beacon"; setName(lightBeaconN, BeaconNodeName);*/ //TODO: set beacon name appendChild(lightBeaconN); light->setBeacon(lightBeaconN); NodeRecPtr lightN = Node::create(); lightN->setCore(light); //setName(lightN,instLight->getName()); //TODO: set light name _visualScene->pushNodeToRoot(lightN); } }