showbase: Fix some members not showing up in API documentation

This commit is contained in:
rdb 2022-12-16 19:37:49 +01:00
parent 42372e139c
commit 32297ecd02

View File

@ -1160,7 +1160,7 @@ class ShowBase(DirectObject.DirectObject):
Creates the render scene graph, the primary scene graph for Creates the render scene graph, the primary scene graph for
rendering 3-d geometry. rendering 3-d geometry.
""" """
## This is the root of the 3-D scene graph. #: This is the root of the 3-D scene graph.
self.render = NodePath('render') self.render = NodePath('render')
self.render.setAttrib(RescaleNormalAttrib.makeDefault()) self.render.setAttrib(RescaleNormalAttrib.makeDefault())
@ -1179,7 +1179,7 @@ class ShowBase(DirectObject.DirectObject):
# for the benefit of creating DirectGui elements before ShowBase. # for the benefit of creating DirectGui elements before ShowBase.
from . import ShowBaseGlobal from . import ShowBaseGlobal
## This is the root of the 2-D scene graph. #: This is the root of the 2-D scene graph.
self.render2d = ShowBaseGlobal.render2d self.render2d = ShowBaseGlobal.render2d
# Set up some overrides to turn off certain properties which # Set up some overrides to turn off certain properties which
@ -1200,12 +1200,12 @@ class ShowBase(DirectObject.DirectObject):
self.render2d.setMaterialOff(1) self.render2d.setMaterialOff(1)
self.render2d.setTwoSided(1) self.render2d.setTwoSided(1)
## The normal 2-d DisplayRegion has an aspect ratio that #: The normal 2-d DisplayRegion has an aspect ratio that
## matches the window, but its coordinate system is square. #: matches the window, but its coordinate system is square.
## This means anything we parent to render2d gets stretched. #: This means anything we parent to render2d gets stretched.
## For things where that makes a difference, we set up #: For things where that makes a difference, we set up
## aspect2d, which scales things back to the right aspect #: aspect2d, which scales things back to the right aspect
## ratio along the X axis (Z is still from -1 to 1) #: ratio along the X axis (Z is still from -1 to 1)
self.aspect2d = ShowBaseGlobal.aspect2d self.aspect2d = ShowBaseGlobal.aspect2d
aspectRatio = self.getAspectRatio() aspectRatio = self.getAspectRatio()
@ -1213,13 +1213,13 @@ class ShowBase(DirectObject.DirectObject):
self.a2dBackground = self.aspect2d.attachNewNode("a2dBackground") self.a2dBackground = self.aspect2d.attachNewNode("a2dBackground")
## The Z position of the top border of the aspect2d screen. #: The Z position of the top border of the aspect2d screen.
self.a2dTop = 1.0 self.a2dTop = 1.0
## The Z position of the bottom border of the aspect2d screen. #: The Z position of the bottom border of the aspect2d screen.
self.a2dBottom = -1.0 self.a2dBottom = -1.0
## The X position of the left border of the aspect2d screen. #: The X position of the left border of the aspect2d screen.
self.a2dLeft = -aspectRatio self.a2dLeft = -aspectRatio
## The X position of the right border of the aspect2d screen. #: The X position of the right border of the aspect2d screen.
self.a2dRight = aspectRatio self.a2dRight = aspectRatio
self.a2dTopCenter = self.aspect2d.attachNewNode("a2dTopCenter") self.a2dTopCenter = self.aspect2d.attachNewNode("a2dTopCenter")
@ -1259,9 +1259,9 @@ class ShowBase(DirectObject.DirectObject):
self.a2dBottomRight.setPos(self.a2dRight, 0, self.a2dBottom) self.a2dBottomRight.setPos(self.a2dRight, 0, self.a2dBottom)
self.a2dBottomRightNs.setPos(self.a2dRight, 0, self.a2dBottom) self.a2dBottomRightNs.setPos(self.a2dRight, 0, self.a2dBottom)
## This special root, pixel2d, uses units in pixels that are relative #: This special root, pixel2d, uses units in pixels that are relative
## to the window. The upperleft corner of the window is (0, 0), #: to the window. The upperleft corner of the window is (0, 0),
## the lowerleft corner is (xsize, -ysize), in this coordinate system. #: the lowerleft corner is (xsize, -ysize), in this coordinate system.
self.pixel2d = self.render2d.attachNewNode(PGTop("pixel2d")) self.pixel2d = self.render2d.attachNewNode(PGTop("pixel2d"))
self.pixel2d.setPos(-1, 0, 1) self.pixel2d.setPos(-1, 0, 1)
xsize, ysize = self.getSize() xsize, ysize = self.getSize()
@ -1291,25 +1291,25 @@ class ShowBase(DirectObject.DirectObject):
self.render2dp.setMaterialOff(1) self.render2dp.setMaterialOff(1)
self.render2dp.setTwoSided(1) self.render2dp.setTwoSided(1)
## The normal 2-d DisplayRegion has an aspect ratio that #: The normal 2-d DisplayRegion has an aspect ratio that
## matches the window, but its coordinate system is square. #: matches the window, but its coordinate system is square.
## This means anything we parent to render2dp gets stretched. #: This means anything we parent to render2dp gets stretched.
## For things where that makes a difference, we set up #: For things where that makes a difference, we set up
## aspect2dp, which scales things back to the right aspect #: aspect2dp, which scales things back to the right aspect
## ratio along the X axis (Z is still from -1 to 1) #: ratio along the X axis (Z is still from -1 to 1)
self.aspect2dp = self.render2dp.attachNewNode(PGTop("aspect2dp")) self.aspect2dp = self.render2dp.attachNewNode(PGTop("aspect2dp"))
self.aspect2dp.node().setStartSort(16384) self.aspect2dp.node().setStartSort(16384)
aspectRatio = self.getAspectRatio() aspectRatio = self.getAspectRatio()
self.aspect2dp.setScale(1.0 / aspectRatio, 1.0, 1.0) self.aspect2dp.setScale(1.0 / aspectRatio, 1.0, 1.0)
## The Z position of the top border of the aspect2dp screen. #: The Z position of the top border of the aspect2dp screen.
self.a2dpTop = 1.0 self.a2dpTop = 1.0
## The Z position of the bottom border of the aspect2dp screen. #: The Z position of the bottom border of the aspect2dp screen.
self.a2dpBottom = -1.0 self.a2dpBottom = -1.0
## The X position of the left border of the aspect2dp screen. #: The X position of the left border of the aspect2dp screen.
self.a2dpLeft = -aspectRatio self.a2dpLeft = -aspectRatio
## The X position of the right border of the aspect2dp screen. #: The X position of the right border of the aspect2dp screen.
self.a2dpRight = aspectRatio self.a2dpRight = aspectRatio
self.a2dpTopCenter = self.aspect2dp.attachNewNode("a2dpTopCenter") self.a2dpTopCenter = self.aspect2dp.attachNewNode("a2dpTopCenter")
@ -1333,9 +1333,9 @@ class ShowBase(DirectObject.DirectObject):
self.a2dpBottomLeft.setPos(self.a2dpLeft, 0, self.a2dpBottom) self.a2dpBottomLeft.setPos(self.a2dpLeft, 0, self.a2dpBottom)
self.a2dpBottomRight.setPos(self.a2dpRight, 0, self.a2dpBottom) self.a2dpBottomRight.setPos(self.a2dpRight, 0, self.a2dpBottom)
## This special root, pixel2d, uses units in pixels that are relative #: This special root, pixel2dp, uses units in pixels that are relative
## to the window. The upperleft corner of the window is (0, 0), #: to the window. The upperleft corner of the window is (0, 0),
## the lowerleft corner is (xsize, -ysize), in this coordinate system. #: the lowerleft corner is (xsize, -ysize), in this coordinate system.
self.pixel2dp = self.render2dp.attachNewNode(PGTop("pixel2dp")) self.pixel2dp = self.render2dp.attachNewNode(PGTop("pixel2dp"))
self.pixel2dp.node().setStartSort(16384) self.pixel2dp.node().setStartSort(16384)
self.pixel2dp.setPos(-1, 0, 1) self.pixel2dp.setPos(-1, 0, 1)
@ -1656,11 +1656,11 @@ class ShowBase(DirectObject.DirectObject):
mw = self.buttonThrowers[0].getParent() mw = self.buttonThrowers[0].getParent()
## A special ButtonThrower to generate keyboard events and #: A special ButtonThrower to generate keyboard events and
## include the time from the OS. This is separate only to #: include the time from the OS. This is separate only to
## support legacy code that did not expect a time parameter; it #: support legacy code that did not expect a time parameter; it
## will eventually be folded into the normal ButtonThrower, #: will eventually be folded into the normal ButtonThrower,
## above. #: above.
self.timeButtonThrower = mw.attachNewNode(ButtonThrower('timeButtons')) self.timeButtonThrower = mw.attachNewNode(ButtonThrower('timeButtons'))
self.timeButtonThrower.node().setPrefix('time-') self.timeButtonThrower.node().setPrefix('time-')
self.timeButtonThrower.node().setTimeFlag(1) self.timeButtonThrower.node().setTimeFlag(1)