MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / writeLight

Method writeLight

Source/Falcor/Scene/SceneCache.cpp:599–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597 // Light
598
599 void SceneCache::writeLight(OutputStream& stream, const ref<Light>& pLight)
600 {
601 LightType type = pLight->getType();
602 stream.write(type);
603
604 stream.write(pLight->mHasAnimation);
605 stream.write(pLight->mIsAnimated);
606 stream.write(pLight->mNodeID);
607
608 stream.write(pLight->mName);
609 stream.write(pLight->mActive);
610 stream.write(pLight->mData);
611
612 switch (type)
613 {
614 case LightType::Point:
615 case LightType::Directional:
616 break;
617 case LightType::Distant:
618 stream.write(static_ref_cast<DistantLight>(pLight)->mAngle);
619 break;
620 case LightType::Rect:
621 case LightType::Disc:
622 case LightType::Sphere:
623 stream.write(static_ref_cast<AnalyticAreaLight>(pLight)->mScaling);
624 stream.write(static_ref_cast<AnalyticAreaLight>(pLight)->mTransformMatrix);
625 break;
626 }
627 }
628
629 ref<Light> SceneCache::readLight(InputStream& stream)
630 {

Callers

nothing calls this directly

Calls 2

getTypeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected