MCPcopy Create free account
hub / github.com/OpenMW/openmw / DropObjectHeightHandler

Method DropObjectHeightHandler

apps/opencs/view/render/instancemode.cpp:1403–1428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1401}
1402
1403CSVRender::DropObjectHeightHandler::DropObjectHeightHandler(WorldspaceWidget* worldspacewidget)
1404 : mWorldspaceWidget(worldspacewidget)
1405{
1406 std::vector<osg::ref_ptr<TagBase>> selection = mWorldspaceWidget->getSelection(Mask_Reference);
1407 for (osg::ref_ptr<TagBase> tag : selection)
1408 {
1409 if (CSVRender::ObjectTag* objectTag = dynamic_cast<CSVRender::ObjectTag*>(tag.get()))
1410 {
1411 osg::ref_ptr<osg::Group> objectNodeWithGUI = objectTag->mObject->getRootNode();
1412 osg::ref_ptr<osg::Group> objectNodeWithoutGUI = objectTag->mObject->getBaseNode();
1413
1414 osg::ComputeBoundsVisitor computeBounds;
1415 computeBounds.setTraversalMask(Mask_Reference);
1416 objectNodeWithoutGUI->accept(computeBounds);
1417 osg::BoundingBox bounds = computeBounds.getBoundingBox();
1418 float boundingBoxOffset = 0.0f;
1419 if (bounds.valid())
1420 boundingBoxOffset = bounds.zMin();
1421
1422 mObjectHeights.emplace_back(boundingBoxOffset);
1423 mOldMasks.emplace_back(objectNodeWithGUI->getNodeMask());
1424
1425 objectNodeWithGUI->setNodeMask(0);
1426 }
1427 }
1428}
1429
1430CSVRender::DropObjectHeightHandler::~DropObjectHeightHandler()
1431{

Callers

nothing calls this directly

Calls 9

getBoundingBoxMethod · 0.80
setNodeMaskMethod · 0.80
getSelectionMethod · 0.45
getMethod · 0.45
getRootNodeMethod · 0.45
getBaseNodeMethod · 0.45
acceptMethod · 0.45
validMethod · 0.45
getNodeMaskMethod · 0.45

Tested by

no test coverage detected