Divergence Angle is now calculated by taking the arctan of d/y, velocity condition was removed.
This commit is contained in:
parent
dbfe5225fa
commit
e808c3dbfb
@ -1,9 +1,8 @@
|
|||||||
function ret = exitCondition(this, ovenObj, PositionVector, VelocityVector, CollisionEvent)
|
function ret = exitCondition(this, PositionVector, CollisionEvent)
|
||||||
d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]);
|
d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]);
|
||||||
y = PositionVector(2);
|
y = PositionVector(2);
|
||||||
DivergenceAngle = (d/abs(y));
|
DivergenceAngle = atan(d/abs(y));
|
||||||
%DivergenceAngle = atan(norm(cross(PositionVector, )) / norm(dot(PositionVector, [0 1 0])));
|
if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && ~CollisionEvent
|
||||||
if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && (abs(VelocityVector(2))<=ovenObj.VelocityCutoff) && ~CollisionEvent
|
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
ret = false;
|
ret = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user