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

Method setupCurrentModes2D

Source/RenderPasses/SDFEditor/SDFEditor.cpp:370–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370void SDFEditor::setupCurrentModes2D()
371{
372 const float minSide = float(std::min(mFrameDim.x, mFrameDim.y));
373 const float side = minSide / 6.0f;
374 const float markerSize = side * 0.5f / kMarkerSizeFactor;
375 const float roundedRadius = markerSize * 0.15f;
376 const float cornerOffset = 10.0f;
377 const float2 center = float2(side * 0.5f, mFrameDim.y - side * 0.5f) + float2(cornerOffset, -cornerOffset);
378
379 // Setup a rounded box as a background where the selected shape and operation will be displayed.
380 mUI2D.pMarker2DSet->addRoundedBox(center, float2(side, side) * 0.5f, roundedRadius, 0.0f, kCurrentModeBGColor); // Add the background
381 // box, in which we will
382 // draw markers.
383
384 // Setup the selected shape and operation markers.
385 float f = mUI2D.currentEditingOperator == SDFOperationType::SmoothUnion ? kMarkerSizeFactorSmoothUnion : kMarkerSizeFactor;
386 setupPrimitiveAndOperation(center, markerSize * f, mUI2D.currentEditingShape, mUI2D.currentEditingOperator, kMarkerColor);
387}
388
389void SDFEditor::manipulateGridPlane(
390 SDFGridPlane& gridPlane,

Callers

nothing calls this directly

Calls 2

addRoundedBoxMethod · 0.80
minFunction · 0.50

Tested by

no test coverage detected