Skip to content

Commit

Permalink
Remove pivot-tracking variables from SelectionSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Dec 19, 2016
1 parent 38faf6a commit 7f10aa0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
24 changes: 1 addition & 23 deletions radiant/selection/RadiantSelectionSystem.cpp
Expand Up @@ -43,9 +43,7 @@ RadiantSelectionSystem::RadiantSelectionSystem() :
_componentMode(eDefault),
_countPrimitive(0),
_countComponent(0),
_defaultManipulatorType(Manipulator::Drag),
_pivotChanged(false),
_pivotMoving(false)
_defaultManipulatorType(Manipulator::Drag)
{}

const SelectionInfo& RadiantSelectionSystem::getSelectionInfo() {
Expand Down Expand Up @@ -187,7 +185,6 @@ bool RadiantSelectionSystem::nothingSelected() const

void RadiantSelectionSystem::pivotChanged() const
{
_pivotChanged = true;
const_cast<RadiantSelectionSystem&>(*this)._pivot.setNeedsRecalculation(true);
SceneChangeNotify();
}
Expand Down Expand Up @@ -753,8 +750,6 @@ void RadiantSelectionSystem::SelectArea(const render::View& view,

void RadiantSelectionSystem::onManipulationStart()
{
_pivotMoving = true;

// Save the pivot state now that the transformation is starting
_pivot.beginOperation();
}
Expand All @@ -771,7 +766,6 @@ void RadiantSelectionSystem::onManipulationChanged()

void RadiantSelectionSystem::onManipulationEnd()
{
_pivotMoving = false;
_pivot.endOperation();

// The selection bounds have possibly changed, request an idle callback
Expand Down Expand Up @@ -891,22 +885,6 @@ const WorkZone& RadiantSelectionSystem::getWorkZone()
return _workZone;
}

/* greebo: This calculates and constructs the pivot point of the selection.
* It cycles through all selected objects and creates its AABB. The origin point of the AABB
* is basically the pivot point. Pivot2World is therefore a translation from (0,0,0) to the calculated origin.
*/
void RadiantSelectionSystem::recalculatePivot2World()
{
if (!_pivotChanged || _pivotMoving)
return;

_pivotChanged = false;

if (!nothingSelected())
{
_pivot.updateFromSelection();
}
}
/* greebo: Renders the currently active manipulator by setting the render state and
* calling the manipulator's render method
*/
Expand Down
4 changes: 0 additions & 4 deletions radiant/selection/RadiantSelectionSystem.h
Expand Up @@ -67,10 +67,6 @@ class RadiantSelectionSystem :
SelectionListType _selection;
SelectionListType _componentSelection;

void recalculatePivot2World();
mutable bool _pivotChanged;
bool _pivotMoving;

// The coordinates of the mouse pointer when the manipulation starts
Vector2 _deviceStart;

Expand Down

0 comments on commit 7f10aa0

Please sign in to comment.