Skip to content

Commit

Permalink
segment is a struct now, so old code was changing copy!
Browse files Browse the repository at this point in the history
  • Loading branch information
rms80 committed Dec 9, 2016
1 parent 5850c8a commit 60ba83b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
6 changes: 2 additions & 4 deletions curve/CurveUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,14 @@ public static bool FindClosestRayIntersection(ICurve c, double segRadius, Ray3d
if (c.Closed)
throw new InvalidOperationException("CurveUtils.FindClosestRayIntersection doesn't support closed curves yet");

DistRay3Segment3 dist = new DistRay3Segment3(ray, new Segment3d(Vector3d.Zero, Vector3d.Zero) );

rayT = double.MaxValue;
int nNearSegment = -1;
//double fNearSegT = 0.0;

int N = c.VertexCount;
for (int i = 0; i < N-1; ++i) {
dist.Segment.SetEndpoints(c.GetVertex(i), c.GetVertex(i + 1));
dist.Reset();
DistRay3Segment3 dist = new DistRay3Segment3(ray,
new Segment3d(c.GetVertex(i), c.GetVertex(i + 1)));

// raycast to line bounding-sphere first (is this going ot be faster??)
double fSphereHitT;
Expand Down
7 changes: 0 additions & 7 deletions queries/DistLine3Ray3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ public DistLine3Ray3(Ray3d ray, Line3d Line)
this.ray = ray; this.line = Line;
}

// have to do this if you are changing Ray/Line yourself and want to reuse this object
public void Reset()
{
DistanceSquared = -1.0f;
}


static public double MinDistance(Ray3d r, Line3d s)
{
return new DistLine3Ray3(r, s).Get();
Expand Down
7 changes: 0 additions & 7 deletions queries/DistRay3Ray3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ public DistRay3Ray3(Ray3d ray1, Ray3d ray2)
this.ray1 = ray1; this.ray2 = ray2;
}

// have to do this if you are changing Ray/Segment yourself and want to reuse this object
public void Reset()
{
DistanceSquared = -1.0f;
}


static public double MinDistance(Ray3d r1, Ray3d r2) {
return new DistRay3Ray3(r1, r2).Get();
}
Expand Down
5 changes: 0 additions & 5 deletions queries/DistRay3Segment3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public DistRay3Segment3(Ray3d ray, Segment3d segment)
this.ray = ray; this.segment = segment;
}

// have to do this if you are changing Ray/Segment yourself and want to reuse this object
public void Reset() {
DistanceSquared = -1.0f;
}


static public double MinDistance(Ray3d r, Segment3d s) {
return new DistRay3Segment3(r, s).Get();
Expand Down

0 comments on commit 60ba83b

Please sign in to comment.