throwing an error in projectile interval if calcTimeOLastImpactOnPlane() fails

This commit is contained in:
Josh Wilson 2008-01-16 19:25:05 +00:00
parent 627f2d0ff7
commit 0d977f5ee3
1 changed files with 5 additions and 1 deletions

View File

@ -195,8 +195,12 @@ class ProjectileInterval(Interval):
# stop when we reach endZ
self.startVel = calcStartVel(self.startPos, wayPoint,
timeToWayPoint, self.zAcc)
self.duration = calcTimeOfLastImpactOnPlane(
time = calcTimeOfLastImpactOnPlane(
self.startPos[2], endZ, self.startVel[2], self.zAcc)
if time is None:
self.notify.error(
'projectile never reaches plane Z=%s' % endZ)
self.duration = time
self.endPos = None
else:
self.notify.error('invalid set of inputs to ProjectileInterval')