Skip to content

Commit

Permalink
use internal validate function
Browse files Browse the repository at this point in the history
  • Loading branch information
rms80 committed Jun 30, 2018
1 parent 8b7f9d6 commit f7f15ba
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sceneObjects/DMeshSO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,7 @@ override public bool FindRayIntersection(Ray3f rayW, out SORayHit hit)
if (enable_spatial == false)
return false;

if (spatial == null) {
spatial = new DMeshAABBTree3(mesh);
spatial.Build();
}
validate_spatial();

// convert ray to local
FScene scene = this.GetScene();
Expand Down Expand Up @@ -517,10 +514,7 @@ public virtual bool FindNearest(Vector3d point, double maxDist, out SORayHit nea
if (enable_spatial == false)
return false;

if (spatial == null) {
spatial = new DMeshAABBTree3(mesh);
spatial.Build();
}
validate_spatial();

// convert to local
Vector3f local_pt = SceneTransforms.TransformTo((Vector3f)point, this, eInCoords, CoordSpace.ObjectCoords);
Expand Down

0 comments on commit f7f15ba

Please sign in to comment.