Skip to content

Commit

Permalink
Remove unused SelectionTest::TestLineLoop()
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mott committed Mar 20, 2021
1 parent 23b1bcd commit ef6e756
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 31 deletions.
13 changes: 6 additions & 7 deletions include/iselectiontest.h
Expand Up @@ -14,13 +14,13 @@ class SelectionIntersection
float _depth;
float _distance;
public:
SelectionIntersection() :
_depth(1),
SelectionIntersection() :
_depth(1),
_distance(2)
{}

SelectionIntersection(float depth, float distance) :
_depth(depth),
SelectionIntersection(float depth, float distance) :
_depth(depth),
_distance(distance)
{}

Expand All @@ -41,15 +41,15 @@ class SelectionIntersection

bool equalEpsilon(const SelectionIntersection& other, float distanceEpsilon, float depthEpsilon) const
{
return float_equal_epsilon(_distance, other._distance, distanceEpsilon) &&
return float_equal_epsilon(_distance, other._distance, distanceEpsilon) &&
float_equal_epsilon(_depth, other._depth, depthEpsilon);
}

float depth() const
{
return _depth;
}

bool isValid() const
{
return depth() < 1;
Expand Down Expand Up @@ -230,7 +230,6 @@ class SelectionTest
virtual const Vector3& getFar() const = 0;
virtual void TestPoint(const Vector3& point, SelectionIntersection& best) = 0;
virtual void TestPolygon(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0;
virtual void TestLineLoop(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0;
virtual void TestLineStrip(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0;
virtual void TestLines(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0;
virtual void TestTriangles(const VertexPointer& vertices, const IndexPointer& indices, SelectionIntersection& best) = 0;
Expand Down
28 changes: 4 additions & 24 deletions libs/selection/SelectionVolume.h
Expand Up @@ -11,11 +11,11 @@

inline SelectionIntersection select_point_from_clipped(Vector4& clipped)
{
return SelectionIntersection(static_cast<float>(clipped[2] / clipped[3]),
return SelectionIntersection(static_cast<float>(clipped[2] / clipped[3]),
static_cast<float>(Vector3(clipped[0] / clipped[3], clipped[1] / clipped[3], 0).getLengthSquared()));
}

class SelectionVolume :
class SelectionVolume :
public SelectionTest
{
Matrix4 _local2view;
Expand All @@ -24,7 +24,7 @@ class SelectionVolume :
Vector3 _near;
Vector3 _far;
public:
SelectionVolume(const render::View& view) :
SelectionVolume(const render::View& view) :
_view(view)
{}

Expand All @@ -49,7 +49,7 @@ class SelectionVolume :

// Cull back-facing polygons based on winding being clockwise or counter-clockwise.
// Don't cull if the material is twosided or the view is wireframe
_cull = twoSided || !_view.fill() ? eClipCullNone :
_cull = twoSided || !_view.fill() ? eClipCullNone :
(localToWorld.getHandedness() == Matrix4::RIGHTHANDED) ? eClipCullCW : eClipCullCCW;

Matrix4 screen2world(_local2view.getFullInverse());
Expand Down Expand Up @@ -86,26 +86,6 @@ class SelectionVolume :
}
}

void TestLineLoop(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) override
{
if (count == 0)
return;
Vector4 clipped[9];
for (VertexPointer::iterator i = vertices.begin(), end = i + count, prev = i + (count - 1); i != end; prev = i, ++i)
{
BestPoint(
_local2view.clipLine(
*prev,
*i,
clipped
),
clipped,
best,
_cull
);
}
}

void TestLineStrip(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) override
{
if (count == 0)
Expand Down

0 comments on commit ef6e756

Please sign in to comment.