| 165 | } |
| 166 | |
| 167 | void ModelInstance::MapLightControllers( SceneGraphNode* node ) |
| 168 | { |
| 169 | if (node->GetLeaf() != nullptr && (node->GetLeaf()->GetContentFlags() & SceneContentFlags::Lights) != 0) |
| 170 | { |
| 171 | std::string data = m_modelType->FindLightControllerInfo(node->GetName()); |
| 172 | Json::Value jsonData; |
| 173 | if (data != "" && LoadJsonFromString(data, jsonData)) |
| 174 | { |
| 175 | auto lightController = std::make_shared<LightController>(); |
| 176 | if (!lightController->Read(jsonData)) |
| 177 | { |
| 178 | assert(false && "Error reading LightController data"); |
| 179 | } |
| 180 | else |
| 181 | { |
| 182 | lightController->Node = node; |
| 183 | m_lightControllers.push_back(lightController); |
| 184 | } |
| 185 | } |
| 186 | else |
| 187 | { |
| 188 | log::warning( "Model instance '%s', light '%s' has no controller", m_node->GetName().c_str(), node->GetName().c_str() ); |
| 189 | } |
| 190 | } |
| 191 | for (int i = 0; i < node->GetNumChildren(); i++) |
| 192 | MapLightControllers(node->GetChild(i)); |
| 193 | } |
| 194 | |
| 195 | void ModelInstance::UpdateLightFromControllers(double gameTime) |
| 196 | { |
nothing calls this directly
no test coverage detected