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):
|
class DirectGrid(NodePath, DirectObject):
|
||||||
def __init__(self,gridSize=100.0,gridSpacing=5.0,planeColor=(0.5,0.5,0.5,0.5)):
|
def __init__(self,gridSize=100.0,gridSpacing=5.0,planeColor=(0.5,0.5,0.5,0.5)):
|
||||||
# Initialize superclass
|
# Initialize superclass
|
||||||
NodePath.__init__(self)
|
NodePath.__init__(self, 'DirectGrid')
|
||||||
self.assign(hidden.attachNewNode('DirectGrid'))
|
|
||||||
# Don't wireframe or light
|
# Don't wireframe or light
|
||||||
useDirectRenderStyle(self)
|
useDirectRenderStyle(self)
|
||||||
|
|
||||||
@ -51,13 +50,17 @@ class DirectGrid(NodePath, DirectObject):
|
|||||||
self.snapAngle = 15.0
|
self.snapAngle = 15.0
|
||||||
self.enable()
|
self.enable()
|
||||||
|
|
||||||
def enable(self):
|
def enable(self, parent = None):
|
||||||
|
if parent:
|
||||||
|
self.reparentTo(parent)
|
||||||
|
else:
|
||||||
self.reparentTo(base.direct.group)
|
self.reparentTo(base.direct.group)
|
||||||
|
|
||||||
self.updateGrid()
|
self.updateGrid()
|
||||||
self.fEnabled = 1
|
self.fEnabled = 1
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
self.reparentTo(hidden)
|
self.detachNode()
|
||||||
self.fEnabled = 0
|
self.fEnabled = 0
|
||||||
|
|
||||||
def toggleGrid(self):
|
def toggleGrid(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user