formatting

This commit is contained in:
Dave Schuyler 2006-03-17 23:17:57 +00:00
parent 3429171dc5
commit f66d4151fc
4 changed files with 84 additions and 82 deletions

View File

@ -204,6 +204,7 @@ class ShipPilot2(PhysicsWalker):
cBowSphereNode.addSolid(self.cBowSphere) cBowSphereNode.addSolid(self.cBowSphere)
self.cBowSphereNodePath = self.avatarNodePath.attachNewNode( self.cBowSphereNodePath = self.avatarNodePath.attachNewNode(
cBowSphereNode) cBowSphereNode)
#self.cBowSphereNodePath.show()
cBowSphereNode.setFromCollideMask(self.cSphereBitMask) cBowSphereNode.setFromCollideMask(self.cSphereBitMask)
cBowSphereNode.setIntoCollideMask(BitMask32.allOff()) cBowSphereNode.setIntoCollideMask(BitMask32.allOff())
@ -220,6 +221,7 @@ class ShipPilot2(PhysicsWalker):
cSternSphereNode.addSolid(self.cSternSphere) cSternSphereNode.addSolid(self.cSternSphere)
self.cSternSphereNodePath = self.avatarNodePath.attachNewNode( self.cSternSphereNodePath = self.avatarNodePath.attachNewNode(
cSternSphereNode) cSternSphereNode)
#self.cSternSphereNodePath.show()
self.cSternSphereBitMask = bitmask self.cSternSphereBitMask = bitmask
cSternSphereNode.setFromCollideMask(self.cSphereBitMask) cSternSphereNode.setFromCollideMask(self.cSphereBitMask)

View File

