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

Method updateBounds

Source/Falcor/Scene/Scene.cpp:856–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854 }
855
856 void Scene::updateBounds()
857 {
858 const auto& globalMatrices = mpAnimationController->getGlobalMatrices();
859
860 mSceneBB = AABB();
861
862 for (const auto& inst : mGeometryInstanceData)
863 {
864 const float4x4& transform = globalMatrices[inst.globalMatrixID];
865 switch (inst.getType())
866 {
867 case GeometryType::TriangleMesh:
868 case GeometryType::DisplacedTriangleMesh:
869 {
870 const AABB& meshBB = mMeshBBs[inst.geometryID];
871 mSceneBB |= meshBB.transform(transform);
872 break;
873 }
874 case GeometryType::Curve:
875 {
876 const AABB& curveBB = mCurveBBs[inst.geometryID];
877 mSceneBB |= curveBB.transform(transform);
878 break;
879 }
880 case GeometryType::SDFGrid:
881 {
882 float3x3 transform3x3 = float3x3(transform);
883 transform3x3[0] = abs(transform3x3[0]);
884 transform3x3[1] = abs(transform3x3[1]);
885 transform3x3[2] = abs(transform3x3[2]);
886 float3 center = transform.getCol(3).xyz();
887 float3 halfExtent = transformVector(transform3x3, float3(0.5f));
888 mSceneBB |= AABB(center - halfExtent, center + halfExtent);
889 break;
890 }
891 }
892 }
893
894 for (const auto& aabb : mCustomPrimitiveAABBs)
895 {
896 mSceneBB |= aabb;
897 }
898
899 for (const auto& pGridVolume : mGridVolumes)
900 {
901 mSceneBB |= pGridVolume->getBounds();
902 }
903 }
904
905 void Scene::updateGeometryInstances(bool forceUpdate)
906 {

Callers

nothing calls this directly

Calls 6

transformMethod · 0.80
getColMethod · 0.80
AABBClass · 0.70
absFunction · 0.50
transformVectorFunction · 0.50
getTypeMethod · 0.45

Tested by

no test coverage detected