mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
minor fixes
This commit is contained in:
parent
8ff665d2c4
commit
e330f19626
@ -7,8 +7,7 @@ from DirectGeometry import *
|
||||
class DirectGrid(NodePath, DirectObject):
|
||||
def __init__(self,gridSize=100.0,gridSpacing=5.0,planeColor=(0.5,0.5,0.5,0.5)):
|
||||
# Initialize superclass
|
||||
NodePath.__init__(self)
|
||||
self.assign(hidden.attachNewNode('DirectGrid'))
|
||||
NodePath.__init__(self, 'DirectGrid')
|
||||
# Don't wireframe or light
|
||||
useDirectRenderStyle(self)
|
||||
|
||||
@ -51,13 +50,17 @@ class DirectGrid(NodePath, DirectObject):
|
||||
self.snapAngle = 15.0
|
||||
self.enable()
|
||||
|
||||
def enable(self):
|
||||
def enable(self, parent = None):
|
||||
if parent:
|
||||
self.reparentTo(parent)
|
||||
else:
|
||||
self.reparentTo(base.direct.group)
|
||||
|
||||
self.updateGrid()
|
||||
self.fEnabled = 1
|
||||
|
||||
def disable(self):
|
||||
self.reparentTo(hidden)
|
||||
self.detachNode()
|
||||
self.fEnabled = 0
|
||||
|
||||
def toggleGrid(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user