@ -108,7 +108,7 @@
from pandac import Point3 from pandac import Point3
v1 = Point3.Point3(0) v1 = Point3.Point3(0)
v2 = Point3.Point3(0) v2 = Point3.Point3(0)
self.calcTightBounds(v1,v2) self.calcTightBounds(v1, v2)
return v1, v2 return v1, v2
def pPrintString(self, other = None): def pPrintString(self, other = None):
@ -265,39 +265,39 @@
child.printTransform(other, sd, fRecursive) child.printTransform(other, sd, fRecursive)
def iPos(self, other = None): def iPos(self, other = None):
""" Set node path's pos to 0,0,0 """ """ Set node path's pos to 0, 0, 0 """
if other: if other:
self.setPos(other, 0,0,0) self.setPos(other, 0, 0, 0)
else: else:
self.setPos(0,0,0) self.setPos(0, 0, 0)
def iHpr(self, other = None): def iHpr(self, other = None):
""" Set node path's hpr to 0,0,0 """ """ Set node path's hpr to 0, 0, 0 """
if other: if other:
self.setHpr(other, 0,0,0) self.setHpr(other, 0, 0, 0)
else: else:
self.setHpr(0,0,0) self.setHpr(0, 0, 0)
def iScale(self, other = None): def iScale(self, other = None):
""" SEt node path's scale to 1,1,1 """ """ SEt node path's scale to 1, 1, 1 """
if other: if other:
self.setScale(other, 1,1,1) self.setScale(other, 1, 1, 1)
else: else:
self.setScale(1,1,1) self.setScale(1, 1, 1)
def iPosHpr(self, other = None): def iPosHpr(self, other = None):
""" Set node path's pos and hpr to 0,0,0 """ """ Set node path's pos and hpr to 0, 0, 0 """
if other: if other:
self.setPosHpr(other,0,0,0,0,0,0) self.setPosHpr(other, 0, 0, 0, 0, 0, 0)
else: else:
self.setPosHpr(0,0,0,0,0,0) self.setPosHpr(0, 0, 0, 0, 0, 0)
def iPosHprScale(self, other = None): def iPosHprScale(self, other = None):
""" Set node path's pos and hpr to 0,0,0 and scale to 1,1,1 """ """ Set node path's pos and hpr to 0, 0, 0 and scale to 1, 1, 1 """
if other: if other:
self.setPosHprScale(other, 0,0,0,0,0,0,1,1,1) self.setPosHprScale(other, 0, 0, 0, 0, 0, 0, 1, 1, 1)
else: else:
self.setPosHprScale(0,0,0,0,0,0,1,1,1) self.setPosHprScale(0, 0, 0, 0, 0, 0, 1, 1, 1)
# private methods # private methods
@ -1041,10 +1041,10 @@
from direct.interval import LerpInterval from direct.interval import LerpInterval
return LerpInterval.LerpColorScaleInterval(self, *args, **kw) return LerpInterval.LerpColorScaleInterval(self, *args, **kw)
def attachCollisionSphere(self, name, cx,cy,cz,r, fromCollide, intoCollide): def attachCollisionSphere(self, name, cx, cy, cz, r, fromCollide, intoCollide):
from pandac import CollisionSphere from pandac import CollisionSphere
from pandac import CollisionNode from pandac import CollisionNode
coll = CollisionSphere.CollisionSphere(cx,cy,cz,r) coll = CollisionSphere.CollisionSphere(cx, cy, cz, r)
collNode = CollisionNode.CollisionNode(name) collNode = CollisionNode.CollisionNode(name)
collNode.addSolid(coll) collNode.addSolid(coll)
collNode.setFromCollideMask(fromCollide) collNode.setFromCollideMask(fromCollide)
@ -1052,10 +1052,10 @@
collNodePath = self.attachNewNode(collNode) collNodePath = self.attachNewNode(collNode)
return collNodePath return collNodePath
def attachCollisionSegment(self, name, ax,ay,az, bx,by,bz, fromCollide, intoCollide): def attachCollisionSegment(self, name, ax, ay, az, bx, by, bz, fromCollide, intoCollide):
from pandac import CollisionSegment from pandac import CollisionSegment
from pandac import CollisionNode from pandac import CollisionNode
coll = CollisionSegment.CollisionSegment(ax,ay,az, bx,by,bz) coll = CollisionSegment.CollisionSegment(ax, ay, az, bx, by, bz)
collNode = CollisionNode.CollisionNode(name) collNode = CollisionNode.CollisionNode(name)
collNode.addSolid(coll) collNode.addSolid(coll)
collNode.setFromCollideMask(fromCollide) collNode.setFromCollideMask(fromCollide)
@ -1063,10 +1063,10 @@
collNodePath = self.attachNewNode(collNode) collNodePath = self.attachNewNode(collNode)
return collNodePath return collNodePath
def attachCollisionRay(self, name, ox,oy,oz, dx,dy,dz, fromCollide, intoCollide): def attachCollisionRay(self, name, ox, oy, oz, dx, dy, dz, fromCollide, intoCollide):
from pandac import CollisionRay from pandac import CollisionRay
from pandac import CollisionNode from pandac import CollisionNode
coll = CollisionRay.CollisionRay(ox,oy,oz, dx,dy,dz) coll = CollisionRay.CollisionRay(ox, oy, oz, dx, dy, dz)
collNode = CollisionNode.CollisionNode(name) collNode = CollisionNode.CollisionNode(name)
collNode.addSolid(coll) collNode.addSolid(coll)
collNode.setFromCollideMask(fromCollide) collNode.setFromCollideMask(fromCollide)

View File

@ -5,11 +5,11 @@
""" """
def __repr__(self): def __repr__(self):
return '%s(%s,%s,%s)' % ( return '%s(%s, %s, %s)' % (
self.__class__.__name__,self[0],self[1],self[2]) self.__class__.__name__, self[0], self[1], self[2])
def pPrintValues(self): def pPrintValues(self):
""" """
Pretty print Pretty print
""" """
return "% 10.4f, % 10.4f, % 10.4f" % (self[0],self[1],self[2]) return "% 10.4f, % 10.4f, % 10.4f" % (self[0], self[1], self[2])

View File

@ -5,11 +5,11 @@
""" """
def __repr__(self): def __repr__(self):
return '%s(%s,%s,%s,%s)' % ( return '%s(%s, %s, %s, %s)' % (
self.__class__.__name__,self[0],self[1],self[2],self[3]) self.__class__.__name__, self[0], self[1], self[2], self[3])
def pPrintValues(self): def pPrintValues(self):
""" """
Pretty print Pretty print
""" """
return '% 10.4f, % 10.4f, % 10.4f, % 10.4f' % (self[0],self[1],self[2],self[3]) return '% 10.4f, % 10.4f, % 10.4f, % 10.4f' % (self[0], self[1], self[2], self[3])