Skip to content

Commit

Permalink
#5951: PatchNodes are showing/hiding their geometry now when visibili…
Browse files Browse the repository at this point in the history
…ty changes
  • Loading branch information
codereader committed May 1, 2022
1 parent 2d437bd commit 354ceb5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
17 changes: 12 additions & 5 deletions radiantcore/patch/PatchNode.cpp
Expand Up @@ -283,6 +283,14 @@ void PatchNode::updateAllRenderables()
_renderableCtrlPoints.queueUpdate();
}

void PatchNode::hideAllRenderables()
{
_renderableSurfaceSolid.hide();
_renderableSurfaceWireframe.hide();
_renderableCtrlLattice.hide();
_renderableCtrlPoints.hide();
}

void PatchNode::clearAllRenderables()
{
_renderableSurfaceSolid.clear();
Expand Down Expand Up @@ -354,8 +362,8 @@ void PatchNode::onPreRender(const VolumeTest& volume)
}
else
{
_renderableCtrlPoints.clear();
_renderableCtrlLattice.clear();
_renderableCtrlPoints.hide();
_renderableCtrlLattice.hide();

// Queue an update the next time it's rendered
_renderableCtrlPoints.queueUpdate();
Expand Down Expand Up @@ -504,12 +512,11 @@ void PatchNode::onVisibilityChanged(bool visible)

if (!visible)
{
// Disconnect our renderable when the node is hidden
clearAllRenderables();
hideAllRenderables();
}
else
{
// Update the vertex buffers next time we need to render
// Queue an update, renderables are automatically shown in onPreRender
updateAllRenderables();
}
}
1 change: 1 addition & 0 deletions radiantcore/patch/PatchNode.h
Expand Up @@ -155,6 +155,7 @@ class PatchNode final :
void transformComponents(const Matrix4& matrix);

void updateAllRenderables();
void hideAllRenderables();
void clearAllRenderables();
};
typedef std::shared_ptr<PatchNode> PatchNodePtr;

0 comments on commit 354ceb5

Please sign in to comment.