2021-07-15 16:52:07 +02:00
|
|
|
function ret = exitCondition(this, PositionVector, CollisionEvent)
|
2021-07-11 14:35:54 +02:00
|
|
|
d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]);
|
|
|
|
y = PositionVector(2);
|
2021-07-15 16:52:07 +02:00
|
|
|
DivergenceAngle = atan(d/abs(y));
|
|
|
|
if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && ~CollisionEvent
|
2021-07-11 14:35:54 +02:00
|
|
|
ret = true;
|
|
|
|
else
|
|
|
|
ret = false;
|
|
|
|
end
|
|
|
|
end
|