MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / GatherVisuals

Method GatherVisuals

GTE/Graphics/PlanarShadowEffect.cpp:203–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void PlanarShadowEffect::GatherVisuals(
204 std::shared_ptr<ProgramFactory> const& factory,
205 std::shared_ptr<Spatial> const& spatial)
206{
207 auto visual = std::dynamic_pointer_cast<Visual>(spatial);
208 if (visual)
209 {
210 Vector4<float> black{ 0.0f, 0.0f, 0.0f, 1.0f };
211 auto effect = std::make_shared<ConstantColorEffect>(factory, black);
212 mCasterVisuals.push_back(visual);
213 mCasterEffects.push_back(effect);
214 return;
215 }
216
217 auto node = std::dynamic_pointer_cast<Node>(spatial);
218 if (node)
219 {
220 for (int32_t i = 0; i < node->GetNumChildren(); ++i)
221 {
222 auto const& child = node->GetChild(i);
223 if (child)
224 {
225 GatherVisuals(factory, child);
226 }
227 }
228 }
229}
230
231void PlanarShadowEffect::GetModelSpaceTriangles()
232{

Callers

nothing calls this directly

Calls 2

GetChildMethod · 0.80
GetNumChildrenMethod · 0.45

Tested by

no test coverage detected