Skip to content

Commit

Permalink
Remove the black "sphere" circle from Rotate manipulator
Browse files Browse the repository at this point in the history
The black circle represented the ability to perform a trackball-like
arbitrary rotation in screen space. This functionality still exists, but
the black circle itself had no real purpose since you perform the
trackball rotation by clicking on empty space, not on any particular
circle.

The _circleSphere renderable is still present since it is used for mouse
selection, but it no longer renders on screen.
  • Loading branch information
Matthew Mott committed May 3, 2023
1 parent 95a2c75 commit 789aa92
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 34 deletions.
45 changes: 23 additions & 22 deletions radiantcore/selection/BasicSelectable.h
Expand Up @@ -10,31 +10,32 @@ namespace selection
* Behaves just as one would expect, keeping track of
* the selected state by means of a boolean.
*/
class BasicSelectable :
public ISelectable
class BasicSelectable: public ISelectable
{
private:
bool _selected;
bool _selected = false;

public:
BasicSelectable() :
_selected(false)
{}

void setSelected(bool select = true)
{
_selected = select;
}

bool isSelected() const
{
return _selected;
}

void invertSelected()
{
_selected = !_selected;
}

void setSelected(bool select = true) override
{
_selected = select;
}

bool isSelected() const override
{
return _selected;
}

void invertSelected()
{
_selected = !_selected;
}
};

/// Convenience function to call setSelected() on a number of items
template<typename... Item> void setSelected(bool select, Item&&... item)
{
(item.setSelected(select), ...);
}

} // namespace
17 changes: 5 additions & 12 deletions radiantcore/selection/manipulators/RotateManipulator.cpp
Expand Up @@ -52,7 +52,6 @@ void RotateManipulator::updateColours()
_circleY.setColour(colourSelected(COLOUR_Y(), _selectableY.isSelected()));
_circleZ.setColour(colourSelected(COLOUR_Z(), _selectableZ.isSelected()));
_circleScreen.setColour(colourSelected(COLOUR_SCREEN(), _selectableScreen.isSelected()));
_circleSphere.setColour(colourSelected(COLOUR_SPHERE(), false));
_pivotPoint.setColour(colourSelected(COLOUR_SPHERE(), _selectablePivotPoint.isSelected()));
}

Expand Down Expand Up @@ -139,7 +138,6 @@ void RotateManipulator::onPreRender(const RenderSystemPtr& renderSystem, const V
_circleY.update(_lineShader);
_circleZ.update(_lineShader);
_circleScreen.update(_lineShader);
_circleSphere.update(_lineShader);
_pivotPoint.update(_pivotPointShader);
_angleText.update(_textRenderer);
}
Expand All @@ -150,7 +148,6 @@ void RotateManipulator::clearRenderables()
_circleY.clear();
_circleZ.clear();
_circleScreen.clear();
_circleSphere.clear();
_pivotPoint.clear();
_angleText.clear();

Expand Down Expand Up @@ -281,16 +278,12 @@ RotateManipulator::Component* RotateManipulator::getActiveComponent()

void RotateManipulator::setSelected(bool select)
{
_selectableX.setSelected(select);
_selectableY.setSelected(select);
_selectableZ.setSelected(select);
_selectableScreen.setSelected(select);
_selectablePivotPoint.setSelected(select);
selection::setSelected(select, _selectableX, _selectableY, _selectableZ,
_selectableScreen, _selectablePivotPoint);

if (!select)
{
_rotateAxis.resetCurAngle();
}
if (!select) {
_rotateAxis.resetCurAngle();
}
}

bool RotateManipulator::isSelected() const
Expand Down

0 comments on commit 789aa92

Please sign in to comment.