#1
|
|||
|
|||
Code Jumps under load
Sorry for this funny topic :
There seem to be code-jumps occurring when a lot of processing has to be done: More specific: Code:
timeElapsedWorld=(time.clock()-worldTime)/slowDown + gliderObj.timeElapsedWorldBeforeBreak glider.translate(glider.actualPos.get()) ballCannon.translate(0,gliderObj.get(viz.POSITION)[1]+0.065*math.cos(bogenConv(slope))+0.03*math.cos(bogenConv(slope+ballAngle)),gliderObj.get(viz.POSITION)[2]+0.065*math.sin(bogenConv(slope))+0.03*math.sin(bogenConv(slope+ballAngle))) catcher.translate(gliderObj.actualPos[0],gliderObj.actualPos[1]+0.065*math.cos(bogenConv(slope))+0.06*math.cos(bogenConv(slope+ballAngle)),gliderObj.actualPos[2]+0.065*math.sin(bogenConv(slope))+0.06*math.sin(bogenConv(slope+ballAngle))) catcherWall.translate(gliderObj.actualPos[0],gliderObj.actualPos[1]+0.065*math.cos(bogenConv(slope))+0.07*math.cos(bogenConv(slope+ballAngle)),gliderObj.actualPos[2]+0.065*math.sin(bogenConv(slope))+0.07*math.sin(bogenConv(slope+ballAngle))) glider.actualVelocityOld=glider.actualVelocity #1=position 2=velocity in z direction 3=acceleration 11=position on airtrack (total) 12=position in y direction 21=velocity total 22 velocity in y direction 31=acceleration total 32=acceleration in y direction for graphInstance in graphBasket: if (graphInstance.graphWhat==1): print "timeElapsedWorld:",timeElapsedWorld I get the following printouts (only if the program is under stress - a lot of balls flying etc.) timeElapsedWorld: 1.53241976489 timeElapsedWorld: 0.25782304277 timeElapsedWorld: 0.259737781056 timeElapsedWorld: 0.261517913083 Loading File: ../resources/joNew/050305_ballBlueOpac.WRL Loading File: ../resources/joNew/050305_ballRedOpac.WRL timeElapsedWorld: 0.263915784652 timeElapsedWorld: 0.266729903628 timeElapsedWorld: 0.270578388046 Loading File: ../resources/joNew/050305_ballGreen.WRL timeElapsedWorld: 0.27311529934 timeElapsedWorld: 1.65854041329 Any ideas? When I turn slowDown to 1 there does not seem to be a problem. Is it possible that the division is skipped? Johannes |
|
|