def move(self, dt=-1, profile=0): if Mover.Profile and not profile: def func(doMove=self.move): for i in xrange(10000): doMove(dt, profile=1) __builtin__.func = func PythonUtil.startProfile(cmd='func()', filename='profile', sorts=['cumulative'], callInfo=0) del __builtin__.func return if Mover.Pstats: self.pscCpp.start() CMover.processCImpulses(self, dt) if Mover.Pstats: self.pscCpp.stop() self.pscPy.start() for impulse in self.impulses.values(): impulse._process(self.getDt()) if Mover.Pstats: self.pscPy.stop() self.pscInt.start() CMover.integrate(self) if Mover.Pstats: self.pscInt.stop()
def move(self, dt = -1, profile = 0): if Mover.Profile and not profile: def func(doMove = self.move): for i in xrange(10000): doMove(dt, profile=1) __builtin__.func = func PythonUtil.startProfile(cmd='func()', filename='profile', sorts=['cumulative'], callInfo=0) del __builtin__.func return if Mover.Pstats: self.pscCpp.start() CMover.processCImpulses(self, dt) if Mover.Pstats: self.pscCpp.stop() self.pscPy.start() for impulse in self.impulses.values(): impulse._process(self.getDt()) if Mover.Pstats: self.pscPy.stop() self.pscInt.start() CMover.integrate(self) if Mover.Pstats: self.pscInt.stop()
def move(self, dt=-1, profile=0): # TODO: account for movement that we didn't cause? if Mover.Profile and (not profile): # profile def func(doMove=self.move): for i in xrange(10000): doMove(dt, profile=1) __builtin__.func = func PythonUtil.startProfile(cmd='func()', filename='profile', sorts=['cumulative'], callInfo=0) del __builtin__.func return if Mover.Pstats: self.pscCpp.start() # do C++ impulses first CMover.processCImpulses(self, dt) if Mover.Pstats: self.pscCpp.stop() self.pscPy.start() # now do Python impulses for impulse in self.impulses.values(): impulse._process(self.getDt()) if Mover.Pstats: self.pscPy.stop() self.pscInt.start() # lastly, do the integration CMover.integrate(self) if Mover.Pstats: self.pscInt.stop()