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

Method getCustomPrimitiveIndex

Source/Falcor/Scene/Scene.cpp:2578–2588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2576 }
2577
2578 uint32_t Scene::getCustomPrimitiveIndex(GlobalGeometryID geometryID) const
2579 {
2580 if (getGeometryType(geometryID) != GeometryType::Custom)
2581 {
2582 FALCOR_THROW("'geometryID' ({}) does not refer to a custom primitive.", geometryID);
2583 }
2584
2585 size_t customPrimitiveOffset = mMeshDesc.size() + mCurveDesc.size() + mSDFGridDesc.size();
2586 FALCOR_ASSERT(geometryID.get() >= (uint32_t)customPrimitiveOffset && geometryID.get() < getGeometryCount());
2587 return geometryID.get() - (uint32_t)customPrimitiveOffset;
2588 }
2589
2590 const CustomPrimitiveDesc& Scene::getCustomPrimitive(uint32_t index) const
2591 {

Callers 1

sceneChangedMethod · 0.80

Calls 3

getGeometryCountFunction · 0.50
sizeMethod · 0.45
getMethod · 0.45

Tested by 1

sceneChangedMethod · 0.64