formatting

This commit is contained in:
Dave Schuyler 2005-11-04 22:16:25 +00:00
parent 9275909425
commit c176b0e336
13 changed files with 14 additions and 48 deletions

View File

@ -7,8 +7,9 @@ import math
class Logger:
def __init__(self, fileName="log"):
"""__init__(self)
Logger constructor"""
"""
Logger constructor
"""
self.__timeStamp = 1
self.__startTime = 0.0
self.__logFile = None

View File

@ -82,8 +82,6 @@ class Mopath(PandaObject):
return tIn
def getFinalState(self):
""" getFinalState()
"""
pos = Point3(0)
if (self.xyzNurbsCurve != None):
self.xyzNurbsCurve.getPoint(self.maxT, pos)

View File

@ -143,12 +143,10 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
def forceToTruePosition(self):
"""forceToTruePosition(self)
"""
This forces the node to reposition itself to its latest known
position. This may result in a pop as the node skips the last
of its lerp points.
"""
if (not self.isLocal()) and \
self.smoother.getLatestPosition():
@ -156,13 +154,11 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
self.smoother.clearPositions(1)
def reloadPosition(self):
"""reloadPosition(self)
"""
This function re-reads the position from the node itself and
clears any old position reports for the node. This should be
used whenever show code bangs on the node position and expects
it to stick.
"""
self.smoother.clearPositions(0)
self.smoother.setMat(self.getMat())

View File

@ -11,8 +11,7 @@ class OnscreenGeom(PandaObject, NodePath):
color = None,
parent = None,
sort = 0):
"""__init__(self, ...)
"""
Make a geom node from string or a node path,
put it into the 2d sg and set it up with all the indicated parameters.

View File

@ -11,8 +11,7 @@ class OnscreenImage(PandaObject, NodePath):
color = None,
parent = None,
sort = 0):
"""__init__(self, ...)
"""
Make a image node from string or a node path,
put it into the 2d sg and set it up with all the indicated parameters.

View File

@ -40,8 +40,6 @@ class ActorInterval(Interval.Interval):
startFrame=None, endFrame=None,
playRate=1.0, name=None, forceUpdate=0,
partName=None, lodName=None):
"""__init__(name)
"""
# Generate unique id
id = 'Actor-%s-%d' % (animName, ActorInterval.animNum)
ActorInterval.animNum += 1

View File

@ -34,7 +34,7 @@ class MopathInterval(LerpInterval.LerpFunctionInterval):
self.node = node
def __doMopath(self, t):
""" updateFunc(t, event)
"""
Go to time t
"""
self.mopath.goTo(self.node, t)

View File

@ -792,7 +792,7 @@ class LevelEditor(NodePath, PandaObject):
self.traversalOn()
def configureDriveModeCollisionData(self):
"""initializeCollisions(self)
"""
Set up the local avatar for collisions
"""
# Set up the collision sphere

View File

@ -14,7 +14,7 @@ noBlend = NoBlendType()
def getBlend(blendType):
"""getBlend(string)
"""
Return the C++ blend class corresponding to blendType string
"""
# Note, this is temporary until blend functions get exposed

View File

@ -976,8 +976,7 @@ class ShowBase(DirectObject.DirectObject):
mw.node().addRegion(PGMouseWatcherBackground())
def enableSoftwareMousePointer(self):
"""enableSoftwareMousePointer(self)
"""
Creates some geometry and parents it to render2d to show
the currently-known mouse position. Useful if the mouse
pointer is invisible for some reason.
@ -1007,21 +1006,18 @@ class ShowBase(DirectObject.DirectObject):
KeyboardButton.control())
def addAngularIntegrator(self):
"""addAngularIntegrator(self)"""
if (self.physicsMgrAngular == 0):
self.physicsMgrAngular = 1
integrator = AngularEulerIntegrator()
self.physicsMgr.attachAngularIntegrator(integrator)
def enableParticles(self):
"""enableParticles(self)"""
self.particleMgrEnabled = 1
self.physicsMgrEnabled = 1
self.taskMgr.remove('manager-update')
self.taskMgr.add(self.updateManagers, 'manager-update')
def disableParticles(self):
"""enableParticles(self)"""
self.particleMgrEnabled = 0
self.physicsMgrEnabled = 0
self.taskMgr.remove('manager-update')

View File

@ -2,12 +2,9 @@ from pandac.PandaModules import *
import Task
class Timer:
id = 0
def __init__(self, name=None):
""" __init__()
"""
self.finalT = 0.0
self.currT = 0.0
if (name == None):
@ -18,8 +15,6 @@ class Timer:
self.callback = None
def start(self, t, name):
""" start(t, name)
"""
if (self.started):
self.stop()
self.callback = None
@ -31,8 +26,6 @@ class Timer:
self.started = 1
def startCallback(self, t, callback):
""" startCallback(t, callback)
"""
if (self.started):
self.stop()
self.callback = callback
@ -43,8 +36,6 @@ class Timer:
self.started = 1
def stop(self):
""" stop()
"""
if (not self.started):
return 0.0
taskMgr.remove(self.name + '-run')
@ -52,38 +43,26 @@ class Timer:
return self.currT
def resume(self):
""" resume()
"""
assert(self.currT <= self.finalT)
assert(self.started == 0)
self.start(self.finalT - self.currT, self.name)
def restart(self):
""" restart()
"""
if (self.callback != None):
self.startCallback(self.finalT, self.callback)
else:
self.start(self.finalT, self.name)
def isStarted(self):
""" isStarted()
"""
return self.started
def addT(self, t):
""" addT(t)
"""
self.finalT = self.finalT + t
def setT(self, t):
""" setT(t)
"""
self.finalT = t
def getT(self):
""" getT()
"""
return (self.finalT - self.currT)
def __timerTask(self, task):

View File

@ -4,7 +4,7 @@ class NotifyPanel:
a panel to control direct/panda notify categories."""
def __init__(self, directNotify, tl = None):
"""__init__(self)
"""
NotifyPanel class pops up a control panel to view/set
notify levels for all available DIRECT and PANDA notify categories
"""

View File

@ -41,7 +41,7 @@ class TaskManagerWidget(PandaObject):
"""
def __init__(self, parent, taskMgr):
"""__init__(self)
"""
TaskManagerWidget class pops up a control panel to view/delete
tasks managed by the taskManager.
"""