Skip to content
Snippets Groups Projects
Commit 6aed22f4 authored by Mark Winter's avatar Mark Winter
Browse files

GetNearestTrackHull now also does an exact match only, if searchDir == 0.

parent 10b87258
No related branches found
No related tags found
No related merge requests found
% [hull hullTime] = GetNearestTrackHull(trackID, time, searchDir)
% Search track for a non-zero hull nearest to the specified time, searchDir
% beack in time if searchDir < 0 or forward if searchDir > 0. Returns 0 if
% no hull exists in specified direction.
%
% Search track for a non-zero hull nearest to the specified time,
% (searchDir < 0) -> search back in time,
% (searchDir > 0) -> search forward in time,
% (searchDir == 0) -> search exact time only.
% returns hull=0 if search fails.
function [hull hullTime] = GetNearestTrackHull(trackID, time, searchDir)
global CellTracks CellHulls
......@@ -10,7 +13,7 @@ function [hull hullTime] = GetNearestTrackHull(trackID, time, searchDir)
hullTime = 0;
hash = time - CellTracks(trackID).startTime + 1;
if ( hash < 1 && (searchDir >= 0) )
if ( hash < 1 && (searchDir > 0) )
hull = CellTracks(trackID).hulls(1);
hullTime = CellHulls(hull).time;
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment