mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Add optional cameraName for making 2d and 2dp cameras.
Allows better tracking of cameras in scene graph.
This commit is contained in:
parent
2f8cf96fd2
commit
fb9f2a2eeb
@ -1076,7 +1076,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
def makeCamera2d(self, win, sort = 10,
|
def makeCamera2d(self, win, sort = 10,
|
||||||
displayRegion = (0, 1, 0, 1), coords = (-1, 1, -1, 1),
|
displayRegion = (0, 1, 0, 1), coords = (-1, 1, -1, 1),
|
||||||
lens = None):
|
lens = None, cameraName = None):
|
||||||
"""
|
"""
|
||||||
Makes a new camera2d associated with the indicated window, and
|
Makes a new camera2d associated with the indicated window, and
|
||||||
assigns it to render the indicated subrectangle of render2d.
|
assigns it to render the indicated subrectangle of render2d.
|
||||||
@ -1091,7 +1091,11 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
left, right, bottom, top = coords
|
left, right, bottom, top = coords
|
||||||
|
|
||||||
# Now make a new Camera node.
|
# Now make a new Camera node.
|
||||||
|
if (cameraName):
|
||||||
|
cam2dNode = Camera('cam2d_' + cameraName)
|
||||||
|
else:
|
||||||
cam2dNode = Camera('cam2d')
|
cam2dNode = Camera('cam2d')
|
||||||
|
|
||||||
if lens == None:
|
if lens == None:
|
||||||
lens = OrthographicLens()
|
lens = OrthographicLens()
|
||||||
lens.setFilmSize(right - left, top - bottom)
|
lens.setFilmSize(right - left, top - bottom)
|
||||||
@ -1114,7 +1118,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
def makeCamera2dp(self, win, sort = 20,
|
def makeCamera2dp(self, win, sort = 20,
|
||||||
displayRegion = (0, 1, 0, 1), coords = (-1, 1, -1, 1),
|
displayRegion = (0, 1, 0, 1), coords = (-1, 1, -1, 1),
|
||||||
lens = None):
|
lens = None, cameraName = None):
|
||||||
"""
|
"""
|
||||||
Makes a new camera2dp associated with the indicated window, and
|
Makes a new camera2dp associated with the indicated window, and
|
||||||
assigns it to render the indicated subrectangle of render2dp.
|
assigns it to render the indicated subrectangle of render2dp.
|
||||||
@ -1128,7 +1132,11 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
left, right, bottom, top = coords
|
left, right, bottom, top = coords
|
||||||
|
|
||||||
# Now make a new Camera node.
|
# Now make a new Camera node.
|
||||||
cam2dNode = Camera('cam2d')
|
if (cameraName):
|
||||||
|
cam2dNode = Camera('cam2dp_' + cameraName)
|
||||||
|
else:
|
||||||
|
cam2dNode = Camera('cam2dp')
|
||||||
|
|
||||||
if lens == None:
|
if lens == None:
|
||||||
lens = OrthographicLens()
|
lens = OrthographicLens()
|
||||||
lens.setFilmSize(right - left, top - bottom)
|
lens.setFilmSize(right - left, top - bottom)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user