MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / MapLightControllers

Method MapLightControllers

Rtxpt/SampleGame/GameModel.cpp:167–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void 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
195void ModelInstance::UpdateLightFromControllers(double gameTime)
196{

Callers

nothing calls this directly

Calls 3

LoadJsonFromStringFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected